od-support-chat 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/lib/chat.d.ts +6 -0
- package/dist/components/lib/chat.js +233 -0
- package/dist/components/lib/chatMobile.d.ts +6 -0
- package/dist/components/lib/chatMobile.js +233 -0
- package/dist/components/lib/info.guest.js +27 -0
- package/dist/components/lib/info.guestMobile.js +27 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/package.json +2 -5
- package/dist/audio_file/alert-sound.mp3 +0 -0
- package/dist/audio_file/ding-small.mp3 +0 -0
- package/dist/od-support-chat.es.js +0 -4386
- package/dist/od-support-chat.umd.js +0 -576
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import e from"./info.guest.js";import t,{useEffect as n,useRef as r,useState as i}from"react";import a,{keyframes as o}from"styled-components";const s=o`
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
transform: translateY(20px);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
transform: translateY(0);
|
|
9
|
+
}
|
|
10
|
+
`,c=o`
|
|
11
|
+
from {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
transform: translateY(0);
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transform: translateY(20px);
|
|
18
|
+
}
|
|
19
|
+
`,l=a.div`
|
|
20
|
+
position: fixed;
|
|
21
|
+
right: 0;
|
|
22
|
+
top: 50%;
|
|
23
|
+
height: 35%;
|
|
24
|
+
width: ${e=>e.maxWidth}%;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
background-color: white;
|
|
28
|
+
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
|
|
29
|
+
transition: all 0.5s ease;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
z-index: 10000;
|
|
32
|
+
animation: ${({displayChat:e})=>e?s:c} 0.3s ease-in-out forwards;
|
|
33
|
+
`,ee=a.div`
|
|
34
|
+
position: fixed;
|
|
35
|
+
right: 0;
|
|
36
|
+
bottom: 10%;
|
|
37
|
+
height: 15%;
|
|
38
|
+
width: ${e=>e.maxWidth/2.5}%;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
transition: all 0.5s ease;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
z-index: 10000;
|
|
44
|
+
animation: ${({displayChat:e})=>e?c:s} 0.3s ease-in-out forwards;
|
|
45
|
+
`,u=a.div`
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 5;
|
|
48
|
+
margin-left: 5px;
|
|
49
|
+
margin-top: 5px;
|
|
50
|
+
height: 30px;
|
|
51
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
52
|
+
width: 96%;
|
|
53
|
+
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
color: rgb(78, 161, 211);
|
|
57
|
+
padding: 5px;
|
|
58
|
+
`,d=a.div`
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: flex-start;
|
|
62
|
+
width: 100%;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
color: rgb(78, 161, 211);
|
|
66
|
+
`,f=a.div`
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
padding-top: 5px;
|
|
71
|
+
width: 30px;
|
|
72
|
+
font-size: calc(10px + 1vmin);
|
|
73
|
+
color: white;
|
|
74
|
+
|
|
75
|
+
:hover {
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
`,p=a.div`
|
|
79
|
+
position: absolute;
|
|
80
|
+
text-align: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
top: 38px;
|
|
83
|
+
margin-left: 5px;
|
|
84
|
+
margin-top: 5px;
|
|
85
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
86
|
+
border-radius: 15px;
|
|
87
|
+
width: 96%;
|
|
88
|
+
|
|
89
|
+
margin-left: 5px;
|
|
90
|
+
margin-top: 2px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
color: white;
|
|
94
|
+
padding: 5px;
|
|
95
|
+
background-color: rgb(78, 161, 211);
|
|
96
|
+
`,te=a.div`
|
|
97
|
+
position: absolute;
|
|
98
|
+
text-align: center;
|
|
99
|
+
align-items: center;
|
|
100
|
+
display: flex;
|
|
101
|
+
gap: 5px;
|
|
102
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
103
|
+
border-radius: 15px;
|
|
104
|
+
width: 100%;
|
|
105
|
+
|
|
106
|
+
margin-left: 10px;
|
|
107
|
+
margin-top: 2px;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
font-size: 12px;
|
|
110
|
+
color: white;
|
|
111
|
+
padding: 10px;
|
|
112
|
+
background-color: rgb(78, 161, 211);
|
|
113
|
+
`,ne=a.div`
|
|
114
|
+
position: absolute;
|
|
115
|
+
top: 80px;
|
|
116
|
+
margin-left: 5px;
|
|
117
|
+
margin-top: 5px;
|
|
118
|
+
width: 100%;
|
|
119
|
+
height: 65%;
|
|
120
|
+
max-height: 83%;
|
|
121
|
+
overflow-x: hidden;
|
|
122
|
+
overflow-y: auto;
|
|
123
|
+
`,re=a.div`
|
|
124
|
+
display: flex;
|
|
125
|
+
width: 100%;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
padding: 15px;
|
|
128
|
+
color: #454552;
|
|
129
|
+
`,m=a.div`
|
|
130
|
+
width: 100%;
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
align-items: flex-start;
|
|
134
|
+
font-size: 12px;
|
|
135
|
+
margin-top: 5px;
|
|
136
|
+
margin-left: 5px;
|
|
137
|
+
text-align: left;
|
|
138
|
+
|
|
139
|
+
> strong {
|
|
140
|
+
margin-left: 3px;
|
|
141
|
+
color: rgb(78, 161, 211)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
> p {
|
|
145
|
+
max-width: 95%;
|
|
146
|
+
width: auto;
|
|
147
|
+
padding: 5px;
|
|
148
|
+
margin-top: 5px;
|
|
149
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
150
|
+
border-radius: 15px;
|
|
151
|
+
color: black;
|
|
152
|
+
font-size: 12px;
|
|
153
|
+
text-align: left;
|
|
154
|
+
}
|
|
155
|
+
`,h=a.div`
|
|
156
|
+
width: 100%;
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
align-items: flex-start;
|
|
160
|
+
font-size: 12px;
|
|
161
|
+
margin-top: 5px;
|
|
162
|
+
margin-left: 5px;
|
|
163
|
+
text-align: left;
|
|
164
|
+
|
|
165
|
+
> strong {
|
|
166
|
+
margin-right: 35px;
|
|
167
|
+
color: rgb(215, 61, 71)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
> p {
|
|
171
|
+
max-width: 95%;
|
|
172
|
+
width: auto;
|
|
173
|
+
padding: 5px;
|
|
174
|
+
margin-top: 5px;
|
|
175
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
176
|
+
border-radius: 15px;
|
|
177
|
+
color: black;
|
|
178
|
+
font-size: 12px;
|
|
179
|
+
text-align: left;
|
|
180
|
+
background-color: #f5f5f5;
|
|
181
|
+
}
|
|
182
|
+
`,g=a.div`
|
|
183
|
+
position: absolute;
|
|
184
|
+
display: flex;
|
|
185
|
+
bottom: 10px;
|
|
186
|
+
margin-left: 5px;
|
|
187
|
+
margin-top: 5px;
|
|
188
|
+
flex-direction: row;
|
|
189
|
+
align-items: center;
|
|
190
|
+
width: 100%;
|
|
191
|
+
gap: 5px;
|
|
192
|
+
`,_=a.input`
|
|
193
|
+
bottom: 0;
|
|
194
|
+
width: 70%;
|
|
195
|
+
height: 25px;
|
|
196
|
+
margin-left: 5px;
|
|
197
|
+
border: 2px solid rgb(69, 69, 82, 0.25);
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
font-size: 14px;
|
|
200
|
+
padding-left: 5px;
|
|
201
|
+
opacity: 0.7;
|
|
202
|
+
|
|
203
|
+
:focus {
|
|
204
|
+
outline: none;
|
|
205
|
+
}
|
|
206
|
+
`,v=a.div`
|
|
207
|
+
height: 25px;
|
|
208
|
+
outline: none;
|
|
209
|
+
border: none;
|
|
210
|
+
display: flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
justify-content: flex-end;
|
|
213
|
+
border-radius: 10px;
|
|
214
|
+
padding-left: 5px;
|
|
215
|
+
padding-right: 10px;
|
|
216
|
+
margin-right: 10px;
|
|
217
|
+
color: black;
|
|
218
|
+
background-color: #bed0f8;
|
|
219
|
+
font-size: 1rem;
|
|
220
|
+
font-weight: 500;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
`,y=a.div`
|
|
223
|
+
position: absolute;
|
|
224
|
+
top: 80px;
|
|
225
|
+
margin-left: 25px;
|
|
226
|
+
width: 100%;
|
|
227
|
+
height: 65%;
|
|
228
|
+
width: 83%;
|
|
229
|
+
margin-bottom: 25px;
|
|
230
|
+
`,b=a.i`
|
|
231
|
+
width: 25px;
|
|
232
|
+
font-size: calc(5px + 1vmin);
|
|
233
|
+
`;var x,S,C;const w=`optimizetalk.com:8443`,T=({meetingLinkKey:a,customerSupportKey:o})=>{let s=r(null),[c]=i(window.innerWidth<window.innerHeight&&window.innerWidth<=900),[T]=i(c?100:15),[E,D]=i([]),O=r(),[k,A]=i(!0),[j,M]=i(!1),[N,P]=i(!1),[F,I]=i(null),[L,R]=i(null),[z,B]=i(),[V,H]=i(),[U,W]=i(!1),[G,K]=i(``),q=r(null),J=r(null),Y=()=>{let e=1e4,t=Math.floor(Math.random()*(9e4-e+1))+e;return console.log(`Random number: `+t),t},ie=(e,t)=>{x=new WebSocket(`wss://`+w+`/signal`),x.onopen=function(){console.log(`Websocket connection established`),le(),oe(e,t),$({from:{userName:e,audio:!0,video:!0},type:`text`,data:`ping from `+e}),S=setInterval(()=>{$({from:{userName:e,audio:!0,video:!0},type:`text`,data:`ping from `+e})},45e3),Z(e,t),console.log(`WebSocket connection opened to chat room `+G)}},ae=(e,t)=>{P(!0),I(t),console.log(`Params guestName:`+e+`, guestEmail:`+t);var n=L?e:`Guest-`+Y()+`: `+e;R(n),console.log(`Joining : `+n),ie(n,t)};function X(){console.log(`Close the socket`),x!=null&&(console.log(`Send 'leave' message to server for session `+z+` accessToken: `+V),$({from:{userName:L,sessionKey:z,audio:!0,video:!0},accessToken:V,type:`leave`,data:a}),x.close())}function oe(e,t){x.onmessage=function(n){let r=JSON.parse(n.data);switch(console.log(`Room received type: `+r.type),r.type){case`text`:console.log(`Text message from `+r.from.userName+` received: `+r.data);break;case`join_meeting`:console.log(`Main message `+r.data),r.data&&r.data===`busy`?(console.log(`Customer support is busy`),W(!0),C||se(e,t)):r.data&&r.data===`valid`&&(clearInterval(C),console.log(`Session key `+r.referenceUsers[0].sessionKey),B(r.referenceUsers[0].sessionKey),console.log(`Session accessToken `+r.accessToken),H(r.accessToken),console.log(`Joined to room `+r.roomDetails.roomName),K(r.roomDetails.roomName));break;case`message`:console.log(`Chat message received from `+r.from.userName),console.log(`Chat message `+r.data),ce(),D(e=>[...e,{sender:r.from.userName,msg:r.data}]),Q();break;case`session_expired`:console.log(`Chat session expired!`),P(!1),B(null),H(null),W(!1),X();break;default:console.log(`Room ignoring message type `+r.type)}}}let se=(e,t)=>{C=setInterval(()=>{console.log(`Trying to connect customer support team ...`),Z(e,t)},1e4)},Z=(e,t)=>{$({from:{userName:e,email:t,audio:!1,video:!1},type:`join_meeting`,roomDetails:{roomLinkKey:a},data:o}),console.log(`Meeting join request sent for guest `+e)},ce=()=>{J.current.play()};function le(){x.addEventListener(`close`,e=>{console.log(`websocket connection closed: `,e),clearInterval(S)}),x.onerror=function(e){console.log(`Error: `+e)}}let Q=()=>{s.current?.scrollIntoView({behavior:`smooth`})},ue=e=>{if(e.key===`Enter`){let t=e.target.value;t&&(console.log(`Send 'message' message to server for session `+z+` accessToken: `+V),$({from:{userName:L,sessionKey:z,audio:!0,video:!0},accessToken:V,type:`message`,data:t}),console.log(`Chat message sent `+t),D(e=>[...e,{sender:L,msg:t}]),O.current.value=``)}},de=()=>{let e=O.current.value;e&&(console.log(`Send 'message' message to server for session `+z+` accessToken: `+V),$({from:{userName:L,sessionKey:z,audio:!0,video:!0},accessToken:V,type:`message`,data:e}),console.log(`Chat message sent `+e),D(t=>[...t,{sender:L,msg:e}]),O.current.value=``,Q())};function $(e){let t=JSON.stringify(e);x.send(t)}function fe(){X(),A(!1),M(!0),B(null),H(null),W(!1)}function pe(){x=new WebSocket(`wss://`+w+`/signal`),B(null),H(null),A(!0),M(!1),P(!1),W(!1),I(null),R(null),D([])}return n(()=>{Q()},[E,z]),t.createElement(`div`,null,!j&&t.createElement(l,{displayChat:k,maxWidth:T},t.createElement(u,null,t.createElement(d,null,`OD Customer Support`),t.createElement(f,{onClick:()=>fe(),className:`text-gray-700`},t.createElement(`svg`,{width:`60%`,height:`60%`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},t.createElement(`path`,{d:`M18 6L6 18M6 6L18 18`,stroke:`orange`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`})))),!N&&!z&&!U&&t.createElement(e,{startGuestChat:ae,guestEmail:F}),N&&!z&&!U&&t.createElement(t.Fragment,null,t.createElement(y,null,t.createElement(`div`,{className:`text-center mt-5`},`Please wait, connecting`),t.createElement(`div`,{className:`flex flex-col items-center `},t.createElement(`div`,null,t.createElement(`img`,{className:`mt-5`,src:`/connecting_customer_support.gif`,width:`80`})),t.createElement(`div`,{className:`absolute text-center bottom-6 font-sm text-sky-400`},`contact us at`),t.createElement(`div`,{className:`absolute text-center bottom-0 font-sm text-sky-400`},`support@origindetector.com.`)))),N&&!z&&U&&t.createElement(t.Fragment,null,t.createElement(y,null,t.createElement(`div`,{className:`text-center text-sm`},`Our customer support team helping other customers, please wait.`),t.createElement(`div`,{className:`text-center mt-5`},`connecting`),t.createElement(`div`,{className:`flex flex-col items-center `},t.createElement(`div`,null,t.createElement(`img`,{className:`mt-5`,src:`/connecting_customer_support.gif`,width:`80`})),t.createElement(`div`,{className:`absolute text-center bottom-6 font-sm text-sky-400`},`contact us at`),t.createElement(`div`,{className:`absolute text-center bottom-0 font-sm text-sky-400`},`support@origindetector.com`)))),N&&z&&t.createElement(`div`,null,t.createElement(p,null,`Live Chat`),t.createElement(ne,null,t.createElement(re,null,E&&E.length==0&&t.createElement(`div`,{className:`ml-2 text-sm`},` You are connected to our customer support team, how can we help you today? `),E&&E.length>0&&t.createElement(`div`,null,E&&E.map(({sender:e,msg:n},r)=>e===L?t.createElement(h,{key:r},t.createElement(`strong`,null,L),t.createElement(`p`,null,n)):t.createElement(m,{key:r},t.createElement(`strong`,null,e),t.createElement(`p`,null,n))),t.createElement(`div`,{style:{float:`left`,clear:`both`},ref:s})))),t.createElement(g,null,t.createElement(_,{ref:O,onKeyUp:ue,placeholder:`Enter your message`}),t.createElement(v,{onClick:de},t.createElement(b,{className:`fas fa-paper-plane`}),`Send`))),t.createElement(`audio`,{ref:q,src:`/audio_file/alert-sound.mp3`}),t.createElement(`audio`,{ref:J,src:`/audio_file/ding-small.mp3`})),j&&t.createElement(ee,{className:`cursor-pointer`,onClick:()=>pe(),displayChat:k,maxWidth:T},t.createElement(te,null,t.createElement(`i`,{className:`bx bx-chat`}),`Live Chat`)))};export{T as Chat};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import e from"./info.guestMobile.js";import t,{useEffect as n,useRef as r,useState as i}from"react";import a,{keyframes as o}from"styled-components";const s=o`
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
transform: translateY(20px);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
transform: translateY(0);
|
|
9
|
+
}
|
|
10
|
+
`,c=o`
|
|
11
|
+
from {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
transform: translateY(0);
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transform: translateY(20px);
|
|
18
|
+
}
|
|
19
|
+
`,l=a.div`
|
|
20
|
+
position: fixed;
|
|
21
|
+
left: 10%;
|
|
22
|
+
top: 50%;
|
|
23
|
+
height: 45%;
|
|
24
|
+
width: ${e=>e.maxWidth}%;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
background-color: white;
|
|
28
|
+
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
|
|
29
|
+
transition: all 0.5s ease;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
z-index: 10000;
|
|
32
|
+
animation: ${({displayChat:e})=>e?s:c} 0.3s ease-in-out forwards;
|
|
33
|
+
`,ee=a.div`
|
|
34
|
+
position: fixed;
|
|
35
|
+
right: 0;
|
|
36
|
+
bottom: 2%;
|
|
37
|
+
height: 15%;
|
|
38
|
+
width: ${e=>e.maxWidth/7}%;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
transition: all 0.5s ease;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
z-index: 10000;
|
|
44
|
+
animation: ${({displayChat:e})=>e?c:s} 0.3s ease-in-out forwards;
|
|
45
|
+
`,u=a.div`
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 5;
|
|
48
|
+
margin-left: 5px;
|
|
49
|
+
margin-top: 5px;
|
|
50
|
+
height: 30px;
|
|
51
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
52
|
+
width: 96%;
|
|
53
|
+
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
color: rgb(78, 161, 211);
|
|
57
|
+
padding: 5px;
|
|
58
|
+
`,d=a.div`
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: flex-start;
|
|
62
|
+
width: 100%;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
color: rgb(78, 161, 211);
|
|
66
|
+
`,f=a.div`
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
padding-top: 5px;
|
|
71
|
+
width: 30px;
|
|
72
|
+
font-size: calc(10px + 1vmin);
|
|
73
|
+
color: white;
|
|
74
|
+
|
|
75
|
+
:hover {
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
`,p=a.div`
|
|
79
|
+
position: absolute;
|
|
80
|
+
text-align: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
top: 38px;
|
|
83
|
+
margin-left: 5px;
|
|
84
|
+
margin-top: 5px;
|
|
85
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
86
|
+
border-radius: 15px;
|
|
87
|
+
width: 96%;
|
|
88
|
+
|
|
89
|
+
margin-left: 5px;
|
|
90
|
+
margin-top: 2px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
font-size: 14px;
|
|
93
|
+
color: white;
|
|
94
|
+
padding: 5px;
|
|
95
|
+
background-color: rgb(78, 161, 211);
|
|
96
|
+
`,te=a.div`
|
|
97
|
+
position: absolute;
|
|
98
|
+
text-align: center;
|
|
99
|
+
align-items: center;
|
|
100
|
+
display: flex;
|
|
101
|
+
gap: 5px;
|
|
102
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
103
|
+
border-radius: 15px;
|
|
104
|
+
width: 100%;
|
|
105
|
+
|
|
106
|
+
margin-left: 10px;
|
|
107
|
+
margin-top: 2px;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
font-size: 14px;
|
|
110
|
+
color: white;
|
|
111
|
+
padding: 10px;
|
|
112
|
+
background-color: rgb(78, 161, 211);
|
|
113
|
+
`,ne=a.div`
|
|
114
|
+
position: absolute;
|
|
115
|
+
top: 80px;
|
|
116
|
+
margin-left: 5px;
|
|
117
|
+
margin-top: 5px;
|
|
118
|
+
width: 100%;
|
|
119
|
+
height: 65%;
|
|
120
|
+
max-height: 83%;
|
|
121
|
+
overflow-x: hidden;
|
|
122
|
+
overflow-y: auto;
|
|
123
|
+
`,re=a.div`
|
|
124
|
+
display: flex;
|
|
125
|
+
width: 100%;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
padding: 15px;
|
|
128
|
+
color: #454552;
|
|
129
|
+
`,m=a.div`
|
|
130
|
+
width: 100%;
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
align-items: flex-start;
|
|
134
|
+
font-size: 12px;
|
|
135
|
+
margin-top: 5px;
|
|
136
|
+
margin-left: 5px;
|
|
137
|
+
text-align: left;
|
|
138
|
+
|
|
139
|
+
> strong {
|
|
140
|
+
margin-left: 3px;
|
|
141
|
+
color: rgb(78, 161, 211)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
> p {
|
|
145
|
+
max-width: 95%;
|
|
146
|
+
width: auto;
|
|
147
|
+
padding: 5px;
|
|
148
|
+
margin-top: 5px;
|
|
149
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
150
|
+
border-radius: 15px;
|
|
151
|
+
color: black;
|
|
152
|
+
font-size: 12px;
|
|
153
|
+
text-align: left;
|
|
154
|
+
}
|
|
155
|
+
`,h=a.div`
|
|
156
|
+
width: 100%;
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
align-items: flex-start;
|
|
160
|
+
font-size: 12px;
|
|
161
|
+
margin-top: 5px;
|
|
162
|
+
margin-left: 5px;
|
|
163
|
+
text-align: left;
|
|
164
|
+
|
|
165
|
+
> strong {
|
|
166
|
+
margin-right: 35px;
|
|
167
|
+
color: rgb(215, 61, 71)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
> p {
|
|
171
|
+
max-width: 95%;
|
|
172
|
+
width: auto;
|
|
173
|
+
padding: 5px;
|
|
174
|
+
margin-top: 5px;
|
|
175
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
176
|
+
border-radius: 15px;
|
|
177
|
+
color: black;
|
|
178
|
+
font-size: 12px;
|
|
179
|
+
text-align: left;
|
|
180
|
+
background-color: #f5f5f5;
|
|
181
|
+
}
|
|
182
|
+
`,g=a.div`
|
|
183
|
+
position: absolute;
|
|
184
|
+
display: flex;
|
|
185
|
+
bottom: 10px;
|
|
186
|
+
margin-left: 5px;
|
|
187
|
+
margin-top: 5px;
|
|
188
|
+
flex-direction: row;
|
|
189
|
+
align-items: center;
|
|
190
|
+
width: 100%;
|
|
191
|
+
gap: 5px;
|
|
192
|
+
`,_=a.input`
|
|
193
|
+
bottom: 0;
|
|
194
|
+
width: 70%;
|
|
195
|
+
height: 25px;
|
|
196
|
+
margin-left: 5px;
|
|
197
|
+
border: 2px solid rgb(69, 69, 82, 0.25);
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
font-size: 14px;
|
|
200
|
+
padding-left: 5px;
|
|
201
|
+
opacity: 0.7;
|
|
202
|
+
|
|
203
|
+
:focus {
|
|
204
|
+
outline: none;
|
|
205
|
+
}
|
|
206
|
+
`,v=a.div`
|
|
207
|
+
height: 25px;
|
|
208
|
+
outline: none;
|
|
209
|
+
border: none;
|
|
210
|
+
display: flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
justify-content: flex-end;
|
|
213
|
+
border-radius: 10px;
|
|
214
|
+
padding-left: 5px;
|
|
215
|
+
padding-right: 10px;
|
|
216
|
+
margin-right: 10px;
|
|
217
|
+
color: black;
|
|
218
|
+
background-color: #bed0f8;
|
|
219
|
+
font-size: 1rem;
|
|
220
|
+
font-weight: 500;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
`,y=a.div`
|
|
223
|
+
position: absolute;
|
|
224
|
+
top: 80px;
|
|
225
|
+
margin-left: 25px;
|
|
226
|
+
width: 100%;
|
|
227
|
+
height: 65%;
|
|
228
|
+
width: 83%;
|
|
229
|
+
margin-bottom: 25px;
|
|
230
|
+
`,b=a.i`
|
|
231
|
+
width: 25px;
|
|
232
|
+
font-size: calc(5px + 1vmin);
|
|
233
|
+
`;var x,S,C;const w=`optimizetalk.com:8443`,T=({meetingLinkKey:a,customerSupportKey:o})=>{let s=r(null),[c]=i(window.innerWidth<window.innerHeight&&window.innerWidth<=900),[T]=i(c?80:20),[E,D]=i([]),O=r(),[k,A]=i(!0),[j,M]=i(!1),[N,P]=i(!1),[F,I]=i(null),[L,R]=i(null),[z,B]=i(),[V,H]=i(),[U,W]=i(!1),[G,K]=i(``),q=r(null),J=r(null),Y=()=>{let e=1e4,t=Math.floor(Math.random()*(9e4-e+1))+e;return console.log(`Random number: `+t),t},ie=(e,t)=>{x=new WebSocket(`wss://`+w+`/signal`),x.onopen=function(){console.log(`Websocket connection established`),le(),oe(e,t),$({from:{userName:e,audio:!0,video:!0},type:`text`,data:`ping from `+e}),S=setInterval(()=>{$({from:{userName:e,audio:!0,video:!0},type:`text`,data:`ping from `+e})},45e3),Z(e,t),console.log(`WebSocket connection opened to chat room `+G)}},ae=(e,t)=>{P(!0),I(t),console.log(`Params guestName:`+e+`, guestEmail:`+t);var n=L?e:`Guest-`+Y()+`: `+e;R(n),console.log(`Joining : `+n),ie(n,t)};function X(){console.log(`Close the socket`),x!=null&&(console.log(`Send 'leave' message to server for session `+z+` accessToken: `+V),$({from:{userName:L,sessionKey:z,audio:!0,video:!0},accessToken:V,type:`leave`,data:a}),x.close())}function oe(e,t){x.onmessage=function(n){let r=JSON.parse(n.data);switch(console.log(`Room received type: `+r.type),r.type){case`text`:console.log(`Text message from `+r.from.userName+` received: `+r.data);break;case`join_meeting`:console.log(`Main message `+r.data),r.data&&r.data===`busy`?(console.log(`Customer support is busy`),W(!0),C||se(e,t)):r.data&&r.data===`valid`&&(clearInterval(C),console.log(`Session key `+r.referenceUsers[0].sessionKey),B(r.referenceUsers[0].sessionKey),console.log(`Session accessToken `+r.accessToken),H(r.accessToken),console.log(`Joined to room `+r.roomDetails.roomName),K(r.roomDetails.roomName));break;case`message`:console.log(`Chat message received from `+r.from.userName),console.log(`Chat message `+r.data),ce(),D(e=>[...e,{sender:r.from.userName,msg:r.data}]),Q();break;case`session_expired`:console.log(`Chat session expired!`),P(!1),B(null),H(null),W(!1),X();break;default:console.log(`Room ignoring message type `+r.type)}}}let se=(e,t)=>{C=setInterval(()=>{console.log(`Trying to connect customer support team ...`),Z(e,t)},1e4)},Z=(e,t)=>{$({from:{userName:e,email:t,audio:!1,video:!1},type:`join_meeting`,roomDetails:{roomLinkKey:a},data:o}),console.log(`Meeting join request sent for guest `+e)},ce=()=>{J.current.play()};function le(){x.addEventListener(`close`,e=>{console.log(`websocket connection closed: `,e),clearInterval(S)}),x.onerror=function(e){console.log(`Error: `+e)}}let Q=()=>{s.current?.scrollIntoView({behavior:`smooth`})},ue=e=>{if(e.key===`Enter`){let t=e.target.value;t&&(console.log(`Send 'message' message to server for session `+z+` accessToken: `+V),$({from:{userName:L,sessionKey:z,audio:!0,video:!0},accessToken:V,type:`message`,data:t}),console.log(`Chat message sent `+t),D(e=>[...e,{sender:L,msg:t}]),O.current.value=``)}},de=()=>{let e=O.current.value;e&&(console.log(`Send 'message' message to server for session `+z+` accessToken: `+V),$({from:{userName:L,sessionKey:z,audio:!0,video:!0},accessToken:V,type:`message`,data:e}),console.log(`Chat message sent `+e),D(t=>[...t,{sender:L,msg:e}]),O.current.value=``,Q())};function $(e){let t=JSON.stringify(e);x.send(t)}function fe(){X(),A(!1),M(!0),B(null),H(null),W(!1)}function pe(){x=new WebSocket(`wss://`+w+`/signal`),B(null),H(null),A(!0),M(!1),P(!1),W(!1),I(null),R(null),D([])}return n(()=>{Q()},[E,z]),t.createElement(`div`,null,!j&&t.createElement(l,{displayChat:k,maxWidth:T},t.createElement(u,null,t.createElement(d,null,`OD Customer Support`),t.createElement(f,{onClick:()=>fe(),className:`text-gray-700`},t.createElement(`svg`,{width:`60%`,height:`60%`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},t.createElement(`path`,{d:`M18 6L6 18M6 6L18 18`,stroke:`orange`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`})))),!N&&!z&&!U&&t.createElement(e,{startGuestChat:ae,guestEmail:F}),N&&!z&&!U&&t.createElement(t.Fragment,null,t.createElement(y,null,t.createElement(`div`,{className:`text-center mt-5`},`Please wait, connecting`),t.createElement(`div`,{className:`flex flex-col items-center `},t.createElement(`div`,null,t.createElement(`img`,{className:`mt-5`,src:`/connecting_customer_support.gif`,width:`80`})),t.createElement(`div`,{className:`absolute text-center bottom-6 font-sx text-sky-400`},`contact us at`),t.createElement(`div`,{className:`absolute text-center bottom-0 font-sx text-sky-400`},`support@origindetector.com.`)))),N&&!z&&U&&t.createElement(t.Fragment,null,t.createElement(y,null,t.createElement(`div`,{className:`text-center`},`Our customer support team helping other customers, please wait.`),t.createElement(`div`,{className:`text-center mt-5`},`connecting`),t.createElement(`div`,{className:`flex flex-col items-center `},t.createElement(`div`,null,t.createElement(`img`,{className:`mt-5`,src:`/connecting_customer_support.gif`,width:`80`})),t.createElement(`div`,{className:`absolute text-center bottom-6 font-sx text-sky-400`},`contact us at`),t.createElement(`div`,{className:`absolute text-center bottom-0 font-sx text-sky-400`},`support@origindetector.com.`)))),N&&z&&t.createElement(`div`,null,t.createElement(p,null,`Live Chat`),t.createElement(ne,null,t.createElement(re,null,E&&E.length==0&&t.createElement(`div`,{className:`ml-2`},` You are connected to our customer support team, how can we help you today? `),E&&E.length>0&&t.createElement(`div`,null,E&&E.map(({sender:e,msg:n},r)=>e===L?t.createElement(h,{key:r},t.createElement(`strong`,null,L),t.createElement(`p`,null,n)):t.createElement(m,{key:r},t.createElement(`strong`,null,e),t.createElement(`p`,null,n))),t.createElement(`div`,{style:{float:`left`,clear:`both`},ref:s})))),t.createElement(g,null,t.createElement(_,{ref:O,onKeyUp:ue,placeholder:`Enter your message`}),t.createElement(v,{onClick:de},t.createElement(b,{className:`fas fa-paper-plane`}),`Send`))),t.createElement(`audio`,{ref:q,src:`/audio_file/alert-sound.mp3`}),t.createElement(`audio`,{ref:J,src:`/audio_file/ding-small.mp3`})),j&&t.createElement(ee,{className:`cursor-pointer`,onClick:()=>pe(),displayChat:k,maxWidth:T},t.createElement(te,null,t.createElement(`i`,{className:`bx bx-chat`}))))};export{T as ChatMobile};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{useState as e}from"react";import t from"styled-components";import{useForm as n}from"react-hook-form";import{twMerge as r}from"tailwind-merge";import{object as i,string as a}from"zod";import{zodResolver as o}from"@hookform/resolvers/zod";const s=t.div`
|
|
2
|
+
position: relative;
|
|
3
|
+
text-align: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
top: 5px;
|
|
6
|
+
margin-left: 5px;
|
|
7
|
+
margin-top: 2px;
|
|
8
|
+
margin-bottom: 30px;
|
|
9
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
10
|
+
border-radius: 15px;
|
|
11
|
+
width: 92%;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
color: white;
|
|
15
|
+
padding: 5px;
|
|
16
|
+
background-color: rgb(78, 161, 211);
|
|
17
|
+
`,c=t.div`
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 40px;
|
|
20
|
+
margin-left: 5px;
|
|
21
|
+
margin-top: 5px;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
max-height: 100%;
|
|
25
|
+
overflow-x: hidden;
|
|
26
|
+
overflow-y: auto;
|
|
27
|
+
`,l=i({name:a().min(1,`Name is required`),email:a().min(1,`Email is required`).email(`Invalid email address`)}),u=({startGuestChat:t,guestEmail:i})=>{let[a,u]=e(),d=n({resolver:o(l)}),{handleSubmit:f,formState:{errors:p}}=d;return React.createElement(c,null,React.createElement(s,null,`Live Chat`),!!i&&React.createElement(`div`,{className:`flex items-center justify-center gap-5 `},React.createElement(`button`,{onClick:()=>t(i),className:`inline-block rounded bg-green-700 px-6 pb-2 pt-2.5 text-xs font-medium leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:bg-primary-600 focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:outline-none focus:ring-0 active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]`},`Start Chat`)),!i&&React.createElement(`form`,{className:`w-full`,onSubmit:f(async e=>{console.log(`Guest: `+e.name),console.log(`Guest Email: `+e.email),t(e.name,e.email)})},React.createElement(`div`,{className:`flex flex-col items-left`},React.createElement(`div`,{className:`max-w-1xl bg-white`},React.createElement(`div`,{className:`relative border-slate-300 flex flex-col items-center`},React.createElement(`div`,null,React.createElement(`label`,{className:`block text-gray-700 text-sm mb-1`,htmlFor:`title`},`Name`),React.createElement(`input`,{className:r(`appearance-none border border-gray-400 rounded w-40 px-1 py-1 text-sm text-gray-700 mb-1 leading-tight focus:outline-none`,`${p.name&&`border-red-500`}`),...d.register(`name`)}),React.createElement(`p`,{className:r(`text-red-500 text-xs italic mb-2 invisible`,`${p.name&&`visible`}`)},p.name?.message)),React.createElement(`div`,null,React.createElement(`label`,{className:`block text-gray-700 text-sm mb-1`,htmlFor:`title`},`Email`),React.createElement(`input`,{type:`email`,className:r(`appearance-none border border-gray-400 rounded w-40 px-1 py-1 text-sm text-gray-700 mb-2 leading-tight focus:outline-none`,`${p.email&&`border-red-500`}`),...d.register(`email`)}),React.createElement(`p`,{className:r(`text-red-500 text-xs italic mb-2 invisible`,`${p.email&&`visible`}`)},p.email?.message))))),React.createElement(`div`,{className:`mb-2 text-gray-600 `},React.createElement(`h2`,{className:`text-sm text-red-600 font-normal`},a)),React.createElement(`div`,{className:`flex items-center justify-center gap-5 `},React.createElement(`button`,{className:`inline-block rounded bg-green-700 px-6 pb-2 pt-2.5 text-xs font-medium leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:bg-primary-600 focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:outline-none focus:ring-0 active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]`},`Start Chat`))))};export{u as default};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{useState as e}from"react";import t from"styled-components";import{useForm as n}from"react-hook-form";import{twMerge as r}from"tailwind-merge";import{object as i,string as a}from"zod";import{zodResolver as o}from"@hookform/resolvers/zod";const s=t.div`
|
|
2
|
+
position: relative;
|
|
3
|
+
text-align: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
top: 5px;
|
|
6
|
+
margin-left: 5px;
|
|
7
|
+
margin-top: 2px;
|
|
8
|
+
margin-bottom: 10px;
|
|
9
|
+
border: 1px solid rgb(78, 161, 211, 0.3);
|
|
10
|
+
border-radius: 15px;
|
|
11
|
+
width: 92%;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
color: white;
|
|
15
|
+
padding: 5px;
|
|
16
|
+
background-color: rgb(78, 161, 211);
|
|
17
|
+
`,c=t.div`
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 40px;
|
|
20
|
+
margin-left: 5px;
|
|
21
|
+
margin-top: 5px;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 80%;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
overflow-x: hidden;
|
|
26
|
+
overflow-y: auto;
|
|
27
|
+
`,l=i({name:a().min(1,`Name is required`),email:a().min(1,`Email is required`).email(`Invalid email address`)}),u=({startGuestChat:t,guestEmail:i})=>{let[a,u]=e(),d=n({resolver:o(l)}),{handleSubmit:f,formState:{errors:p}}=d;return React.createElement(c,null,React.createElement(s,null,`Live Chat`),!!i&&React.createElement(`div`,{className:`flex items-center justify-center gap-5 `},React.createElement(`button`,{onClick:()=>t(i),className:`inline-block rounded bg-green-700 px-6 pb-2 pt-2.5 text-xs font-medium leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:bg-primary-600 focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:outline-none focus:ring-0 active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]`},`Start Chat`)),!i&&React.createElement(`form`,{className:`w-full`,onSubmit:f(async e=>{console.log(`Guest: `+e.name),console.log(`Guest Email: `+e.email),t(e.name,e.email)})},React.createElement(`div`,{className:`flex flex-col items-left`},React.createElement(`div`,{className:`max-w-1xl bg-white`},React.createElement(`div`,{className:`relative border-slate-300 flex flex-col items-center`},React.createElement(`div`,null,React.createElement(`label`,{className:`block text-gray-700 text-normal mb-1`,htmlFor:`title`},`Name`),React.createElement(`input`,{className:r(`appearance-none border border-gray-400 rounded w-full text-gray-700 mb-1 px-1 py-1 leading-tight focus:outline-none`,`${p.name&&`border-red-500`}`),...d.register(`name`)}),React.createElement(`p`,{className:r(`text-red-500 text-xs italic invisible`,`${p.name&&`visible`}`)},p.name?.message)),React.createElement(`div`,null,React.createElement(`label`,{className:`block text-gray-700 text-normal mb-1`,htmlFor:`title`},`Email`),React.createElement(`input`,{type:`email`,className:r(`appearance-none border border-gray-400 rounded w-full text-gray-700 mb-1 px-1 py-1 leading-tight focus:outline-none`,`${p.email&&`border-red-500`}`),...d.register(`email`)}),React.createElement(`p`,{className:r(`text-red-500 text-xs italic mb-2 invisible`,`${p.email&&`visible`}`)},p.email?.message))))),React.createElement(`div`,{className:`mb-2 text-gray-600 `},React.createElement(`h2`,{className:`text-sm text-red-600 font-normal`},a)),React.createElement(`div`,{className:`flex items-center justify-center gap-5 `},React.createElement(`button`,{className:`inline-block rounded bg-green-700 px-6 pb-2 pt-2.5 text-xs font-medium leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:bg-primary-600 focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:outline-none focus:ring-0 active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]`},`Start Chat`))))};export{u as default};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Chat as e}from"./components/lib/chat.js";import{ChatMobile as t}from"./components/lib/chatMobile.js";export{e as Chat,t as ChatMobile};
|
package/package.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "od-support-chat",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/od-support-chat.umd.js",
|
|
7
7
|
"module": "./dist/od-support-chat.es.js",
|
|
8
8
|
"types": "./dist/main.d.ts",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"
|
|
11
|
-
"build": "vite build",
|
|
12
|
-
"preview": "vite preview --host localhost --port 3000",
|
|
13
|
-
"local": "vite preview --host localhost --port 3000"
|
|
10
|
+
"build": "tsdown"
|
|
14
11
|
},
|
|
15
12
|
"exports": {
|
|
16
13
|
".": {
|
|
Binary file
|
|
Binary file
|