File size: 6,102 Bytes
5f32fbd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
@extends('panel.layout.settings', ['disable_tblr' => true])
@section('title', $title)
@section('titlebar_actions', '')

@section('settings')
    <form
        class="flex flex-col gap-5"
        id="user_edit_form"
        method="post"
        enctype="multipart/form-data"
        action="{{ $action }}"
    >
        @csrf
        @method($method)

        <div class="space-y-3">
            <x-forms.input
                id="chatbot_status"
                label="{{ __('Show ChatBot Ballon on') }}"
                type="select"
                size="lg"
                name="chatbot_status"
            >
                <option
                    value="disabled"
                    @selected($settings_two->chatbot_status == 'disabled')
                >
                    {{ __('Disabled') }}
                </option>
                <option
                    value="frontend"
                    @selected($settings_two->chatbot_status == 'frontend')
                >
                    {{ __('Frontend') }}
                </option>
                <option
                    value="dashboard"
                    @selected($settings_two->chatbot_status == 'dashboard')
                >
                    {{ __('Dashboard') }}
                </option>
                <option
                    value="both"
                    @selected($settings_two->chatbot_status == 'both')
                >
                    {{ __('Both') }}
                </option>
            </x-forms.input>
            @error('chatbot_status')
                <p class="text-red-500">
                    {{ $message }}
                </p>
            @enderror
        </div>

        <div class="space-y-3">
            <x-forms.input
                id="chatbot_template"
                name="chatbot_template"
                label="{{ __('Template') }}"
                type="select"
                size="lg"
            >
                @foreach ($chatbotData as $chatbot)
                    <option
                        value="{{ $chatbot->id }}"
                        @selected($settings_two->chatbot_template == $chatbot->id)
                    >
                        {{ __($chatbot->title) }}
                    </option>
                @endforeach
            </x-forms.input>
            @error('chatbot_template')
                <p class="text-red-500">
                    {{ $message }}
                </p>
            @enderror
        </div>

        <div class="space-y-3">
            <x-forms.input
                type="select"
                size="lg"
                name="position"
                label="{{ __('Position') }}"
            >
                <option
                    value="top-left"
                    @selected($settings_two->chatbot_position == 'top-left')
                >
                    {{ __('Top Left') }}
                </option>
                <option
                    value="top-right"
                    @selected($settings_two->chatbot_position == 'top-right')
                >
                    {{ __('Top Right') }}
                </option>
                <option
                    value="bottom-right"
                    @selected($settings_two->chatbot_position == 'bottom-right')
                >
                    {{ __('Bottom Right') }}
                </option>
                <option
                    value="bottom-left"
                    @selected($settings_two->chatbot_position == 'bottom-left')
                >
                    {{ __('Bottom Left') }}
                </option>
            </x-forms.input>
        </div>

        <div class="space-y-3">
            <x-forms.input
                id="chatbot_rate_limit"
                type="number"
                name="chatbot_rate_limit"
                min="2"
                max="50"
                default="2"
                size="lg"
                label="{{ __('Message Limit per day') }}"
                value="{{ $settings_two->chatbot_rate_limit }}"
            />
            @error('chatbot_rate_limit')
                <p class="text-red-500">
                    {{ $message }}
                </p>
            @enderror
        </div>

        <div class="space-y-2">
            <x-forms.input
                id="first_message"
                name="first_message"
                value="{{ old('first_message', $chatbot?->first_message) }}"
                label="{{ __('First Message') }}"
                size="lg"
            />
            @error('first_message')
                <p class="text-red-500">
                    {{ $message }}
                </p>
            @enderror
        </div>

        <div class="space-y-2">
            <x-forms.input
                id="instructions"
                type="textarea"
                name="instructions"
                label="{{ __('Instructions') }}"
                rows="5"
                tooltip="{{ __('You can provide instructions to your GPT-3 model to ensure it aligns with your brand and tone.') }}"
            >{{ old('instructions', $chatbot?->instructions) }}</x-forms.input>
            @error('instructions')
                <p class="text-red-500">
                    {{ $message }}
                </p>
            @enderror
        </div>

        <x-forms.input
            id="chatbot_login_require"
            size="lg"
            name="chatbot_login_require"
            type="checkbox"
            label="{{ __('Disable if user not logged in?') }}"
            :checked="$settings_two->chatbot_login_require == true"
            switcher
        />

        <x-forms.input
            id="chatbot_show_timestamp"
            name="chatbot_show_timestamp"
            size="lg"
            type="checkbox"
            label="{{ __('Show timestamp?') }}"
            :checked="$settings_two->chatbot_show_timestamp == true"
            switcher
        />

        <x-button
            size="lg"
            type="submit"
        >
            {{ __('Save') }}
        </x-button>
    </form>
@endsection