@accurix/centrinfo-widget 1.0.0 โ 1.0.1
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/README.md +62 -9
- package/dist/cdn/centrinfo-widget.js +2153 -225
- package/dist/cdn/manifest.json +6 -6
- package/dist/config-CCkOySUT.mjs +29 -0
- package/dist/config-CzrfVSPp.cjs +35 -0
- package/dist/index.cjs +2118 -218
- package/dist/index.d.cts +3 -291
- package/dist/index.d.mts +2 -293
- package/dist/index.d.ts +2 -293
- package/dist/index.mjs +2118 -218
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.cts +245 -0
- package/dist/runtime.d.mts +245 -0
- package/dist/runtime.mjs +1 -0
- package/dist/types-DQWp12Cg.d.mts +661 -0
- package/dist/types-rfkc-TtX.d.cts +658 -0
- package/package.json +33 -17
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`);var r=class extends Error{constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};const i=()=>({agentName:`Assistant`,greeting:`Hi! ๐ How can I help you today?`,allowVoiceInput:!1,availableActions:[]});var a=class{constructor(e,t,n){this.baseUrl=e,this.token=t,this.gifApiKey=n}headers(e=!0){let t={Authorization:`Bearer ${this.token}`};return e&&(t[`Content-Type`]=`application/json`),t}async json(e){let t;try{t=await e.json()}catch{t=void 0}if(!e.ok){let n=s(t)??`request failed (${e.status})`;throw new r(e.status,n)}return t?.data??t}async bootstrap(){try{let e=await fetch(`${this.baseUrl}/public-chat/bootstrap`,{headers:this.headers(!1)});if(!e.ok)return i();let t=await this.json(e);return{...i(),...t}}catch{return i()}}async stream(e,t,n){let r=await fetch(`${this.baseUrl}/public-chat/stream`,{method:`POST`,headers:this.headers(),body:JSON.stringify({question:e,sessionId:t}),signal:n.signal});return!r.ok||!r.body?this.send(e,t,n):c(r.body,n)}async send(e,t,n){let r=await fetch(`${this.baseUrl}/public-chat`,{method:`POST`,headers:this.headers(),body:JSON.stringify({question:e,sessionId:t}),signal:n.signal}),i=await this.json(r);return n.onChunk(i.answer??``),{answer:i.answer??``,sources:i.sources??[],suggestedReplies:i.suggestedReplies??[],availableActions:i.availableActions??[],handoffOffered:i.handoffOffered??!1,requestedContactFields:u(i.requestedContactFields),conversationEnded:i.conversationEnded??!1}}async action(e,t){let n=await fetch(`${this.baseUrl}/public-chat/${e}`,{method:`POST`,headers:this.headers(),body:JSON.stringify(t)}),r=await this.json(n);return{ok:!0,note:r?.note,booking:r?.booking}}async identify(e,t){if(!(!e||!t))try{let n=await fetch(`${this.baseUrl}/public-chat/identify`,{method:`POST`,headers:this.headers(),body:JSON.stringify(o(e,t))});if(!n.ok)try{await n.text()}catch{}}catch{}}async transcribe(e,t){let n=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:`POST`,headers:this.headers(),body:JSON.stringify({audioBase64:e,mimeType:t})});return(await this.json(n)).text??``}async endConversation(e){try{let t=await fetch(`${this.baseUrl}/public-chat/end`,{method:`POST`,headers:this.headers(),body:JSON.stringify({sessionId:e})});if(!t.ok)try{await t.text()}catch{}}catch{}}async sendFeedback(e){try{let t=await fetch(`${this.baseUrl}/public-chat/feedback`,{method:`POST`,headers:this.headers(),body:JSON.stringify(e)});if(!t.ok)try{await t.text()}catch{}}catch{}}async extract(e,t,n){let r=await fetch(`${this.baseUrl}/public-chat/extract`,{method:`POST`,headers:this.headers(),body:JSON.stringify({fileBase64:e,mimeType:t,filename:n})});return(await this.json(r)).text??``}async demoSlots(e,t){try{let n=`from=${encodeURIComponent(e)}&to=${encodeURIComponent(t)}`,r=await fetch(`${this.baseUrl}/public-chat/demo-slots?${n}`,{headers:this.headers(!1)});if(!r.ok)return{taken:[],busy:[]};let i=await this.json(r);return{taken:i?.taken??[],busy:i?.busy??[]}}catch{return{taken:[],busy:[]}}}async searchGifs(e){if(!this.gifApiKey)return[];let t=`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(e.trim()||`trending`)}&key=${this.gifApiKey}&limit=24&media_filter=tinygif,gif&contentfilter=high`;try{let e=await fetch(t);return e.ok?((await e.json()).results??[]).map(e=>({id:e.id,url:e.media_formats?.gif?.url??e.media_formats?.tinygif?.url??``,preview:e.media_formats?.tinygif?.url??e.media_formats?.gif?.url??``,alt:e.content_description||`GIF`})).filter(e=>e.url):[]}catch{return[]}}};const o=(e,t)=>{let n={...t.customAttributes??{},...t.metadata??{}};t.createdAt!==void 0&&(n.createdAt=t.createdAt),t.avatarUrl&&(n.avatarUrl=t.avatarUrl),t.company&&(n.company=t.company);let r={sessionId:e},i=t.externalId??t.userId;return i&&(r.externalId=i),t.email&&(r.email=t.email),t.firstName&&(r.firstName=t.firstName),t.lastName&&(r.lastName=t.lastName),t.name&&(r.name=t.name),t.phone&&(r.phone=t.phone),Object.keys(n).length>0&&(r.metadata=n),r},s=e=>{let t=e?.message;if(Array.isArray(t))return t.join(`, `);if(typeof t==`string`)return t},c=async(e,t)=>{let n=e.getReader(),i=new TextDecoder,a={answer:``,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1},o=``;for(;;){let{done:e,value:s}=await n.read();if(e)break;o+=i.decode(s,{stream:!0});let c;for(;(c=o.indexOf(`
|
|
2
|
-
|
|
3
|
-
`))!==-1;){let e=o.slice(0,c);o=o.slice(c+2);let n=l(e);if(n){if(n.event===`error`)throw new r(502,n.data?.message??`stream error`);if(n.event===`chunk`&&typeof n.data?.text==`string`)a.answer+=n.data.text,t.onChunk(n.data.text);else if(n.event===`final`&&n.data)a.sources=n.data.sources??[],a.suggestedReplies=n.data.suggestedReplies??[],a.availableActions=n.data.availableActions??[],a.handoffOffered=!!n.data.handoffOffered,a.requestedContactFields=u(n.data.requestedContactFields),a.conversationEnded=!!n.data.conversationEnded;else if(n.event===`done`)return a}}}return a},l=e=>{let t=`message`,n=[];for(let r of e.split(`
|
|
4
|
-
`))r.startsWith(`event:`)?t=r.slice(6).trim():r.startsWith(`data:`)&&n.push(r.slice(5).trim());if(n.length===0)return{event:t};try{return{event:t,data:JSON.parse(n.join(`
|
|
5
|
-
`))}}catch{return{event:t}}},u=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],d=e=>new Promise(t=>setTimeout(t,e)),f={agentName:`Sara`,agentAvatarUrl:``,greeting:`Hi! ๐ I'm Sara, the Northwind assistant. Ask me anything about tracking, customs, or pricing โ or book a demo.`,allowVoiceInput:!0,availableActions:[`public_book_demo`,`public_capture_contact`,`public_submit_inquiry`],agentDescription:`I help with shipment tracking, customs, and pricing.`,welcomeSubtitle:`Ask me anything โ most answers are instant.`,disclaimerText:`Sara is an AI assistant; answers may be imperfect.`,starterQuestions:[`How do I track a shipment?`,`How does customs work?`,`What's your pricing?`]},p=[{match:/^\s*(hi+|hey+|hello|yo|sup|howdy|hola|thanks|thank you|thx|good (morning|afternoon|evening))\b/i,result:{answer:`Hello! ๐ How can I help you today?`,sources:[],suggestedReplies:[`How do I track a shipment?`,`How does customs work?`],handoffOffered:!1}},{match:/track|shipment|where|status/i,result:{answer:`You can track any shipment in real time from the **Tracking** tab โ we merge GPS pings with carrier scan events, so the status is usually fresher than the carrier's own site. Each shipment also has a shareable link you can send to customers.`,sources:[{title:`Real-time tracking`,url:`https://northwind.example/docs/tracking`},{title:`Shareable tracking links`,url:`https://northwind.example/docs/share`}],suggestedReplies:[`How fresh is the data?`,`Can customers track too?`],handoffOffered:!1}},{match:/custom|clear|duty|tariff|import/i,result:{answer:`Customs is automated end-to-end: HS codes are auto-classified from your product catalog, duties are estimated up front, and most lanes are pre-cleared before the freight lands. If a shipment needs a human broker, we flag it early so it never sits at the border.`,sources:[{title:`Smart customs`,url:`https://northwind.example/docs/customs`}],suggestedReplies:[`Which countries are pre-cleared?`,`What does it cost?`],handoffOffered:!1}},{match:/price|cost|pricing|plan|quote/i,result:{answer:`Pricing is usage-based โ you pay per shipment, with volume tiers that kick in automatically. There's no platform fee and no per-seat charge. I can have someone put together a quote for your lanes if you'd like.`,sources:[{title:`Pricing`,url:`https://northwind.example/pricing`}],suggestedReplies:[`How do volume tiers work?`,`Is there a free trial?`],handoffOffered:!1}}],m={answer:`That's a great question โ I don't have a confident answer from Northwind's published docs yet. Want me to pass it to the team so a human can follow up? You can also book a quick demo.`,sources:[],suggestedReplies:[`What can you help with?`],handoffOffered:!0};var h=class{async bootstrap(){return await d(180),f}async stream(e,t,n){await d(550);let r=p.find(t=>t.match.test(e)),i=r?r.result:m,a=i.answer.split(/(\s+)/);for(let e of a){if(n.signal?.aborted)break;n.onChunk(e),await d(18+Math.min(40,e.length*6))}return{...i,availableActions:f.availableActions}}async action(e,t){return await d(450),{ok:!0,note:{"book-demo":`Demo requested โ we'll email you a few times that work. ๐
`,contact:`Got it โ saved your details. โ
`,inquiry:`Thanks! We'll get back to you shortly. โ๏ธ`,"request-callback":`We'll call you back soon. ๐`,"subscribe-newsletter":`You're subscribed. ๐`}[e]}}async transcribe(e,t){return await d(700),`How do I track a shipment?`}async extract(e,t,n){return await d(600),`[Attached file${n?`: ${n}`:``}] Invoice #4821 โ 3 pallets, Rotterdam โ Lagos, ETA 12 days.`}async identify(e,t){await d(50)}async endConversation(e){await d(50)}async sendFeedback(){await d(50)}async demoSlots(e,t){return await d(150),{taken:[[11,0],[15,0]].map(([e,t])=>{let n=new Date;return n.setHours(e,t,0,0),n.toISOString()}),busy:[]}}async searchGifs(e){await d(280);let t=e.trim().toLowerCase(),n=t?y.filter(e=>e.alt.includes(t)||e.tags.some(e=>e.includes(t)||t.includes(e))):y;return(n.length>0?n:y).map(e=>({id:e.id,url:v(e.emoji,e.anim),preview:v(e.emoji,e.anim),alt:e.alt}))}};const g=`<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>`,_=`<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>`,v=(e,t)=>{let n=`<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128'><rect width='128' height='128' rx='14' fill='#eef1f4'/><text x='64' y='88' font-size='64' text-anchor='middle'>${e}${t}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(n)}`},y=[{id:`g1`,emoji:`๐`,alt:`thumbs up`,tags:[`thumbs`,`yes`,`ok`,`great`,`good`],anim:g},{id:`g2`,emoji:`๐`,alt:`celebrate`,tags:[`party`,`yay`,`congrats`,`celebrate`],anim:_},{id:`g3`,emoji:`๐`,alt:`wave hello`,tags:[`hi`,`hello`,`hey`,`wave`,`bye`],anim:_},{id:`g4`,emoji:`โค๏ธ`,alt:`heart`,tags:[`love`,`thanks`,`heart`],anim:g},{id:`g5`,emoji:`๐ค`,alt:`thinking`,tags:[`hmm`,`think`,`thinking`],anim:_},{id:`g6`,emoji:`๐`,alt:`laughing`,tags:[`lol`,`funny`,`haha`,`laugh`],anim:g},{id:`g7`,emoji:`๐ฅ`,alt:`fire`,tags:[`fire`,`hot`,`lit`,`awesome`],anim:g},{id:`g8`,emoji:`๐`,alt:`rocket`,tags:[`rocket`,`launch`,`fast`,`go`],anim:_}],b=e=>new Promise(t=>setTimeout(t,e));var x=class{constructor(e,t){this.real=e,this.strings=t}bootstrap(){return this.real.bootstrap()}async stream(e,t,n){await b(300);for(let e of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(e),await b(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async action(){return await b(250),{ok:!0,note:this.strings.previewActionNote}}async identify(){}async endConversation(){}async sendFeedback(){}async transcribe(){return``}async extract(){return``}async searchGifs(){return[]}async demoSlots(){return{taken:[],busy:[]}}};const S=[{name:`Smileys`,emojis:`๐.๐.๐.๐.๐
.๐.๐คฃ.๐.๐.๐.๐.๐.๐.๐.๐ฅฐ.๐.๐.๐.๐.๐คช.๐ค.๐คญ.๐ค.๐ค.๐.๐ถ.๐.๐.๐ด.๐ฅณ.๐.๐ค.๐ฅบ.๐ข.๐ญ.๐ค.๐ .๐คฏ.๐ฌ.๐ฑ.๐คฉ.๐ฅฑ`.split(`.`)},{name:`Gestures`,emojis:[`๐`,`๐`,`๐`,`๐ค`,`โ๏ธ`,`๐ค`,`๐ค`,`๐ค`,`๐ค`,`๐`,`๐`,`๐`,`๐`,`โ`,`๐๏ธ`,`๐`,`๐ค`,`๐`,`๐ช`,`๐`,`๐`,`๐`,`๐คฒ`,`๐ซถ`]},{name:`Hearts & symbols`,emojis:`โค๏ธ.๐งก.๐.๐.๐.๐.๐ค.๐ค.๐.โฃ๏ธ.๐.๐.๐.๐.โจ.โญ.๐.๐ซ.๐ฅ.๐.๐.โ
.โ.โก.๐ฏ.๐`.split(`.`)},{name:`Animals & nature`,emojis:[`๐ถ`,`๐ฑ`,`๐ฆ`,`๐ป`,`๐ผ`,`๐จ`,`๐ฆ`,`๐ฎ`,`๐ธ`,`๐ต`,`๐ง`,`๐ฆ`,`๐`,`๐ฆ`,`๐ข`,`๐ฌ`,`๐ท`,`๐ธ`,`๐น`,`๐ป`,`๐ณ`,`๐`]},{name:`Food & drink`,emojis:[`๐`,`๐`,`๐`,`๐`,`๐`,`๐ฅ`,`๐`,`๐`,`๐`,`๐ฎ`,`๐ฟ`,`๐ฉ`,`๐ช`,`๐`,`โ`,`๐ต`,`๐บ`,`๐ฅ`,`๐ท`]},{name:`Objects & travel`,emojis:`๐.โ๏ธ.๐.๐ .๐ฆ.๐ฑ.๐ป.โ.๐ท.๐ก.๐.๐.๐.โ๏ธ.๐.๐.๐ง.๐ฐ.๐.โฐ.๐.๐ฏ.๐.๐ฎ.๐ต.๐ฌ.๐`.split(`.`)}],C={inquiry:{title:`Leave a message`,submit:`Send message`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`message`,label:`Message`,kind:`textarea`,required:!0,placeholder:`How can we help?`}]},contact:{title:`Share your details`,submit:`Save`,fields:[{key:`name`,label:`Name`,kind:`text`,identity:`name`},{key:`email`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`phone`,label:`Phone`,kind:`tel`,identity:`phone`}]},"book-demo":{title:`Book a demo`,submit:`Request demo`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`preferredAt`,label:`Preferred time`,kind:`text`,placeholder:`e.g. Thursday 3pm`},{key:`notes`,label:`Notes`,kind:`textarea`,placeholder:`Anything we should know?`}]},"request-callback":{title:`Request a callback`,submit:`Request callback`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorPhone`,label:`Phone`,kind:`tel`,required:!0,identity:`phone`},{key:`bestTime`,label:`Best time to call`,kind:`text`,placeholder:`e.g. tomorrow afternoon`},{key:`topic`,label:`Topic`,kind:`text`,placeholder:`What should we call about?`}]},"subscribe-newsletter":{title:`Subscribe`,submit:`Subscribe`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`}]}},w={openChat:`Open chat`,closeChat:`Close chat`,muteSounds:`Mute sounds`,unmuteSounds:`Unmute sounds`,statusOnline:`Online ยท replies instantly`,statusOffline:`Away ยท leave a message`,composerPlaceholder:`Type your messageโฆ`,send:`Send message`,emoji:`Emoji`,gifs:`GIFs`,attachFile:`Attach a file`,recordVoice:`Record a voice message`,stopRecording:`Stop recording`,stop:`Stop`,copy:`Copy`,copied:`Copied`,retry:`Retry`,clearChat:`Clear conversation`,clearChatConfirm:`Clear this conversation?`,clearChatConfirmBody:`This clears the messages on this device and starts a fresh chat.`,clearConfirmCta:`Clear chat`,endChat:`End conversation`,endChatConfirm:`End this conversation?`,endChatConfirmBody:`You won't be able to send more messages in this chat, but you can start a new one anytime.`,endConfirmCta:`End conversation`,conversationEnded:`This conversation has ended.`,startNewChat:`Start a new conversation`,pastConversations:`Past conversations`,viewingPast:`Viewing a past conversation (read-only)`,backToChat:`Back to current chat`,historyEnded:`ended`,feedbackHelpful:`Helpful`,feedbackNotHelpful:`Not helpful`,feedbackThanks:`Thanks for the feedback`,csatPrompt:`How was this chat?`,feedbackCommentPlaceholder:`What went wrong? (optional)`,feedbackSend:`Send`,cancel:`Cancel`,newMessages:`New messages`,poweredBy:`Powered by`,searchGifs:`Search GIFsโฆ`,searchingGifs:`Searchingโฆ`,noGifs:`No GIFs found`,assistantTyping:`Assistant is typing`,emptyReply:`Sorry, I couldn't generate a reply.`,errorGeneric:`Something went wrong reaching the assistant. Please try again.`,errorRateLimit:`Youโre sending messages a little fast โ give it a second and try again.`,attaching:`Reading fileโฆ`,attachTooLarge:`That file is too large (max 8 MB).`,attachFailed:`Couldnโt read that file โ try another.`,handoffTitle:`Want our team to follow up?`,handoffName:`Name (optional)`,handoffEmail:`Your email`,handoffNotify:`Notify the team`,sending:`Sendingโฆ`,handoffShared:`Iโve shared this with our team โ theyโll get back to you at {email}.`,formThanks:`Thanks! Weโll be in touch.`,formError:`Something went wrong โ please try again.`,bookingPickTime:`What time works best?`,bookingDuration:`30-minute demo`,bookingRequested:`Requested for {when} โ weโll confirm by email.`,bookingConfirmed:`Youโre booked for {when}! A calendar invite is on its way. ๐
`,bookingSlotTaken:`That time was just taken โ please pick another.`,bookingViaProvider:`Pick a time that works for you on {provider}.`,bookingOpenScheduler:`Open the scheduler`,bookingLinkOpened:`Opening the scheduler โ pick a time that suits you. ๐
`,bookingMeetingLink:`Meeting link`,previewReply:`๐ This is a preview โ replies here are samples. Publish the widget on your site to chat with the live AI.`,previewActionNote:`Preview โ nothing was actually sent. This works for real once you publish.`,previewBanner:`Preview โ sample replies, no AI`},T=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>t[n]??``),E=e=>e?{...w,...e}:w,D=(0,e.createContext)(w),O=D.Provider,k=()=>(0,t.useContext)(D),A=(e,t)=>(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,...t,children:e}),ee=e=>(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,n.jsx)(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z`})}),te=e=>A((0,n.jsx)(`path`,{d:`m6 9 6 6 6-6`}),e),j=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,n.jsx)(`path`,{d:`M22 2 11 13`})]}),e),ne=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,n.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,n.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`})]}),e),M=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M15 3h6v6`}),(0,n.jsx)(`path`,{d:`M10 14 21 3`}),(0,n.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),e),N=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`}),(0,n.jsx)(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),(0,n.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),(0,n.jsx)(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]}),e),P=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,n.jsx)(`path`,{d:`m22 7-10 5L2 7`})]}),e),F=e=>A((0,n.jsx)(`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z`}),e),re=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,n.jsx)(`path`,{d:`M8.5 14.5a4 4 0 0 0 7 0`}),(0,n.jsx)(`line`,{x1:`9`,y1:`9.5`,x2:`9.01`,y2:`9.5`}),(0,n.jsx)(`line`,{x1:`15`,y1:`9.5`,x2:`15.01`,y2:`9.5`})]}),e),I=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),e),L=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,n.jsx)(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),(0,n.jsx)(`path`,{d:`M19 5a9 9 0 0 1 0 14`})]}),e),ie=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,n.jsx)(`line`,{x1:`22`,y1:`9`,x2:`16`,y2:`15`}),(0,n.jsx)(`line`,{x1:`16`,y1:`9`,x2:`22`,y2:`15`})]}),e),R=e=>A((0,n.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),e),z=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,n.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),e),ae=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M1 4v6h6`}),(0,n.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),e),oe=e=>A((0,n.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`}),e),se=e=>A((0,n.jsx)(`path`,{d:`M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`}),e),ce=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M18.36 6.64a9 9 0 1 1-12.73 0`}),(0,n.jsx)(`line`,{x1:`12`,y1:`2`,x2:`12`,y2:`12`})]}),e),le=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,n.jsx)(`path`,{d:`M12 7v5l3 2`})]}),e),ue=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M7 10v12`}),(0,n.jsx)(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})]}),e),de=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M17 14V2`}),(0,n.jsx)(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})]}),e),fe=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,n.jsx)(`path`,{d:`m19 12-7 7-7-7`})]}),e),pe=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,B=e=>{let t=[],r=0,i=0,a;for(pe.lastIndex=0;(a=pe.exec(e))!==null;){a.index>r&&t.push(e.slice(r,a.index));let o=a[0];if(o.startsWith("`"))t.push((0,n.jsx)(`code`,{class:`cf-md-code`,children:o.slice(1,-1)},i++));else if(o.startsWith(`**`))t.push((0,n.jsx)(`strong`,{children:o.slice(2,-2)},i++));else if(o.startsWith(`[`)){let e=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(o),r=e?e[1]:o,a=e?e[2]:`#`;t.push((0,n.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer nofollow`,children:r},i++))}else t.push((0,n.jsx)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer nofollow`,children:o},i++));r=a.index+o.length}return r<e.length&&t.push(e.slice(r)),t},me=/^(```|#{1,6}\s|\s*[-*]\s|\s*\d+\.\s)/,he=e=>{let t=e.replace(/\r\n/g,`
|
|
6
|
-
`).split(`
|
|
7
|
-
`),r=[],i=0,a=0;for(;a<t.length;){let e=t[a];if(e.trim().startsWith("```")){let e=[];for(a++;a<t.length&&!t[a].trim().startsWith("```");)e.push(t[a]),a++;a++,r.push((0,n.jsx)(`pre`,{class:`cf-md-pre`,children:(0,n.jsx)(`code`,{children:e.join(`
|
|
8
|
-
`)})},i++));continue}if(e.trim()===``){a++;continue}let o=/^(#{1,6})\s+(.*)$/.exec(e);if(o){r.push((0,n.jsx)(`div`,{class:`cf-md-h`,children:B(o[2])},i++)),a++;continue}if(/^\s*[-*]\s+/.test(e)){let e=[];for(;a<t.length&&/^\s*[-*]\s+/.test(t[a]);)e.push((0,n.jsx)(`li`,{children:B(t[a].replace(/^\s*[-*]\s+/,``))},e.length)),a++;r.push((0,n.jsx)(`ul`,{class:`cf-md-list`,children:e},i++));continue}if(/^\s*\d+\.\s+/.test(e)){let e=[];for(;a<t.length&&/^\s*\d+\.\s+/.test(t[a]);)e.push((0,n.jsx)(`li`,{children:B(t[a].replace(/^\s*\d+\.\s+/,``))},e.length)),a++;r.push((0,n.jsx)(`ol`,{class:`cf-md-list`,children:e},i++));continue}let s=[e];for(a++;a<t.length&&t[a].trim()!==``&&!me.test(t[a]);)s.push(t[a]),a++;r.push((0,n.jsx)(`p`,{children:B(s.join(` `))},i++))}return r},ge=()=>{let e=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let t=requestAnimationFrame(()=>e.current?.scrollIntoView({block:`end`}));return()=>cancelAnimationFrame(t)},[]),e},_e=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)||`๐ค`,ve=({persona:e,small:t})=>{let r=t?`cf-msg__avatar`:`cf-header__avatar`;return e?.agentAvatarUrl?(0,n.jsx)(`span`,{class:r,children:(0,n.jsx)(`img`,{src:e.agentAvatarUrl,alt:``})}):(0,n.jsx)(`span`,{class:r,children:e?_e(e.agentName):`ยท`})},ye=()=>{let e=k();return(0,n.jsxs)(`div`,{class:`cf-msg__bubble cf-typing`,"aria-label":e.assistantTyping,children:[(0,n.jsx)(`span`,{class:`cf-typing__dot`}),(0,n.jsx)(`span`,{class:`cf-typing__dot`}),(0,n.jsx)(`span`,{class:`cf-typing__dot`})]})},be=3,V=({msg:e})=>{if(!e.sources||e.sources.length===0)return null;let t=new Set,r=[];for(let n of e.sources){let e=(n.url||n.title||``).toLowerCase();!e||t.has(e)||(t.add(e),r.push(n))}if(r.length===0)return null;let i=r.slice(0,3),a=r.length-i.length;return(0,n.jsxs)(`div`,{class:`cf-sources`,children:[i.map((e,t)=>e.url?(0,n.jsxs)(`a`,{class:`cf-source`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.title||e.url,children:[(0,n.jsx)(M,{}),(0,n.jsx)(`span`,{children:e.title||e.url})]},t):(0,n.jsxs)(`span`,{class:`cf-source`,title:e.title,children:[(0,n.jsx)(M,{}),(0,n.jsx)(`span`,{children:e.title})]},t)),a>0&&(0,n.jsxs)(`span`,{class:`cf-source cf-source--more`,children:[`+`,a,` more`]})]})},H=({replies:e,onPick:t})=>e&&e.length>0?(0,n.jsx)(`div`,{class:`cf-chips`,children:e.map((e,r)=>(0,n.jsx)(`button`,{type:`button`,class:`cf-chip`,onClick:()=>t(e),children:e},r))}):null,U={public_book_demo:{type:`book-demo`,label:`Book a demo`,Icon:N},public_submit_inquiry:{type:`inquiry`,label:`Leave a message`,Icon:P},public_request_callback:{type:`request-callback`,label:`Request a callback`,Icon:F},public_subscribe_newsletter:{type:`subscribe-newsletter`,label:`Subscribe`,Icon:P}},xe=({field:e,value:t,onInput:r})=>{let i=e.placeholder??e.label,a={class:`cf-form__input`,placeholder:e.required?`${i} *`:i,value:t,"aria-label":e.label,onInput:e=>r(e.target.value)};return e.kind===`textarea`?(0,n.jsx)(`textarea`,{rows:2,...a}):(0,n.jsx)(`input`,{type:e.kind,...a})},Se=({spec:e,visitor:r,onSubmit:i,onCancel:a})=>{let o=k(),s=ge(),[c,l]=(0,t.useState)(()=>{let t={};for(let n of e.fields)n.identity&&r[n.identity]&&(t[n.key]=r[n.identity]);return t}),[u,d]=(0,t.useState)(`idle`),[f,p]=(0,t.useState)(``),m=e=>!!(e.identity&&r[e.identity]?.trim()),h=e.fields.filter(e=>!m(e)),g=h.every(e=>!e.required||(c[e.key]?.trim()??``)!==``),_=r.email||r.name||``;return u===`done`?(0,n.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,n.jsx)(R,{}),(0,n.jsx)(`span`,{children:f})]}):(0,n.jsxs)(`div`,{class:`cf-form`,ref:s,children:[(0,n.jsx)(`div`,{class:`cf-form__title`,children:e.title}),h.length===0&&_&&(0,n.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,_]}),h.map(e=>(0,n.jsx)(xe,{field:e,value:c[e.key]??``,onInput:t=>l(n=>({...n,[e.key]:t}))},e.key)),u===`error`&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:o.formError}),(0,n.jsxs)(`div`,{class:`cf-form__actions`,children:[a&&(0,n.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:a,children:`Cancel`}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!g||u===`submitting`,onClick:async()=>{if(!g||u===`submitting`)return;d(`submitting`);let t={},n={};for(let r of e.fields){let e=c[r.key]?.trim();e&&(t[r.key]=e,r.identity&&(n[r.identity]=e))}try{p((await i(t,n)).note||o.formThanks),d(`done`)}catch{d(`error`)}},children:u===`submitting`?o.sending:e.submit})]})]})},W=e=>String(e).padStart(2,`0`),Ce=()=>{let e=[];for(let t=9;t<=17;t++)e.push(`${W(t)}:00`),e.push(`${W(t)}:30`);return e},we=e=>{let t=new Date;return t.setHours(0,0,0,0),Array.from({length:e},(e,n)=>{let r=new Date(t);return r.setDate(t.getDate()+n),r})},G=(e,t)=>{let[n,r]=t.split(`:`).map(Number),i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0);try{return new Intl.DateTimeFormat(void 0,{weekday:`short`,day:`numeric`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}).format(i)}catch{return`${e.toDateString()} ${t}`}},K=(e,t)=>{let[n,r]=t.split(`:`).map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0)},q=({visitor:e,onSubmit:r,onCancel:i,onDemoSlots:a,scheduler:o})=>{let s=k(),c=ge(),l=(0,t.useMemo)(()=>we(14),[]),u=(0,t.useMemo)(()=>Ce(),[]),[d,f]=(0,t.useState)((0,t.useMemo)(()=>{let e=Date.now();for(let t=0;t<l.length;t++)if(u.some(n=>K(l[t],n).getTime()>e))return t;return 0},[l,u])),[p,m]=(0,t.useState)(null),[h,g]=(0,t.useState)(e.name??``),[_,v]=(0,t.useState)(e.email??``),[y,b]=(0,t.useState)(`idle`),[x,S]=(0,t.useState)(``),[w,E]=(0,t.useState)(``),[D,O]=(0,t.useState)(``),A=o?.connected&&o.mode===`link`,ee=async()=>{if(y===`submitting`||!e.email?.trim()&&!_.trim())return;b(`submitting`),E(``);let t={};_.trim()&&(t.email=_.trim()),h.trim()&&(t.name=h.trim());try{let e=await r({..._.trim()?{visitorEmail:_.trim()}:{},...h.trim()?{visitorName:h.trim()}:{}},t),n=e.booking?.schedulingLink||o?.bookingLink||``;if(!n){b(`error`);return}try{window.open(n,`_blank`,`noopener,noreferrer`)}catch{}O(n),S(e.note||s.bookingLinkOpened),b(`done`)}catch{b(`error`)}},[te,j]=(0,t.useState)(new Set),[ne,N]=(0,t.useState)([]),[P,F]=(0,t.useState)(0),[re,I]=(0,t.useState)(!1);(0,t.useEffect)(()=>{if(!a)return;let e=!0,t=new Date,n=new Date;return n.setDate(n.getDate()+15),a(t.toISOString(),n.toISOString()).then(t=>{e&&(j(new Set(t.taken.map(e=>Date.parse(e)).filter(e=>!Number.isNaN(e)))),N(t.busy.map(e=>[Date.parse(e.start),Date.parse(e.end)]).filter(([e,t])=>!Number.isNaN(e)&&!Number.isNaN(t))))}).catch(()=>{}),()=>{e=!1}},[a,P]);let L=!!e.email?.trim(),ie=!!p&&(L||_.trim()!==``),z=e.email||e.name||``,ae=e=>te.has(K(l[d],e).getTime()),oe=e=>K(l[d],e).getTime()<=Date.now(),se=e=>{let t=K(l[d],e).getTime(),n=t+18e5;return ne.some(([e,r])=>t<r&&n>e)},ce=async()=>{if(!ie||y===`submitting`||!p)return;b(`submitting`),I(!1),E(``);let e=K(l[d],p),t=G(l[d],p),n={};_.trim()&&(n.email=_.trim()),h.trim()&&(n.name=h.trim());try{let i=await r({preferredAt:t,slotAt:e.toISOString(),..._.trim()?{visitorEmail:_.trim()}:{},...h.trim()?{visitorName:h.trim()}:{}},n);i.booking?.confirmed?(S(i.note||T(s.bookingConfirmed,{when:t})),O(i.booking.meetingUrl||i.booking.eventLink||``)):S(i.note||T(s.bookingRequested,{when:t})),b(`done`)}catch(t){if(t?.status===409)j(t=>new Set(t).add(e.getTime())),m(null),I(!0),F(e=>e+1),b(`idle`);else{let e=t?.message;E(e&&e.length<120?e:``),b(`error`)}}};return y===`done`?(0,n.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,n.jsx)(R,{}),(0,n.jsx)(`span`,{children:x}),D&&(0,n.jsxs)(`a`,{class:`cf-booking__link`,href:D,target:`_blank`,rel:`noopener noreferrer`,children:[A?s.bookingOpenScheduler:s.bookingMeetingLink,` `,(0,n.jsx)(M,{})]})]}):A?(0,n.jsxs)(`div`,{class:`cf-form cf-booking`,ref:c,children:[(0,n.jsx)(`div`,{class:`cf-form__title`,children:C[`book-demo`].title}),(0,n.jsx)(`div`,{class:`cf-booking__hint`,children:T(s.bookingViaProvider,{provider:o?.label??`the scheduler`})}),L?z?(0,n.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,z]}):null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:s.handoffName,value:h,"aria-label":s.handoffName,onInput:e=>g(e.target.value)}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${s.handoffEmail} *`,value:_,"aria-label":s.handoffEmail,onInput:e=>v(e.target.value)})]}),y===`error`&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:w||s.formError}),(0,n.jsxs)(`div`,{class:`cf-form__actions`,children:[i&&(0,n.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:i,children:s.cancel}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:y===`submitting`||!L&&_.trim()===``,onClick:ee,children:y===`submitting`?s.sending:s.bookingOpenScheduler})]})]}):(0,n.jsxs)(`div`,{class:`cf-form cf-booking`,ref:c,children:[(0,n.jsx)(`div`,{class:`cf-form__title`,children:C[`book-demo`].title}),(0,n.jsxs)(`div`,{class:`cf-booking__hint`,children:[s.bookingPickTime,` ยท `,(0,n.jsx)(`span`,{class:`cf-booking__dur`,children:s.bookingDuration})]}),(0,n.jsx)(`div`,{class:`cf-booking__dates`,role:`tablist`,"aria-label":`Pick a day`,children:l.map((e,t)=>(0,n.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===d,class:`cf-booking__date ${t===d?`is-selected`:``}`,onClick:()=>{f(t),m(null)},children:[(0,n.jsx)(`span`,{class:`cf-booking__dow`,children:e.toLocaleDateString(void 0,{weekday:`short`})}),(0,n.jsx)(`span`,{class:`cf-booking__dom`,children:e.getDate()})]},t))}),(0,n.jsx)(`div`,{class:`cf-booking__slots`,role:`listbox`,"aria-label":`Pick a time`,children:u.map(e=>{let t=oe(e),r=se(e),i=ae(e),a=i||t||r;return(0,n.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":p===e,disabled:a,title:t?`Earlier today`:r?`Busy on the calendar`:i?`Already booked`:void 0,class:`cf-booking__slot ${p===e?`is-selected`:``} ${a?`is-taken`:``}`,onClick:()=>m(e),children:e},e)})}),re&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:s.bookingSlotTaken}),L?z?(0,n.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,z]}):null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:s.handoffName,value:h,"aria-label":s.handoffName,onInput:e=>g(e.target.value)}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${s.handoffEmail} *`,value:_,"aria-label":s.handoffEmail,onInput:e=>v(e.target.value)})]}),y===`error`&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:w||s.formError}),(0,n.jsxs)(`div`,{class:`cf-form__actions`,children:[i&&(0,n.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:i,children:s.cancel}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!ie||y===`submitting`,onClick:ce,children:y===`submitting`?s.sending:C[`book-demo`].submit})]})]})},J=({actions:e,visitor:r,onSubmitForm:i,onDemoSlots:a,scheduler:o,exclude:s=[]})=>{let[c,l]=(0,t.useState)(null),u=(e??[]).map(e=>U[e]).filter(e=>!!e&&!s.includes(e.type));return u.length===0?null:c===`book-demo`?(0,n.jsx)(q,{visitor:r,onCancel:()=>l(null),onSubmit:(e,t)=>i(`book-demo`,e,t),onDemoSlots:a,scheduler:o}):c?(0,n.jsx)(Se,{spec:C[c],visitor:r,onCancel:()=>l(null),onSubmit:(e,t)=>i(c,e,t)}):(0,n.jsx)(`div`,{class:`cf-actions`,children:u.map(({type:e,label:t,Icon:r})=>(0,n.jsxs)(`button`,{type:`button`,class:`cf-action`,onClick:()=>l(e),children:[(0,n.jsx)(r,{}),t]},e))})},Y=({hasEmail:e,visitor:r,question:i,onSubmitForm:a})=>{let o=k(),[s,c]=(0,t.useState)(!1),[l,u]=(0,t.useState)(!1),[d,f]=(0,t.useState)(r.name??``),[p,m]=(0,t.useState)(r.email??``);if(e)return null;if(s){let e=r.email||p;return(0,n.jsxs)(`div`,{class:`cf-handoff cf-handoff--done`,children:[(0,n.jsx)(R,{}),(0,n.jsx)(`span`,{children:T(o.handoffShared,{email:e})})]})}let h=async()=>{if(!(!p.trim()||l)){u(!0);try{await a(`inquiry`,{visitorEmail:p.trim(),...d.trim()?{visitorName:d.trim()}:{},message:i||`I had a question the assistant couldnโt answer.`,subject:`Help request from chat`},{email:p.trim(),name:d.trim()||void 0}),c(!0)}catch{u(!1)}}};return(0,n.jsxs)(`div`,{class:`cf-handoff`,children:[(0,n.jsx)(`div`,{class:`cf-handoff__title`,children:o.handoffTitle}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:o.handoffName,value:d,"aria-label":o.handoffName,onInput:e=>f(e.target.value)}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${o.handoffEmail} *`,value:p,"aria-label":o.handoffEmail,onInput:e=>m(e.target.value)}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!p.trim()||l,onClick:h,children:l?o.sending:o.handoffNotify})]})},Te=({text:e})=>{let r=k(),[i,a]=(0,t.useState)(!1);return(0,n.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{}},"aria-label":r.copy,children:[i?(0,n.jsx)(R,{}):(0,n.jsx)(z,{}),i?r.copied:r.copy]})},Ee=({items:e,onPick:t})=>e.length===0?null:(0,n.jsx)(`div`,{class:`cf-starters`,children:e.map((e,r)=>(0,n.jsx)(`button`,{type:`button`,class:`cf-starter`,onClick:()=>t(e),children:e},r))}),De=({msg:e,onRate:r})=>{let i=k(),[a,o]=(0,t.useState)(!1),[s,c]=(0,t.useState)(``),l=e.feedback,u=()=>{r(e.id,`up`),o(!1)},d=()=>{r(e.id,`down`),o(!0)},f=()=>{r(e.id,`down`,s.trim()),o(!1)};return(0,n.jsxs)(`div`,{class:`cf-feedback`,children:[(0,n.jsxs)(`div`,{class:`cf-feedback__row`,children:[(0,n.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${l===`up`?`is-active`:``}`,"aria-label":i.feedbackHelpful,"aria-pressed":l===`up`,onClick:u,children:(0,n.jsx)(ue,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${l===`down`?`is-active`:``}`,"aria-label":i.feedbackNotHelpful,"aria-pressed":l===`down`,onClick:d,children:(0,n.jsx)(de,{})}),l&&!a&&(0,n.jsx)(`span`,{class:`cf-feedback__thanks`,children:i.feedbackThanks})]}),a&&l===`down`&&(0,n.jsxs)(`div`,{class:`cf-feedback__comment`,children:[(0,n.jsx)(`textarea`,{class:`cf-feedback__input`,rows:2,placeholder:i.feedbackCommentPlaceholder,value:s,onInput:e=>c(e.target.value)}),(0,n.jsx)(`button`,{type:`button`,class:`cf-feedback__send`,onClick:f,children:i.feedbackSend})]})]})},Oe=({msg:e,persona:t,isLast:r,visitor:i,hasEmail:a,lastQuestion:o,showActions:s,onPickReply:c,onSubmitForm:l,onDemoSlots:u,onRetry:d,ratable:f,onRate:p})=>{let m=k(),h=e.role===`user`,g=e.requestedContactFields?.includes(`email`)===!0,_=r&&!h&&!!(e.handoffOffered||g),v=_&&!a?[`inquiry`]:[],y=!e.pending&&!e.streaming;return(0,n.jsxs)(`div`,{class:`cf-msg cf-msg--${h?`user`:`agent`}`,children:[!h&&(0,n.jsx)(ve,{persona:t,small:!0}),(0,n.jsxs)(`div`,{class:`cf-msg__col`,children:[e.pending&&e.content===``?(0,n.jsx)(ye,{}):e.imageUrl?(0,n.jsxs)(`div`,{class:`cf-msg__bubble cf-msg__bubble--media`,children:[(0,n.jsx)(`img`,{class:`cf-msg__media`,src:e.imageUrl,alt:`GIF`}),e.content&&(0,n.jsx)(`span`,{class:`cf-msg__caption`,children:e.content})]}):(0,n.jsxs)(`div`,{class:`cf-msg__bubble`,children:[h?e.content:he(e.content),e.streaming&&(0,n.jsx)(`span`,{class:`cf-caret`,"aria-hidden":`true`})]}),h&&e.attachmentName&&(0,n.jsxs)(`div`,{class:`cf-attach-chip`,title:e.attachmentName,children:[(0,n.jsx)(se,{}),(0,n.jsx)(`span`,{children:e.attachmentName})]}),!h&&(0,n.jsxs)(n.Fragment,{children:[y&&(e.error||e.content)&&(0,n.jsx)(`div`,{class:`cf-msg__tools`,children:e.error?(0,n.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:()=>d(e.id,e.retryText??``),children:[(0,n.jsx)(ae,{}),m.retry]}):(0,n.jsx)(Te,{text:e.content})}),y&&f&&!e.error&&e.content&&(0,n.jsx)(De,{msg:e,onRate:p}),(0,n.jsx)(V,{msg:e}),r&&(0,n.jsx)(H,{replies:e.suggestedReplies,onPick:c}),_&&(0,n.jsx)(Y,{hasEmail:a,visitor:i,question:o,onSubmitForm:l}),s&&(0,n.jsx)(J,{actions:e.availableActions,visitor:i,onSubmitForm:l,onDemoSlots:u,scheduler:t?.scheduler,exclude:v})]})]})]})},ke=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]??``),r.onerror=n,r.readAsDataURL(e)}),Ae=({onPick:e})=>(0,n.jsx)(`div`,{class:`cf-picker cf-emoji`,children:S.map(t=>(0,n.jsxs)(`div`,{class:`cf-emoji__group`,children:[(0,n.jsx)(`div`,{class:`cf-emoji__label`,children:t.name}),(0,n.jsx)(`div`,{class:`cf-emoji__grid`,children:t.emojis.map((t,r)=>(0,n.jsx)(`button`,{type:`button`,class:`cf-emoji__btn`,onClick:()=>e(t),"aria-label":t,children:t},r))})]},t.name))}),je=({onSearch:e,onPick:r})=>{let i=k(),[a,o]=(0,t.useState)(``),[s,c]=(0,t.useState)([]),[l,u]=(0,t.useState)(!0);return(0,t.useEffect)(()=>{let t=!0;u(!0);let n=setTimeout(()=>{e(a).then(e=>t&&(c(e),u(!1))).catch(()=>t&&(c([]),u(!1)))},300);return()=>{t=!1,clearTimeout(n)}},[a,e]),(0,n.jsxs)(`div`,{class:`cf-picker cf-gif`,children:[(0,n.jsx)(`input`,{class:`cf-gif__search`,placeholder:i.searchGifs,value:a,"aria-label":i.searchGifs,onInput:e=>o(e.target.value)}),(0,n.jsx)(`div`,{class:`cf-gif__grid`,children:l?(0,n.jsx)(`div`,{class:`cf-gif__hint`,children:i.searchingGifs}):s.length===0?(0,n.jsx)(`div`,{class:`cf-gif__hint`,children:i.noGifs}):s.map(e=>(0,n.jsx)(`button`,{type:`button`,class:`cf-gif__item`,onClick:()=>r(e.url),"aria-label":e.alt,children:(0,n.jsx)(`img`,{src:e.preview,alt:e.alt,loading:`lazy`})},e.id))}),(0,n.jsx)(`div`,{class:`cf-gif__powered`,children:`via Tenor`})]})},Me=8*1024*1024,Ne=`image/png,image/jpeg,image/webp,image/gif,application/pdf`,Pe=({onSend:e,onSendGif:r,disabled:i,allowVoice:a,onTranscribe:o,gifEnabled:s,onSearchGifs:c,allowAttach:l,onExtract:u})=>{let d=k(),[f,p]=(0,t.useState)(``),[m,h]=(0,t.useState)(!1),[g,_]=(0,t.useState)(`none`),[v,y]=(0,t.useState)(null),[b,x]=(0,t.useState)(!1),[S,C]=(0,t.useState)(``),w=(0,t.useRef)(null),T=(0,t.useRef)(null),E=(0,t.useRef)(null),D=(0,t.useRef)(null),O=(0,t.useRef)([]);(0,t.useEffect)(()=>{let e=w.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,110)}px`)},[f]),(0,t.useEffect)(()=>{if(g===`none`)return;let e=e=>{T.current&&!e.composedPath().includes(T.current)&&_(`none`)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g]);let A=e=>_(t=>t===e?`none`:e),ee=e=>{let t=w.current;if(!t){p(t=>t+e);return}let n=t.selectionStart??f.length,r=t.selectionEnd??f.length;p(f.slice(0,n)+e+f.slice(r)),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})},te=e=>{_(`none`),r(e)},M=async e=>{let t=e.target,n=t.files?.[0];if(t.value=``,n){if(C(``),n.size>8388608){C(d.attachTooLarge);return}x(!0);try{let e=await u(await ke(n),n.type||`application/octet-stream`,n.name);if(!e){C(d.attachFailed);return}y({name:n.name,text:e})}catch{C(d.attachFailed)}finally{x(!1)}}},N=(!!f.trim()||!!v)&&!i&&!b,P=()=>{N&&(e(f,v?{attachmentName:v.name,attachmentText:v.text}:void 0),p(``),y(null),C(``))},F=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),P()):e.key===`Escape`&&g!==`none`&&(e.preventDefault(),e.stopPropagation(),_(`none`))},L=async()=>{if(m){D.current?.stop();return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);O.current=[],t.ondataavailable=e=>e.data.size>0&&O.current.push(e.data),t.onstop=async()=>{e.getTracks().forEach(e=>e.stop()),h(!1);let n=new Blob(O.current,{type:t.mimeType||`audio/webm`});try{let e=await o(await ke(n),n.type);e&&p(t=>t?`${t} ${e}`:e)}catch{}},D.current=t,t.start(),h(!0)}catch{let e=await o(``,`audio/webm`).catch(()=>``);e&&p(t=>t?`${t} ${e}`:e)}};return(0,n.jsxs)(`div`,{class:`cf-composer`,ref:T,children:[g===`emoji`&&(0,n.jsx)(Ae,{onPick:ee}),g===`gif`&&(0,n.jsx)(je,{onSearch:c,onPick:te}),(v||b||S)&&(0,n.jsx)(`div`,{class:`cf-attach-row`,children:b?(0,n.jsx)(`span`,{class:`cf-attach-status`,children:d.attaching}):S?(0,n.jsx)(`span`,{class:`cf-attach-status cf-attach-status--err`,children:S}):v&&(0,n.jsxs)(`span`,{class:`cf-attach-chip`,title:v.name,children:[(0,n.jsx)(se,{}),(0,n.jsx)(`span`,{children:v.name}),(0,n.jsx)(`button`,{type:`button`,class:`cf-attach-x`,"aria-label":`Remove attachment`,onClick:()=>y(null),children:(0,n.jsx)(I,{})})]})}),(0,n.jsxs)(`div`,{class:`cf-composer__field`,children:[(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn ${g===`emoji`?`is-active`:``}`,"aria-label":d.emoji,"aria-pressed":g===`emoji`,onClick:()=>A(`emoji`),children:g===`emoji`?(0,n.jsx)(I,{}):(0,n.jsx)(re,{})}),s&&(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-gifbtn ${g===`gif`?`is-active`:``}`,"aria-label":d.gifs,"aria-pressed":g===`gif`,onClick:()=>A(`gif`),children:(0,n.jsx)(`span`,{class:`cf-gif-label`,children:`GIF`})}),l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`input`,{ref:E,type:`file`,class:`cf-file-input`,accept:`image/png,image/jpeg,image/webp,image/gif,application/pdf`,onChange:M,tabIndex:-1,"aria-hidden":`true`}),(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn`,"aria-label":d.attachFile,disabled:b,onClick:()=>E.current?.click(),children:(0,n.jsx)(se,{})})]}),(0,n.jsx)(`textarea`,{ref:w,class:`cf-textarea`,rows:1,placeholder:d.composerPlaceholder,value:f,"aria-label":d.composerPlaceholder,disabled:i,onInput:e=>p(e.target.value),onKeyDown:F}),a&&(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-mic ${m?`is-recording`:``}`,"aria-label":m?d.stopRecording:d.recordVoice,"aria-pressed":m,onClick:L,children:(0,n.jsx)(ne,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-send`,"aria-label":d.send,disabled:!N,onClick:P,children:(0,n.jsx)(j,{})})]})]})};let Fe=!0,X=null;const Ie=e=>{Fe=e},Le=()=>{let e=typeof window<`u`?window.AudioContext??window.webkitAudioContext:void 0;if(!e)return null;if(!X)try{X=new e}catch{return null}return X.state===`suspended`&&X.resume(),X},Z=(e,t,n,r,i,a)=>{let o=e.createOscillator(),s=e.createGain();o.type=i,o.frequency.setValueAtTime(t,n),o.connect(s),s.connect(e.destination),s.gain.setValueAtTime(1e-4,n),s.gain.exponentialRampToValueAtTime(a,n+.012),s.gain.exponentialRampToValueAtTime(1e-4,n+r),o.start(n),o.stop(n+r+.03)},Re=e=>{if(!Fe)return;let t=Le();if(!t)return;let n=t.currentTime;try{e===`open`?(Z(t,523,n,.12,`sine`,.05),Z(t,784,n+.08,.16,`sine`,.05)):e===`send`?Z(t,660,n,.08,`triangle`,.04):e===`receive`&&(Z(t,880,n,.1,`sine`,.045),Z(t,1175,n+.09,.14,`sine`,.045))}catch{}},Q=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,ze=e=>{try{return e===`none`?null:e===`session`?sessionStorage:localStorage}catch{return null}},$=e=>`centrinfo:session:${e.slice(0,12)}`,Be=e=>`centrinfo:visitor:${e.slice(0,12)}`,Ve=(e,t)=>`centrinfo:chat:${e.slice(0,12)}:${t}`,He=e=>`centrinfo:history:${e.slice(0,12)}`,Ue=20,We=720*60*60*1e3,Ge=1440*60*1e3,Ke=(e,t)=>{try{return JSON.parse(e?.getItem(Be(t))||`{}`)}catch{return{}}},qe=(e,t)=>{if(!e)return Q();try{let n=$(t),r=e.getItem(n);if(r)return r;let i=Q();return e.setItem(n,i),i}catch{return Q()}},Je=(e,t,n)=>{if(!e)return{};try{let r=e.getItem(Ve(t,n));return r?JSON.parse(r):{}}catch{return{}}},Ye=(e,t,n)=>{let{ts:r,messages:i}=Je(e,t,n);return!Array.isArray(i)||typeof r==`number`&&Date.now()-r>We?[]:i},Xe=(e,t,n)=>{let{ts:r,messages:i,ended:a}=Je(e,t,n);return!Array.isArray(i)||i.length===0||typeof r==`number`&&Date.now()-r>We?!1:a===!0||typeof r==`number`&&Date.now()-r>864e5},Ze=(e,t,n,r,i)=>{if(e)try{let a=r.filter(e=>!e.pending).slice(-50);if(a.length===0)return;e.setItem(Ve(t,n),JSON.stringify({ts:Date.now(),messages:a,ended:i}))}catch{}},Qe=(e,t)=>{if(!e)return[];try{let n=e.getItem(He(t)),r=n?JSON.parse(n):[];return Array.isArray(r)?r:[]}catch{return[]}},$e=(e,t,n)=>{if(e)try{e.setItem(He(t),JSON.stringify(n.slice(0,20)))}catch{}},et=(e,t)=>{if(e)try{let n=`centrinfo:chat:${t.slice(0,12)}:`,r=new Set([$(t),Be(t),He(t)]),i=[];for(let t=0;t<e.length;t++){let a=e.key(t);a&&(r.has(a)||a.startsWith(n))&&i.push(a)}i.forEach(t=>e.removeItem(t))}catch{}},tt=e=>{let t=(e.find(e=>e.role===`user`&&e.content.trim())?.content||e.find(e=>e.content.trim())?.content||``).trim().replace(/\s+/g,` `);return t.length>60?t.slice(0,60)+`โฆ`:t||`Conversation`},nt=(e,n)=>{let r=(0,t.useRef)(ze(n.persistence)).current,i=(0,t.useRef)(qe(r,n.token)),a=(0,t.useRef)(null),[o,s]=(0,t.useState)(null),[c,l]=(0,t.useState)(()=>Ye(r,n.token,i.current)),[u,d]=(0,t.useState)(!1),[f,p]=(0,t.useState)(()=>Xe(r,n.token,i.current)),[m,h]=(0,t.useState)(()=>Ke(r,n.token)),[g,_]=(0,t.useState)(()=>Qe(r,n.token)),[v,y]=(0,t.useState)(null),[b,x]=(0,t.useState)([]),S=(0,t.useRef)(m);(0,t.useEffect)(()=>{S.current=m},[m]);let C=(0,t.useCallback)(()=>{a.current?.abort(),et(r,n.token);let e=Q();i.current=e;try{r?.setItem($(n.token),e)}catch{}y(null),x([]),p(!1),_([]),h({}),l(o?[{id:Q(),role:`assistant`,content:o.greeting,availableActions:o.availableActions}]:[])},[r,n.token,o]),w=(0,t.useCallback)(e=>{try{r?.setItem(Be(n.token),JSON.stringify(e))}catch{}},[r,n.token]),T=(0,t.useCallback)(t=>{let n=(t.email??``).trim().toLowerCase(),r=(S.current.email??``).trim().toLowerCase();n&&r&&n!==r&&C();let a={};t.email?.trim()&&(a.email=t.email.trim()),t.phone?.trim()&&(a.phone=t.phone.trim());let o=[t.firstName,t.lastName].filter(e=>!!e?.trim()).join(` `).trim()||t.name?.trim()||``;o&&(a.name=o),Object.keys(a).length>0&&h(e=>{let t={...a,...e};return w(t),t}),e.identify(i.current,t).catch(()=>{})},[e,w,C]);(0,t.useEffect)(()=>{let t=!0;return e.bootstrap().then(e=>{t&&(s(e),l(t=>t.length>0?t:[{id:Q(),role:`assistant`,content:e.greeting,availableActions:e.availableActions}]))}),n.user&&T(n.user),()=>{t=!1}},[]),(0,t.useEffect)(()=>{Ze(r,n.token,i.current,c,f)},[c,f,r,n.token]),(0,t.useEffect)(()=>{c.some(e=>e.role===`user`)&&_(e=>{let t=i.current,a=[{sessionId:t,ts:Date.now(),title:tt(c),ended:f},...e.filter(e=>e.sessionId!==t)];return $e(r,n.token,a),a.slice(0,20)})},[c,f,r,n.token]);let E=(0,t.useCallback)((e,t)=>{l(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]),D=(0,t.useCallback)((t,r)=>{d(!0);let o=new AbortController;a.current=o,e.stream(t,i.current,{signal:o.signal,onChunk:e=>l(t=>t.map(t=>t.id===r?{...t,content:t.content+e,pending:!1,streaming:!0}:t))}).then(e=>{l(t=>t.map(t=>t.id===r?{...t,content:e.answer||t.content||n.strings.emptyReply,pending:!1,streaming:!1,error:!1,retryText:void 0,sources:e.sources,suggestedReplies:e.suggestedReplies,availableActions:e.availableActions,handoffOffered:e.handoffOffered,requestedContactFields:e.requestedContactFields}:t)),Re(`receive`),n.onMessage?.({role:`assistant`,content:e.answer}),e.handoffOffered&&n.onHandoff?.(),e.conversationEnded&&p(!0)}).catch(e=>{if(o.signal.aborted){E(r,{pending:!1,streaming:!1});return}E(r,{content:e?.status===429?n.strings.errorRateLimit:n.strings.errorGeneric,pending:!1,streaming:!1,error:!0,retryText:t})}).finally(()=>{d(!1),a.current=null})},[e,n,E]),O=(0,t.useCallback)((e,t={})=>{let r=e.trim(),{imageUrl:i,attachmentName:a,attachmentText:o}=t;if(!r&&!i&&!o||u||f)return;let s=r;o?s=`${r}\n\n[Attached file${a?` "${a}"`:``}]:\n${o}`.trim():!s&&i&&(s=i);let c={id:Q(),role:`user`,content:r,imageUrl:i,attachmentName:a},d=Q();l(e=>[...e,c,{id:d,role:`assistant`,content:``,pending:!0}]),Re(`send`),n.onMessage?.({role:`user`,content:s}),D(s,d)},[u,f,n,D]),k=(0,t.useCallback)(()=>a.current?.abort(),[]),A=(0,t.useCallback)((e,t)=>{u||f||!t||(E(e,{content:``,pending:!0,streaming:!1,error:!1}),Re(`send`),D(t,e))},[u,f,E,D]),ee=(0,t.useCallback)((t,n,r)=>{E(t,{feedback:n});let a=c.findIndex(e=>e.id===t),o=a>=0?c[a]?.content:void 0,s;for(let e=a-1;e>=0;e--)if(c[e]?.role===`user`){s=c[e]?.content;break}e.sendFeedback({sessionId:i.current,messageId:t,rating:n,comment:r,question:s,answer:o}).catch(()=>{})},[e,E,c]),te=(0,t.useCallback)(async(t,r,a={})=>{n.onAction?.(t);let o=await e.action(t,{sessionId:i.current,...r}),s={};return a.name?.trim()&&(s.name=a.name.trim()),a.email?.trim()&&(s.email=a.email.trim()),a.phone?.trim()&&(s.phone=a.phone.trim()),Object.keys(s).length>0&&(h(e=>{let t={...e,...s};return w(t),t}),s.email&&t!==`contact`&&e.action(`contact`,{sessionId:i.current,...s}).catch(()=>{})),Re(`receive`),o},[e,n,w]),j=(0,t.useCallback)(e=>{let t=e.trim();t&&l(e=>e.some(e=>e.role===`assistant`&&e.content===t)?e:[...e,{id:Q(),role:`assistant`,content:t}])},[]),ne=(0,t.useCallback)((t,n)=>{e.sendFeedback({sessionId:i.current,messageId:`__csat__`,rating:t,comment:n}).catch(()=>{})},[e]),M=(0,t.useCallback)((t,n)=>e.transcribe(t,n),[e]),N=(0,t.useCallback)((t,n,r)=>e.extract(t,n,r),[e]),P=(0,t.useCallback)(t=>e.searchGifs(t),[e]),F=(0,t.useCallback)((t,n)=>e.demoSlots(t,n),[e]),re=(0,t.useCallback)(e=>O(``,{imageUrl:e}),[O]),I=n.demo||!!n.gifApiKey,L=(0,t.useCallback)(()=>{a.current?.abort(),p(!0),e.endConversation(i.current).catch(()=>{})},[e]),ie=(0,t.useCallback)(()=>{a.current?.abort();let e=Q();i.current=e;try{r?.setItem($(n.token),e)}catch{}y(null),x([]),p(!1),l(o?[{id:Q(),role:`assistant`,content:o.greeting,availableActions:o.availableActions}]:[])},[r,n.token,o]),R=(0,t.useCallback)(e=>{if(e===i.current){y(null);return}x(Ye(r,n.token,e)),y(e)},[r,n.token]),z=(0,t.useCallback)(()=>{y(null),x([])},[]);return{persona:o,messages:c,sending:u,visitor:m,starters:n.starters.length>0?n.starters:o?.starterQuestions??[],hasEmail:!!m.email,send:O,sendGif:re,stop:k,retry:A,rateMessage:ee,injectAssistant:j,submitCsat:ne,submitForm:te,transcribe:M,extract:N,searchGifs:P,demoSlots:F,gifEnabled:I,identify:T,ended:f,endConversation:L,startNew:ie,history:g,viewingSessionId:v,viewMessages:b,openConversation:R,closeHistoryView:z,shutdown:C}},rt=e=>{let[n,r]=(0,t.useState)(`light`);return(0,t.useEffect)(()=>{if(e!==`auto`||typeof matchMedia>`u`)return;let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>r(t.matches?`dark`:`light`);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),e===`auto`?n:e},it=({transport:e,config:r,bindControls:i})=>{let a=r.strings,{persona:o,messages:s,sending:c,visitor:l,hasEmail:u,starters:d,send:f,sendGif:p,stop:m,retry:h,rateMessage:g,injectAssistant:_,submitCsat:v,submitForm:y,transcribe:b,extract:x,searchGifs:S,demoSlots:C,gifEnabled:w,identify:T,ended:E,endConversation:D,startNew:k,history:A,viewingSessionId:j,viewMessages:ne,openConversation:M,closeHistoryView:N,shutdown:P}=nt(e,r),[F,re]=(0,t.useState)(r.openByDefault),[I,R]=(0,t.useState)(0),[z,ae]=(0,t.useState)(()=>{try{return localStorage.getItem(`centrinfo:muted`)===`1`}catch{return!1}}),se=rt(r.theme);(0,t.useEffect)(()=>{Ie(r.sound&&!z)},[r.sound,z]);let pe=(0,t.useCallback)(()=>{ae(e=>{let t=!e;try{localStorage.setItem(`centrinfo:muted`,t?`1`:`0`)}catch{}return t})},[]),B=(0,t.useRef)(null),me=(0,t.useRef)(null),he=(0,t.useRef)(null),ge=(0,t.useRef)(0),[_e,ye]=(0,t.useState)(!0),[be,V]=(0,t.useState)(!1),[H,U]=(0,t.useState)(!1),xe=(0,t.useRef)(null),[Se,W]=(0,t.useState)(!1),[Ce,we]=(0,t.useState)(!1),G=!!j,K=G?ne:s,q=(0,t.useCallback)(()=>{re(!0),R(0),Re(`open`),r.onOpen?.(),r.onShow?.()},[r]),J=(0,t.useCallback)(()=>{re(!1),r.onClose?.(),r.onHide?.(),me.current?.focus()},[r]),Y=(0,t.useCallback)(()=>F?J():q(),[F,q,J]),Te=(0,t.useCallback)(()=>U(!0),[]),De=(0,t.useCallback)(()=>{D(),U(!1)},[D]),ke=(0,t.useCallback)(()=>{k(),V(!1),ye(!0)},[k]);(0,t.useEffect)(()=>{H&&xe.current?.focus()},[H]),(0,t.useEffect)(()=>{i({open:q,close:J,toggle:Y,identify:T,startNew:k,endConversation:D,shutdown:P})},[i,q,J,Y,T,k,D,P]),(0,t.useEffect)(()=>{let e=s.filter(e=>e.role===`assistant`&&!e.pending).length;if(F){ge.current=e;return}e>ge.current&&R(e-ge.current)},[s,F]),(0,t.useEffect)(()=>{r.onUnreadChange?.(I)},[I,r]),(0,t.useEffect)(()=>{let e=r.sessionDurationMinutes;if(!e||e<=0)return;let t=setTimeout(()=>P(),e*60*1e3);return()=>clearTimeout(t)},[r.sessionDurationMinutes,s,F,P]),(0,t.useEffect)(()=>{let e=r.customLauncherSelector;if(!e||typeof document>`u`)return;let t=[];try{t=Array.from(document.querySelectorAll(e))}catch{return}let n=e=>{e.preventDefault(),Y()};return t.forEach(e=>e.addEventListener(`click`,n)),()=>t.forEach(e=>e.removeEventListener(`click`,n))},[r.customLauncherSelector,Y]);let Ae=(0,t.useRef)(!1);(0,t.useEffect)(()=>{let e=r.proactiveMessage?.trim();if(!e||Ae.current)return;let t=r.proactiveOnPaths??[],n=typeof location<`u`?location.pathname:``;if(t.length>0&&!t.some(e=>n.includes(e)))return;let i=`centrinfo:proactive:${r.token.slice(0,12)}`;try{if(sessionStorage.getItem(i)===`1`)return}catch{}let a=setTimeout(()=>{if(!(F||E||s.some(e=>e.role===`user`))){Ae.current=!0;try{sessionStorage.setItem(i,`1`)}catch{}_(e),q()}},Math.max(0,r.proactiveDelaySeconds)*1e3);return()=>clearTimeout(a)},[r.proactiveMessage]),(0,t.useEffect)(()=>{let e=he.current;!F||!e||(s[s.length-1]?.role===`user`||_e?(e.scrollTop=e.scrollHeight,V(!1)):V(!0))},[s,F,c,_e]);let je=(0,t.useCallback)(()=>{let e=he.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<80;ye(t),t&&V(!1)},[]),Me=(0,t.useCallback)(()=>{let e=he.current;e&&(e.scrollTop=e.scrollHeight),V(!1),ye(!0)},[]),[Ne,Fe]=(0,t.useState)(``),X=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(X.current&&!c){let e=[...s].reverse().find(e=>e.role===`assistant`&&!e.streaming&&!e.pending&&e.content);e&&Fe(e.content)}X.current=c},[c,s]),(0,t.useEffect)(()=>{if(!F)return;let e=B.current;H||e?.querySelector(`.cf-textarea`)?.focus();let t=t=>{if(t.key===`Escape`){if(t.preventDefault(),H){U(!1);return}J();return}if(t.key!==`Tab`||!e)return;let n=e.querySelectorAll(`button, [href], textarea, input, [tabindex]:not([tabindex="-1"])`),r=Array.from(n).filter(e=>!e.hasAttribute(`disabled`));if(r.length===0)return;let i=r[0],a=r[r.length-1],o=e.getRootNode()instanceof ShadowRoot?e.getRootNode().activeElement:document.activeElement;t.shiftKey&&o===i?(t.preventDefault(),a.focus()):!t.shiftKey&&o===a&&(t.preventDefault(),i.focus())};return e?.addEventListener(`keydown`,t),()=>e?.removeEventListener(`keydown`,t)},[F,J,H]),(0,t.useEffect)(()=>{let e=B.current;e&&(F?e.removeAttribute(`inert`):e.setAttribute(`inert`,``))},[F]);let Le=r.accentColor??o?.accentColor,Z={zIndex:r.zIndex,"--cf-h-pad":`${r.horizontalPadding}px`,"--cf-v-pad":`${r.verticalPadding}px`,...Le?{"--cf-accent":Le,"--cf-accent-2":`color-mix(in oklab, ${Le} 76%, #14141f)`}:{}},Q=e=>f(e),ze=[...s].reverse().find(e=>e.role===`user`&&e.content.trim())?.content??``,$=s.some(e=>e.role===`user`),Be=!$&&!!(o?.agentDescription||o?.welcomeSubtitle);return(0,n.jsx)(O,{value:a,children:(0,n.jsxs)(`div`,{class:`cf-root`,"data-theme":se,"data-align":r.alignment,style:Z,children:[(0,n.jsxs)(`div`,{ref:B,class:`cf-panel ${F?`is-open`:``}`,role:`dialog`,"aria-modal":`false`,"aria-label":`Chat with ${o?.agentName??`us`}`,"aria-hidden":!F,children:[(0,n.jsxs)(`div`,{class:`cf-header`,children:[(0,n.jsx)(ve,{persona:o}),(0,n.jsxs)(`div`,{class:`cf-header__meta`,children:[(0,n.jsx)(`div`,{class:`cf-header__name`,children:o?.agentName??`Chat`}),(0,n.jsx)(`div`,{class:`cf-header__status ${o?.offline?`cf-header__status--offline`:``}`,children:(0,n.jsx)(`span`,{class:`cf-header__status-text`,children:o?.offline?a.statusOffline:a.statusOnline})})]}),(0,n.jsxs)(`div`,{class:`cf-header__actions`,children:[A.length>0&&(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.pastConversations,title:a.pastConversations,"aria-pressed":Se,onClick:()=>W(e=>!e),children:(0,n.jsx)(le,{})}),$&&!E&&!G&&(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.endChat,title:a.endChat,onClick:Te,children:(0,n.jsx)(ce,{})}),r.sound&&(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":z?a.unmuteSounds:a.muteSounds,"aria-pressed":z,onClick:pe,children:z?(0,n.jsx)(ie,{}):(0,n.jsx)(L,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.closeChat,onClick:J,children:(0,n.jsx)(te,{})})]})]}),r.preview&&(0,n.jsx)(`div`,{class:`cf-preview-banner`,children:a.previewBanner}),G&&(0,n.jsx)(`div`,{class:`cf-viewing-banner`,children:a.viewingPast}),(0,n.jsxs)(`div`,{class:`cf-body`,ref:he,role:`log`,onScroll:je,children:[Be&&!G&&(0,n.jsxs)(`div`,{class:`cf-welcome`,children:[o?.agentDescription&&(0,n.jsx)(`p`,{class:`cf-welcome__desc`,children:o.agentDescription}),o?.welcomeSubtitle&&(0,n.jsx)(`p`,{class:`cf-welcome__sub`,children:o.welcomeSubtitle})]}),K.map((e,t)=>(0,n.jsx)(Oe,{msg:e,persona:o,isLast:!G&&t===K.length-1,visitor:l,hasEmail:u,lastQuestion:ze,showActions:!G&&t===K.length-1&&(!$||!!e.handoffOffered),onPickReply:Q,onSubmitForm:y,onDemoSlots:C,onRetry:h,ratable:!G&&K.slice(0,t).some(e=>e.role===`user`),onRate:g},e.id)),!$&&!G&&(0,n.jsx)(Ee,{items:d,onPick:f}),be&&(0,n.jsxs)(`button`,{type:`button`,class:`cf-newmsg`,onClick:Me,children:[(0,n.jsx)(fe,{}),a.newMessages]})]}),(0,n.jsx)(`div`,{class:`cf-sr-live`,"aria-live":`polite`,"aria-atomic":`true`,children:Ne}),c&&!E&&!G&&(0,n.jsx)(`div`,{class:`cf-stopbar`,children:(0,n.jsxs)(`button`,{type:`button`,class:`cf-stop`,onClick:m,children:[(0,n.jsx)(oe,{}),a.stop]})}),G?(0,n.jsx)(`div`,{class:`cf-ended`,children:(0,n.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:N,children:a.backToChat})}):E?(0,n.jsxs)(`div`,{class:`cf-ended`,children:[(0,n.jsx)(`p`,{class:`cf-ended__text`,children:a.conversationEnded}),r.csat&&$?Ce?(0,n.jsx)(`p`,{class:`cf-ended__text`,children:a.feedbackThanks}):(0,n.jsxs)(`div`,{class:`cf-csat`,children:[(0,n.jsx)(`span`,{class:`cf-csat__q`,children:a.csatPrompt}),(0,n.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":a.feedbackHelpful,onClick:()=>{v(`up`),we(!0)},children:(0,n.jsx)(ue,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":a.feedbackNotHelpful,onClick:()=>{v(`down`),we(!0)},children:(0,n.jsx)(de,{})})]}):null,(0,n.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:ke,children:a.startNewChat})]}):(0,n.jsx)(Pe,{onSend:f,onSendGif:p,disabled:c,allowVoice:!!o?.allowVoiceInput,onTranscribe:b,gifEnabled:w,onSearchGifs:S,allowAttach:r.attachments,onExtract:x}),!E&&o?.disclaimerText&&(0,n.jsx)(`div`,{class:`cf-disclaimer`,children:o.disclaimerText}),(0,n.jsxs)(`div`,{class:`cf-footer`,children:[a.poweredBy,` `,(0,n.jsx)(`a`,{href:`https://accurix.tech/centrinfo`,target:`_blank`,rel:`noopener noreferrer`,children:`Centrinfo`})]}),H&&(0,n.jsx)(`div`,{class:`cf-confirm`,onClick:()=>U(!1),children:(0,n.jsxs)(`div`,{class:`cf-confirm__card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":a.endChatConfirm,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`div`,{class:`cf-confirm__title`,children:a.endChatConfirm}),(0,n.jsx)(`div`,{class:`cf-confirm__body`,children:a.endChatConfirmBody}),(0,n.jsxs)(`div`,{class:`cf-confirm__actions`,children:[(0,n.jsx)(`button`,{ref:xe,type:`button`,class:`cf-confirm__btn cf-confirm__btn--cancel`,onClick:()=>U(!1),children:a.cancel}),(0,n.jsx)(`button`,{type:`button`,class:`cf-confirm__btn cf-confirm__btn--danger`,onClick:De,children:a.endConfirmCta})]})]})}),Se&&(0,n.jsx)(`div`,{class:`cf-confirm`,onClick:()=>W(!1),children:(0,n.jsxs)(`div`,{class:`cf-history`,role:`dialog`,"aria-modal":`true`,"aria-label":a.pastConversations,onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)(`div`,{class:`cf-history__head`,children:[(0,n.jsx)(`span`,{children:a.pastConversations}),(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.closeChat,onClick:()=>W(!1),children:(0,n.jsx)(te,{})})]}),(0,n.jsx)(`div`,{class:`cf-history__list`,children:A.map(e=>(0,n.jsxs)(`button`,{type:`button`,class:`cf-history__item ${e.sessionId===j?`is-active`:``}`,onClick:()=>{M(e.sessionId),W(!1)},children:[(0,n.jsx)(`span`,{class:`cf-history__title`,children:e.title}),(0,n.jsxs)(`span`,{class:`cf-history__meta`,children:[new Date(e.ts).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),e.ended?` ยท ${a.historyEnded}`:``]})]},e.sessionId))})]})})]}),!r.hideDefaultLauncher&&(0,n.jsxs)(`button`,{ref:me,type:`button`,class:`cf-launcher`,"aria-label":F?a.closeChat:a.openChat,"aria-expanded":F,onClick:Y,children:[r.launcherIcon?(0,n.jsx)(`img`,{class:`cf-launcher__img`,src:r.launcherIcon,alt:``}):(0,n.jsx)(ee,{}),!F&&I>0&&(0,n.jsx)(`span`,{class:`cf-launcher__badge`,children:I})]})]})})},at=`https://api.accurixtech.com`,ot=e=>{if(!e||typeof e.token!=`string`||e.token.length===0)throw Error("[centrinfo-widget] `token` is required โ pass your pub_* token to Centrinfo.init({ token }).");return{token:e.token,apiBaseUrl:(e.apiBaseUrl??`https://api.accurixtech.com`).replace(/\/$/,``),accentColor:e.accentColor,launcherIcon:e.launcherIcon,gifApiKey:e.gifApiKey,theme:e.theme??`auto`,openByDefault:e.openByDefault??!1,sound:e.sound??!0,starters:e.starters??[],strings:E(e.labels),persistence:e.persistence??`local`,attachments:e.attachments??!0,zIndex:e.zIndex??2147483e3,demo:e.demo??!1,preview:e.preview??!1,alignment:e.alignment===`left`?`left`:`right`,horizontalPadding:typeof e.horizontalPadding==`number`?e.horizontalPadding:20,verticalPadding:typeof e.verticalPadding==`number`?e.verticalPadding:20,hideDefaultLauncher:e.hideDefaultLauncher??!1,customLauncherSelector:e.customLauncherSelector,sessionDurationMinutes:typeof e.sessionDurationMinutes==`number`?e.sessionDurationMinutes:0,proactiveMessage:e.proactiveMessage,proactiveDelaySeconds:typeof e.proactiveDelaySeconds==`number`?e.proactiveDelaySeconds:5,proactiveOnPaths:e.proactiveOnPaths,csat:e.csat??!0,user:e.user,onOpen:e.onOpen,onClose:e.onClose,onShow:e.onShow,onHide:e.onHide,onUnreadChange:e.onUnreadChange,onMessage:e.onMessage,onAction:e.onAction,onHandoff:e.onHandoff}},st=`
|
|
1
|
+
const e=require(`./config-CzrfVSPp.cjs`);let t=require(`preact`),n=require(`preact/hooks`),r=require(`preact/jsx-runtime`);const i=[`audio/webm;codecs=opus`,`audio/webm`,`audio/ogg;codecs=opus`,`audio/ogg`],a=e=>{let t=globalThis.MediaRecorder;if(typeof t?.isTypeSupported==`function`){for(let n of i)if(t.isTypeSupported(n))try{return new t(e,{mimeType:n})}catch{}}return new t(e)},o=e=>{if(!(!e||e.state!==`recording`)){try{e.requestData()}catch{}e.stop()}},s=[{name:`Smileys`,emojis:`๐.๐.๐.๐.๐
.๐.๐คฃ.๐.๐.๐.๐.๐.๐.๐.๐ฅฐ.๐.๐.๐.๐.๐คช.๐ค.๐คญ.๐ค.๐ค.๐.๐ถ.๐.๐.๐ด.๐ฅณ.๐.๐ค.๐ฅบ.๐ข.๐ญ.๐ค.๐ .๐คฏ.๐ฌ.๐ฑ.๐คฉ.๐ฅฑ`.split(`.`)},{name:`Gestures`,emojis:[`๐`,`๐`,`๐`,`๐ค`,`โ๏ธ`,`๐ค`,`๐ค`,`๐ค`,`๐ค`,`๐`,`๐`,`๐`,`๐`,`โ`,`๐๏ธ`,`๐`,`๐ค`,`๐`,`๐ช`,`๐`,`๐`,`๐`,`๐คฒ`,`๐ซถ`]},{name:`Hearts & symbols`,emojis:`โค๏ธ.๐งก.๐.๐.๐.๐.๐ค.๐ค.๐.โฃ๏ธ.๐.๐.๐.๐.โจ.โญ.๐.๐ซ.๐ฅ.๐.๐.โ
.โ.โก.๐ฏ.๐`.split(`.`)},{name:`Animals & nature`,emojis:[`๐ถ`,`๐ฑ`,`๐ฆ`,`๐ป`,`๐ผ`,`๐จ`,`๐ฆ`,`๐ฎ`,`๐ธ`,`๐ต`,`๐ง`,`๐ฆ`,`๐`,`๐ฆ`,`๐ข`,`๐ฌ`,`๐ท`,`๐ธ`,`๐น`,`๐ป`,`๐ณ`,`๐`]},{name:`Food & drink`,emojis:[`๐`,`๐`,`๐`,`๐`,`๐`,`๐ฅ`,`๐`,`๐`,`๐`,`๐ฎ`,`๐ฟ`,`๐ฉ`,`๐ช`,`๐`,`โ`,`๐ต`,`๐บ`,`๐ฅ`,`๐ท`]},{name:`Objects & travel`,emojis:`๐.โ๏ธ.๐.๐ .๐ฆ.๐ฑ.๐ป.โ.๐ท.๐ก.๐.๐.๐.โ๏ธ.๐.๐.๐ง.๐ฐ.๐.โฐ.๐.๐ฏ.๐.๐ฎ.๐ต.๐ฌ.๐`.split(`.`)}],c={inquiry:{title:`Leave a message`,submit:`Send message`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`message`,label:`Message`,kind:`textarea`,required:!0,placeholder:`How can we help?`}]},contact:{title:`Share your details`,submit:`Save`,fields:[{key:`name`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`email`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`phone`,label:`Phone`,kind:`tel`,required:!0,identity:`phone`}]},"book-demo":{title:`Book a demo`,submit:`Request demo`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`preferredAt`,label:`Preferred time`,kind:`text`,placeholder:`e.g. Thursday 3pm`},{key:`notes`,label:`Notes`,kind:`textarea`,placeholder:`Anything we should know?`}]},"request-callback":{title:`Request a callback`,submit:`Request callback`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorPhone`,label:`Phone`,kind:`tel`,required:!0,identity:`phone`},{key:`bestTime`,label:`Best time to call`,kind:`text`,placeholder:`e.g. tomorrow afternoon`},{key:`topic`,label:`Topic`,kind:`text`,placeholder:`What should we call about?`}]},"subscribe-newsletter":{title:`Subscribe`,submit:`Subscribe`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`}]}},l=(e,t)=>(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,...t,children:e}),u=e=>(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,r.jsx)(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z`})}),d=e=>l((0,r.jsx)(`path`,{d:`m6 9 6 6 6-6`}),e),f=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,r.jsx)(`path`,{d:`M22 2 11 13`})]}),e),p=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,r.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,r.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`})]}),e),m=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M9 9v1a3 3 0 0 0 4.24 2.73`}),(0,r.jsx)(`path`,{d:`M15 5.5V5a3 3 0 0 0-5.94-.6`}),(0,r.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-9.9 6.36`}),(0,r.jsx)(`path`,{d:`M5 10v2a6.98 6.98 0 0 0 1.11 3.79`}),(0,r.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`}),(0,r.jsx)(`line`,{x1:`2`,y1:`2`,x2:`22`,y2:`22`})]}),e),h=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M15 3h6v6`}),(0,r.jsx)(`path`,{d:`M10 14 21 3`}),(0,r.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),e),g=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`}),(0,r.jsx)(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),(0,r.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),(0,r.jsx)(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]}),e),_=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,r.jsx)(`path`,{d:`m22 7-10 5L2 7`})]}),e),v=e=>l((0,r.jsx)(`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z`}),e),ee=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`path`,{d:`M8.5 14.5a4 4 0 0 0 7 0`}),(0,r.jsx)(`line`,{x1:`9`,y1:`9.5`,x2:`9.01`,y2:`9.5`}),(0,r.jsx)(`line`,{x1:`15`,y1:`9.5`,x2:`15.01`,y2:`9.5`})]}),e),y=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,r.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),e),b=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,r.jsx)(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),(0,r.jsx)(`path`,{d:`M19 5a9 9 0 0 1 0 14`})]}),e),x=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,r.jsx)(`line`,{x1:`22`,y1:`9`,x2:`16`,y2:`15`}),(0,r.jsx)(`line`,{x1:`16`,y1:`9`,x2:`22`,y2:`15`})]}),e),S=e=>l((0,r.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),e),C=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,r.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),e),te=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M1 4v6h6`}),(0,r.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),e),ne=e=>l((0,r.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`}),e),w=e=>l((0,r.jsx)(`path`,{d:`M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`}),e),T=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M18.36 6.64a9 9 0 1 1-12.73 0`}),(0,r.jsx)(`line`,{x1:`12`,y1:`2`,x2:`12`,y2:`12`})]}),e),re=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`path`,{d:`M12 7v5l3 2`})]}),e),ie=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M7 10v12`}),(0,r.jsx)(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})]}),e),E=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M17 14V2`}),(0,r.jsx)(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})]}),e),D=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M15 3h6v6`}),(0,r.jsx)(`path`,{d:`M9 21H3v-6`}),(0,r.jsx)(`path`,{d:`M21 3l-7 7`}),(0,r.jsx)(`path`,{d:`M3 21l7-7`})]}),e),O=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M9 3v6H3`}),(0,r.jsx)(`path`,{d:`M15 21v-6h6`}),(0,r.jsx)(`path`,{d:`M9 9 2 2`}),(0,r.jsx)(`path`,{d:`M15 15l7 7`})]}),e),k=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`14`,rx:`2`}),(0,r.jsx)(`rect`,{x:`11`,y:`11`,width:`8`,height:`6`,rx:`1`,fill:`currentColor`,stroke:`none`})]}),e),ae=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`14`,rx:`2`}),(0,r.jsx)(`path`,{d:`M12 15V9`}),(0,r.jsx)(`path`,{d:`m8.5 12.5 3.5-3.5 3.5 3.5`})]}),e),oe=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,r.jsx)(`path`,{d:`m19 12-7 7-7-7`})]}),e),se=e=>{if(!e)return`Live data`;let t=new Date(e);return Number.isNaN(t.getTime())?`Live data`:`Updated ${new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t)}`},A=e=>e?.name?.trim()?e.version?`${e.name.trim()} ยท v${e.version}`:e.name.trim():``,ce=({model:e,answeredAt:t,reportingPeriod:n,filters:i=[],rowCount:a})=>{let o=A(e);return(0,r.jsxs)(`div`,{class:`cf-analytics-meta`,"data-testid":`analytics-result-meta`,"aria-label":`Result details`,children:[o?(0,r.jsx)(`span`,{class:`cf-analytics-meta__model`,children:o}):null,(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,class:`cf-analytics-meta__dot`}),se(t)]}),n?.label?(0,r.jsx)(`span`,{children:n.label}):null,typeof a==`number`?(0,r.jsxs)(`span`,{children:[a,` `,a===1?`row`:`rows`]}):null,i.length>0?(0,r.jsxs)(`span`,{children:[i.length,` applied `,i.length===1?`filter`:`filters`]}):null]})},j=({label:e,value:t,detail:n})=>(0,r.jsxs)(`section`,{class:`cf-analytics-kpi`,"aria-label":e,"data-testid":`analytics-kpi`,children:[(0,r.jsx)(`div`,{class:`cf-analytics-kpi__label`,children:e}),(0,r.jsx)(`div`,{class:`cf-analytics-kpi__value`,children:t}),n?(0,r.jsx)(`div`,{class:`cf-analytics-kpi__detail`,children:n}):null]}),le=({title:e=`No matching data`,description:t=`No approved records matched this question.`})=>(0,r.jsxs)(`section`,{class:`cf-analytics-empty`,role:`status`,"data-testid":`analytics-empty-state`,children:[(0,r.jsx)(`p`,{children:e}),(0,r.jsx)(`p`,{children:t})]}),ue=({explanation:e,onFollowUp:t,showLead:n=!1,maxFollowUps:i=3})=>(0,r.jsxs)(`section`,{class:`cf-analytics-explanation`,"data-testid":`inline-analytics-explanation`,"aria-label":`Analysis and supporting evidence`,children:[n?(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__lead`,"data-testid":`analytics-explanation-lead`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__lead-meta`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__eyebrow`,children:`Answer from your data`}),(0,r.jsxs)(`span`,{class:`cf-analytics-explanation__provenance`,children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,class:`cf-analytics-explanation__provenance-dot`}),e.source===`ai_grounded`?`AI-assisted ยท evidence checked`:`Based on current values`]})]}),(0,r.jsx)(`h3`,{class:`cf-analytics-explanation__headline`,children:e.headline}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__summary`,children:e.summary})]}):null,(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__body`,children:[(e.evidence?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`What the numbers show`}),(0,r.jsx)(`ul`,{class:`cf-analytics-explanation__evidence`,children:e.evidence?.slice(0,4).map(e=>(0,r.jsxs)(`li`,{class:`cf-analytics-explanation__evidence-item`,children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,class:`cf-analytics-explanation__evidence-bullet`}),(0,r.jsx)(`span`,{children:e})]},e))})]}):null,e.businessMeaning?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__meaning`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Why this may matter`}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__paragraph`,children:e.businessMeaning})]}):null,(e.possibleDrivers?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__section-heading`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Possibilities worth checking`}),(0,r.jsx)(`span`,{class:`cf-analytics-explanation__hint`,children:`These are not proven causes`})]}),(0,r.jsx)(`div`,{class:`cf-analytics-explanation__drivers`,children:e.possibleDrivers?.slice(0,2).map(e=>(0,r.jsxs)(`article`,{class:`cf-analytics-explanation__driver`,children:[(0,r.jsx)(`p`,{class:`cf-analytics-explanation__driver-title`,children:e.hypothesis}),(0,r.jsxs)(`p`,{class:`cf-analytics-explanation__driver-body`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__driver-label`,children:`How to check:`}),` `,e.howToCheck]})]},`${e.hypothesis}-${e.howToCheck}`))})]}):null,(e.recommendations?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Useful next steps`}),(0,r.jsx)(`div`,{class:`cf-analytics-explanation__recommendations`,children:e.recommendations?.slice(0,3).map((e,t)=>(0,r.jsxs)(`article`,{class:`cf-analytics-explanation__recommendation`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__recommendation-index`,children:t+1}),(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`p`,{class:`cf-analytics-explanation__recommendation-title`,children:e.action}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:e.why}),e.successMetric?(0,r.jsxs)(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__driver-label`,children:`Watch:`}),` `,e.successMetric]}):null]})]},`${e.action}-${e.why}`))})]}):null,e.forecast?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__outlook`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__outlook-header`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Outlook`}),(0,r.jsx)(`span`,{class:`cf-analytics-explanation__outlook-badge`,children:`Validated estimate`})]}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__paragraph`,children:e.forecast.text}),e.forecast.limitations?(0,r.jsx)(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:e.forecast.limitations}):null]}):null,t&&(e.followUps?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section cf-analytics-explanation__follow-up`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Ask a follow-up`}),(0,r.jsx)(`div`,{class:`cf-analytics-explanation__questions`,children:e.followUps?.slice(0,i).map(e=>(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-explanation__question`,onClick:()=>t(e),children:e},e))})]}):null,(e.limitations?.length??0)>0?(0,r.jsxs)(`details`,{class:`cf-analytics-explanation__limits`,children:[(0,r.jsx)(`summary`,{class:`cf-analytics-explanation__limits-summary`,children:`Important limits`}),(0,r.jsx)(`ul`,{class:`cf-analytics-explanation__limits-list`,children:e.limitations?.map(e=>(0,r.jsx)(`li`,{children:e},e))})]}):null]}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__source`,children:e.source===`ai_grounded`?`AI-assisted wording, checked against the live values shown here.`:`Based only on the live values shown here.`})]}),de=()=>{let e=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=requestAnimationFrame(()=>e.current?.scrollIntoView({block:`end`}));return()=>cancelAnimationFrame(t)},[]),e},M=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)||`๐ค`,N=e=>{let t=e?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?` cf-avatar-preset--${t}`:``},fe={"support-guide":`SG`,"sales-host":`SH`,"calm-advisor":`CA`,"technical-guide":`TG`,"school-desk":`SD`,"front-office":`FO`},P=e=>{let t=e?.avatarId?.trim().toLowerCase();return t&&fe[t]||(e?M(e.agentName):`ยท`)},F=({persona:e,small:t,hideWhenMissing:n})=>{let i=t?`cf-msg__avatar`:`cf-header__avatar`,a=e?.agentAvatarUrl?.trim();return a?(0,r.jsx)(`span`,{class:i,children:(0,r.jsx)(`img`,{src:a,alt:``})}):n?null:(0,r.jsx)(`span`,{class:`${i}${N(e)}`,children:P(e)})},pe=()=>{let t=e.c();return(0,r.jsxs)(`div`,{class:`cf-msg__bubble cf-typing`,"aria-label":t.assistantTyping,children:[(0,r.jsx)(`span`,{class:`cf-typing__label`,children:`Thinking`}),(0,r.jsx)(`span`,{class:`cf-typing__dot`}),(0,r.jsx)(`span`,{class:`cf-typing__dot`}),(0,r.jsx)(`span`,{class:`cf-typing__dot`})]})},me=3,I=({msg:e})=>{if(!e.sources||e.sources.length===0)return null;let t=new Set,n=[];for(let r of e.sources){let e=(r.url||r.title||``).toLowerCase();!e||t.has(e)||(t.add(e),n.push(r))}if(n.length===0)return null;let i=n.slice(0,3),a=n.length-i.length;return(0,r.jsxs)(`div`,{class:`cf-sources`,children:[i.map((e,t)=>e.url?(0,r.jsxs)(`a`,{class:`cf-source`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.title||e.url,children:[(0,r.jsx)(h,{}),(0,r.jsx)(`span`,{children:e.title||e.url})]},t):(0,r.jsxs)(`span`,{class:`cf-source`,title:e.title,children:[(0,r.jsx)(h,{}),(0,r.jsx)(`span`,{children:e.title})]},t)),a>0&&(0,r.jsxs)(`span`,{class:`cf-source cf-source--more`,children:[`+`,a,` more`]})]})},he=({replies:e,onPick:t})=>e&&e.length>0?(0,r.jsx)(`div`,{class:`cf-chips`,children:e.map((e,n)=>(0,r.jsx)(`button`,{type:`button`,class:`cf-chip`,onClick:()=>t(e),children:e},n))}):null,ge=({persona:e,starters:t,onPick:n,onFocusComposer:i,speaking:a,voiceState:o=`idle`,replyPending:s=!1,pinned:c=!1,muted:l=!1,onToggleMute:u,onEndCall:d,onTalkNow:f,showTalkNow:m=!1,micLevel:h=0,theaterMode:g=!1,onToggleTheater:_,onMinimize:v,audioDevices:ee=[],selectedAudioDeviceId:y=``,onSelectAudioDevice:b,connectingOnly:x=!1})=>{if(!e||!(e.talkbackMode===`avatar`||e.widgetModule===`assistant`||e.allowVoiceInput))return null;let S=e.agentAvatarUrl?.trim()||``,C=e.assistantMediaUrl?.trim()||S,te=e.assistantMediaKind===`video`&&!!C,ne=t.slice(0,3),w=o!==`idle`,T=o===`idle`?`Speak with ${e.agentName}`:`End voice chat`,re=c&&!w&&!a,ie=o===`connecting`||o===`processing`||w&&s,E=[`cf-assistant-card__stage`,`cf-assistant-card__stage--local`,w?`is-live`:``,ie?`is-thinking`:``,o===`listening`&&!l?`is-listening`:``,a||o===`speaking`?`is-speaking`:``,l?`is-muted`:``].filter(Boolean).join(` `),D=o===`listening`&&!l?{"--cf-listen":String(Math.max(.18,Math.min(1,h*8)))}:void 0,O=ie&&(0,r.jsxs)(`span`,{class:`cf-call-ripple`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{})]});if(x)return(0,r.jsxs)(`div`,{class:`cf-assistant-card cf-assistant-card--connecting`,"aria-live":`polite`,children:[(0,r.jsxs)(`div`,{class:`cf-assistant-card__connecting-avatar`,children:[S?(0,r.jsx)(`img`,{src:S,alt:``}):(0,r.jsx)(`span`,{class:`cf-assistant-card__connecting-face${N(e)}`,children:P(e)}),O]}),(0,r.jsxs)(`div`,{class:`cf-assistant-card__connecting-copy`,children:[(0,r.jsx)(`span`,{class:`cf-assistant-card__connecting-eyebrow`,children:e.agentName}),(0,r.jsx)(`strong`,{children:`Connecting with the AIโฆ`})]})]});let k=w&&d&&(0,r.jsx)(Re,{voiceState:o,muted:l,onToggleMute:u??(()=>{}),onEndCall:d,onTalkNow:f??(()=>{}),showTalkNow:m,micLevel:h,theaterMode:g,onToggleTheater:_??(()=>{}),onMinimize:v??(()=>{}),audioDevices:ee,selectedAudioDeviceId:y,onSelectAudioDevice:b??(()=>{})});return re?(0,r.jsx)(`div`,{class:`cf-assistant-card cf-assistant-card--pinned cf-assistant-card--compact`,children:(0,r.jsxs)(`button`,{type:`button`,class:`cf-assistant-card__compact-speak`,onClick:i,children:[S?(0,r.jsx)(`span`,{class:`cf-assistant-card__compact-avatar`,children:(0,r.jsx)(`img`,{src:S,alt:``})}):null,(0,r.jsx)(`span`,{class:`cf-assistant-card__compact-mic`,"aria-hidden":`true`,children:(0,r.jsx)(p,{})}),(0,r.jsx)(`span`,{class:`cf-assistant-card__compact-label`,children:T})]})}):(0,r.jsxs)(`div`,{class:`cf-assistant-card ${c?`cf-assistant-card--pinned`:``} ${a?`is-speaking`:``}`,children:[(C||e.allowVoiceInput)&&(0,r.jsxs)(`div`,{class:E,style:D,children:[(0,r.jsxs)(`div`,{class:`cf-assistant-card__media ${C?`cf-assistant-card__media--uploaded`:`cf-assistant-card__media--generated`}${N(e)}`,children:[te?(0,r.jsx)(`video`,{src:C,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):C?(0,r.jsx)(`img`,{src:C,alt:``}):(0,r.jsx)(`div`,{class:`cf-assistant-card__avatar-stage${N(e)}`,children:(0,r.jsxs)(`div`,{class:`cf-assistant-card__face`,children:[(0,r.jsx)(`span`,{class:`cf-assistant-card__initials`,children:P(e)}),(0,r.jsx)(`span`,{class:`cf-assistant-card__eye cf-assistant-card__eye--left`}),(0,r.jsx)(`span`,{class:`cf-assistant-card__eye cf-assistant-card__eye--right`}),(0,r.jsx)(`span`,{class:`cf-assistant-card__mouth`})]})}),C&&!te&&(0,r.jsx)(`span`,{class:`cf-assistant-card__mouth cf-assistant-card__mouth--overlay`}),(0,r.jsx)(`span`,{class:`cf-avatar-aura cf-avatar-aura--one`,"aria-hidden":`true`}),(0,r.jsx)(`span`,{class:`cf-avatar-aura cf-avatar-aura--two`,"aria-hidden":`true`}),(0,r.jsx)(`span`,{class:`cf-avatar-listen-ring`,"aria-hidden":`true`}),(0,r.jsxs)(`span`,{class:`cf-avatar-wave`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{})]})]}),O,e.allowVoiceInput&&(k||(0,r.jsxs)(`button`,{type:`button`,class:`cf-assistant-card__speak`,onClick:i,children:[(0,r.jsx)(p,{}),T]}))]}),!c&&(0,r.jsxs)(r.Fragment,{children:[e.agentDescription?(0,r.jsx)(`p`,{class:`cf-assistant-card__copy`,children:e.agentDescription}):(0,r.jsx)(`p`,{class:`cf-assistant-card__copy`,children:e.greeting}),ne.length>0&&(0,r.jsx)(`div`,{class:`cf-assistant-card__chips`,children:ne.map(e=>(0,r.jsx)(`button`,{type:`button`,class:`cf-assistant-card__chip`,onClick:()=>n(e),children:e},e))}),e.disclaimerText||e.assistantPrivacyUrl?(0,r.jsxs)(`p`,{class:`cf-assistant-card__privacy`,children:[e.disclaimerText||`This chat may be recorded for quality and support.`,e.assistantPrivacyUrl?(0,r.jsxs)(r.Fragment,{children:[` `,(0,r.jsx)(`a`,{href:e.assistantPrivacyUrl,target:`_blank`,rel:`noopener noreferrer nofollow`,children:`Privacy Policy`})]}):null]}):null]})]})},_e={public_book_demo:{type:`book-demo`,label:`Book a demo`,description:`Pick a time or request a demo from the team.`,Icon:g},public_submit_inquiry:{type:`inquiry`,label:`Leave a message`,description:`Send your question and contact details.`,Icon:_},public_request_callback:{type:`request-callback`,label:`Request a callback`,description:`Share your phone number and best time to call.`,Icon:v},public_subscribe_newsletter:{type:`subscribe-newsletter`,label:`Subscribe`,description:`Get product updates and useful announcements.`,Icon:_}},ve=({field:e,value:t,onInput:n})=>{let i=e.placeholder??e.label,a={class:`cf-form__input`,placeholder:e.required?`${i} *`:i,value:t,"aria-label":e.label,onInput:e=>n(e.target.value)};return e.kind===`textarea`?(0,r.jsx)(`textarea`,{rows:2,...a}):(0,r.jsx)(`input`,{type:e.kind,...a})},ye=({spec:t,visitor:i,onSubmit:a,onCancel:o})=>{let s=e.c(),c=de(),[l,u]=(0,n.useState)(()=>{let e={};for(let n of t.fields)n.identity&&i[n.identity]&&(e[n.key]=i[n.identity]);return e}),[d,f]=(0,n.useState)(`idle`),[p,m]=(0,n.useState)(``),h=e=>!!(e.identity&&i[e.identity]?.trim()),g=t.fields.filter(e=>!h(e)),_=g.every(e=>!e.required||(l[e.key]?.trim()??``)!==``),v=i.email||i.name||``;return d===`done`?(0,r.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,r.jsx)(S,{}),(0,r.jsx)(`span`,{children:p})]}):(0,r.jsxs)(`div`,{class:`cf-form`,ref:c,children:[(0,r.jsx)(`div`,{class:`cf-form__title`,children:t.title}),g.length===0&&v&&(0,r.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,v]}),g.map(e=>(0,r.jsx)(ve,{field:e,value:l[e.key]??``,onInput:t=>u(n=>({...n,[e.key]:t}))},e.key)),d===`error`&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:s.formError}),(0,r.jsxs)(`div`,{class:`cf-form__actions`,children:[o&&(0,r.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:o,children:`Cancel`}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!_||d===`submitting`,onClick:async()=>{if(!_||d===`submitting`)return;f(`submitting`);let e={},n={};for(let r of t.fields){let t=l[r.key]?.trim();t&&(e[r.key]=t,r.identity&&(n[r.identity]=t))}try{m((await a(e,n)).note||s.formThanks),f(`done`)}catch{f(`error`)}},children:d===`submitting`?s.sending:t.submit})]})]})},be=e=>String(e).padStart(2,`0`),xe=()=>{let e=[];for(let t=9;t<=17;t++)e.push(`${be(t)}:00`),e.push(`${be(t)}:30`);return e},Se=e=>{let t=new Date;return t.setHours(0,0,0,0),Array.from({length:e},(e,n)=>{let r=new Date(t);return r.setDate(t.getDate()+n),r})},Ce=(e,t)=>{let[n,r]=t.split(`:`).map(Number),i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0);try{return new Intl.DateTimeFormat(void 0,{weekday:`short`,day:`numeric`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}).format(i)}catch{return`${e.toDateString()} ${t}`}},L=(e,t)=>{let[n,r]=t.split(`:`).map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0)},R=({visitor:t,onSubmit:i,onCancel:a,onDemoSlots:o,scheduler:s})=>{let l=e.c(),u=de(),d=(0,n.useMemo)(()=>Se(14),[]),f=(0,n.useMemo)(()=>xe(),[]),[p,m]=(0,n.useState)((0,n.useMemo)(()=>{let e=Date.now();for(let t=0;t<d.length;t++)if(f.some(n=>L(d[t],n).getTime()>e))return t;return 0},[d,f])),[g,_]=(0,n.useState)(null),[v,ee]=(0,n.useState)(t.name??``),[y,b]=(0,n.useState)(t.email??``),[x,C]=(0,n.useState)(`idle`),[te,ne]=(0,n.useState)(``),[w,T]=(0,n.useState)(``),[re,ie]=(0,n.useState)(``),E=s?.connected&&s.mode===`link`,D=async()=>{if(x===`submitting`||!t.name?.trim()&&!v.trim()||!t.email?.trim()&&!y.trim())return;C(`submitting`),T(``);let e={};y.trim()&&(e.email=y.trim()),v.trim()&&(e.name=v.trim());try{let t=await i({...y.trim()?{visitorEmail:y.trim()}:{},...v.trim()?{visitorName:v.trim()}:{}},e),n=t.booking?.schedulingLink||s?.bookingLink||``;if(!n){C(`error`);return}try{window.open(n,`_blank`,`noopener,noreferrer`)}catch{}ie(n),ne(t.note||l.bookingLinkOpened),C(`done`)}catch{C(`error`)}},[O,k]=(0,n.useState)(new Set),[ae,oe]=(0,n.useState)([]),[se,A]=(0,n.useState)(0),[ce,j]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!o)return;let e=!0,t=new Date,n=new Date;return n.setDate(n.getDate()+15),o(t.toISOString(),n.toISOString()).then(t=>{e&&(k(new Set(t.taken.map(e=>Date.parse(e)).filter(e=>!Number.isNaN(e)))),oe(t.busy.map(e=>[Date.parse(e.start),Date.parse(e.end)]).filter(([e,t])=>!Number.isNaN(e)&&!Number.isNaN(t))))}).catch(()=>{}),()=>{e=!1}},[o,se]);let le=!!t.email?.trim(),ue=!!t.name?.trim(),M=!!g&&(ue||v.trim()!==``)&&(le||y.trim()!==``),N=t.email||t.name||``,fe=e=>O.has(L(d[p],e).getTime()),P=e=>L(d[p],e).getTime()<=Date.now(),F=e=>{let t=L(d[p],e).getTime(),n=t+18e5;return ae.some(([e,r])=>t<r&&n>e)},pe=async()=>{if(!M||x===`submitting`||!g)return;C(`submitting`),j(!1),T(``);let t=L(d[p],g),n=Ce(d[p],g),r={};y.trim()&&(r.email=y.trim()),v.trim()&&(r.name=v.trim());try{let a=await i({preferredAt:n,slotAt:t.toISOString(),...y.trim()?{visitorEmail:y.trim()}:{},...v.trim()?{visitorName:v.trim()}:{}},r);a.booking?.confirmed?(ne(a.note||e.s(l.bookingConfirmed,{when:n})),ie(a.booking.meetingUrl||a.booking.eventLink||``)):ne(a.note||e.s(l.bookingRequested,{when:n})),C(`done`)}catch(e){if(e?.status===409)k(e=>new Set(e).add(t.getTime())),_(null),j(!0),A(e=>e+1),C(`idle`);else{let t=e?.message;T(t&&t.length<120?t:``),C(`error`)}}};return x===`done`?(0,r.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,r.jsx)(S,{}),(0,r.jsx)(`span`,{children:te}),re&&(0,r.jsxs)(`a`,{class:`cf-booking__link`,href:re,target:`_blank`,rel:`noopener noreferrer`,children:[E?l.bookingOpenScheduler:l.bookingMeetingLink,` `,(0,r.jsx)(h,{})]})]}):E?(0,r.jsxs)(`div`,{class:`cf-form cf-booking`,ref:u,children:[(0,r.jsx)(`div`,{class:`cf-form__title`,children:c[`book-demo`].title}),(0,r.jsx)(`div`,{class:`cf-booking__hint`,children:e.s(l.bookingViaProvider,{provider:s?.label??`the scheduler`})}),le?N?(0,r.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,N]}):null:(0,r.jsxs)(r.Fragment,{children:[!t.name?.trim()&&(0,r.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:`${l.handoffName} *`,value:v,"aria-label":l.handoffName,onInput:e=>ee(e.target.value)}),(0,r.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${l.handoffEmail} *`,value:y,"aria-label":l.handoffEmail,onInput:e=>b(e.target.value)})]}),x===`error`&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:w||l.formError}),(0,r.jsxs)(`div`,{class:`cf-form__actions`,children:[a&&(0,r.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:a,children:l.cancel}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:x===`submitting`||!t.name?.trim()&&v.trim()===``||!le&&y.trim()===``,onClick:D,children:x===`submitting`?l.sending:l.bookingOpenScheduler})]})]}):(0,r.jsxs)(`div`,{class:`cf-form cf-booking`,ref:u,children:[(0,r.jsx)(`div`,{class:`cf-form__title`,children:c[`book-demo`].title}),(0,r.jsxs)(`div`,{class:`cf-booking__hint`,children:[l.bookingPickTime,` ยท `,(0,r.jsx)(`span`,{class:`cf-booking__dur`,children:l.bookingDuration})]}),(0,r.jsx)(`div`,{class:`cf-booking__dates`,role:`tablist`,"aria-label":`Pick a day`,children:d.map((e,t)=>(0,r.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===p,class:`cf-booking__date ${t===p?`is-selected`:``}`,onClick:()=>{m(t),_(null)},children:[(0,r.jsx)(`span`,{class:`cf-booking__dow`,children:e.toLocaleDateString(void 0,{weekday:`short`})}),(0,r.jsx)(`span`,{class:`cf-booking__dom`,children:e.getDate()})]},t))}),(0,r.jsx)(`div`,{class:`cf-booking__slots`,role:`listbox`,"aria-label":`Pick a time`,children:f.map(e=>{let t=P(e),n=F(e),i=fe(e),a=i||t||n;return(0,r.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":g===e,disabled:a,title:t?`Earlier today`:n?`Busy on the calendar`:i?`Already booked`:void 0,class:`cf-booking__slot ${g===e?`is-selected`:``} ${a?`is-taken`:``}`,onClick:()=>_(e),children:e},e)})}),ce&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:l.bookingSlotTaken}),N?(0,r.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,N]}):null,!ue&&(0,r.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:`${l.handoffName} *`,value:v,"aria-label":l.handoffName,onInput:e=>ee(e.target.value)}),!le&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${l.handoffEmail} *`,value:y,"aria-label":l.handoffEmail,onInput:e=>b(e.target.value)})}),x===`error`&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:w||l.formError}),(0,r.jsxs)(`div`,{class:`cf-form__actions`,children:[a&&(0,r.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:a,children:l.cancel}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!M||x===`submitting`,onClick:pe,children:x===`submitting`?l.sending:c[`book-demo`].submit})]})]})},we=({actions:e,visitor:t,onSubmitForm:i,onDemoSlots:a,scheduler:o,exclude:s=[]})=>{let[l,u]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),m=(e??[]).map(e=>_e[e]).filter(e=>!!e&&!s.includes(e.type));if(m.length===0)return null;let h=()=>{u(null),p(!1)},g=()=>u(null);if(l===`book-demo`)return(0,r.jsxs)(`div`,{class:`cf-action-drawer is-open`,role:`dialog`,"aria-label":`Book a demo`,children:[(0,r.jsx)(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-action-drawer__head`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`span`,{class:`cf-action-drawer__eyebrow`,children:`Contact options`}),(0,r.jsx)(`strong`,{children:`Book a demo`})]}),(0,r.jsx)(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:g,children:(0,r.jsx)(y,{})})]}),(0,r.jsx)(R,{visitor:t,onCancel:g,onSubmit:(e,t)=>i(`book-demo`,e,t),onDemoSlots:a,scheduler:o})]});if(l){let e=m.find(e=>e.type===l);return(0,r.jsxs)(`div`,{class:`cf-action-drawer is-open`,role:`dialog`,"aria-label":e?.label??`Contact`,children:[(0,r.jsx)(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-action-drawer__head`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`span`,{class:`cf-action-drawer__eyebrow`,children:`Contact options`}),(0,r.jsx)(`strong`,{children:e?.label??c[l].title})]}),(0,r.jsx)(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:g,children:(0,r.jsx)(y,{})})]}),(0,r.jsx)(ye,{spec:c[l],visitor:t,onCancel:g,onSubmit:(e,t)=>i(l,e,t)})]})}return f?(0,r.jsxs)(`div`,{class:`cf-action-drawer cf-action-drawer--menu`,children:[(0,r.jsx)(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-action-drawer__head`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`span`,{class:`cf-action-drawer__eyebrow`,children:`Need help?`}),(0,r.jsx)(`strong`,{children:`Choose what you want to do`})]}),(0,r.jsx)(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:h,children:(0,r.jsx)(y,{})})]}),(0,r.jsx)(`div`,{class:`cf-action-drawer__grid`,children:m.map(({type:e,label:t,description:n,Icon:i})=>(0,r.jsxs)(`button`,{type:`button`,class:`cf-action-card`,onClick:()=>u(e),children:[(0,r.jsx)(`span`,{class:`cf-action-card__icon`,children:(0,r.jsx)(i,{})}),(0,r.jsxs)(`span`,{class:`cf-action-card__copy`,children:[(0,r.jsx)(`strong`,{children:t}),(0,r.jsx)(`small`,{children:n})]}),(0,r.jsx)(d,{})]},e))}),(0,r.jsx)(`p`,{class:`cf-action-drawer__note`,children:`Weโll ask for your full name and the best email or phone so the team can reach you.`})]}):(0,r.jsxs)(`button`,{type:`button`,class:`cf-action-trigger`,onClick:()=>p(!0),children:[(0,r.jsx)(`span`,{class:`cf-action-trigger__icon`,children:(0,r.jsx)(_,{})}),(0,r.jsxs)(`span`,{class:`cf-action-trigger__copy`,children:[(0,r.jsx)(`strong`,{children:`Contact options`}),(0,r.jsx)(`small`,{children:`Demo, message, callback`})]}),(0,r.jsx)(d,{})]})},Te=({hasEmail:t,visitor:i,question:a,onSubmitForm:o})=>{let s=e.c(),[c,l]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),[f,p]=(0,n.useState)(i.name??``),[m,h]=(0,n.useState)(i.email??``);if(t)return(0,r.jsxs)(`div`,{class:`cf-handoff cf-handoff--done`,children:[(0,r.jsx)(S,{}),(0,r.jsx)(`span`,{children:`Weโve alerted the team. If someone is available, they can continue here.`})]});if(c){let t=i.email||m;return(0,r.jsxs)(`div`,{class:`cf-handoff cf-handoff--done`,children:[(0,r.jsx)(S,{}),(0,r.jsx)(`span`,{children:e.s(s.handoffShared,{email:t})})]})}let g=async()=>{if(!(!m.trim()||u)){d(!0);try{await o(`inquiry`,{visitorEmail:m.trim(),...f.trim()?{visitorName:f.trim()}:{},message:a||`I had a question the assistant couldnโt answer.`,subject:`Help request from chat`},{email:m.trim(),name:f.trim()||void 0}),l(!0)}catch{d(!1)}}};return(0,r.jsxs)(`div`,{class:`cf-handoff`,children:[(0,r.jsx)(`div`,{class:`cf-handoff__title`,children:s.handoffTitle}),(0,r.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:s.handoffName,value:f,"aria-label":s.handoffName,onInput:e=>p(e.target.value)}),(0,r.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${s.handoffEmail} *`,value:m,"aria-label":s.handoffEmail,onInput:e=>h(e.target.value)}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!m.trim()||u,onClick:g,children:u?s.sending:s.handoffNotify})]})},Ee=({text:t})=>{let i=e.c(),[a,o]=(0,n.useState)(!1);return(0,r.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:async()=>{try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)}catch{}},"aria-label":i.copy,children:[a?(0,r.jsx)(S,{}):(0,r.jsx)(C,{}),a?i.copied:i.copy]})},De=({items:e,onPick:t})=>e.length===0?null:(0,r.jsx)(`div`,{class:`cf-starters`,children:e.map((e,n)=>(0,r.jsx)(`button`,{type:`button`,class:`cf-starter`,onClick:()=>t(e),children:e},n))}),Oe=({items:e})=>{let t=e.filter(e=>e.label.trim()&&e.url.trim()).slice(0,4);return t.length===0?null:(0,r.jsx)(`div`,{class:`cf-featured-links`,children:t.map((e,t)=>(0,r.jsxs)(`a`,{class:`cf-featured-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.label,children:[(0,r.jsx)(h,{}),(0,r.jsx)(`span`,{children:e.label})]},`${e.url}-${t}`))})},z=({msg:t,onRate:i})=>{let a=e.c(),[o,s]=(0,n.useState)(!1),[c,l]=(0,n.useState)(``),u=t.feedback,d=()=>{i(t.id,`up`),s(!1)},f=()=>{i(t.id,`down`),s(!0)},p=()=>{i(t.id,`down`,c.trim()),s(!1)};return(0,r.jsxs)(`div`,{class:`cf-feedback`,children:[(0,r.jsxs)(`div`,{class:`cf-feedback__row`,children:[(0,r.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${u===`up`?`is-active`:``}`,"aria-label":a.feedbackHelpful,"aria-pressed":u===`up`,onClick:d,children:(0,r.jsx)(ie,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${u===`down`?`is-active`:``}`,"aria-label":a.feedbackNotHelpful,"aria-pressed":u===`down`,onClick:f,children:(0,r.jsx)(E,{})}),u&&!o&&(0,r.jsx)(`span`,{class:`cf-feedback__thanks`,children:a.feedbackThanks})]}),o&&u===`down`&&(0,r.jsxs)(`div`,{class:`cf-feedback__comment`,children:[(0,r.jsx)(`textarea`,{class:`cf-feedback__input`,rows:2,placeholder:a.feedbackCommentPlaceholder,value:c,onInput:e=>l(e.target.value)}),(0,r.jsx)(`button`,{type:`button`,class:`cf-feedback__send`,onClick:p,children:a.feedbackSend})]})]})},ke=({msg:t,persona:n,isLast:i,visitor:a,hasEmail:o,lastQuestion:s,showActions:c,onPickReply:l,onSubmitForm:u,onDemoSlots:d,onRetry:f,ratable:p,onRate:m,onExpandVisualization:h})=>{let g=e.c(),_=t.role===`user`,v=t.role===`system`,ee=t.requestedContactFields?.includes(`email`)===!0,y=i&&!_&&!v&&!!(t.handoffOffered||ee),b=y&&!o?[`inquiry`]:[],x=!t.pending&&!t.streaming;return v?(0,r.jsx)(`div`,{class:`cf-msg cf-msg--system`,children:(0,r.jsxs)(`div`,{class:`cf-system-event`,children:[(0,r.jsx)(`div`,{class:`cf-system-event__mark`,children:(0,r.jsx)(F,{persona:n,small:!0})}),(0,r.jsx)(`div`,{class:`cf-system-event__text`,children:t.content}),t.createdAt&&(0,r.jsx)(`div`,{class:`cf-system-event__time`,children:new Date(t.createdAt).toLocaleString(void 0,{day:`2-digit`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`})})]})}):(0,r.jsxs)(`div`,{class:`cf-msg cf-msg--${_?`user`:`agent`}`,children:[!_&&(0,r.jsx)(F,{persona:n,small:!0}),(0,r.jsxs)(`div`,{class:`cf-msg__col`,children:[t.pending&&t.content===``?(0,r.jsx)(pe,{}):t.imageUrl?(0,r.jsxs)(`div`,{class:`cf-msg__bubble cf-msg__bubble--media`,children:[(0,r.jsx)(`img`,{class:`cf-msg__media`,src:t.imageUrl,alt:`GIF`}),t.content&&(0,r.jsx)(`span`,{class:`cf-msg__caption`,children:t.content})]}):(0,r.jsxs)(`div`,{class:`cf-msg__bubble`,children:[_?t.content:e.a(t.content),t.streaming&&(0,r.jsx)(`span`,{class:`cf-caret`,"aria-hidden":`true`})]}),!_&&t.visualization?(0,r.jsx)(Ae,{visualization:t.visualization,onExpand:h?()=>h(t.id):void 0,expandControlId:t.id}):null,!_&&t.visualization?.explanation?(0,r.jsx)(ue,{explanation:t.visualization.explanation,onFollowUp:l,showLead:!t.content.toLocaleLowerCase().includes(t.visualization.explanation.headline.toLocaleLowerCase())}):null,_&&t.attachmentName&&(0,r.jsxs)(`div`,{class:`cf-attach-chip`,title:t.attachmentName,children:[(0,r.jsx)(w,{}),(0,r.jsx)(`span`,{children:t.attachmentName})]}),!_&&(0,r.jsxs)(r.Fragment,{children:[x&&(t.error||t.content)&&(0,r.jsx)(`div`,{class:`cf-msg__tools`,children:t.error?(0,r.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:()=>f(t.id,t.retryText??``),children:[(0,r.jsx)(te,{}),g.retry]}):(0,r.jsx)(Ee,{text:t.content})}),x&&p&&!t.error&&t.content&&(0,r.jsx)(z,{msg:t,onRate:m}),(0,r.jsx)(I,{msg:t}),i&&(0,r.jsx)(he,{replies:t.suggestedReplies,onPick:l}),y&&(0,r.jsx)(Te,{hasEmail:o,visitor:a,question:s,onSubmitForm:u}),c&&(0,r.jsx)(we,{actions:t.availableActions,visitor:a,onSubmitForm:u,onDemoSlots:d,scheduler:n?.scheduler,exclude:b})]})]})]})},Ae=({visualization:t,expanded:i=!1,onExpand:a,onClose:o,expandControlId:s})=>{let c=(0,n.useMemo)(()=>e.p(t),[t]),l=t.rows??[],u=t.columns??[];if(l.length===0)return(0,r.jsx)(le,{});let d=(0,r.jsx)(ce,{model:t.model,answeredAt:t.freshness?.answeredAt,reportingPeriod:t.reportingPeriod,filters:t.appliedFilters,rowCount:t.rowCount??l.length});if(t.presentation===`table`||!t.presentation&&t.type===`table`)return!t.tableAvailable||u.length===0?null:(0,r.jsxs)(`div`,{class:`cf-analytics-visualization${i?` is-expanded`:``}`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__header`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`div`,{class:`cf-analytics-visualization__title`,children:t.title?.trim()||`Result details`}),d]}),(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__actions`,children:[t.downloadAvailable?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__download`,onClick:()=>B(u,l),children:`Download`}):null,i&&o?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:o,children:(0,r.jsx)(y,{})}):a&&t.expandable!==!1?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__expand`,"aria-label":`Expand table`,"data-visualization-message":s,onClick:a,children:(0,r.jsx)(D,{})}):null]})]}),(0,r.jsx)(e.l,{rows:l,columns:u,maxRows:5,expanded:i,classNames:{wrap:`cf-analytics-table-wrap`,table:`cf-analytics-table`,note:`cf-analytics-table-note`}})]});let f=t.chartRecommendation?.valueFields?.[0]??t.valueFields?.[0]??t.value??u[1];if(t.presentation===`kpi`||!t.presentation&&t.type===`kpi`){let n=l[0]?.[f??u[0]??``],a=typeof n==`number`?n:Number(n),s=t.columnMetadata?.find(e=>e.key===f),c=Number.isFinite(a)?e.m(a,s,t):String(n??`No value`);return(0,r.jsxs)(`div`,{class:`cf-analytics-visualization${i?` is-expanded`:``}`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__header`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`div`,{class:`cf-analytics-visualization__title`,children:`Live metric`}),d]}),i&&o?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:o,children:(0,r.jsx)(y,{})}):null]}),(0,r.jsx)(j,{label:s?.label??f??`Current value`,value:c,detail:t.explanation?.summary})]})}return c?(0,r.jsxs)(`div`,{class:`cf-analytics-visualization${i?` is-expanded`:``}`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__header`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`div`,{class:`cf-analytics-visualization__title`,children:c.title}),d]}),i&&o?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:o,children:(0,r.jsx)(y,{})}):a&&t.expandable!==!1?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__expand`,"aria-label":`Expand chart`,"data-visualization-message":s,onClick:a,children:(0,r.jsx)(D,{})}):null]}),(0,r.jsx)(e.f,{model:c,expanded:i}),(0,r.jsx)(`p`,{class:`cf-analytics-chart__summary`,children:c.summary}),t.downloadAvailable?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__download`,onClick:()=>B(u,l),children:`Download this data`}):null]}):null},B=(t,n)=>{if(typeof document>`u`||t.length===0)return;let r=e.d(n,t),i=URL.createObjectURL(new Blob([r],{type:`text/csv;charset=utf-8`})),a=document.createElement(`a`);a.href=i,a.download=`analytics-result.csv`,a.click(),URL.revokeObjectURL(i)},V=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]??``),r.onerror=n,r.readAsDataURL(e)}),je=({onPick:e})=>(0,r.jsx)(`div`,{class:`cf-picker cf-emoji`,children:s.map(t=>(0,r.jsxs)(`div`,{class:`cf-emoji__group`,children:[(0,r.jsx)(`div`,{class:`cf-emoji__label`,children:t.name}),(0,r.jsx)(`div`,{class:`cf-emoji__grid`,children:t.emojis.map((t,n)=>(0,r.jsx)(`button`,{type:`button`,class:`cf-emoji__btn`,onClick:()=>e(t),"aria-label":t,children:t},n))})]},t.name))}),H=({onSearch:t,onPick:i})=>{let a=e.c(),[o,s]=(0,n.useState)(``),[c,l]=(0,n.useState)([]),[u,d]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=!0;d(!0);let n=setTimeout(()=>{t(o).then(t=>e&&(l(t),d(!1))).catch(()=>e&&(l([]),d(!1)))},300);return()=>{e=!1,clearTimeout(n)}},[o,t]),(0,r.jsxs)(`div`,{class:`cf-picker cf-gif`,children:[(0,r.jsx)(`input`,{class:`cf-gif__search`,placeholder:a.searchGifs,value:o,"aria-label":a.searchGifs,onInput:e=>s(e.target.value)}),(0,r.jsx)(`div`,{class:`cf-gif__grid`,children:u?(0,r.jsx)(`div`,{class:`cf-gif__hint`,children:a.searchingGifs}):c.length===0?(0,r.jsx)(`div`,{class:`cf-gif__hint`,children:a.noGifs}):c.map(e=>(0,r.jsx)(`button`,{type:`button`,class:`cf-gif__item`,onClick:()=>i(e.url),"aria-label":e.alt,children:(0,r.jsx)(`img`,{src:e.preview,alt:e.alt,loading:`lazy`})},e.id))}),(0,r.jsx)(`div`,{class:`cf-gif__powered`,children:`via Tenor`})]})},Me=8*1024*1024,Ne=`image/png,image/jpeg,image/webp,image/gif,application/pdf`,Pe=12e3,Fe=250,U=e=>{switch(e){case`connecting`:return`Connecting with AIโฆ`;case`listening`:return`Listening now โ go ahead.`;case`speaking`:return`AI is speaking โ talk to interrupt.`;case`processing`:return`Understanding what you saidโฆ`;case`noise`:return`I couldn't hear clear words. Try again closer to the mic.`;case`misunderstood`:return`I didn't understand that. Please try again.`;case`denied`:return`Microphone access is blocked. Allow the mic or type your question.`;case`muted`:return`Muted โ tap the mic to unmute.`;case`timeout`:return`Didn't hear anything for a while โ ending the call.`;default:return``}},Ie=.004,W=({muted:e,listening:t,micLevel:n,onToggleMute:i})=>(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn ${e?`is-muted`:``} ${t?`is-listening`:``} ${t&&n>=.004?`is-hot`:``}`,"aria-label":e?`Unmute microphone`:`Mute microphone`,"aria-pressed":e,onClick:i,style:t?{"--cf-wave":String(Math.max(.2,Math.min(1,n*6)))}:void 0,children:e?(0,r.jsx)(m,{}):(0,r.jsx)(p,{})}),Le=({audioDevices:e,selectedAudioDeviceId:t,onSelectAudioDevice:i})=>{let[a,o]=(0,n.useState)(!1),s=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!e.composedPath().includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]);let c=[{deviceId:``,label:`Default microphone`},...e];return(0,r.jsxs)(`div`,{class:`cf-call-more`,ref:s,children:[(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--microphones`,"aria-label":`Choose microphone`,"aria-expanded":a,onClick:()=>o(e=>!e),children:(0,r.jsx)(d,{})}),a&&(0,r.jsxs)(`div`,{class:`cf-call-menu`,role:`menu`,children:[(0,r.jsx)(`div`,{class:`cf-call-menu__label`,children:`Microphone`}),c.map(e=>(0,r.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.deviceId===t,class:`cf-call-menu__item ${e.deviceId===t?`is-active`:``}`,onClick:()=>{i(e.deviceId),o(!1)},children:[e.deviceId===t?(0,r.jsx)(S,{}):(0,r.jsx)(`span`,{class:`cf-call-menu__spacer`}),(0,r.jsx)(`span`,{children:e.label})]},e.deviceId))]})]})},Re=({voiceState:e,muted:t,onToggleMute:n,onEndCall:i,onTalkNow:a,showTalkNow:o,micLevel:s,theaterMode:c,onToggleTheater:l,onMinimize:u,audioDevices:d,selectedAudioDeviceId:f,onSelectAudioDevice:m})=>(0,r.jsxs)(`div`,{class:`cf-call-controls`,children:[(0,r.jsx)(W,{muted:t,listening:e===`listening`&&!t,micLevel:s,onToggleMute:n}),(0,r.jsx)(Le,{audioDevices:d,selectedAudioDeviceId:f,onSelectAudioDevice:m}),o&&(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--talk`,"aria-label":`Talk now`,onClick:a,children:(0,r.jsx)(p,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn`,"aria-label":c?`Exit expanded view`:`Expand view`,"aria-pressed":c,onClick:l,children:c?(0,r.jsx)(O,{}):(0,r.jsx)(D,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn`,"aria-label":`Minimize voice chat`,onClick:u,children:(0,r.jsx)(k,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--end`,"aria-label":`End voice chat`,onClick:i,children:(0,r.jsx)(T,{})})]}),ze=({persona:e,voiceState:t,muted:n,onToggleMute:i,onEndCall:a,micLevel:o,onExpand:s})=>{let c=e=>e.stopPropagation(),l=e?.assistantMediaUrl?.trim()||e?.agentAvatarUrl?.trim()||``,u=e?.assistantMediaKind===`video`&&!!l,d=e?.agentName||`Assistant`;return(0,r.jsxs)(`div`,{class:[`cf-floating-call-card`,t===`listening`&&!n?`is-listening`:``,t===`speaking`?`is-speaking`:``,t===`processing`||t===`connecting`?`is-thinking`:``,n?`is-muted`:``].filter(Boolean).join(` `),style:t===`listening`&&!n?{"--cf-listen":String(Math.max(.18,Math.min(1,o*8)))}:void 0,role:`button`,tabIndex:0,"aria-label":`Reopen voice chat with ${d}`,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},children:[(0,r.jsx)(`div`,{class:`cf-floating-call-card__media`,"aria-hidden":`true`,children:l?u?(0,r.jsx)(`video`,{src:l,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):(0,r.jsx)(`img`,{src:l,alt:``}):(0,r.jsxs)(`div`,{class:`cf-floating-call-card__avatar${N(e)}`,children:[(0,r.jsx)(`span`,{children:P(e)}),(0,r.jsx)(`span`,{class:`cf-floating-call-card__eye cf-floating-call-card__eye--left`}),(0,r.jsx)(`span`,{class:`cf-floating-call-card__eye cf-floating-call-card__eye--right`}),(0,r.jsx)(`span`,{class:`cf-floating-call-card__mouth`})]})}),(0,r.jsx)(`div`,{class:`cf-floating-call-card__shade`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-floating-call-card__controls`,onClick:c,onKeyDown:c,role:`presentation`,children:[(0,r.jsx)(W,{muted:n,listening:t===`listening`&&!n,micLevel:o,onToggleMute:i}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--restore`,"aria-label":`Restore voice chat`,onClick:e=>{c(e),s()},children:(0,r.jsx)(ae,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--end`,"aria-label":`End voice chat`,onClick:e=>{c(e),a()},children:(0,r.jsx)(T,{})})]})]})},Be=({onSend:t,onSendGif:i,onTyping:s,disabled:c,allowVoice:l,onTranscribe:u,gifEnabled:d,onSearchGifs:m,allowAttach:h,onExtract:g,voiceStartSignal:_=0,onVoiceStateChange:v})=>{let b=e.c(),[x,S]=(0,n.useState)(``),[C,te]=(0,n.useState)(!1),[ne,T]=(0,n.useState)(!1),[re,ie]=(0,n.useState)(`idle`),[E,D]=(0,n.useState)(`none`),[O,k]=(0,n.useState)(null),[ae,oe]=(0,n.useState)(!1),[se,A]=(0,n.useState)(``),ce=(0,n.useRef)(null),j=(0,n.useRef)(null),le=(0,n.useRef)(null),ue=(0,n.useRef)(null),de=(0,n.useRef)([]),M=(0,n.useRef)(void 0),N=(0,n.useRef)(null),fe=(0,n.useRef)(void 0),P=(0,n.useRef)(0),F=e=>{ie(e),v?.(e)},pe=()=>{M.current&&window.clearTimeout(M.current),M.current=void 0,fe.current&&cancelAnimationFrame(fe.current),fe.current=void 0,N.current?.close().catch(()=>void 0),N.current=null};(0,n.useEffect)(()=>{let e=ce.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,110)}px`)},[x]),(0,n.useEffect)(()=>{if(E===`none`)return;let e=e=>{j.current&&!e.composedPath().includes(j.current)&&D(`none`)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[E]);let me=e=>D(t=>t===e?`none`:e),I=e=>{let t=ce.current;if(!t){S(t=>t+e);return}let n=t.selectionStart??x.length,r=t.selectionEnd??x.length;S(x.slice(0,n)+e+x.slice(r)),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})},he=e=>{D(`none`),i(e)},ge=async e=>{let t=e.target,n=t.files?.[0];if(t.value=``,n){if(A(``),n.size>8388608){A(b.attachTooLarge);return}oe(!0);try{let e=await g(await V(n),n.type||`application/octet-stream`,n.name);if(!e){A(b.attachFailed);return}k({name:n.name,text:e})}catch{A(b.attachFailed)}finally{oe(!1)}}},_e=(!!x.trim()||!!O)&&!c&&!ae&&!ne,ve=()=>{_e&&(t(x,O?{attachmentName:O.name,attachmentText:O.text}:void 0),s?.(!1),S(``),k(null),A(``))},ye=e=>{let n=e.trim();if(!n||c){F(`misunderstood`),window.setTimeout(()=>F(`idle`),2500);return}let r=x.trim();t(r?`${r} ${n}`:n),s?.(!1),S(``),k(null),A(``),F(`idle`)},be=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),ve()):e.key===`Escape`&&E!==`none`&&(e.preventDefault(),e.stopPropagation(),D(`none`))},xe=async()=>{if(C){o(ue.current);return}try{F(`connecting`);let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=a(e);de.current=[],P.current=0;try{let t=window.AudioContext??window.webkitAudioContext;if(t){let n=new t;N.current=n;let r=n.createMediaStreamSource(e),i=n.createAnalyser();i.fftSize=512,r.connect(i);let a=new Uint8Array(i.frequencyBinCount),o=()=>{i.getByteTimeDomainData(a);let e=0;for(let t of a){let n=(t-128)/128;e+=n*n}P.current=Math.max(P.current,Math.sqrt(e/a.length)),fe.current=requestAnimationFrame(o)};o()}}catch{}t.ondataavailable=e=>e.data.size>0&&de.current.push(e.data),t.onstop=async()=>{pe(),e.getTracks().forEach(e=>e.stop()),te(!1);let n=new Blob(de.current,{type:t.mimeType||`audio/webm`});if(n.size===0||n.size<900||P.current<.006){F(`noise`),window.setTimeout(()=>F(`idle`),3200);return}T(!0),F(`processing`);try{let e=await V(n);if(!e.trim()){F(`noise`),window.setTimeout(()=>F(`idle`),3200);return}let t=typeof navigator<`u`&&(navigator.languages?.[0]||navigator.language)||void 0;ye(await u(e,n.type,t))}catch{F(`misunderstood`),window.setTimeout(()=>F(`idle`),3e3)}finally{T(!1)}},ue.current=t,t.start(250),te(!0),F(`listening`),M.current=window.setTimeout(()=>{o(ue.current)},12e3)}catch{F(`denied`),window.setTimeout(()=>F(`idle`),3500)}};return(0,n.useEffect)(()=>{!_||!l||c||C||ne||xe()},[_]),(0,n.useEffect)(()=>()=>pe(),[]),(0,r.jsxs)(`div`,{class:`cf-composer`,ref:j,children:[E===`emoji`&&(0,r.jsx)(je,{onPick:I}),E===`gif`&&(0,r.jsx)(H,{onSearch:m,onPick:he}),(O||ae||se)&&(0,r.jsx)(`div`,{class:`cf-attach-row`,children:ae?(0,r.jsx)(`span`,{class:`cf-attach-status`,children:b.attaching}):se?(0,r.jsx)(`span`,{class:`cf-attach-status cf-attach-status--err`,children:se}):O&&(0,r.jsxs)(`span`,{class:`cf-attach-chip`,title:O.name,children:[(0,r.jsx)(w,{}),(0,r.jsx)(`span`,{children:O.name}),(0,r.jsx)(`button`,{type:`button`,class:`cf-attach-x`,"aria-label":`Remove attachment`,onClick:()=>k(null),children:(0,r.jsx)(y,{})})]})}),re!==`idle`&&(0,r.jsxs)(`div`,{class:`cf-voice-state`,"aria-live":`polite`,children:[(0,r.jsx)(`span`,{class:`cf-voice-state__dot ${C?`is-live`:``}`}),U(re)]}),(0,r.jsxs)(`div`,{class:`cf-composer__field`,children:[(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn ${E===`emoji`?`is-active`:``}`,"aria-label":b.emoji,"aria-pressed":E===`emoji`,onClick:()=>me(`emoji`),children:E===`emoji`?(0,r.jsx)(y,{}):(0,r.jsx)(ee,{})}),d&&(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-gifbtn ${E===`gif`?`is-active`:``}`,"aria-label":b.gifs,"aria-pressed":E===`gif`,onClick:()=>me(`gif`),children:(0,r.jsx)(`span`,{class:`cf-gif-label`,children:`GIF`})}),h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`input`,{ref:le,type:`file`,class:`cf-file-input`,accept:`image/png,image/jpeg,image/webp,image/gif,application/pdf`,onChange:ge,tabIndex:-1,"aria-hidden":`true`}),(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn`,"aria-label":b.attachFile,disabled:ae,onClick:()=>le.current?.click(),children:(0,r.jsx)(w,{})})]}),(0,r.jsx)(`textarea`,{ref:ce,class:`cf-textarea`,rows:1,placeholder:b.composerPlaceholder,value:x,"aria-label":b.composerPlaceholder,disabled:c,onInput:e=>{let t=e.target.value;S(t),s?.(!!t.trim())},onKeyDown:be}),l&&(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-mic ${C?`is-recording`:``}`,"aria-label":C?b.stopRecording:b.recordVoice,"aria-pressed":C,disabled:ne||c,onClick:xe,children:(0,r.jsx)(p,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-send`,"aria-label":b.send,disabled:!_e,onClick:ve,children:(0,r.jsx)(f,{})})]})]})},Ve=({name:e,greeting:t})=>(0,r.jsxs)(`section`,{class:`cf-empty-welcome`,"aria-label":`${e} welcome`,children:[(0,r.jsx)(`span`,{class:`cf-empty-welcome__eyebrow`,children:`Ready when you are`}),(0,r.jsx)(`h2`,{children:e}),t?(0,r.jsx)(`p`,{children:t}):(0,r.jsx)(`p`,{children:`Ask a question, leave a message, or book a demo.`})]}),He=e=>{let[t,r]=(0,n.useState)(`light`);return(0,n.useEffect)(()=>{if(e!==`auto`||typeof matchMedia>`u`)return;let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>r(t.matches?`dark`:`light`);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),e===`auto`?t:e},Ue=1e4,We=1400,Ge=.0038,Ke=.0022,qe=1600,Je=550,Ye=350,Xe=.001,Ze=6e4,Qe=90,$e=.009,et=280,tt=250,nt=250,rt=e=>e.replace(/\[[^\]]{0,60}\]/g,` `).replace(/\(([^)]{0,60})\)/g,(e,t)=>it.has(t.trim().toLowerCase().replace(/[.!?,โฆ]+$/,``).replace(/\s+/g,` `))?` `:e).replace(/\*[^*]{0,60}\*/g,` `).replace(/\s+/g,` `).trim(),it=new Set(`background noise.engine noise.noise.inaudible.unintelligible.silence.no speech.static.music.laughter.applause.wind.breathing.click.clicks.clicking.mouse click.mouse clicks.beep.beeps.beeping.tap.taps.tapping.typing.keyboard typing.cough.coughing.sigh.hmm.mm.mmm.uh.um.ah.oh`.split(`.`)),at=e=>{let t=e.trim().toLowerCase().replace(/[()[\]*]/g,` `).replace(/[.!?,โฆ]+$/,``).replace(/\s+/g,` `).trim();return!t||/^(?:sh+\s*)+$/.test(t)?!0:it.has(t)},ot=e=>{let t=e.trim().toLowerCase().replace(/\s+/g,` `);return t?t.includes(`transcribe this audio recording verbatim`)||t.includes(`preserve the spoken language and any code-switching`)||t.includes(`output only the transcribed text, no commentary`):!1},st={end:`end the call`,mute:`mute your microphone`,minimize:`minimize the chat`,expand:`expand the view`,shrink:`exit the expanded view`},ct=e=>e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s']/gu,` `).replace(/\s+/g,` `).trim(),lt=[{action:`shrink`,re:/\b(?:exit|leave|quit|close)\b[\s\w]*\b(?:full ?screen|expanded|theat(?:er|re))\b|\bshrink\b|\bsmaller view\b/},{action:`end`,re:/\b(?:end|close|stop|finish|hang ?up|quit|exit)\b[\s\w]*\b(?:call|chat|conversation|convo|session|talking)\b|\bhang ?up\b|\bgood ?bye\b|^bye(?: bye)?$/},{action:`mute`,re:/\bmute\b|\bstop listening\b/},{action:`minimize`,re:/\bminimi[sz]e\b|\bhide\b[\s\w]*\b(?:chat|call|window|widget)\b/},{action:`expand`,re:/\bexpand\b|\bmaximi[sz]e\b|\bfull ?screen\b|\btheat(?:er|re) mode\b|\bbigger view\b/}],ut=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,dt=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,ft=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,pt=e=>{let t=ct(e);if(!t)return null;for(let{action:e,re:n}of lt)if(n.test(t)){let n=t.split(` `).length;return{action:e,confident:e===`end`?n<=10:n<=6}}return null},mt=e=>`I didn't catch yes or no. Say yes to ${st[e]}, or no to keep talking.`,ht=e=>`I caught some audio, but not enough clear words. Try again a little closer to the mic, or type your question for ${e?.agentName?.trim()||`the assistant`}.`,gt=e=>{let t=ct(e).replace(/\b(?:um|uh|erm|hmm)\b/g,``).trim();return!t||t.split(/\s+/).length<=2&&/^(?:can|could|would|will|do|does|is|are|what|why|how|where|when)\b/.test(t)?!0:/\b(?:can you|could you|would you|will you|do you|can i|could i|would i|i want to|i need to|tell me about|what about|how about|about|with|to|for|please)$/i.test(t)},_t=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``).split(`,`)[1]??``),r.onerror=()=>n(r.error),r.readAsDataURL(e)}),vt=(e,t)=>{let n=window.AudioContext??window.webkitAudioContext;if(!n)return null;let r,i=!1,a=new n;try{let n=a.createMediaStreamSource(e),o=a.createAnalyser();o.fftSize=512,n.connect(o);let s=new Uint8Array(o.frequencyBinCount),c=()=>{if(i)return;o.getByteTimeDomainData(s);let e=0;for(let t of s){let n=(t-128)/128;e+=n*n}t(Math.sqrt(e/s.length),performance.now()),i||(r=requestAnimationFrame(c))};c()}catch{return a.close().catch(()=>void 0),null}return{stop:()=>{i||(i=!0,r!==void 0&&cancelAnimationFrame(r),r=void 0,a.close().catch(()=>void 0))}}},yt=e=>({...e?{deviceId:{exact:e}}:{},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),bt=({transport:t,config:i,bindControls:s})=>{let c=i.strings,[l,f]=(0,n.useState)(i.openByDefault),{persona:p,messages:m,sending:h,assistantSpeaking:g,visitor:_,hasEmail:v,liveMode:ee,assignedAgentName:y,agentTypingName:S,starters:C,featuredLinks:te,send:w,sendGif:D,notifyTyping:O,stop:k,retry:ae,rateMessage:se,injectAssistant:A,appendUserDraft:ce,patchMessage:j,removeMessage:le,submitCsat:ue,submitForm:de,transcribe:M,extract:N,searchGifs:fe,demoSlots:P,gifEnabled:pe,identify:me,ended:I,endConversation:he,startNew:_e,history:ve,viewingSessionId:ye,viewMessages:be,openConversation:xe,closeHistoryView:Se,shutdown:Ce,stopSpeaking:L,speakAssistantText:R}=e.n(t,i,l),[Te,Ee]=(0,n.useState)(0),[z,B]=(0,n.useState)(`idle`),[V,je]=(0,n.useState)(!1),[H,Me]=(0,n.useState)(!1),[Ne,Pe]=(0,n.useState)(0),[Fe,U]=(0,n.useState)(!1),[Ie,W]=(0,n.useState)(null),[Le,Re]=(0,n.useState)([]),[We,Ge]=(0,n.useState)(``),[Je,Ye]=(0,n.useState)(()=>{try{return localStorage.getItem(`centrinfo:muted`)===`1`}catch{return!1}}),Xe=He(i.theme),Qe=m.some(e=>e.role===`assistant`&&(e.pending||e.streaming)),$e=h||Qe||g,et=p?.soundEnabled??!0;(0,n.useEffect)(()=>{e.i(i.sound&&et&&!Je)},[i.sound,et,Je]);let tt=(0,n.useCallback)(()=>{Ye(e=>{let t=!e;try{localStorage.setItem(`centrinfo:muted`,t?`1`:`0`)}catch{}return t})},[]),nt=(0,n.useRef)(null),it=(0,n.useRef)(null),lt=(0,n.useRef)(null),bt=(0,n.useRef)(0),G=(0,n.useRef)(!1),K=(0,n.useRef)(!1),q=(0,n.useRef)(!1),xt=(0,n.useRef)(0),St=(0,n.useRef)(!1),J=(0,n.useRef)(null),Ct=(0,n.useRef)(null),wt=(0,n.useRef)([]),Tt=(0,n.useRef)(void 0),Et=(0,n.useRef)(void 0),Dt=(0,n.useRef)(null),Ot=(0,n.useRef)(0),kt=(0,n.useRef)(0),At=(0,n.useRef)(!1),jt=(0,n.useRef)(0),Mt=(0,n.useRef)(null),Nt=(0,n.useRef)(null),Pt=(0,n.useRef)(0),Y=(0,n.useRef)(null),Ft=(0,n.useRef)([]),It=(0,n.useRef)(0),Lt=(0,n.useRef)(0),Rt=(0,n.useRef)(0),zt=(0,n.useRef)(null),Bt=(0,n.useRef)(!1),Vt=(0,n.useRef)(null),Ht=(0,n.useRef)(``),Ut=(0,n.useRef)(()=>{}),Wt=(0,n.useRef)(``),Gt=(0,n.useRef)(h),Kt=(0,n.useRef)(g),qt=(0,n.useRef)($e),Jt=(0,n.useRef)(z),Yt=(0,n.useRef)(0);(0,n.useEffect)(()=>{Gt.current=h},[h]),(0,n.useEffect)(()=>{Kt.current=g},[g]),(0,n.useEffect)(()=>{qt.current=$e},[$e]),(0,n.useEffect)(()=>{Jt.current=z},[z]);let[Xt,Zt]=(0,n.useState)(!0),[Qt,$t]=(0,n.useState)(!1),en=(0,n.useRef)(0),[tn,nn]=(0,n.useState)(!1),rn=(0,n.useRef)(null),[an,on]=(0,n.useState)(!1),[sn,cn]=(0,n.useState)(!1),X=!!ye,ln=X?be:m,un=ln.find(e=>e.id===Ie&&e.visualization)?.visualization;(0,n.useEffect)(()=>{!Ie||un||(W(null),U(!1))},[un,Ie]);let dn=(0,n.useCallback)(()=>{f(!0),Ee(0),e.r(`open`),i.onOpen?.(),i.onShow?.()},[i]),fn=(0,n.useCallback)(()=>{f(!1),U(!1),W(null),i.onClose?.(),i.onHide?.(),it.current?.focus()},[i]),pn=(0,n.useCallback)(()=>l?fn():dn(),[l,dn,fn]),mn=(0,n.useCallback)(()=>nn(!0),[]),hn=(0,n.useCallback)(()=>{he(),nn(!1)},[he]),gn=(0,n.useCallback)(()=>{_e(),$t(!1),Zt(!0)},[_e]);(0,n.useEffect)(()=>{tn&&rn.current?.focus()},[tn]),(0,n.useEffect)(()=>{s({open:dn,close:fn,toggle:pn,identify:me,startNew:_e,endConversation:he,shutdown:Ce})},[s,dn,fn,pn,me,_e,he,Ce]),(0,n.useEffect)(()=>{let e=m.filter(e=>e.role===`assistant`&&!e.pending).length;if(l){bt.current=e;return}e>bt.current&&Ee(e-bt.current)},[m,l]),(0,n.useEffect)(()=>{i.onUnreadChange?.(Te)},[Te,i]),(0,n.useEffect)(()=>{let e=i.sessionDurationMinutes;if(!e||e<=0)return;let t=setTimeout(()=>Ce(),e*60*1e3);return()=>clearTimeout(t)},[i.sessionDurationMinutes,m,l,Ce]),(0,n.useEffect)(()=>{let e=i.customLauncherSelector;if(!e||typeof document>`u`)return;let t=[];try{t=Array.from(document.querySelectorAll(e))}catch{return}let n=e=>{e.preventDefault(),pn()};return t.forEach(e=>e.addEventListener(`click`,n)),()=>t.forEach(e=>e.removeEventListener(`click`,n))},[i.customLauncherSelector,pn]);let _n=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=i.proactiveMessage?.trim();if(!e||_n.current)return;let t=i.proactiveOnPaths??[],n=typeof location<`u`?location.pathname:``;if(t.length>0&&!t.some(e=>n.includes(e)))return;let r=`centrinfo:proactive:${i.token.slice(0,12)}`;try{if(sessionStorage.getItem(r)===`1`)return}catch{}let a=setTimeout(()=>{if(!(l||I||m.some(e=>e.role===`user`))){_n.current=!0;try{sessionStorage.setItem(r,`1`)}catch{}A(e),dn()}},Math.max(0,i.proactiveDelaySeconds)*1e3);return()=>clearTimeout(a)},[i.proactiveMessage]),(0,n.useEffect)(()=>{let e=lt.current;if(!l||!e)return;let t=m[m.length-1],n=Date.now()<en.current;t?.role===`user`||Xt||n?(requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight}),$t(!1),n&&Zt(!0)):$t(!0)},[m,l,h,Xt]);let vn=(0,n.useCallback)(()=>{let e=lt.current;if(!e)return;if(G.current&&!X){Zt(!0),$t(!1);return}let t=e.scrollHeight-e.scrollTop-e.clientHeight<80;Zt(t),t&&$t(!1)},[X]),yn=(0,n.useCallback)(()=>{let e=lt.current;e&&(e.scrollTop=e.scrollHeight),$t(!1),Zt(!0)},[]),bn=(0,n.useCallback)(()=>{en.current=Date.now()+3e3,requestAnimationFrame(yn)},[yn]);(0,n.useEffect)(()=>{if(!l||X||!V||z===`connecting`)return;en.current=Date.now()+6e4,yn();let e=requestAnimationFrame(()=>{yn(),requestAnimationFrame(yn)}),t=[80,180,360].map(e=>window.setTimeout(yn,e));return()=>{cancelAnimationFrame(e),t.forEach(e=>window.clearTimeout(e))}},[g,m,l,yn,h,V,X,z]);let xn=(0,n.useCallback)(()=>{nt.current?.querySelector(`.cf-textarea`)?.focus()},[]),Sn=(0,n.useCallback)(()=>{Tt.current&&window.clearTimeout(Tt.current),Tt.current=void 0,Et.current&&window.clearTimeout(Et.current),Et.current=void 0,Dt.current?.stop(),Dt.current=null,Pe(0)},[]),Z=(0,n.useCallback)(()=>{Nt.current?.stop(),Nt.current=null,o(Y.current),Mt.current?.getTracks().forEach(e=>e.stop()),Mt.current=null,Pt.current=0,Lt.current=0},[]),Cn=(0,n.useCallback)(()=>{Sn(),Ct.current?.getTracks().forEach(e=>e.stop()),Ct.current=null},[Sn]),Q=(0,n.useCallback)(()=>{G.current=!1,q.current=!1,K.current=!1,St.current=!1,zt.current=null,Bt.current=!1,Vt.current=null,Ht.current=``,je(!1),Me(!1),U(!1),W(null),Z(),L();let e=J.current;e?.state===`recording`?o(e):(Cn(),B(`idle`))},[Z,L,Cn]),wn=(0,n.useCallback)(()=>{Fe&&W(null),U(!Fe)},[Fe]),Tn=(0,n.useCallback)(e=>{W(e),U(!0)},[]),En=(0,n.useCallback)(()=>{let e=Ie;W(null),U(!1),window.requestAnimationFrame(()=>{Array.from(nt.current?.querySelectorAll(`[data-visualization-message]`)??[]).find(t=>t.dataset.visualizationMessage===e)?.focus()})},[Ie]),Dn=(0,n.useCallback)(()=>{W(null),U(!1)},[]),On=(0,n.useCallback)((e,t)=>{if(Date.now()-xt.current>=Ze){B(`timeout`),Et.current=window.setTimeout(()=>Q(),2400);return}B(e),Et.current=window.setTimeout(()=>{G.current&&!K.current&&!Kt.current&&t()},1400)},[Q]),kn=(0,n.useCallback)((e,t,n)=>{Date.now()-xt.current<Ze&&!K.current&&(q.current=!0,R(t)),On(e,n)},[On,R]),An=(0,n.useCallback)((e,t)=>{bn(),xt.current=Date.now(),q.current=!0,t&&j(t,{content:e,pending:!0,streaming:!1});let n=()=>{if(G.current){if(Gt.current){window.setTimeout(n,80);return}t&&Vt.current===t&&(Vt.current=null),w(e,{forceVoicePlayback:!0,userMessageId:t})}};n()},[bn,j,w]),jn=(0,n.useCallback)(async(e,t,n,r=`normal`,i)=>{let a=null,o=e=>a||(bn(),a=Vt.current||ce(e),Vt.current=a,j(a,{content:Ht.current||e,pending:!0,streaming:!1}),a),s=()=>{a&&(Vt.current===a&&(Vt.current=null),Ht.current=``,le(a),a=null)},c=()=>{Ht.current=``,B(`listening`),window.setTimeout(()=>{G.current&&!K.current&&!Gt.current&&!J.current&&n()},120)},l=e.size===0,u=e.size<350&&t<.001;if(l||u){if(r===`barge`){c();return}let e=zt.current;kn(`noise`,e?mt(e):ht(p),n),Ht.current=``;return}B(`processing`);let d=++Yt.current,f=o(`Listening...`);try{let t=typeof navigator<`u`&&(navigator.languages?.[0]||navigator.language)||void 0;j(f,{content:Ht.current?`${Ht.current} ...`:`Transcribing...`,pending:!0});let a=await _t(e);if(!a.trim()){if(s(),r===`barge`){c();return}kn(`noise`,zt.current?mt(zt.current):ht(p),n);return}let o=rt(await M(a,e.type,t,i));if(d!==Yt.current){s();return}let l=[Ht.current,o].map(e=>e.trim()).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();if(!l||at(l)||ot(l)){if(s(),r===`barge`){c();return}let e=zt.current;kn(`misunderstood`,e?mt(e):ht(p),n);return}let u=zt.current;if(u){let e=ct(l);if(ut.test(e)||u===`end`&&ft.test(e)){s(),zt.current=null,Ut.current(u);return}if(dt.test(e)){s(),zt.current=null;let e=`Okay, never mind โ what would you like to know?`;A(e),q.current=!0,B(`speaking`),R(e);return}s();let t=mt(u);A(t),q.current=!0,B(`speaking`),R(t);return}let m=pt(l);if(m){if(s(),xt.current=Date.now(),m.confident){Ut.current(m.action);return}zt.current=m.action;let e=`Just to confirm โ you want me to ${st[m.action]}? Please say yes or no.`;A(e),q.current=!0,B(`speaking`),R(e);return}if(j(f,{content:l,pending:!0}),gt(l)){Ht.current=l,B(`listening`),n();return}Ht.current=``,An(l,f)}catch(e){if(s(),r===`barge`){c();return}kn(`misunderstood`,`I couldn't convert your speech to text. Please check the speech service configuration or type your question.${e instanceof Error&&e.message.trim()?` (${e.message.trim()})`:``}`,n)}},[ce,bn,kn,A,j,p,le,An,R,M]),$=(0,n.useCallback)(async()=>{if(!(!G.current||K.current)&&!(!p?.allowVoiceInput||I||X)&&!Gt.current&&!J.current){Z(),q.current=!1;try{B(`connecting`);let e=await navigator.mediaDevices.getUserMedia({audio:yt(Wt.current)});if(!G.current||K.current){e.getTracks().forEach(e=>e.stop());return}navigator.mediaDevices.enumerateDevices().then(e=>{Re(e.filter(e=>e.kind===`audioinput`).map((e,t)=>({deviceId:e.deviceId,label:e.label||`Microphone ${t+1}`})))}).catch(()=>{});let t=a(e);J.current=t,Ct.current=e,wt.current=[],Ot.current=0,At.current=!1,jt.current=0;let n=performance.now();Dt.current=vt(e,(e,r)=>{if(Ot.current=Math.max(Ot.current,e),e>=.0038)At.current=!0,jt.current=0;else if(At.current&&e<=Ke){jt.current||(jt.current=r);let e=r-jt.current,i=r-n;if(e>=qe&&i>=550&&t.state===`recording`){o(t);return}}else jt.current=0;r-kt.current>90&&(kt.current=r,Pe(e))}),t.ondataavailable=e=>{e.data.size>0&&wt.current.push(e.data)},t.onstop=async()=>{if(Cn(),J.current=null,St.current){St.current=!1,G.current&&!K.current?(B(`idle`),$()):B(G.current&&K.current?`muted`:`idle`);return}if(!G.current){B(`idle`);return}await jn(new Blob(wt.current,{type:t.mimeType||`audio/webm`}),Ot.current,$,`normal`,Math.max(0,(performance.now()-n)/1e3))},t.start(250),B(`listening`),Tt.current=window.setTimeout(()=>{o(J.current)},Ue)}catch{B(`denied`),Et.current=window.setTimeout(()=>Q(),3500)}}},[I,Q,jn,p,p?.allowVoiceInput,Z,Cn,X]),Mn=(0,n.useCallback)(()=>{if(G.current){Q();return}xn(),!(!p?.allowVoiceInput||Gt.current||I||X)&&(xt.current=Date.now(),q.current=!1,K.current=!1,G.current=!0,Me(!1),je(!0),B(`connecting`),$())},[I,Q,xn,p,p?.allowVoiceInput,$,X]),Nn=(0,n.useCallback)(()=>{Me(e=>{let t=!e;if(K.current=t,t){let e=J.current;e?.state===`recording`?(St.current=!0,o(e)):(Cn(),B(`muted`))}else G.current&&!I&&!X&&(B(`idle`),$());return t})},[I,$,Cn,X]),Pn=(0,n.useCallback)((e,t)=>{A(e),t&&(q.current=!0),B(`speaking`),R(e)},[A,R]),Fn=(0,n.useCallback)(e=>{switch(xt.current=Date.now(),e){case`end`:q.current=!1,Bt.current=!0,Pn(`Okay โ ending our call now. Goodbye!`,!1),window.setTimeout(()=>{Bt.current&&(Bt.current=!1,Q())},2e3);break;case`mute`:{K.current||Nn();let e=`Muted. Tap the mic button when you want me to listen again.`;A(e),R(e);break}case`minimize`:fn(),Pn(`Minimized โ I'm still listening. Tap the call pill to bring the chat back.`,!0);break;case`expand`:U(!0),Pn(`Sure โ expanding the view.`,!0);break;case`shrink`:W(null),U(!1),Pn(`Okay โ back to the smaller view.`,!0);break}},[fn,Q,A,R,Pn,Nn]);(0,n.useEffect)(()=>{Ut.current=Fn},[Fn]);let In=(0,n.useRef)(!1);(0,n.useEffect)(()=>{In.current&&!g&&Bt.current&&(Bt.current=!1,Q()),In.current=g},[g,Q]);let Ln=(0,n.useCallback)(e=>{Wt.current=e,Ge(e);let t=J.current;t?.state===`recording`&&(St.current=!0,o(t))},[]),Rn=(0,n.useCallback)(()=>{if(!(!G.current||K.current)){if(Z(),k(),L(),xt.current=Date.now(),B(`listening`),Gt.current){let e=()=>{if(!(!G.current||K.current)){if(Gt.current){window.setTimeout(e,70);return}q.current=!1,$()}};window.setTimeout(e,70);return}q.current=!1,$()}},[$,k,Z,L]),zn=(0,n.useCallback)(async()=>{if(!(Mt.current||Nt.current)&&!(!G.current||K.current))try{let e=await navigator.mediaDevices.getUserMedia({audio:yt(Wt.current)});if(!G.current||K.current||J.current||Mt.current||!qt.current&&Jt.current!==`processing`){e.getTracks().forEach(e=>e.stop());return}Mt.current=e,Pt.current=0,Lt.current=0,Rt.current=0;let t=()=>{if(Y.current)return;k(),L(),Yt.current+=1,xt.current=Date.now(),q.current=!1,B(`listening`);let t=a(e);Y.current=t,Ft.current=[],It.current=performance.now(),Lt.current=0,t.ondataavailable=e=>{e.data.size>0&&Ft.current.push(e.data)},t.onstop=async()=>{let e=Ft.current,n=Rt.current,r=t.mimeType||`audio/webm`;Y.current=null,Ft.current=[],Z(),G.current&&await jn(new Blob(e,{type:r}),n,$,`barge`,Math.max(0,(performance.now()-It.current)/1e3))},t.start(250)};Nt.current=vt(e,(e,n)=>{if(Rt.current=Math.max(Rt.current,e),n-kt.current>90&&(kt.current=n,Pe(e)),e>=.009)Pt.current||(Pt.current=n),n-Pt.current>=280&&t(),Lt.current=0;else if(Y.current&&e<=Ke){Lt.current||(Lt.current=n);let e=n-Lt.current,t=n-It.current;e>=qe&&t>=550&&Y.current.state===`recording`&&o(Y.current)}else Y.current&&n-It.current>=Ue&&Y.current.state===`recording`?o(Y.current):(Pt.current=0,Lt.current=0)}),Nt.current||Z()}catch{}},[jn,$,k,Z,L]);(0,n.useEffect)(()=>{if(!(V&&!H&&!I&&!X&&($e||z===`processing`))){Z();return}let e=window.setTimeout(()=>void zn(),250);return()=>window.clearTimeout(e)},[$e,I,zn,Z,V,H,z,X]);let Bn=V&&!H&&(h||g||z===`processing`);(0,n.useEffect)(()=>{!V||H||g&&B(`speaking`)},[g,V,H]),(0,n.useEffect)(()=>{if(!V||H||!q.current||h||g||![`processing`,`speaking`,`noise`,`misunderstood`].includes(z))return;let e=window.setTimeout(()=>{!G.current||K.current||Gt.current||(q.current=!1,$())},700);return()=>window.clearTimeout(e)},[g,h,$,V,H,z]),(0,n.useEffect)(()=>()=>Q(),[Q]);let[Vn,Hn]=(0,n.useState)(``),Un=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(Un.current&&!h){let e=[...m].reverse().find(e=>e.role===`assistant`&&!e.streaming&&!e.pending&&e.content);e&&Hn(e.content)}Un.current=h},[h,m]),(0,n.useEffect)(()=>{if(!l)return;let e=nt.current;tn||e?.querySelector(`.cf-textarea`)?.focus();let t=t=>{if(t.key===`Escape`){if(t.preventDefault(),tn){nn(!1);return}fn();return}if(t.key!==`Tab`||!e)return;let n=e.querySelectorAll(`button, [href], textarea, input, [tabindex]:not([tabindex="-1"])`),r=Array.from(n).filter(e=>!e.hasAttribute(`disabled`));if(r.length===0)return;let i=r[0],a=r[r.length-1],o=e.getRootNode()instanceof ShadowRoot?e.getRootNode().activeElement:document.activeElement;t.shiftKey&&o===i?(t.preventDefault(),a.focus()):!t.shiftKey&&o===a&&(t.preventDefault(),i.focus())};return e?.addEventListener(`keydown`,t),()=>e?.removeEventListener(`keydown`,t)},[l,fn,tn]),(0,n.useEffect)(()=>{let e=nt.current;e&&(l?e.removeAttribute(`inert`):e.setAttribute(`inert`,``))},[l]);let Wn=i.accentColor??p?.accentColor,Gn={zIndex:i.zIndex,"--cf-h-pad":`${i.horizontalPadding}px`,"--cf-v-pad":`${i.verticalPadding}px`,...Wn?{"--cf-accent":Wn,"--cf-accent-2":`color-mix(in oklab, ${Wn} 76%, #14141f)`}:{}},Kn=e=>w(e),qn=[...m].reverse().find(e=>e.role===`user`&&e.content.trim())?.content??``,Jn=m.some(e=>e.role===`user`),Yn=p?.talkbackMode===`avatar`||p?.widgetModule===`assistant`||!!p?.allowVoiceInput,Xn=!X&&Yn&&!Jn?ln.filter((e,t)=>!(t===0&&e.role===`assistant`)):ln,Zn=ee===`human`&&y?y:p?.agentName??`Chat`,Qn=ee===`human`?`Live support`:ee===`queued`?`Waiting for the team`:p?.offline?c.statusOffline:c.statusOnline,$n=!I&&!X?p?.availableActions:void 0,er=V&&z===`connecting`&&!X;return(0,r.jsx)(e.o,{value:c,children:(0,r.jsxs)(`div`,{class:`cf-root`,"data-theme":Xe,"data-align":i.alignment,"data-display":`floating`,style:Gn,children:[Fe&&l&&(0,r.jsx)(`div`,{class:`cf-theater-backdrop`,onClick:Dn}),(0,r.jsxs)(`div`,{ref:nt,class:`cf-panel ${l?`is-open`:``} ${V?`cf-panel--call`:``} ${er?`cf-panel--voice-connecting`:``} ${Fe&&l?`cf-panel--theater`:``} ${un?`cf-panel--analytics-focus`:``}`,role:`dialog`,"aria-modal":`false`,"aria-label":`Chat with ${p?.agentName??`us`}`,"aria-hidden":!l,children:[(0,r.jsxs)(`div`,{class:`cf-header`,children:[(0,r.jsx)(F,{persona:p,hideWhenMissing:!0}),(0,r.jsxs)(`div`,{class:`cf-header__meta`,children:[(0,r.jsx)(`div`,{class:`cf-header__name`,children:Zn}),(0,r.jsx)(`div`,{class:`cf-header__status ${ee===`ai`&&p?.offline?`cf-header__status--offline`:``}`,children:(0,r.jsx)(`span`,{class:`cf-header__status-text`,children:Qn})})]}),(0,r.jsxs)(`div`,{class:`cf-header__actions`,children:[ve.length>0&&(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":c.pastConversations,title:c.pastConversations,"aria-pressed":an,onClick:()=>on(e=>!e),children:(0,r.jsx)(re,{})}),Jn&&!I&&!X&&(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":c.endChat,title:c.endChat,onClick:mn,children:(0,r.jsx)(T,{})}),i.sound&&et&&(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":Je?c.unmuteSounds:c.muteSounds,"aria-pressed":Je,onClick:tt,children:Je?(0,r.jsx)(x,{}):(0,r.jsx)(b,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn cf-header__close`,"aria-label":c.closeChat,onClick:fn,children:(0,r.jsx)(d,{})})]})]}),(0,r.jsx)(`div`,{class:`cf-panel__video`,children:un?(0,r.jsx)(`div`,{class:`cf-analytics-focus`,role:`region`,"aria-label":`Expanded analytics result`,children:(0,r.jsx)(Ae,{visualization:un,expanded:!0,onClose:En})}):!X&&Yn?(0,r.jsx)(ge,{persona:p,starters:[],onPick:w,onFocusComposer:Mn,speaking:Qe||g,voiceState:z,replyPending:V&&h&&!g,pinned:!0,muted:H,onToggleMute:Nn,onEndCall:Q,onTalkNow:Rn,showTalkNow:Bn,micLevel:Ne,theaterMode:Fe,onToggleTheater:wn,onMinimize:fn,audioDevices:Le,selectedAudioDeviceId:We,onSelectAudioDevice:Ln,connectingOnly:er}):null}),!er&&(0,r.jsxs)(`div`,{class:`cf-panel__chat`,children:[i.preview&&(0,r.jsx)(`div`,{class:`cf-preview-banner`,children:c.previewBanner}),X&&(0,r.jsx)(`div`,{class:`cf-viewing-banner`,children:c.viewingPast}),(0,r.jsxs)(`div`,{class:`cf-body`,ref:lt,role:`log`,onScroll:vn,children:[Xn.map((e,t)=>(0,r.jsx)(ke,{msg:e,persona:p,isLast:!X&&t===Xn.length-1,visitor:_,hasEmail:v,lastQuestion:qn,showActions:!X&&t===Xn.length-1&&!!e.handoffOffered,onPickReply:Kn,onSubmitForm:de,onDemoSlots:P,onRetry:ae,ratable:!X&&Xn.slice(0,t).some(e=>e.role===`user`),onRate:se,onExpandVisualization:X?void 0:Tn},e.id)),!Jn&&!X&&(0,r.jsxs)(r.Fragment,{children:[Xn.length===0&&(0,r.jsx)(Ve,{name:p?.agentName??`Assistant`,greeting:p?.greeting}),(0,r.jsx)(De,{items:C,onPick:w}),(0,r.jsx)(Oe,{items:te})]}),Qt&&(0,r.jsxs)(`button`,{type:`button`,class:`cf-newmsg`,onClick:yn,children:[(0,r.jsx)(oe,{}),c.newMessages]})]}),(0,r.jsx)(`div`,{class:`cf-sr-live`,"aria-live":`polite`,"aria-atomic":`true`,children:Vn}),h&&!I&&!X&&(0,r.jsx)(`div`,{class:`cf-stopbar`,children:(0,r.jsxs)(`button`,{type:`button`,class:`cf-stop`,onClick:k,children:[(0,r.jsx)(ne,{}),c.stop]})}),X?(0,r.jsx)(`div`,{class:`cf-ended`,children:(0,r.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:Se,children:c.backToChat})}):I?(0,r.jsxs)(`div`,{class:`cf-ended`,children:[(0,r.jsx)(`p`,{class:`cf-ended__text`,children:c.conversationEnded}),i.csat&&Jn?sn?(0,r.jsx)(`p`,{class:`cf-ended__text`,children:c.feedbackThanks}):(0,r.jsxs)(`div`,{class:`cf-csat`,children:[(0,r.jsx)(`span`,{class:`cf-csat__q`,children:c.csatPrompt}),(0,r.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":c.feedbackHelpful,onClick:()=>{ue(`up`),cn(!0)},children:(0,r.jsx)(ie,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":c.feedbackNotHelpful,onClick:()=>{ue(`down`),cn(!0)},children:(0,r.jsx)(E,{})})]}):null,(0,r.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:gn,children:c.startNewChat})]}):(0,r.jsxs)(r.Fragment,{children:[S?(0,r.jsxs)(`div`,{class:`cf-live-typing`,"aria-live":`polite`,children:[S,` is typingโฆ`]}):null,$n&&$n.length>0&&(0,r.jsx)(`div`,{class:`cf-footer-actions`,children:(0,r.jsx)(we,{actions:$n,visitor:_,onSubmitForm:de,onDemoSlots:P,scheduler:p?.scheduler})}),(0,r.jsx)(Be,{onSend:w,onSendGif:D,onTyping:O,disabled:h,allowVoice:!!p?.allowVoiceInput,onTranscribe:M,gifEnabled:pe,onSearchGifs:fe,allowAttach:i.attachments,onExtract:N})]}),!I&&p?.disclaimerText&&(0,r.jsx)(`div`,{class:`cf-disclaimer`,children:p.disclaimerText}),(0,r.jsxs)(`div`,{class:`cf-footer`,children:[c.poweredBy,` `,(0,r.jsx)(`a`,{href:`https://accurix.tech/centrinfo`,target:`_blank`,rel:`noopener noreferrer`,children:`Centrinfo`})]})]}),tn&&(0,r.jsx)(`div`,{class:`cf-confirm`,onClick:()=>nn(!1),children:(0,r.jsxs)(`div`,{class:`cf-confirm__card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":c.endChatConfirm,onClick:e=>e.stopPropagation(),children:[(0,r.jsx)(`div`,{class:`cf-confirm__title`,children:c.endChatConfirm}),(0,r.jsx)(`div`,{class:`cf-confirm__body`,children:c.endChatConfirmBody}),(0,r.jsxs)(`div`,{class:`cf-confirm__actions`,children:[(0,r.jsx)(`button`,{ref:rn,type:`button`,class:`cf-confirm__btn cf-confirm__btn--cancel`,onClick:()=>nn(!1),children:c.cancel}),(0,r.jsx)(`button`,{type:`button`,class:`cf-confirm__btn cf-confirm__btn--danger`,onClick:hn,children:c.endConfirmCta})]})]})}),an&&(0,r.jsx)(`div`,{class:`cf-confirm`,onClick:()=>on(!1),children:(0,r.jsxs)(`div`,{class:`cf-history`,role:`dialog`,"aria-modal":`true`,"aria-label":c.pastConversations,onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)(`div`,{class:`cf-history__head`,children:[(0,r.jsx)(`span`,{children:c.pastConversations}),(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":c.closeChat,onClick:()=>on(!1),children:(0,r.jsx)(d,{})})]}),(0,r.jsx)(`div`,{class:`cf-history__list`,children:ve.map(e=>(0,r.jsxs)(`button`,{type:`button`,class:`cf-history__item ${e.sessionId===ye?`is-active`:``}`,onClick:()=>{xe(e.sessionId),on(!1)},children:[(0,r.jsx)(`span`,{class:`cf-history__title`,children:e.title}),(0,r.jsxs)(`span`,{class:`cf-history__meta`,children:[new Date(e.ts).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),e.ended?` ยท ${c.historyEnded}`:``]})]},e.sessionId))})]})})]}),V&&!l?(0,r.jsx)(ze,{persona:p,voiceState:z,muted:H,onToggleMute:Nn,onEndCall:Q,micLevel:Ne,onExpand:dn}):Fe&&l?null:!i.hideDefaultLauncher&&(0,r.jsxs)(`button`,{ref:it,type:`button`,class:`cf-launcher`,"aria-label":l?c.closeChat:c.openChat,"aria-expanded":l,onClick:pn,children:[i.launcherIcon?(0,r.jsx)(`img`,{class:`cf-launcher__img`,src:i.launcherIcon,alt:``}):(0,r.jsx)(u,{}),!l&&Te>0&&(0,r.jsx)(`span`,{class:`cf-launcher__badge`,children:Te})]})]})})},G=`
|
|
9
2
|
:host {
|
|
10
3
|
all: initial;
|
|
11
4
|
}
|
|
@@ -27,8 +20,8 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
27
20
|
bottom: 0;
|
|
28
21
|
right: 0;
|
|
29
22
|
font-family: var(--cf-font);
|
|
30
|
-
font-size:
|
|
31
|
-
line-height: 1.
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
line-height: 1.45;
|
|
32
25
|
color: var(--cf-text);
|
|
33
26
|
-webkit-font-smoothing: antialiased;
|
|
34
27
|
}
|
|
@@ -135,24 +128,132 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
135
128
|
z-index: 2;
|
|
136
129
|
width: 384px;
|
|
137
130
|
max-width: calc(100vw - 32px);
|
|
138
|
-
height:
|
|
131
|
+
height: min(88vh, 820px);
|
|
132
|
+
min-height: 560px;
|
|
139
133
|
max-height: calc(100vh - 40px);
|
|
140
134
|
background: var(--cf-bg);
|
|
141
135
|
border-radius: var(--cf-radius);
|
|
142
136
|
box-shadow: var(--cf-shadow);
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
/* Grid (not flex) so theater mode below can reflow header/video/chat into a
|
|
138
|
+
two-column split purely in CSS, without reordering the DOM. */
|
|
139
|
+
display: grid;
|
|
140
|
+
grid-template-columns: 1fr;
|
|
141
|
+
grid-template-rows: auto auto minmax(0, 1fr);
|
|
142
|
+
grid-template-areas: 'header' 'video' 'chat';
|
|
145
143
|
overflow: hidden;
|
|
146
144
|
transform-origin: bottom right;
|
|
147
145
|
opacity: 0;
|
|
148
|
-
transform: translateY(
|
|
146
|
+
transform: translateY(22px) scale(0.94);
|
|
149
147
|
pointer-events: none;
|
|
150
|
-
transition: opacity 0.
|
|
148
|
+
transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
|
|
149
|
+
height 0.28s ease, width 0.28s ease;
|
|
151
150
|
}
|
|
152
151
|
.cf-panel.is-open {
|
|
153
152
|
opacity: 1;
|
|
154
153
|
transform: translateY(0) scale(1);
|
|
155
154
|
pointer-events: auto;
|
|
155
|
+
animation: cf-panel-open 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.cf-panel > .cf-header { grid-area: header; }
|
|
159
|
+
/* Stacked ABOVE .cf-panel__chat (which sits right below it in the docked
|
|
160
|
+
layout) so the call bar's popover โ which opens downward and overlaps
|
|
161
|
+
that space โ paints over the transcript instead of getting interleaved
|
|
162
|
+
with message bubbles underneath it. */
|
|
163
|
+
.cf-panel__video {
|
|
164
|
+
grid-area: video;
|
|
165
|
+
position: relative;
|
|
166
|
+
z-index: 5;
|
|
167
|
+
min-width: 0;
|
|
168
|
+
}
|
|
169
|
+
.cf-panel__chat {
|
|
170
|
+
grid-area: chat;
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
min-height: 0;
|
|
174
|
+
min-width: 0;
|
|
175
|
+
}
|
|
176
|
+
/* A live voice call gets more room for the transcript underneath the avatar card. */
|
|
177
|
+
.cf-panel.cf-panel--call {
|
|
178
|
+
height: min(90vh, 840px);
|
|
179
|
+
}
|
|
180
|
+
.cf-panel.cf-panel--voice-connecting {
|
|
181
|
+
height: min(72vh, 560px);
|
|
182
|
+
min-height: 420px;
|
|
183
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
184
|
+
grid-template-areas: 'header' 'video';
|
|
185
|
+
}
|
|
186
|
+
.cf-panel--voice-connecting .cf-panel__video {
|
|
187
|
+
display: grid;
|
|
188
|
+
min-height: 0;
|
|
189
|
+
}
|
|
190
|
+
/* Expanded "theater" view โ video and chat side by side in a large centered
|
|
191
|
+
modal instead of the corner bubble. Only reachable from an active call's
|
|
192
|
+
expand button, so it never applies below the existing mobile breakpoint. */
|
|
193
|
+
@media (min-width: 640px) {
|
|
194
|
+
.cf-panel.cf-panel--theater {
|
|
195
|
+
inset: 0;
|
|
196
|
+
margin: auto;
|
|
197
|
+
width: min(1040px, calc(100vw - 48px));
|
|
198
|
+
height: min(760px, calc(100vh - 48px));
|
|
199
|
+
max-width: none;
|
|
200
|
+
max-height: none;
|
|
201
|
+
grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
|
|
202
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
203
|
+
grid-template-areas: 'header header' 'video chat';
|
|
204
|
+
}
|
|
205
|
+
.cf-panel.cf-panel--theater.is-open {
|
|
206
|
+
transform: none;
|
|
207
|
+
}
|
|
208
|
+
.cf-panel--theater .cf-panel__video { height: 100%; }
|
|
209
|
+
.cf-panel--theater .cf-assistant-card--pinned {
|
|
210
|
+
height: 100%;
|
|
211
|
+
margin: 0;
|
|
212
|
+
padding: 0;
|
|
213
|
+
border: 0;
|
|
214
|
+
border-right: 1px solid var(--cf-border);
|
|
215
|
+
}
|
|
216
|
+
.cf-panel--theater .cf-assistant-card--pinned .cf-assistant-card__stage {
|
|
217
|
+
height: 100%;
|
|
218
|
+
border-radius: 0;
|
|
219
|
+
}
|
|
220
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__face {
|
|
221
|
+
width: min(220px, 38vw);
|
|
222
|
+
height: min(220px, 38vw);
|
|
223
|
+
}
|
|
224
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__initials {
|
|
225
|
+
font-size: clamp(42px, 7vw, 76px);
|
|
226
|
+
transform: translateY(-14px);
|
|
227
|
+
}
|
|
228
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye {
|
|
229
|
+
top: 43%;
|
|
230
|
+
width: 11px;
|
|
231
|
+
height: 11px;
|
|
232
|
+
}
|
|
233
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye--left { left: 34%; }
|
|
234
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye--right { right: 34%; }
|
|
235
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__mouth {
|
|
236
|
+
bottom: 27%;
|
|
237
|
+
width: 52px;
|
|
238
|
+
height: 8px;
|
|
239
|
+
}
|
|
240
|
+
.cf-panel--theater .cf-avatar-wave {
|
|
241
|
+
bottom: 92px;
|
|
242
|
+
}
|
|
243
|
+
/* The call bar sits near the BOTTOM of the full-height theater video pane
|
|
244
|
+
(vs. near the top of the short docked card), so its popover flips to
|
|
245
|
+
open upward here โ there's room above it, none below. */
|
|
246
|
+
.cf-panel--theater .cf-call-menu {
|
|
247
|
+
top: auto;
|
|
248
|
+
bottom: calc(100% + 8px);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
.cf-theater-backdrop {
|
|
252
|
+
position: fixed;
|
|
253
|
+
inset: 0;
|
|
254
|
+
z-index: 1;
|
|
255
|
+
background: rgba(10, 14, 20, 0.55);
|
|
256
|
+
pointer-events: auto;
|
|
156
257
|
}
|
|
157
258
|
|
|
158
259
|
/* Left-aligned messenger (alignment: 'left') โ dock to the left edge. */
|
|
@@ -188,6 +289,10 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
188
289
|
height: 100%;
|
|
189
290
|
object-fit: cover;
|
|
190
291
|
}
|
|
292
|
+
.cf-header__avatar[class*='cf-avatar-preset--'],
|
|
293
|
+
.cf-msg__avatar[class*='cf-avatar-preset--'] {
|
|
294
|
+
background: linear-gradient(135deg, var(--cf-avatar-a, var(--cf-accent)), var(--cf-avatar-b, var(--cf-accent-2)));
|
|
295
|
+
}
|
|
191
296
|
.cf-header__meta {
|
|
192
297
|
min-width: 0;
|
|
193
298
|
flex: 1 1 auto;
|
|
@@ -276,12 +381,13 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
276
381
|
|
|
277
382
|
/* ---------- Body / messages ---------- */
|
|
278
383
|
.cf-body {
|
|
279
|
-
flex: 1;
|
|
384
|
+
flex: 1 1 0;
|
|
385
|
+
min-height: 0;
|
|
280
386
|
overflow-y: auto;
|
|
281
387
|
/* Never scroll/shift horizontally โ a long source pill or code line is
|
|
282
388
|
clipped, not allowed to push the whole thread sideways. */
|
|
283
389
|
overflow-x: hidden;
|
|
284
|
-
padding:
|
|
390
|
+
padding: 12px 14px 8px;
|
|
285
391
|
display: flex;
|
|
286
392
|
flex-direction: column;
|
|
287
393
|
gap: 12px;
|
|
@@ -295,6 +401,38 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
295
401
|
background: var(--cf-border);
|
|
296
402
|
border-radius: 4px;
|
|
297
403
|
}
|
|
404
|
+
.cf-empty-welcome {
|
|
405
|
+
display: flex;
|
|
406
|
+
flex-direction: column;
|
|
407
|
+
gap: 5px;
|
|
408
|
+
margin: 4px 0 2px;
|
|
409
|
+
padding: 14px 14px 13px;
|
|
410
|
+
border-radius: 18px;
|
|
411
|
+
background:
|
|
412
|
+
radial-gradient(circle at 14% 0%, color-mix(in oklab, var(--cf-accent) 20%, transparent), transparent 34%),
|
|
413
|
+
linear-gradient(135deg, color-mix(in oklab, var(--cf-surface) 88%, var(--cf-bg)), var(--cf-bg));
|
|
414
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 78%, var(--cf-accent));
|
|
415
|
+
}
|
|
416
|
+
.cf-empty-welcome__eyebrow {
|
|
417
|
+
color: var(--cf-accent);
|
|
418
|
+
font-size: 10px;
|
|
419
|
+
font-weight: 800;
|
|
420
|
+
letter-spacing: 0.11em;
|
|
421
|
+
text-transform: uppercase;
|
|
422
|
+
}
|
|
423
|
+
.cf-empty-welcome h2 {
|
|
424
|
+
margin: 0;
|
|
425
|
+
color: var(--cf-text);
|
|
426
|
+
font-size: 17px;
|
|
427
|
+
line-height: 1.15;
|
|
428
|
+
letter-spacing: -0.02em;
|
|
429
|
+
}
|
|
430
|
+
.cf-empty-welcome p {
|
|
431
|
+
margin: 0;
|
|
432
|
+
color: var(--cf-muted);
|
|
433
|
+
font-size: 12.8px;
|
|
434
|
+
line-height: 1.45;
|
|
435
|
+
}
|
|
298
436
|
.cf-msg {
|
|
299
437
|
display: flex;
|
|
300
438
|
gap: 8px;
|
|
@@ -304,6 +442,10 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
304
442
|
.cf-msg--user {
|
|
305
443
|
justify-content: flex-end;
|
|
306
444
|
}
|
|
445
|
+
.cf-msg--system {
|
|
446
|
+
justify-content: center;
|
|
447
|
+
margin: 4px 0;
|
|
448
|
+
}
|
|
307
449
|
.cf-msg__avatar {
|
|
308
450
|
width: 26px;
|
|
309
451
|
height: 26px;
|
|
@@ -327,7 +469,7 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
327
469
|
words like "Hello" never split mid-word. */
|
|
328
470
|
overflow-wrap: break-word;
|
|
329
471
|
white-space: pre-wrap;
|
|
330
|
-
font-size:
|
|
472
|
+
font-size: 13.5px;
|
|
331
473
|
}
|
|
332
474
|
.cf-msg--agent .cf-msg__bubble {
|
|
333
475
|
background: var(--cf-surface);
|
|
@@ -348,6 +490,39 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
348
490
|
.cf-msg__bubble p:last-child { margin-bottom: 0; }
|
|
349
491
|
.cf-msg__col { min-width: 0; max-width: 85%; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
|
|
350
492
|
.cf-msg--user .cf-msg__col { align-items: flex-end; }
|
|
493
|
+
.cf-system-event {
|
|
494
|
+
width: min(220px, 86%);
|
|
495
|
+
display: grid;
|
|
496
|
+
justify-items: center;
|
|
497
|
+
gap: 6px;
|
|
498
|
+
text-align: center;
|
|
499
|
+
color: var(--cf-muted);
|
|
500
|
+
}
|
|
501
|
+
.cf-system-event__mark {
|
|
502
|
+
width: 40px;
|
|
503
|
+
height: 40px;
|
|
504
|
+
border-radius: 999px;
|
|
505
|
+
display: grid;
|
|
506
|
+
place-items: center;
|
|
507
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent, #2f7f55) 38%, transparent);
|
|
508
|
+
background: color-mix(in srgb, var(--cf-accent, #2f7f55) 8%, transparent);
|
|
509
|
+
}
|
|
510
|
+
.cf-system-event__mark .cf-msg__avatar {
|
|
511
|
+
align-self: center;
|
|
512
|
+
width: 28px;
|
|
513
|
+
height: 28px;
|
|
514
|
+
}
|
|
515
|
+
.cf-system-event__text {
|
|
516
|
+
font-size: 14px;
|
|
517
|
+
font-weight: 700;
|
|
518
|
+
line-height: 1.25;
|
|
519
|
+
color: var(--cf-text);
|
|
520
|
+
}
|
|
521
|
+
.cf-system-event__time {
|
|
522
|
+
font-size: 12px;
|
|
523
|
+
line-height: 1.2;
|
|
524
|
+
color: var(--cf-muted);
|
|
525
|
+
}
|
|
351
526
|
|
|
352
527
|
/* ---------- Markdown in answers ---------- */
|
|
353
528
|
.cf-msg__bubble .cf-md-h { font-weight: 700; font-size: 14.5px; margin: 4px 0 2px; }
|
|
@@ -456,20 +631,85 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
456
631
|
.cf-feedback__send:hover { opacity: 0.9; }
|
|
457
632
|
|
|
458
633
|
/* conversation starters */
|
|
459
|
-
.cf-starters {
|
|
634
|
+
.cf-starters {
|
|
635
|
+
display: flex;
|
|
636
|
+
flex-direction: column;
|
|
637
|
+
align-items: flex-start;
|
|
638
|
+
min-width: 0;
|
|
639
|
+
gap: 8px;
|
|
640
|
+
margin: 2px 0 4px 34px;
|
|
641
|
+
}
|
|
460
642
|
.cf-starter {
|
|
461
|
-
|
|
643
|
+
max-width: 100%;
|
|
644
|
+
padding: 8px 12px;
|
|
462
645
|
border-radius: 14px;
|
|
463
646
|
border: 1px solid var(--cf-border);
|
|
464
647
|
background: var(--cf-bg);
|
|
465
648
|
color: var(--cf-text);
|
|
466
|
-
font-size:
|
|
649
|
+
font-size: 12.8px;
|
|
467
650
|
font-weight: 500;
|
|
468
651
|
text-align: left;
|
|
652
|
+
overflow-wrap: anywhere;
|
|
469
653
|
transition: border-color 0.15s ease, transform 0.1s ease;
|
|
470
654
|
}
|
|
471
655
|
.cf-starter:hover { border-color: var(--cf-accent); }
|
|
472
656
|
.cf-starter:active { transform: scale(0.98); }
|
|
657
|
+
.cf-starter:focus-visible {
|
|
658
|
+
outline: 2px solid var(--cf-accent-2);
|
|
659
|
+
outline-offset: 2px;
|
|
660
|
+
}
|
|
661
|
+
.cf-featured-links {
|
|
662
|
+
display: flex;
|
|
663
|
+
flex-wrap: wrap;
|
|
664
|
+
align-items: flex-start;
|
|
665
|
+
min-width: 0;
|
|
666
|
+
gap: 8px;
|
|
667
|
+
margin: 2px 0 4px;
|
|
668
|
+
}
|
|
669
|
+
.cf-featured-link {
|
|
670
|
+
flex: 0 1 auto;
|
|
671
|
+
min-width: 0;
|
|
672
|
+
max-width: 100%;
|
|
673
|
+
display: inline-flex;
|
|
674
|
+
align-items: center;
|
|
675
|
+
gap: 7px;
|
|
676
|
+
min-width: 0;
|
|
677
|
+
min-height: 34px;
|
|
678
|
+
padding: 7px 11px;
|
|
679
|
+
border-radius: 999px;
|
|
680
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent) 55%, var(--cf-border));
|
|
681
|
+
background: color-mix(in srgb, var(--cf-accent) 10%, var(--cf-bg));
|
|
682
|
+
color: var(--cf-text);
|
|
683
|
+
font-size: 13px;
|
|
684
|
+
font-weight: 500;
|
|
685
|
+
text-decoration: none;
|
|
686
|
+
transition: border-color 0.15s ease, background-color 0.15s ease;
|
|
687
|
+
}
|
|
688
|
+
.cf-featured-link svg {
|
|
689
|
+
width: 14px;
|
|
690
|
+
height: 14px;
|
|
691
|
+
flex: 0 0 14px;
|
|
692
|
+
}
|
|
693
|
+
.cf-featured-link svg {
|
|
694
|
+
width: 14px;
|
|
695
|
+
height: 14px;
|
|
696
|
+
flex: 0 0 14px;
|
|
697
|
+
color: var(--cf-accent);
|
|
698
|
+
}
|
|
699
|
+
.cf-featured-link span {
|
|
700
|
+
min-width: 0;
|
|
701
|
+
overflow: hidden;
|
|
702
|
+
text-overflow: ellipsis;
|
|
703
|
+
white-space: nowrap;
|
|
704
|
+
}
|
|
705
|
+
.cf-featured-link:hover {
|
|
706
|
+
border-color: var(--cf-accent);
|
|
707
|
+
background: color-mix(in srgb, var(--cf-accent) 16%, var(--cf-bg));
|
|
708
|
+
}
|
|
709
|
+
.cf-featured-link:focus-visible {
|
|
710
|
+
outline: 2px solid var(--cf-accent-2);
|
|
711
|
+
outline-offset: 2px;
|
|
712
|
+
}
|
|
473
713
|
|
|
474
714
|
/* stop generating */
|
|
475
715
|
.cf-stopbar { display: flex; justify-content: center; padding: 6px 0 2px; flex-shrink: 0; }
|
|
@@ -493,12 +733,20 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
493
733
|
/* typing */
|
|
494
734
|
.cf-typing {
|
|
495
735
|
display: inline-flex;
|
|
736
|
+
align-items: center;
|
|
496
737
|
gap: 4px;
|
|
497
|
-
padding: 13px
|
|
738
|
+
padding: 10px 13px;
|
|
739
|
+
min-width: 98px;
|
|
740
|
+
}
|
|
741
|
+
.cf-typing__label {
|
|
742
|
+
margin-right: 3px;
|
|
743
|
+
color: var(--cf-muted);
|
|
744
|
+
font-size: 12px;
|
|
745
|
+
font-weight: 650;
|
|
498
746
|
}
|
|
499
747
|
.cf-typing__dot {
|
|
500
|
-
width:
|
|
501
|
-
height:
|
|
748
|
+
width: 5px;
|
|
749
|
+
height: 5px;
|
|
502
750
|
border-radius: 50%;
|
|
503
751
|
background: var(--cf-muted);
|
|
504
752
|
animation: cf-typing 1.1s infinite ease-in-out;
|
|
@@ -565,7 +813,7 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
565
813
|
background: var(--cf-surface);
|
|
566
814
|
border: 1px solid var(--cf-border);
|
|
567
815
|
color: var(--cf-text);
|
|
568
|
-
font-size:
|
|
816
|
+
font-size: 12.8px;
|
|
569
817
|
font-weight: 600;
|
|
570
818
|
transition: border-color 0.15s ease, transform 0.1s ease;
|
|
571
819
|
}
|
|
@@ -756,6 +1004,13 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
756
1004
|
border-top: 1px solid var(--cf-border);
|
|
757
1005
|
background: var(--cf-bg);
|
|
758
1006
|
}
|
|
1007
|
+
.cf-live-typing {
|
|
1008
|
+
flex-shrink: 0;
|
|
1009
|
+
padding: 8px 14px 0;
|
|
1010
|
+
color: var(--cf-muted);
|
|
1011
|
+
font-size: 12px;
|
|
1012
|
+
background: var(--cf-bg);
|
|
1013
|
+
}
|
|
759
1014
|
.cf-composer__field {
|
|
760
1015
|
display: flex;
|
|
761
1016
|
align-items: flex-end;
|
|
@@ -767,6 +1022,23 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
767
1022
|
transition: border-color 0.15s ease;
|
|
768
1023
|
}
|
|
769
1024
|
.cf-composer__field:focus-within { border-color: var(--cf-accent); }
|
|
1025
|
+
.cf-voice-state {
|
|
1026
|
+
display: inline-flex;
|
|
1027
|
+
align-items: center;
|
|
1028
|
+
gap: 8px;
|
|
1029
|
+
margin: 0 0 8px 2px;
|
|
1030
|
+
color: var(--cf-muted);
|
|
1031
|
+
font-size: 12.5px;
|
|
1032
|
+
}
|
|
1033
|
+
.cf-voice-state__dot {
|
|
1034
|
+
width: 8px;
|
|
1035
|
+
height: 8px;
|
|
1036
|
+
border-radius: 999px;
|
|
1037
|
+
background: var(--cf-accent);
|
|
1038
|
+
}
|
|
1039
|
+
.cf-voice-state__dot.is-live {
|
|
1040
|
+
animation: cf-pulse 1s infinite;
|
|
1041
|
+
}
|
|
770
1042
|
.cf-textarea {
|
|
771
1043
|
flex: 1;
|
|
772
1044
|
border: none;
|
|
@@ -899,106 +1171,1168 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
899
1171
|
.cf-footer a { color: var(--cf-muted); text-decoration: none; font-weight: 600; }
|
|
900
1172
|
.cf-footer a:hover { color: var(--cf-accent); }
|
|
901
1173
|
|
|
902
|
-
/* ----------
|
|
903
|
-
.cf-
|
|
904
|
-
.cf-welcome__desc { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--cf-text); }
|
|
905
|
-
.cf-welcome__sub { margin: 0; font-size: 12.5px; color: var(--cf-muted); }
|
|
906
|
-
|
|
907
|
-
/* Offline presence dot (amber instead of green). */
|
|
908
|
-
.cf-header__status--offline::before { background: #e2c07e; box-shadow: 0 0 0 2px rgba(226, 192, 126, 0.3); }
|
|
909
|
-
|
|
910
|
-
/* Disclaimer fine-print under the composer. */
|
|
911
|
-
.cf-disclaimer { padding: 0 16px 2px; font-size: 10.5px; line-height: 1.45; color: var(--cf-muted); text-align: center; }
|
|
912
|
-
|
|
913
|
-
/* Read-only banner shown while viewing a past conversation. */
|
|
914
|
-
.cf-viewing-banner {
|
|
915
|
-
padding: 7px 16px;
|
|
916
|
-
font-size: 12px;
|
|
917
|
-
font-weight: 600;
|
|
918
|
-
text-align: center;
|
|
919
|
-
color: var(--cf-muted);
|
|
920
|
-
background: var(--cf-surface);
|
|
921
|
-
border-bottom: 1px solid var(--cf-border);
|
|
1174
|
+
/* ---------- Footer lead actions ---------- */
|
|
1175
|
+
.cf-footer-actions {
|
|
922
1176
|
flex-shrink: 0;
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
/* Past-conversations history panel (over the chat, like the confirm dialog). */
|
|
926
|
-
.cf-history {
|
|
927
|
-
width: min(340px, 90%);
|
|
928
|
-
max-height: 70%;
|
|
929
|
-
display: flex;
|
|
930
|
-
flex-direction: column;
|
|
1177
|
+
padding: 6px 14px 5px;
|
|
931
1178
|
background: var(--cf-bg);
|
|
932
|
-
border-
|
|
933
|
-
box-shadow: var(--cf-shadow);
|
|
934
|
-
overflow: hidden;
|
|
1179
|
+
border-top: 1px solid var(--cf-border);
|
|
935
1180
|
}
|
|
936
|
-
.cf-
|
|
937
|
-
display:
|
|
1181
|
+
.cf-action-trigger {
|
|
1182
|
+
display: grid;
|
|
1183
|
+
grid-template-columns: 28px minmax(0, 1fr) 16px;
|
|
938
1184
|
align-items: center;
|
|
939
|
-
|
|
940
|
-
padding: 12px 14px;
|
|
941
|
-
font-size: 14px;
|
|
942
|
-
font-weight: 700;
|
|
943
|
-
color: var(--cf-text);
|
|
944
|
-
border-bottom: 1px solid var(--cf-border);
|
|
945
|
-
}
|
|
946
|
-
.cf-history__list { overflow-y: auto; padding: 6px; }
|
|
947
|
-
.cf-history__item {
|
|
948
|
-
display: flex;
|
|
949
|
-
flex-direction: column;
|
|
950
|
-
gap: 2px;
|
|
1185
|
+
gap: 8px;
|
|
951
1186
|
width: 100%;
|
|
1187
|
+
min-height: 40px;
|
|
1188
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
|
|
1189
|
+
border-radius: 14px;
|
|
1190
|
+
padding: 6px 9px;
|
|
1191
|
+
background:
|
|
1192
|
+
radial-gradient(circle at 15% 0%, color-mix(in oklab, var(--cf-accent) 15%, transparent), transparent 40%),
|
|
1193
|
+
color-mix(in oklab, var(--cf-bg-soft) 78%, transparent);
|
|
1194
|
+
color: var(--cf-text);
|
|
952
1195
|
text-align: left;
|
|
953
|
-
padding: 9px 10px;
|
|
954
|
-
border-radius: 9px;
|
|
955
1196
|
cursor: pointer;
|
|
956
|
-
|
|
1197
|
+
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
|
|
957
1198
|
}
|
|
958
|
-
.cf-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
.cf-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1199
|
+
.cf-action-trigger:hover {
|
|
1200
|
+
border-color: color-mix(in oklab, var(--cf-accent) 46%, var(--cf-border));
|
|
1201
|
+
}
|
|
1202
|
+
.cf-action-trigger > svg {
|
|
1203
|
+
width: 14px;
|
|
1204
|
+
height: 14px;
|
|
1205
|
+
color: var(--cf-muted);
|
|
1206
|
+
}
|
|
1207
|
+
.cf-action-trigger__icon {
|
|
1208
|
+
display: inline-flex;
|
|
1209
|
+
align-items: center;
|
|
1210
|
+
justify-content: center;
|
|
1211
|
+
width: 28px;
|
|
1212
|
+
height: 28px;
|
|
1213
|
+
border-radius: 10px;
|
|
1214
|
+
background: color-mix(in oklab, var(--cf-accent) 15%, transparent);
|
|
1215
|
+
color: var(--cf-accent);
|
|
1216
|
+
}
|
|
1217
|
+
.cf-action-trigger__icon svg { width: 14px; height: 14px; }
|
|
1218
|
+
.cf-action-trigger__copy {
|
|
1219
|
+
display: grid;
|
|
1220
|
+
gap: 1px;
|
|
1221
|
+
min-width: 0;
|
|
1222
|
+
}
|
|
1223
|
+
.cf-action-trigger__copy strong {
|
|
1224
|
+
font-size: 12px;
|
|
1225
|
+
line-height: 1.1;
|
|
1226
|
+
}
|
|
1227
|
+
.cf-action-trigger__copy small {
|
|
1228
|
+
overflow: hidden;
|
|
1229
|
+
color: var(--cf-muted);
|
|
1230
|
+
font-size: 10.5px;
|
|
1231
|
+
line-height: 1.2;
|
|
1232
|
+
text-overflow: ellipsis;
|
|
1233
|
+
white-space: nowrap;
|
|
1234
|
+
}
|
|
1235
|
+
.cf-action-drawer {
|
|
1236
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
|
|
1237
|
+
border-radius: 18px 18px 12px 12px;
|
|
1238
|
+
padding: 7px;
|
|
1239
|
+
background:
|
|
1240
|
+
radial-gradient(circle at 18% 0%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 38%),
|
|
1241
|
+
color-mix(in oklab, var(--cf-bg) 94%, #ffffff);
|
|
1242
|
+
box-shadow: 0 -10px 34px rgba(15, 23, 42, 0.14);
|
|
1243
|
+
animation: cf-drawer-up 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1244
|
+
}
|
|
1245
|
+
.cf-action-drawer__handle {
|
|
1246
|
+
width: 36px;
|
|
1247
|
+
height: 3px;
|
|
1248
|
+
margin: 0 auto 6px;
|
|
1249
|
+
border-radius: 999px;
|
|
1250
|
+
background: color-mix(in oklab, var(--cf-muted) 42%, transparent);
|
|
1251
|
+
}
|
|
1252
|
+
.cf-action-drawer__head {
|
|
965
1253
|
display: flex;
|
|
966
|
-
flex-direction: column;
|
|
967
1254
|
align-items: center;
|
|
1255
|
+
justify-content: space-between;
|
|
968
1256
|
gap: 10px;
|
|
969
|
-
padding:
|
|
970
|
-
|
|
971
|
-
text-align: center;
|
|
1257
|
+
padding: 0 3px 6px;
|
|
1258
|
+
color: var(--cf-text);
|
|
972
1259
|
}
|
|
973
|
-
.cf-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1260
|
+
.cf-action-drawer__head strong {
|
|
1261
|
+
display: block;
|
|
1262
|
+
font-size: 13px;
|
|
1263
|
+
line-height: 1.2;
|
|
1264
|
+
}
|
|
1265
|
+
.cf-action-drawer__eyebrow {
|
|
1266
|
+
display: block;
|
|
1267
|
+
margin-bottom: 2px;
|
|
1268
|
+
font-size: 9px;
|
|
1269
|
+
font-weight: 800;
|
|
1270
|
+
letter-spacing: 0.16em;
|
|
1271
|
+
text-transform: uppercase;
|
|
1272
|
+
color: var(--cf-muted);
|
|
1273
|
+
}
|
|
1274
|
+
.cf-action-drawer__close {
|
|
977
1275
|
display: inline-flex;
|
|
978
1276
|
align-items: center;
|
|
979
1277
|
justify-content: center;
|
|
980
|
-
width:
|
|
981
|
-
height:
|
|
982
|
-
border
|
|
1278
|
+
width: 28px;
|
|
1279
|
+
height: 28px;
|
|
1280
|
+
border: 1px solid var(--cf-border);
|
|
1281
|
+
border-radius: 999px;
|
|
1282
|
+
background: var(--cf-bg-soft);
|
|
983
1283
|
color: var(--cf-muted);
|
|
984
1284
|
cursor: pointer;
|
|
985
|
-
transition: background 0.15s ease, color 0.15s ease;
|
|
986
1285
|
}
|
|
987
|
-
.cf-
|
|
988
|
-
.cf-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1286
|
+
.cf-action-drawer__close svg { width: 14px; height: 14px; }
|
|
1287
|
+
.cf-action-drawer__grid {
|
|
1288
|
+
display: grid;
|
|
1289
|
+
gap: 6px;
|
|
1290
|
+
}
|
|
1291
|
+
.cf-action-card {
|
|
1292
|
+
display: grid;
|
|
1293
|
+
grid-template-columns: 30px minmax(0, 1fr) 14px;
|
|
1294
|
+
align-items: center;
|
|
1295
|
+
gap: 8px;
|
|
1296
|
+
width: 100%;
|
|
1297
|
+
border: 1px solid var(--cf-border);
|
|
1298
|
+
border-radius: 14px;
|
|
1299
|
+
padding: 7px 8px;
|
|
1300
|
+
background: color-mix(in oklab, var(--cf-bg-soft) 72%, transparent);
|
|
1301
|
+
color: var(--cf-text);
|
|
1302
|
+
text-align: left;
|
|
997
1303
|
cursor: pointer;
|
|
998
|
-
transition:
|
|
1304
|
+
transition:
|
|
1305
|
+
transform 0.16s ease,
|
|
1306
|
+
border-color 0.16s ease,
|
|
1307
|
+
background 0.16s ease;
|
|
1308
|
+
}
|
|
1309
|
+
.cf-action-card:hover {
|
|
1310
|
+
border-color: color-mix(in oklab, var(--cf-accent) 44%, var(--cf-border));
|
|
1311
|
+
background: color-mix(in oklab, var(--cf-accent) 9%, var(--cf-bg-soft));
|
|
1312
|
+
}
|
|
1313
|
+
.cf-action-card:active { transform: translateY(1px); }
|
|
1314
|
+
.cf-action-card > svg {
|
|
1315
|
+
width: 13px;
|
|
1316
|
+
height: 13px;
|
|
1317
|
+
color: var(--cf-muted);
|
|
1318
|
+
transform: rotate(-90deg);
|
|
999
1319
|
}
|
|
1000
|
-
.cf-
|
|
1001
|
-
|
|
1320
|
+
.cf-action-card__icon {
|
|
1321
|
+
display: inline-flex;
|
|
1322
|
+
align-items: center;
|
|
1323
|
+
justify-content: center;
|
|
1324
|
+
width: 30px;
|
|
1325
|
+
height: 30px;
|
|
1326
|
+
border-radius: 10px;
|
|
1327
|
+
background: color-mix(in oklab, var(--cf-accent) 14%, transparent);
|
|
1328
|
+
color: var(--cf-accent);
|
|
1329
|
+
}
|
|
1330
|
+
.cf-action-card__icon svg { width: 14px; height: 14px; }
|
|
1331
|
+
.cf-action-card__copy {
|
|
1332
|
+
display: grid;
|
|
1333
|
+
gap: 2px;
|
|
1334
|
+
min-width: 0;
|
|
1335
|
+
}
|
|
1336
|
+
.cf-action-card__copy strong {
|
|
1337
|
+
font-size: 12px;
|
|
1338
|
+
line-height: 1.2;
|
|
1339
|
+
}
|
|
1340
|
+
.cf-action-card__copy small {
|
|
1341
|
+
overflow: hidden;
|
|
1342
|
+
color: var(--cf-muted);
|
|
1343
|
+
font-size: 10.5px;
|
|
1344
|
+
line-height: 1.25;
|
|
1345
|
+
text-overflow: ellipsis;
|
|
1346
|
+
white-space: nowrap;
|
|
1347
|
+
}
|
|
1348
|
+
.cf-action-drawer__note {
|
|
1349
|
+
margin: 6px 3px 0;
|
|
1350
|
+
color: var(--cf-muted);
|
|
1351
|
+
font-size: 10px;
|
|
1352
|
+
line-height: 1.25;
|
|
1353
|
+
}
|
|
1354
|
+
.cf-action-drawer .cf-form,
|
|
1355
|
+
.cf-action-drawer .cf-booking {
|
|
1356
|
+
max-width: none;
|
|
1357
|
+
margin: 0;
|
|
1358
|
+
border: 0;
|
|
1359
|
+
background: transparent;
|
|
1360
|
+
box-shadow: none;
|
|
1361
|
+
}
|
|
1362
|
+
.cf-footer-actions .cf-actions {
|
|
1363
|
+
display: grid;
|
|
1364
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1365
|
+
gap: 7px;
|
|
1366
|
+
}
|
|
1367
|
+
.cf-footer-actions .cf-action {
|
|
1368
|
+
justify-content: center;
|
|
1369
|
+
min-width: 0;
|
|
1370
|
+
gap: 5px;
|
|
1371
|
+
min-height: 32px;
|
|
1372
|
+
border-radius: 11px;
|
|
1373
|
+
padding: 6px 8px;
|
|
1374
|
+
font-size: 12px;
|
|
1375
|
+
line-height: 1.15;
|
|
1376
|
+
font-weight: 650;
|
|
1377
|
+
}
|
|
1378
|
+
.cf-footer-actions .cf-action svg {
|
|
1379
|
+
width: 13px;
|
|
1380
|
+
height: 13px;
|
|
1381
|
+
}
|
|
1382
|
+
.cf-footer-actions .cf-form,
|
|
1383
|
+
.cf-footer-actions .cf-booking {
|
|
1384
|
+
max-width: none;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
@keyframes cf-drawer-up {
|
|
1388
|
+
from {
|
|
1389
|
+
opacity: 0;
|
|
1390
|
+
transform: translateY(14px) scale(0.98);
|
|
1391
|
+
}
|
|
1392
|
+
to {
|
|
1393
|
+
opacity: 1;
|
|
1394
|
+
transform: translateY(0) scale(1);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/* ---------- Assistant card module ---------- */
|
|
1399
|
+
.cf-assistant-card {
|
|
1400
|
+
display: flex;
|
|
1401
|
+
flex-direction: column;
|
|
1402
|
+
gap: 12px;
|
|
1403
|
+
margin: 0 2px 4px;
|
|
1404
|
+
animation: cf-msg-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1405
|
+
}
|
|
1406
|
+
.cf-assistant-card--pinned {
|
|
1407
|
+
flex-shrink: 0;
|
|
1408
|
+
gap: 0;
|
|
1409
|
+
margin: 0;
|
|
1410
|
+
padding: 8px 14px 10px;
|
|
1411
|
+
border-bottom: 1px solid var(--cf-border);
|
|
1412
|
+
background: var(--cf-bg);
|
|
1413
|
+
}
|
|
1414
|
+
.cf-assistant-card--compact {
|
|
1415
|
+
align-items: flex-start;
|
|
1416
|
+
padding-top: 10px;
|
|
1417
|
+
padding-bottom: 12px;
|
|
1418
|
+
}
|
|
1419
|
+
.cf-assistant-card__compact-speak {
|
|
1420
|
+
position: relative;
|
|
1421
|
+
isolation: isolate;
|
|
1422
|
+
display: inline-flex;
|
|
1423
|
+
align-items: center;
|
|
1424
|
+
gap: 8px;
|
|
1425
|
+
max-width: 100%;
|
|
1426
|
+
min-height: 44px;
|
|
1427
|
+
padding: 5px 15px 5px 6px;
|
|
1428
|
+
border-radius: 999px;
|
|
1429
|
+
background:
|
|
1430
|
+
linear-gradient(180deg, color-mix(in oklab, var(--cf-accent) 13%, var(--cf-surface)), color-mix(in oklab, var(--cf-bg) 92%, var(--cf-surface))),
|
|
1431
|
+
var(--cf-bg);
|
|
1432
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 58%, var(--cf-border));
|
|
1433
|
+
color: var(--cf-text);
|
|
1434
|
+
box-shadow:
|
|
1435
|
+
inset 0 1px 0 color-mix(in oklab, #fff 13%, transparent),
|
|
1436
|
+
0 13px 30px -22px color-mix(in oklab, var(--cf-accent) 60%, #000);
|
|
1437
|
+
font-size: 12.25px;
|
|
1438
|
+
font-weight: 750;
|
|
1439
|
+
line-height: 1;
|
|
1440
|
+
transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
|
|
1441
|
+
overflow: hidden;
|
|
1442
|
+
}
|
|
1443
|
+
.cf-assistant-card__compact-speak::before {
|
|
1444
|
+
content: '';
|
|
1445
|
+
position: absolute;
|
|
1446
|
+
inset: 1px;
|
|
1447
|
+
z-index: -1;
|
|
1448
|
+
border-radius: inherit;
|
|
1449
|
+
background:
|
|
1450
|
+
radial-gradient(circle at 20% 10%, color-mix(in oklab, var(--cf-accent) 28%, transparent), transparent 42%),
|
|
1451
|
+
radial-gradient(circle at 85% 100%, color-mix(in oklab, var(--cf-accent-2) 18%, transparent), transparent 38%);
|
|
1452
|
+
opacity: 0.76;
|
|
1453
|
+
pointer-events: none;
|
|
1454
|
+
}
|
|
1455
|
+
.cf-assistant-card__compact-speak:hover {
|
|
1456
|
+
border-color: color-mix(in oklab, var(--cf-accent) 82%, var(--cf-border));
|
|
1457
|
+
box-shadow:
|
|
1458
|
+
inset 0 1px 0 color-mix(in oklab, #fff 15%, transparent),
|
|
1459
|
+
0 16px 34px -22px color-mix(in oklab, var(--cf-accent) 76%, #000);
|
|
1460
|
+
}
|
|
1461
|
+
.cf-assistant-card__compact-speak:active { transform: scale(0.98); }
|
|
1462
|
+
.cf-assistant-card__compact-speak:focus-visible {
|
|
1463
|
+
outline: 2px solid var(--cf-accent-2);
|
|
1464
|
+
outline-offset: 2px;
|
|
1465
|
+
}
|
|
1466
|
+
.cf-assistant-card__compact-mic {
|
|
1467
|
+
width: 24px;
|
|
1468
|
+
height: 24px;
|
|
1469
|
+
margin-left: -14px;
|
|
1470
|
+
border-radius: 999px;
|
|
1471
|
+
display: inline-flex;
|
|
1472
|
+
align-items: center;
|
|
1473
|
+
justify-content: center;
|
|
1474
|
+
flex-shrink: 0;
|
|
1475
|
+
color: var(--cf-accent);
|
|
1476
|
+
background: color-mix(in oklab, var(--cf-bg) 90%, transparent);
|
|
1477
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 48%, var(--cf-border));
|
|
1478
|
+
box-shadow: 0 7px 18px -12px rgba(0, 0, 0, 0.75);
|
|
1479
|
+
}
|
|
1480
|
+
.cf-assistant-card__compact-mic svg {
|
|
1481
|
+
width: 13px;
|
|
1482
|
+
height: 13px;
|
|
1483
|
+
color: var(--cf-accent);
|
|
1484
|
+
flex-shrink: 0;
|
|
1485
|
+
}
|
|
1486
|
+
.cf-assistant-card__compact-mic:first-child {
|
|
1487
|
+
margin-left: 0;
|
|
1488
|
+
}
|
|
1489
|
+
.cf-assistant-card__compact-label {
|
|
1490
|
+
min-width: 0;
|
|
1491
|
+
overflow: hidden;
|
|
1492
|
+
text-overflow: ellipsis;
|
|
1493
|
+
white-space: nowrap;
|
|
1494
|
+
letter-spacing: 0.01em;
|
|
1495
|
+
}
|
|
1496
|
+
.cf-assistant-card__compact-avatar {
|
|
1497
|
+
width: 34px;
|
|
1498
|
+
height: 34px;
|
|
1499
|
+
border-radius: 999px;
|
|
1500
|
+
display: grid;
|
|
1501
|
+
place-items: center;
|
|
1502
|
+
flex-shrink: 0;
|
|
1503
|
+
overflow: hidden;
|
|
1504
|
+
color: #fff;
|
|
1505
|
+
background: linear-gradient(135deg, var(--cf-avatar-a, var(--cf-accent)), var(--cf-avatar-b, var(--cf-accent-2)));
|
|
1506
|
+
border: 1px solid color-mix(in oklab, #fff 24%, transparent);
|
|
1507
|
+
box-shadow:
|
|
1508
|
+
0 0 0 3px color-mix(in oklab, var(--cf-accent) 16%, transparent),
|
|
1509
|
+
inset 0 1px 0 color-mix(in oklab, #fff 18%, transparent);
|
|
1510
|
+
font-size: 11px;
|
|
1511
|
+
font-weight: 800;
|
|
1512
|
+
}
|
|
1513
|
+
.cf-assistant-card__compact-avatar img {
|
|
1514
|
+
width: 100%;
|
|
1515
|
+
height: 100%;
|
|
1516
|
+
object-fit: cover;
|
|
1517
|
+
}
|
|
1518
|
+
.cf-assistant-card--pinned .cf-assistant-card__stage {
|
|
1519
|
+
height: 132px;
|
|
1520
|
+
min-height: 0;
|
|
1521
|
+
border-radius: 13px;
|
|
1522
|
+
}
|
|
1523
|
+
/* The stage sizes/positions the card's video area; .cf-assistant-card__media
|
|
1524
|
+
inside it stays overflow: hidden for the rounded image/video corners,
|
|
1525
|
+
while interactive controls sit as a stage sibling so their popovers
|
|
1526
|
+
aren't clipped by it. */
|
|
1527
|
+
.cf-assistant-card__stage {
|
|
1528
|
+
position: relative;
|
|
1529
|
+
border-radius: 12px;
|
|
1530
|
+
aspect-ratio: 16 / 9;
|
|
1531
|
+
}
|
|
1532
|
+
.cf-assistant-card__voice-only {
|
|
1533
|
+
position: relative;
|
|
1534
|
+
display: flex;
|
|
1535
|
+
align-items: center;
|
|
1536
|
+
justify-content: center;
|
|
1537
|
+
width: 100%;
|
|
1538
|
+
min-height: 44px;
|
|
1539
|
+
align-self: stretch;
|
|
1540
|
+
}
|
|
1541
|
+
.cf-assistant-card__media {
|
|
1542
|
+
position: absolute;
|
|
1543
|
+
inset: 0;
|
|
1544
|
+
overflow: hidden;
|
|
1545
|
+
border-radius: inherit;
|
|
1546
|
+
background: var(--cf-surface);
|
|
1547
|
+
border: 1px solid var(--cf-border);
|
|
1548
|
+
}
|
|
1549
|
+
.cf-assistant-card__stage--local {
|
|
1550
|
+
isolation: isolate;
|
|
1551
|
+
overflow: hidden;
|
|
1552
|
+
background:
|
|
1553
|
+
radial-gradient(circle at 30% 18%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 36%),
|
|
1554
|
+
linear-gradient(145deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
|
|
1555
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 82%, var(--cf-accent));
|
|
1556
|
+
box-shadow:
|
|
1557
|
+
inset 0 1px 0 color-mix(in oklab, #fff 9%, transparent),
|
|
1558
|
+
0 22px 44px -34px color-mix(in oklab, var(--cf-accent) 46%, #000);
|
|
1559
|
+
}
|
|
1560
|
+
.cf-assistant-card__stage--local.is-live {
|
|
1561
|
+
height: 188px;
|
|
1562
|
+
aspect-ratio: auto;
|
|
1563
|
+
}
|
|
1564
|
+
.cf-assistant-card--pinned .cf-assistant-card__stage--local.is-live {
|
|
1565
|
+
height: 154px;
|
|
1566
|
+
}
|
|
1567
|
+
.cf-assistant-card__stage--local.is-speaking {
|
|
1568
|
+
box-shadow:
|
|
1569
|
+
inset 0 1px 0 color-mix(in oklab, #fff 11%, transparent),
|
|
1570
|
+
0 20px 54px -28px color-mix(in oklab, var(--cf-accent) 72%, #000);
|
|
1571
|
+
}
|
|
1572
|
+
.cf-assistant-card__stage--local.is-listening {
|
|
1573
|
+
border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
|
|
1574
|
+
}
|
|
1575
|
+
.cf-assistant-card__stage--local.is-muted {
|
|
1576
|
+
filter: saturate(0.72);
|
|
1577
|
+
}
|
|
1578
|
+
.cf-assistant-card__stage--local .cf-assistant-card__media {
|
|
1579
|
+
z-index: 1;
|
|
1580
|
+
border: 0;
|
|
1581
|
+
background:
|
|
1582
|
+
radial-gradient(circle at 50% 42%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 38%),
|
|
1583
|
+
color-mix(in oklab, var(--cf-bg) 92%, var(--cf-surface));
|
|
1584
|
+
}
|
|
1585
|
+
.cf-assistant-card__media--uploaded::after {
|
|
1586
|
+
content: '';
|
|
1587
|
+
position: absolute;
|
|
1588
|
+
inset: 0;
|
|
1589
|
+
pointer-events: none;
|
|
1590
|
+
background:
|
|
1591
|
+
radial-gradient(circle at 50% 50%, transparent 28%, rgba(2, 6, 23, 0.08) 62%, rgba(2, 6, 23, 0.34) 100%),
|
|
1592
|
+
linear-gradient(180deg, transparent 52%, rgba(2, 6, 23, 0.26));
|
|
1593
|
+
}
|
|
1594
|
+
.cf-assistant-card__media img,
|
|
1595
|
+
.cf-assistant-card__media video {
|
|
1596
|
+
width: 100%;
|
|
1597
|
+
height: 100%;
|
|
1598
|
+
display: block;
|
|
1599
|
+
object-fit: cover;
|
|
1600
|
+
}
|
|
1601
|
+
.cf-avatar-aura {
|
|
1602
|
+
position: absolute;
|
|
1603
|
+
left: 50%;
|
|
1604
|
+
top: 50%;
|
|
1605
|
+
width: 104px;
|
|
1606
|
+
height: 104px;
|
|
1607
|
+
border-radius: 999px;
|
|
1608
|
+
transform: translate(-50%, -50%) scale(0.88);
|
|
1609
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 42%, transparent);
|
|
1610
|
+
opacity: 0;
|
|
1611
|
+
pointer-events: none;
|
|
1612
|
+
z-index: 3;
|
|
1613
|
+
}
|
|
1614
|
+
.cf-avatar-aura--two {
|
|
1615
|
+
width: 142px;
|
|
1616
|
+
height: 142px;
|
|
1617
|
+
}
|
|
1618
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--one {
|
|
1619
|
+
animation: cf-avatar-breathe 1.35s ease-in-out infinite;
|
|
1620
|
+
}
|
|
1621
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--two {
|
|
1622
|
+
animation: cf-avatar-breathe 1.35s ease-in-out infinite 0.32s;
|
|
1623
|
+
}
|
|
1624
|
+
.cf-avatar-listen-ring {
|
|
1625
|
+
position: absolute;
|
|
1626
|
+
left: 50%;
|
|
1627
|
+
top: 50%;
|
|
1628
|
+
width: calc(112px + (var(--cf-listen, 0.2) * 42px));
|
|
1629
|
+
height: calc(112px + (var(--cf-listen, 0.2) * 42px));
|
|
1630
|
+
border-radius: 999px;
|
|
1631
|
+
transform: translate(-50%, -50%);
|
|
1632
|
+
border: 2px solid color-mix(in oklab, var(--cf-accent) 58%, transparent);
|
|
1633
|
+
box-shadow: 0 0 calc(14px + (var(--cf-listen, 0.2) * 24px)) color-mix(in oklab, var(--cf-accent) 34%, transparent);
|
|
1634
|
+
opacity: 0;
|
|
1635
|
+
pointer-events: none;
|
|
1636
|
+
z-index: 4;
|
|
1637
|
+
}
|
|
1638
|
+
.cf-assistant-card__stage--local.is-listening .cf-avatar-listen-ring {
|
|
1639
|
+
opacity: calc(0.36 + (var(--cf-listen, 0.2) * 0.42));
|
|
1640
|
+
}
|
|
1641
|
+
.cf-avatar-wave {
|
|
1642
|
+
position: absolute;
|
|
1643
|
+
left: 50%;
|
|
1644
|
+
bottom: 46px;
|
|
1645
|
+
z-index: 6;
|
|
1646
|
+
display: inline-flex;
|
|
1647
|
+
align-items: center;
|
|
1648
|
+
justify-content: center;
|
|
1649
|
+
gap: 4px;
|
|
1650
|
+
min-width: 58px;
|
|
1651
|
+
height: 25px;
|
|
1652
|
+
padding: 5px 8px;
|
|
1653
|
+
border-radius: 999px;
|
|
1654
|
+
transform: translateX(-50%) translateY(8px);
|
|
1655
|
+
background: color-mix(in oklab, var(--cf-bg) 82%, transparent);
|
|
1656
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 36%, transparent);
|
|
1657
|
+
opacity: 0;
|
|
1658
|
+
pointer-events: none;
|
|
1659
|
+
backdrop-filter: blur(10px);
|
|
1660
|
+
}
|
|
1661
|
+
.cf-avatar-wave span {
|
|
1662
|
+
width: 4px;
|
|
1663
|
+
height: 8px;
|
|
1664
|
+
border-radius: 999px;
|
|
1665
|
+
background: color-mix(in oklab, var(--cf-accent) 88%, #fff);
|
|
1666
|
+
transform-origin: center;
|
|
1667
|
+
}
|
|
1668
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave {
|
|
1669
|
+
opacity: 1;
|
|
1670
|
+
transform: translateX(-50%) translateY(0);
|
|
1671
|
+
}
|
|
1672
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span {
|
|
1673
|
+
animation: cf-avatar-wave 0.58s ease-in-out infinite;
|
|
1674
|
+
}
|
|
1675
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(2) { animation-delay: 0.1s; }
|
|
1676
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(3) { animation-delay: 0.2s; }
|
|
1677
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(4) { animation-delay: 0.3s; }
|
|
1678
|
+
.cf-assistant-card__stage--local.is-thinking .cf-assistant-card__media::before {
|
|
1679
|
+
content: '';
|
|
1680
|
+
position: absolute;
|
|
1681
|
+
inset: -35%;
|
|
1682
|
+
z-index: 5;
|
|
1683
|
+
pointer-events: none;
|
|
1684
|
+
background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 20%, transparent) 50%, transparent 58%);
|
|
1685
|
+
animation: cf-avatar-thinking 1.45s ease-in-out infinite;
|
|
1686
|
+
}
|
|
1687
|
+
.cf-assistant-card__avatar-stage {
|
|
1688
|
+
position: absolute;
|
|
1689
|
+
inset: 0;
|
|
1690
|
+
display: grid;
|
|
1691
|
+
place-items: center;
|
|
1692
|
+
--cf-avatar-a: var(--cf-accent);
|
|
1693
|
+
--cf-avatar-b: color-mix(in oklab, var(--cf-accent) 70%, #0f1f2e);
|
|
1694
|
+
--cf-avatar-glow: color-mix(in oklab, var(--cf-accent) 38%, transparent);
|
|
1695
|
+
background:
|
|
1696
|
+
radial-gradient(circle at 35% 30%, var(--cf-avatar-glow), transparent 32%),
|
|
1697
|
+
linear-gradient(145deg, color-mix(in oklab, var(--cf-avatar-a) 18%, var(--cf-bg)), var(--cf-surface-2));
|
|
1698
|
+
}
|
|
1699
|
+
.cf-assistant-card__face {
|
|
1700
|
+
position: relative;
|
|
1701
|
+
width: 128px;
|
|
1702
|
+
height: 128px;
|
|
1703
|
+
border-radius: 999px;
|
|
1704
|
+
display: grid;
|
|
1705
|
+
place-items: center;
|
|
1706
|
+
color: #fff;
|
|
1707
|
+
background: linear-gradient(145deg, var(--cf-avatar-a), var(--cf-avatar-b));
|
|
1708
|
+
box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.75);
|
|
1709
|
+
z-index: 2;
|
|
1710
|
+
}
|
|
1711
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__face {
|
|
1712
|
+
animation: cf-avatar-nod 1.6s ease-in-out infinite;
|
|
1713
|
+
}
|
|
1714
|
+
.cf-assistant-card__stage--local.is-listening .cf-assistant-card__face {
|
|
1715
|
+
box-shadow:
|
|
1716
|
+
0 22px 44px -28px rgba(0, 0, 0, 0.75),
|
|
1717
|
+
0 0 0 calc(5px + (var(--cf-listen, 0.2) * 6px)) color-mix(in oklab, var(--cf-accent) 16%, transparent);
|
|
1718
|
+
}
|
|
1719
|
+
.cf-assistant-card--pinned .cf-assistant-card__face {
|
|
1720
|
+
width: 72px;
|
|
1721
|
+
height: 72px;
|
|
1722
|
+
}
|
|
1723
|
+
.cf-avatar-preset--support-guide {
|
|
1724
|
+
--cf-avatar-a: #10b981;
|
|
1725
|
+
--cf-avatar-b: #0f766e;
|
|
1726
|
+
--cf-avatar-glow: rgba(16, 185, 129, 0.34);
|
|
1727
|
+
}
|
|
1728
|
+
.cf-avatar-preset--sales-host {
|
|
1729
|
+
--cf-avatar-a: #3b82f6;
|
|
1730
|
+
--cf-avatar-b: #4338ca;
|
|
1731
|
+
--cf-avatar-glow: rgba(59, 130, 246, 0.34);
|
|
1732
|
+
}
|
|
1733
|
+
.cf-avatar-preset--calm-advisor {
|
|
1734
|
+
--cf-avatar-a: #64748b;
|
|
1735
|
+
--cf-avatar-b: #0f172a;
|
|
1736
|
+
--cf-avatar-glow: rgba(100, 116, 139, 0.34);
|
|
1737
|
+
}
|
|
1738
|
+
.cf-avatar-preset--technical-guide {
|
|
1739
|
+
--cf-avatar-a: #06b6d4;
|
|
1740
|
+
--cf-avatar-b: #1d4ed8;
|
|
1741
|
+
--cf-avatar-glow: rgba(6, 182, 212, 0.34);
|
|
1742
|
+
}
|
|
1743
|
+
.cf-avatar-preset--school-desk {
|
|
1744
|
+
--cf-avatar-a: #8b5cf6;
|
|
1745
|
+
--cf-avatar-b: #6d28d9;
|
|
1746
|
+
--cf-avatar-glow: rgba(139, 92, 246, 0.34);
|
|
1747
|
+
}
|
|
1748
|
+
.cf-avatar-preset--front-office {
|
|
1749
|
+
--cf-avatar-a: #f59e0b;
|
|
1750
|
+
--cf-avatar-b: #c2410c;
|
|
1751
|
+
--cf-avatar-glow: rgba(245, 158, 11, 0.34);
|
|
1752
|
+
}
|
|
1753
|
+
.cf-assistant-card__initials {
|
|
1754
|
+
transform: translateY(-12px);
|
|
1755
|
+
font-size: 34px;
|
|
1756
|
+
font-weight: 800;
|
|
1757
|
+
}
|
|
1758
|
+
.cf-assistant-card--pinned .cf-assistant-card__initials {
|
|
1759
|
+
transform: translateY(-6px);
|
|
1760
|
+
font-size: 19px;
|
|
1761
|
+
}
|
|
1762
|
+
.cf-assistant-card__eye {
|
|
1763
|
+
position: absolute;
|
|
1764
|
+
top: 58px;
|
|
1765
|
+
width: 8px;
|
|
1766
|
+
height: 8px;
|
|
1767
|
+
border-radius: 999px;
|
|
1768
|
+
background: rgba(255, 255, 255, 0.9);
|
|
1769
|
+
}
|
|
1770
|
+
.cf-assistant-card__eye--left { left: 42px; }
|
|
1771
|
+
.cf-assistant-card__eye--right { right: 42px; }
|
|
1772
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye {
|
|
1773
|
+
top: 33px;
|
|
1774
|
+
width: 5px;
|
|
1775
|
+
height: 5px;
|
|
1776
|
+
}
|
|
1777
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye--left { left: 23px; }
|
|
1778
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye--right { right: 23px; }
|
|
1779
|
+
.cf-assistant-card__mouth {
|
|
1780
|
+
position: absolute;
|
|
1781
|
+
left: 50%;
|
|
1782
|
+
bottom: 31px;
|
|
1783
|
+
width: 34px;
|
|
1784
|
+
height: 6px;
|
|
1785
|
+
transform: translateX(-50%);
|
|
1786
|
+
border-radius: 999px;
|
|
1787
|
+
background: rgba(255, 255, 255, 0.9);
|
|
1788
|
+
}
|
|
1789
|
+
.cf-assistant-card--pinned .cf-assistant-card__mouth {
|
|
1790
|
+
bottom: 18px;
|
|
1791
|
+
width: 20px;
|
|
1792
|
+
height: 4px;
|
|
1793
|
+
}
|
|
1794
|
+
.cf-assistant-card.is-speaking .cf-assistant-card__mouth {
|
|
1795
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
1796
|
+
}
|
|
1797
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth {
|
|
1798
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
1799
|
+
}
|
|
1800
|
+
.cf-assistant-card__mouth--overlay {
|
|
1801
|
+
z-index: 6;
|
|
1802
|
+
bottom: 39px;
|
|
1803
|
+
width: 42px;
|
|
1804
|
+
height: 7px;
|
|
1805
|
+
opacity: 0;
|
|
1806
|
+
background: color-mix(in oklab, #fff 90%, var(--cf-accent));
|
|
1807
|
+
box-shadow:
|
|
1808
|
+
0 0 0 4px rgba(2, 6, 23, 0.22),
|
|
1809
|
+
0 10px 22px -10px rgba(0, 0, 0, 0.85);
|
|
1810
|
+
}
|
|
1811
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth--overlay {
|
|
1812
|
+
opacity: 1;
|
|
1813
|
+
}
|
|
1814
|
+
.cf-assistant-card--pinned .cf-assistant-card__mouth--overlay {
|
|
1815
|
+
bottom: 42px;
|
|
1816
|
+
}
|
|
1817
|
+
@keyframes cf-mouth-talk {
|
|
1818
|
+
from { height: 5px; width: 28px; border-radius: 999px; }
|
|
1819
|
+
to { height: 20px; width: 22px; border-radius: 45% 45% 55% 55%; }
|
|
1820
|
+
}
|
|
1821
|
+
@keyframes cf-avatar-breathe {
|
|
1822
|
+
0%, 100% { opacity: 0.16; transform: translate(-50%, -50%) scale(0.82); }
|
|
1823
|
+
50% { opacity: 0.58; transform: translate(-50%, -50%) scale(1.12); }
|
|
1824
|
+
}
|
|
1825
|
+
@keyframes cf-avatar-wave {
|
|
1826
|
+
0%, 100% { transform: scaleY(0.62); opacity: 0.72; }
|
|
1827
|
+
50% { transform: scaleY(1.85); opacity: 1; }
|
|
1828
|
+
}
|
|
1829
|
+
@keyframes cf-avatar-thinking {
|
|
1830
|
+
0% { transform: translateX(-18%); opacity: 0; }
|
|
1831
|
+
38% { opacity: 1; }
|
|
1832
|
+
100% { transform: translateX(18%); opacity: 0; }
|
|
1833
|
+
}
|
|
1834
|
+
@keyframes cf-avatar-nod {
|
|
1835
|
+
0%, 100% { transform: translateY(0) scale(1); }
|
|
1836
|
+
45% { transform: translateY(-2px) scale(1.012); }
|
|
1837
|
+
}
|
|
1838
|
+
.cf-assistant-card__speak {
|
|
1839
|
+
position: absolute;
|
|
1840
|
+
left: 50%;
|
|
1841
|
+
bottom: 12px;
|
|
1842
|
+
transform: translateX(-50%);
|
|
1843
|
+
display: inline-flex;
|
|
1844
|
+
align-items: center;
|
|
1845
|
+
gap: 7px;
|
|
1846
|
+
max-width: calc(100% - 24px);
|
|
1847
|
+
padding: 8px 12px;
|
|
1848
|
+
border-radius: 999px;
|
|
1849
|
+
background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
|
|
1850
|
+
color: var(--cf-accent);
|
|
1851
|
+
box-shadow: 0 10px 22px -14px rgba(15, 30, 42, 0.6);
|
|
1852
|
+
font-size: 12.5px;
|
|
1853
|
+
font-weight: 700;
|
|
1854
|
+
white-space: nowrap;
|
|
1855
|
+
}
|
|
1856
|
+
.cf-assistant-card--pinned .cf-assistant-card__speak {
|
|
1857
|
+
padding: 6px 10px;
|
|
1858
|
+
font-size: 11.5px;
|
|
1859
|
+
}
|
|
1860
|
+
.cf-assistant-card__speak svg { width: 15px; height: 15px; }
|
|
1861
|
+
.cf-assistant-card__voice-only .cf-assistant-card__speak,
|
|
1862
|
+
.cf-assistant-card__voice-only .cf-call-controls {
|
|
1863
|
+
position: static;
|
|
1864
|
+
transform: none;
|
|
1865
|
+
max-width: 100%;
|
|
1866
|
+
}
|
|
1867
|
+
.cf-assistant-card--connecting {
|
|
1868
|
+
min-height: 100%;
|
|
1869
|
+
display: grid;
|
|
1870
|
+
place-items: center;
|
|
1871
|
+
align-content: center;
|
|
1872
|
+
gap: 18px;
|
|
1873
|
+
padding: 34px 24px 42px;
|
|
1874
|
+
text-align: center;
|
|
1875
|
+
border-top: 1px solid var(--cf-border);
|
|
1876
|
+
background:
|
|
1877
|
+
radial-gradient(circle at 50% 38%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 36%),
|
|
1878
|
+
linear-gradient(180deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
|
|
1879
|
+
}
|
|
1880
|
+
.cf-assistant-card__connecting-avatar {
|
|
1881
|
+
position: relative;
|
|
1882
|
+
width: 118px;
|
|
1883
|
+
height: 118px;
|
|
1884
|
+
display: grid;
|
|
1885
|
+
place-items: center;
|
|
1886
|
+
}
|
|
1887
|
+
.cf-assistant-card__connecting-avatar img,
|
|
1888
|
+
.cf-assistant-card__connecting-face {
|
|
1889
|
+
width: 92px;
|
|
1890
|
+
height: 92px;
|
|
1891
|
+
border-radius: 999px;
|
|
1892
|
+
display: grid;
|
|
1893
|
+
place-items: center;
|
|
1894
|
+
object-fit: cover;
|
|
1895
|
+
color: #fff;
|
|
1896
|
+
font-size: 28px;
|
|
1897
|
+
font-weight: 850;
|
|
1898
|
+
letter-spacing: -0.04em;
|
|
1899
|
+
background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
|
|
1900
|
+
border: 1px solid color-mix(in oklab, #fff 30%, transparent);
|
|
1901
|
+
box-shadow:
|
|
1902
|
+
0 22px 48px -24px color-mix(in oklab, var(--cf-accent) 60%, #000),
|
|
1903
|
+
0 0 0 8px color-mix(in oklab, var(--cf-accent) 10%, transparent);
|
|
1904
|
+
z-index: 2;
|
|
1905
|
+
}
|
|
1906
|
+
.cf-assistant-card__connecting-copy {
|
|
1907
|
+
display: grid;
|
|
1908
|
+
gap: 6px;
|
|
1909
|
+
}
|
|
1910
|
+
.cf-assistant-card__connecting-eyebrow {
|
|
1911
|
+
color: var(--cf-muted);
|
|
1912
|
+
font-size: 11px;
|
|
1913
|
+
font-weight: 800;
|
|
1914
|
+
letter-spacing: 0.12em;
|
|
1915
|
+
text-transform: uppercase;
|
|
1916
|
+
}
|
|
1917
|
+
.cf-assistant-card__connecting-copy strong {
|
|
1918
|
+
color: var(--cf-text);
|
|
1919
|
+
font-size: 18px;
|
|
1920
|
+
line-height: 1.25;
|
|
1921
|
+
}
|
|
1922
|
+
.cf-assistant-card--connecting .cf-call-ripple {
|
|
1923
|
+
inset: -18px;
|
|
1924
|
+
border-radius: 999px;
|
|
1925
|
+
}
|
|
1926
|
+
.cf-assistant-card--connecting .cf-call-ripple span {
|
|
1927
|
+
width: 92px;
|
|
1928
|
+
height: 92px;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
/* ---------- Call "working" ripple ----------
|
|
1932
|
+
Concentric rings pulsing out from the avatar's center while the call is
|
|
1933
|
+
connecting / transcribing / waiting for the reply โ the classic "ringing
|
|
1934
|
+
call" cue, so busy moments read as live activity instead of a freeze. */
|
|
1935
|
+
.cf-call-ripple {
|
|
1936
|
+
position: absolute;
|
|
1937
|
+
inset: 0;
|
|
1938
|
+
display: grid;
|
|
1939
|
+
place-items: center;
|
|
1940
|
+
pointer-events: none;
|
|
1941
|
+
overflow: hidden;
|
|
1942
|
+
border-radius: inherit;
|
|
1943
|
+
}
|
|
1944
|
+
.cf-call-ripple span {
|
|
1945
|
+
position: absolute;
|
|
1946
|
+
width: 74px;
|
|
1947
|
+
height: 74px;
|
|
1948
|
+
border-radius: 999px;
|
|
1949
|
+
border: 2px solid var(--cf-accent);
|
|
1950
|
+
opacity: 0;
|
|
1951
|
+
animation: cf-call-ripple 1.8s ease-out infinite;
|
|
1952
|
+
}
|
|
1953
|
+
.cf-call-ripple span:nth-child(2) { animation-delay: 0.6s; }
|
|
1954
|
+
.cf-call-ripple span:nth-child(3) { animation-delay: 1.2s; }
|
|
1955
|
+
@keyframes cf-call-ripple {
|
|
1956
|
+
0% { transform: scale(0.9); opacity: 0.55; }
|
|
1957
|
+
100% { transform: scale(2.6); opacity: 0; }
|
|
1958
|
+
}
|
|
1959
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1960
|
+
.cf-call-ripple span { animation: none; opacity: 0.25; transform: scale(1.4); }
|
|
1961
|
+
.cf-call-ripple span:nth-child(2), .cf-call-ripple span:nth-child(3) { display: none; }
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
/* ---------- In-call controls (mic / audio picker / expand / minimize / end) ---------- */
|
|
1965
|
+
.cf-call-controls {
|
|
1966
|
+
position: absolute;
|
|
1967
|
+
left: 50%;
|
|
1968
|
+
bottom: 12px;
|
|
1969
|
+
transform: translateX(-50%);
|
|
1970
|
+
display: inline-flex;
|
|
1971
|
+
align-items: center;
|
|
1972
|
+
gap: 4px;
|
|
1973
|
+
max-width: calc(100% - 24px);
|
|
1974
|
+
padding: 5px 7px;
|
|
1975
|
+
border-radius: 999px;
|
|
1976
|
+
background: color-mix(in oklab, var(--cf-bg) 94%, transparent);
|
|
1977
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 72%, transparent);
|
|
1978
|
+
box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7);
|
|
1979
|
+
z-index: 30;
|
|
1980
|
+
}
|
|
1981
|
+
.cf-assistant-card--pinned .cf-call-controls { padding: 4px 6px; gap: 4px; }
|
|
1982
|
+
.cf-call-btn {
|
|
1983
|
+
position: relative;
|
|
1984
|
+
flex-shrink: 0;
|
|
1985
|
+
width: 30px;
|
|
1986
|
+
height: 30px;
|
|
1987
|
+
border-radius: 999px;
|
|
1988
|
+
display: inline-flex;
|
|
1989
|
+
align-items: center;
|
|
1990
|
+
justify-content: center;
|
|
1991
|
+
gap: 6px;
|
|
1992
|
+
color: var(--cf-text);
|
|
1993
|
+
background: color-mix(in oklab, var(--cf-surface) 88%, transparent);
|
|
1994
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 76%, transparent);
|
|
1995
|
+
transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
|
|
1996
|
+
}
|
|
1997
|
+
.cf-call-btn:hover { background: color-mix(in oklab, var(--cf-accent) 10%, var(--cf-surface)); }
|
|
1998
|
+
.cf-call-btn:active { transform: scale(0.94); }
|
|
1999
|
+
.cf-call-btn svg { width: 14px; height: 14px; }
|
|
2000
|
+
.cf-call-btn--microphones {
|
|
2001
|
+
width: 24px;
|
|
2002
|
+
margin-left: -5px;
|
|
2003
|
+
border-top-left-radius: 10px;
|
|
2004
|
+
border-bottom-left-radius: 10px;
|
|
2005
|
+
}
|
|
2006
|
+
.cf-call-btn--microphones svg { width: 13px; height: 13px; }
|
|
2007
|
+
.cf-call-btn--restore svg { width: 15px; height: 15px; }
|
|
2008
|
+
.cf-call-btn.is-muted {
|
|
2009
|
+
color: #fff;
|
|
2010
|
+
background: var(--cf-muted);
|
|
2011
|
+
border-color: transparent;
|
|
2012
|
+
}
|
|
2013
|
+
/* Live-listening cue: a soft ring around the mic button that breathes with
|
|
2014
|
+
the mic level, instead of a separate waveform element eating up row width. */
|
|
2015
|
+
.cf-call-btn.is-listening::after {
|
|
2016
|
+
content: '';
|
|
2017
|
+
position: absolute;
|
|
2018
|
+
inset: -4px;
|
|
2019
|
+
border-radius: inherit;
|
|
2020
|
+
border: 2px solid var(--cf-accent);
|
|
2021
|
+
opacity: calc(0.25 + var(--cf-wave, 0.2) * 0.5);
|
|
2022
|
+
transform: scale(calc(1 + var(--cf-wave, 0.2) * 0.22));
|
|
2023
|
+
transition: transform 0.09s ease, opacity 0.09s ease;
|
|
2024
|
+
pointer-events: none;
|
|
2025
|
+
}
|
|
2026
|
+
/* Your voice is actually registering: the mic fills with the accent color
|
|
2027
|
+
and the ring flares, so "it hears me" is unmistakable at a glance. */
|
|
2028
|
+
.cf-call-btn.is-listening.is-hot {
|
|
2029
|
+
color: var(--cf-accent-ink);
|
|
2030
|
+
background: var(--cf-accent);
|
|
2031
|
+
border-color: transparent;
|
|
2032
|
+
}
|
|
2033
|
+
.cf-call-btn.is-listening.is-hot::after {
|
|
2034
|
+
border-width: 3px;
|
|
2035
|
+
opacity: calc(0.5 + var(--cf-wave, 0.2) * 0.5);
|
|
2036
|
+
transform: scale(calc(1.08 + var(--cf-wave, 0.2) * 0.35));
|
|
2037
|
+
box-shadow: 0 0 12px 2px color-mix(in oklab, var(--cf-accent) 55%, transparent);
|
|
2038
|
+
}
|
|
2039
|
+
.cf-call-btn--talk {
|
|
2040
|
+
color: var(--cf-accent-ink);
|
|
2041
|
+
background: var(--cf-accent);
|
|
2042
|
+
border-color: transparent;
|
|
2043
|
+
}
|
|
2044
|
+
.cf-call-btn--end {
|
|
2045
|
+
color: #fff;
|
|
2046
|
+
background: #e5484d;
|
|
2047
|
+
border-color: transparent;
|
|
2048
|
+
}
|
|
2049
|
+
.cf-call-btn--end:hover { background: #dc3d42; }
|
|
2050
|
+
/* Microphone selector popover. */
|
|
2051
|
+
.cf-call-more { position: static; display: inline-flex; z-index: 40; }
|
|
2052
|
+
.cf-call-menu {
|
|
2053
|
+
position: absolute;
|
|
2054
|
+
top: calc(100% + 8px);
|
|
2055
|
+
bottom: auto;
|
|
2056
|
+
left: 50%;
|
|
2057
|
+
transform: translateX(-50%);
|
|
2058
|
+
display: flex;
|
|
2059
|
+
flex-direction: column;
|
|
2060
|
+
gap: 2px;
|
|
2061
|
+
width: min(240px, calc(var(--cf-panel-w, 388px) - 72px), calc(100vw - 64px));
|
|
2062
|
+
min-width: 0;
|
|
2063
|
+
max-width: calc(100vw - 64px);
|
|
2064
|
+
max-height: min(300px, calc(100vh - 220px));
|
|
2065
|
+
overflow-y: auto;
|
|
2066
|
+
padding: 8px;
|
|
2067
|
+
border-radius: 14px;
|
|
2068
|
+
background: color-mix(in oklab, var(--cf-bg) 98%, #000);
|
|
2069
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
|
|
2070
|
+
box-shadow: 0 18px 45px -20px rgba(0, 0, 0, 0.78);
|
|
2071
|
+
z-index: 60;
|
|
2072
|
+
}
|
|
2073
|
+
.cf-call-menu__label {
|
|
2074
|
+
margin: 8px 8px 4px;
|
|
2075
|
+
color: var(--cf-muted);
|
|
2076
|
+
font-size: 11px;
|
|
2077
|
+
font-weight: 700;
|
|
2078
|
+
text-transform: uppercase;
|
|
2079
|
+
letter-spacing: 0.08em;
|
|
2080
|
+
}
|
|
2081
|
+
.cf-call-menu__item {
|
|
2082
|
+
display: flex;
|
|
2083
|
+
align-items: center;
|
|
2084
|
+
gap: 8px;
|
|
2085
|
+
min-width: 0;
|
|
2086
|
+
padding: 8px 9px;
|
|
2087
|
+
border-radius: 10px;
|
|
2088
|
+
color: var(--cf-text);
|
|
2089
|
+
font-size: 12.5px;
|
|
2090
|
+
text-align: left;
|
|
2091
|
+
white-space: nowrap;
|
|
2092
|
+
overflow: hidden;
|
|
2093
|
+
}
|
|
2094
|
+
.cf-call-menu__item span:last-child {
|
|
2095
|
+
min-width: 0;
|
|
2096
|
+
overflow: hidden;
|
|
2097
|
+
text-overflow: ellipsis;
|
|
2098
|
+
}
|
|
2099
|
+
.cf-call-menu__item:hover { background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-surface)); }
|
|
2100
|
+
.cf-call-menu__item.is-active { color: var(--cf-accent); font-weight: 600; }
|
|
2101
|
+
.cf-call-menu__item svg { width: 13px; height: 13px; flex-shrink: 0; }
|
|
2102
|
+
.cf-call-menu__spacer { width: 13px; flex-shrink: 0; }
|
|
2103
|
+
/* Detached floating avatar card โ replaces the launcher while a call runs minimized. */
|
|
2104
|
+
.cf-floating-call-card {
|
|
2105
|
+
position: fixed;
|
|
2106
|
+
bottom: var(--cf-v-pad, 20px);
|
|
2107
|
+
right: var(--cf-h-pad, 20px);
|
|
2108
|
+
z-index: 1;
|
|
2109
|
+
pointer-events: auto;
|
|
2110
|
+
width: min(340px, calc(100vw - 32px));
|
|
2111
|
+
aspect-ratio: 16 / 9;
|
|
2112
|
+
overflow: hidden;
|
|
2113
|
+
border-radius: 14px;
|
|
2114
|
+
background: var(--cf-bg);
|
|
2115
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
|
|
2116
|
+
box-shadow: 0 20px 48px -20px rgba(0, 0, 0, 0.72);
|
|
2117
|
+
animation: cf-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
|
2118
|
+
}
|
|
2119
|
+
.cf-root[data-align='left'] .cf-floating-call-card { right: auto; left: var(--cf-h-pad, 20px); }
|
|
2120
|
+
.cf-floating-call-card__media,
|
|
2121
|
+
.cf-floating-call-card__shade {
|
|
2122
|
+
position: absolute;
|
|
2123
|
+
inset: 0;
|
|
2124
|
+
}
|
|
2125
|
+
.cf-floating-call-card__media img,
|
|
2126
|
+
.cf-floating-call-card__media video {
|
|
2127
|
+
width: 100%;
|
|
2128
|
+
height: 100%;
|
|
2129
|
+
object-fit: cover;
|
|
2130
|
+
}
|
|
2131
|
+
.cf-floating-call-card__shade {
|
|
2132
|
+
background:
|
|
2133
|
+
linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18)),
|
|
2134
|
+
radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 42%);
|
|
2135
|
+
pointer-events: none;
|
|
2136
|
+
}
|
|
2137
|
+
.cf-floating-call-card__avatar {
|
|
2138
|
+
position: absolute;
|
|
2139
|
+
inset: 0;
|
|
2140
|
+
display: flex;
|
|
2141
|
+
align-items: center;
|
|
2142
|
+
justify-content: center;
|
|
2143
|
+
color: #fff;
|
|
2144
|
+
background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
|
|
2145
|
+
}
|
|
2146
|
+
.cf-floating-call-card.is-muted {
|
|
2147
|
+
filter: saturate(0.72);
|
|
2148
|
+
}
|
|
2149
|
+
.cf-floating-call-card.is-listening {
|
|
2150
|
+
border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
|
|
2151
|
+
box-shadow:
|
|
2152
|
+
0 20px 48px -20px rgba(0, 0, 0, 0.72),
|
|
2153
|
+
0 0 calc(12px + (var(--cf-listen, 0.2) * 18px)) color-mix(in oklab, var(--cf-accent) 28%, transparent);
|
|
2154
|
+
}
|
|
2155
|
+
.cf-floating-call-card.is-thinking .cf-floating-call-card__shade::before {
|
|
2156
|
+
content: '';
|
|
2157
|
+
position: absolute;
|
|
2158
|
+
inset: -45%;
|
|
2159
|
+
background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 22%, transparent) 50%, transparent 58%);
|
|
2160
|
+
animation: cf-avatar-thinking 1.45s ease-in-out infinite;
|
|
2161
|
+
}
|
|
2162
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__avatar,
|
|
2163
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__media img {
|
|
2164
|
+
animation: cf-avatar-nod 1.6s ease-in-out infinite;
|
|
2165
|
+
}
|
|
2166
|
+
.cf-floating-call-card__avatar > span:first-child {
|
|
2167
|
+
font-size: clamp(64px, 22vw, 118px);
|
|
2168
|
+
font-weight: 800;
|
|
2169
|
+
line-height: 1;
|
|
2170
|
+
}
|
|
2171
|
+
.cf-floating-call-card__eye,
|
|
2172
|
+
.cf-floating-call-card__mouth {
|
|
2173
|
+
position: absolute;
|
|
2174
|
+
background: rgba(255, 255, 255, 0.9);
|
|
2175
|
+
}
|
|
2176
|
+
.cf-floating-call-card__eye {
|
|
2177
|
+
top: 37%;
|
|
2178
|
+
width: 8px;
|
|
2179
|
+
height: 8px;
|
|
2180
|
+
border-radius: 999px;
|
|
2181
|
+
}
|
|
2182
|
+
.cf-floating-call-card__eye--left { left: 38%; }
|
|
2183
|
+
.cf-floating-call-card__eye--right { right: 38%; }
|
|
2184
|
+
.cf-floating-call-card__mouth {
|
|
2185
|
+
bottom: 31%;
|
|
2186
|
+
width: 34px;
|
|
2187
|
+
height: 6px;
|
|
2188
|
+
border-radius: 999px;
|
|
2189
|
+
}
|
|
2190
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__mouth {
|
|
2191
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
2192
|
+
}
|
|
2193
|
+
.cf-floating-call-card__controls {
|
|
2194
|
+
position: absolute;
|
|
2195
|
+
left: 50%;
|
|
2196
|
+
bottom: 12px;
|
|
2197
|
+
transform: translateX(-50%);
|
|
2198
|
+
display: inline-flex;
|
|
2199
|
+
align-items: center;
|
|
2200
|
+
gap: 4px;
|
|
2201
|
+
padding: 5px 7px;
|
|
2202
|
+
border-radius: 999px;
|
|
2203
|
+
background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
|
|
2204
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 70%, transparent);
|
|
2205
|
+
box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.74);
|
|
2206
|
+
}
|
|
2207
|
+
.cf-assistant-card__copy {
|
|
2208
|
+
margin: 0;
|
|
2209
|
+
color: var(--cf-text);
|
|
2210
|
+
font-size: 14px;
|
|
2211
|
+
line-height: 1.55;
|
|
2212
|
+
}
|
|
2213
|
+
.cf-assistant-card__chips {
|
|
2214
|
+
display: flex;
|
|
2215
|
+
flex-wrap: wrap;
|
|
2216
|
+
gap: 7px;
|
|
2217
|
+
}
|
|
2218
|
+
.cf-assistant-card__chip {
|
|
2219
|
+
max-width: 100%;
|
|
2220
|
+
border-radius: 6px;
|
|
2221
|
+
padding: 7px 9px;
|
|
2222
|
+
background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-bg));
|
|
2223
|
+
color: var(--cf-accent);
|
|
2224
|
+
font-size: 12.5px;
|
|
2225
|
+
line-height: 1.2;
|
|
2226
|
+
}
|
|
2227
|
+
.cf-assistant-card__chip:hover { background: color-mix(in oklab, var(--cf-accent) 18%, var(--cf-bg)); }
|
|
2228
|
+
.cf-assistant-card__privacy {
|
|
2229
|
+
margin: -2px 0 0;
|
|
2230
|
+
color: var(--cf-muted);
|
|
2231
|
+
font-size: 10.5px;
|
|
2232
|
+
line-height: 1.4;
|
|
2233
|
+
text-align: center;
|
|
2234
|
+
}
|
|
2235
|
+
.cf-assistant-card__privacy a {
|
|
2236
|
+
color: var(--cf-muted);
|
|
2237
|
+
text-decoration: underline;
|
|
2238
|
+
text-underline-offset: 2px;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
/* Offline presence dot (amber instead of green). */
|
|
2242
|
+
.cf-header__status--offline::before { background: #e2c07e; box-shadow: 0 0 0 2px rgba(226, 192, 126, 0.3); }
|
|
2243
|
+
|
|
2244
|
+
/* Disclaimer fine-print under the composer. */
|
|
2245
|
+
.cf-disclaimer { padding: 0 16px 2px; font-size: 10.5px; line-height: 1.45; color: var(--cf-muted); text-align: center; }
|
|
2246
|
+
|
|
2247
|
+
/* Read-only banner shown while viewing a past conversation. */
|
|
2248
|
+
.cf-viewing-banner {
|
|
2249
|
+
padding: 7px 16px;
|
|
2250
|
+
font-size: 12px;
|
|
2251
|
+
font-weight: 600;
|
|
2252
|
+
text-align: center;
|
|
2253
|
+
color: var(--cf-muted);
|
|
2254
|
+
background: var(--cf-surface);
|
|
2255
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2256
|
+
flex-shrink: 0;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
/* Past-conversations history panel (over the chat, like the confirm dialog). */
|
|
2260
|
+
.cf-history {
|
|
2261
|
+
width: min(340px, 90%);
|
|
2262
|
+
max-height: 70%;
|
|
2263
|
+
display: flex;
|
|
2264
|
+
flex-direction: column;
|
|
2265
|
+
background: var(--cf-bg);
|
|
2266
|
+
border-radius: 14px;
|
|
2267
|
+
box-shadow: var(--cf-shadow);
|
|
2268
|
+
overflow: hidden;
|
|
2269
|
+
}
|
|
2270
|
+
.cf-history__head {
|
|
2271
|
+
display: flex;
|
|
2272
|
+
align-items: center;
|
|
2273
|
+
justify-content: space-between;
|
|
2274
|
+
padding: 12px 14px;
|
|
2275
|
+
font-size: 14px;
|
|
2276
|
+
font-weight: 700;
|
|
2277
|
+
color: var(--cf-text);
|
|
2278
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2279
|
+
}
|
|
2280
|
+
.cf-history__list { overflow-y: auto; padding: 6px; }
|
|
2281
|
+
.cf-history__item {
|
|
2282
|
+
display: flex;
|
|
2283
|
+
flex-direction: column;
|
|
2284
|
+
gap: 2px;
|
|
2285
|
+
width: 100%;
|
|
2286
|
+
text-align: left;
|
|
2287
|
+
padding: 9px 10px;
|
|
2288
|
+
border-radius: 9px;
|
|
2289
|
+
cursor: pointer;
|
|
2290
|
+
transition: background 0.15s ease;
|
|
2291
|
+
}
|
|
2292
|
+
.cf-history__item:hover { background: var(--cf-surface); }
|
|
2293
|
+
.cf-history__item.is-active { background: var(--cf-surface); }
|
|
2294
|
+
.cf-history__title { font-size: 13px; color: var(--cf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
2295
|
+
.cf-history__meta { font-size: 11px; color: var(--cf-muted); }
|
|
2296
|
+
|
|
2297
|
+
/* Ended-conversation bar โ replaces the composer once the chat is closed. */
|
|
2298
|
+
.cf-ended {
|
|
2299
|
+
display: flex;
|
|
2300
|
+
flex-direction: column;
|
|
2301
|
+
align-items: center;
|
|
2302
|
+
gap: 10px;
|
|
2303
|
+
padding: 14px 16px 16px;
|
|
2304
|
+
flex-shrink: 0;
|
|
2305
|
+
text-align: center;
|
|
2306
|
+
}
|
|
2307
|
+
.cf-ended__text { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--cf-muted); }
|
|
2308
|
+
.cf-csat { display: inline-flex; align-items: center; gap: 8px; }
|
|
2309
|
+
.cf-csat__q { font-size: 12.5px; color: var(--cf-muted); }
|
|
2310
|
+
.cf-csat__btn {
|
|
2311
|
+
display: inline-flex;
|
|
2312
|
+
align-items: center;
|
|
2313
|
+
justify-content: center;
|
|
2314
|
+
width: 30px;
|
|
2315
|
+
height: 30px;
|
|
2316
|
+
border-radius: 8px;
|
|
2317
|
+
color: var(--cf-muted);
|
|
2318
|
+
cursor: pointer;
|
|
2319
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
2320
|
+
}
|
|
2321
|
+
.cf-csat__btn:hover { background: var(--cf-surface); color: var(--cf-accent); }
|
|
2322
|
+
.cf-csat__btn svg { width: 16px; height: 16px; }
|
|
2323
|
+
.cf-ended__btn {
|
|
2324
|
+
font-size: 13px;
|
|
2325
|
+
font-weight: 600;
|
|
2326
|
+
color: var(--cf-accent-ink);
|
|
2327
|
+
background: var(--cf-accent);
|
|
2328
|
+
border: none;
|
|
2329
|
+
border-radius: 999px;
|
|
2330
|
+
padding: 9px 18px;
|
|
2331
|
+
cursor: pointer;
|
|
2332
|
+
transition: opacity 0.15s ease;
|
|
2333
|
+
}
|
|
2334
|
+
.cf-ended__btn:hover { opacity: 0.9; }
|
|
2335
|
+
.cf-ended__btn:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
|
|
1002
2336
|
|
|
1003
2337
|
/* "โ New messages" pill โ shown when a reply streams in while scrolled up. */
|
|
1004
2338
|
.cf-newmsg {
|
|
@@ -1012,142 +2346,708 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
|
|
|
1012
2346
|
pointer-events: auto;
|
|
1013
2347
|
display: inline-flex;
|
|
1014
2348
|
align-items: center;
|
|
1015
|
-
gap: 6px;
|
|
1016
|
-
font-size: 12.5px;
|
|
1017
|
-
font-weight: 600;
|
|
1018
|
-
color: var(--cf-accent-ink);
|
|
1019
|
-
background: linear-gradient(135deg, var(--cf-accent, #2f7f55) 0%, var(--cf-accent-2, #2f7de8) 160%);
|
|
1020
|
-
border-radius: 999px;
|
|
1021
|
-
padding: 7px 14px;
|
|
1022
|
-
box-shadow: var(--cf-shadow);
|
|
1023
|
-
animation: cf-msg-in 0.2s ease both;
|
|
2349
|
+
gap: 6px;
|
|
2350
|
+
font-size: 12.5px;
|
|
2351
|
+
font-weight: 600;
|
|
2352
|
+
color: var(--cf-accent-ink);
|
|
2353
|
+
background: linear-gradient(135deg, var(--cf-accent, #2f7f55) 0%, var(--cf-accent-2, #2f7de8) 160%);
|
|
2354
|
+
border-radius: 999px;
|
|
2355
|
+
padding: 7px 14px;
|
|
2356
|
+
box-shadow: var(--cf-shadow);
|
|
2357
|
+
animation: cf-msg-in 0.2s ease both;
|
|
2358
|
+
}
|
|
2359
|
+
.cf-newmsg svg { width: 14px; height: 14px; }
|
|
2360
|
+
|
|
2361
|
+
/* ---------- Clear-chat confirm dialog (in-widget, replaces window.confirm) ---------- */
|
|
2362
|
+
.cf-confirm {
|
|
2363
|
+
position: absolute;
|
|
2364
|
+
inset: 0;
|
|
2365
|
+
z-index: 6;
|
|
2366
|
+
pointer-events: auto;
|
|
2367
|
+
display: grid;
|
|
2368
|
+
place-items: center;
|
|
2369
|
+
padding: 22px;
|
|
2370
|
+
background: color-mix(in oklab, var(--cf-bg) 62%, transparent);
|
|
2371
|
+
backdrop-filter: blur(2px);
|
|
2372
|
+
animation: cf-fade-in 0.14s ease both;
|
|
2373
|
+
}
|
|
2374
|
+
.cf-confirm__card {
|
|
2375
|
+
width: 100%;
|
|
2376
|
+
max-width: 300px;
|
|
2377
|
+
background: var(--cf-bg);
|
|
2378
|
+
border: 1px solid var(--cf-border);
|
|
2379
|
+
border-radius: 16px;
|
|
2380
|
+
box-shadow: var(--cf-shadow);
|
|
2381
|
+
padding: 18px;
|
|
2382
|
+
text-align: center;
|
|
2383
|
+
animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
2384
|
+
}
|
|
2385
|
+
.cf-confirm__title { font-size: 15px; font-weight: 700; color: var(--cf-text); }
|
|
2386
|
+
.cf-confirm__body { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--cf-muted); }
|
|
2387
|
+
.cf-confirm__actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }
|
|
2388
|
+
.cf-confirm__btn {
|
|
2389
|
+
padding: 9px 16px;
|
|
2390
|
+
border-radius: 10px;
|
|
2391
|
+
font-size: 13.5px;
|
|
2392
|
+
font-weight: 600;
|
|
2393
|
+
transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
|
2394
|
+
}
|
|
2395
|
+
.cf-confirm__btn:active { transform: scale(0.97); }
|
|
2396
|
+
.cf-confirm__btn:focus-visible { outline: 2px solid var(--cf-accent-2); outline-offset: 2px; }
|
|
2397
|
+
.cf-confirm__btn--cancel { background: var(--cf-surface); color: var(--cf-text); border: 1px solid var(--cf-border); }
|
|
2398
|
+
.cf-confirm__btn--cancel:hover { border-color: var(--cf-accent); }
|
|
2399
|
+
.cf-confirm__btn--danger { background: #f25767; color: #fff; }
|
|
2400
|
+
.cf-confirm__btn--danger:hover { opacity: 0.9; }
|
|
2401
|
+
|
|
2402
|
+
/* Visually-hidden live region (announces the final answer only). */
|
|
2403
|
+
.cf-sr-live {
|
|
2404
|
+
position: absolute;
|
|
2405
|
+
width: 1px;
|
|
2406
|
+
height: 1px;
|
|
2407
|
+
padding: 0;
|
|
2408
|
+
margin: -1px;
|
|
2409
|
+
overflow: hidden;
|
|
2410
|
+
clip: rect(0 0 0 0);
|
|
2411
|
+
white-space: nowrap;
|
|
2412
|
+
border: 0;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
/* ---------- Attachments ---------- */
|
|
2416
|
+
.cf-file-input { display: none; }
|
|
2417
|
+
.cf-iconbtn:disabled { opacity: 0.4; cursor: default; }
|
|
2418
|
+
.cf-attach-row { padding: 0 4px 8px; }
|
|
2419
|
+
.cf-attach-status { font-size: 12px; color: var(--cf-muted); }
|
|
2420
|
+
.cf-attach-status--err { color: #f25767; }
|
|
2421
|
+
.cf-attach-chip {
|
|
2422
|
+
display: inline-flex;
|
|
2423
|
+
align-items: center;
|
|
2424
|
+
gap: 6px;
|
|
2425
|
+
max-width: 100%;
|
|
2426
|
+
padding: 5px 6px 5px 10px;
|
|
2427
|
+
border-radius: 999px;
|
|
2428
|
+
background: var(--cf-surface-2);
|
|
2429
|
+
border: 1px solid var(--cf-border);
|
|
2430
|
+
color: var(--cf-text);
|
|
2431
|
+
font-size: 12px;
|
|
2432
|
+
}
|
|
2433
|
+
.cf-attach-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2434
|
+
.cf-attach-chip svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--cf-muted); }
|
|
2435
|
+
.cf-attach-x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--cf-muted); flex-shrink: 0; }
|
|
2436
|
+
.cf-attach-x:hover { background: var(--cf-surface); color: var(--cf-text); }
|
|
2437
|
+
.cf-attach-x svg { width: 11px; height: 11px; }
|
|
2438
|
+
|
|
2439
|
+
/* ---------- Mobile: full-screen panel ---------- */
|
|
2440
|
+
@media (max-width: 480px) {
|
|
2441
|
+
.cf-panel {
|
|
2442
|
+
bottom: 0;
|
|
2443
|
+
right: 0;
|
|
2444
|
+
width: 100vw;
|
|
2445
|
+
max-width: 100vw;
|
|
2446
|
+
height: 100dvh;
|
|
2447
|
+
max-height: 100dvh;
|
|
2448
|
+
border-radius: 0;
|
|
2449
|
+
}
|
|
2450
|
+
.cf-launcher { bottom: 16px; right: 16px; }
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/* ---------- Keyframes ---------- */
|
|
2454
|
+
@keyframes cf-pop {
|
|
2455
|
+
from { transform: scale(0); opacity: 0; }
|
|
2456
|
+
to { transform: scale(1); opacity: 1; }
|
|
2457
|
+
}
|
|
2458
|
+
@keyframes cf-badge-pop {
|
|
2459
|
+
from { transform: scale(0); }
|
|
2460
|
+
to { transform: scale(1); }
|
|
2461
|
+
}
|
|
2462
|
+
@keyframes cf-panel-open {
|
|
2463
|
+
0% {
|
|
2464
|
+
opacity: 0;
|
|
2465
|
+
transform: translateY(24px) scale(0.93);
|
|
2466
|
+
filter: blur(2px);
|
|
2467
|
+
}
|
|
2468
|
+
58% {
|
|
2469
|
+
opacity: 1;
|
|
2470
|
+
transform: translateY(-3px) scale(1.006);
|
|
2471
|
+
filter: blur(0);
|
|
2472
|
+
}
|
|
2473
|
+
100% {
|
|
2474
|
+
opacity: 1;
|
|
2475
|
+
transform: translateY(0) scale(1);
|
|
2476
|
+
filter: blur(0);
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
@keyframes cf-msg-in {
|
|
2480
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
2481
|
+
to { opacity: 1; transform: none; }
|
|
2482
|
+
}
|
|
2483
|
+
@keyframes cf-fade-in {
|
|
2484
|
+
from { opacity: 0; }
|
|
2485
|
+
to { opacity: 1; }
|
|
2486
|
+
}
|
|
2487
|
+
@keyframes cf-typing {
|
|
2488
|
+
0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
|
|
2489
|
+
40% { opacity: 1; transform: translateY(-4px); }
|
|
2490
|
+
}
|
|
2491
|
+
@keyframes cf-pulse {
|
|
2492
|
+
0%, 100% { opacity: 1; }
|
|
2493
|
+
50% { opacity: 0.4; }
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2497
|
+
.cf-root *, .cf-root *::before, .cf-root *::after {
|
|
2498
|
+
animation-duration: 0.01ms !important;
|
|
2499
|
+
animation-iteration-count: 1 !important;
|
|
2500
|
+
transition-duration: 0.01ms !important;
|
|
2501
|
+
scroll-behavior: auto !important;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
.cf-analytics-visualization {
|
|
2505
|
+
box-sizing: border-box;
|
|
2506
|
+
width: 100%;
|
|
2507
|
+
max-width: 100%;
|
|
2508
|
+
margin-top: 8px;
|
|
2509
|
+
min-width: 0;
|
|
2510
|
+
overflow: hidden;
|
|
2511
|
+
border: 1px solid var(--cf-border);
|
|
2512
|
+
border-radius: 13px;
|
|
2513
|
+
background: var(--cf-surface);
|
|
2514
|
+
padding: 12px;
|
|
2515
|
+
color: var(--cf-muted);
|
|
2516
|
+
font-size: 11px;
|
|
2517
|
+
}
|
|
2518
|
+
.cf-analytics-visualization.is-expanded {
|
|
2519
|
+
display: flex;
|
|
2520
|
+
min-height: 100%;
|
|
2521
|
+
flex-direction: column;
|
|
2522
|
+
margin: 0;
|
|
2523
|
+
border: 0;
|
|
2524
|
+
border-radius: 0;
|
|
2525
|
+
background: transparent;
|
|
2526
|
+
padding: 0;
|
|
2527
|
+
}
|
|
2528
|
+
.cf-analytics-visualization__header {
|
|
2529
|
+
display: flex;
|
|
2530
|
+
width: 100%;
|
|
2531
|
+
min-width: 0;
|
|
2532
|
+
min-height: 32px;
|
|
2533
|
+
align-items: center;
|
|
2534
|
+
justify-content: space-between;
|
|
2535
|
+
gap: 10px;
|
|
2536
|
+
}
|
|
2537
|
+
.cf-analytics-visualization__header > div:first-child {
|
|
2538
|
+
min-width: 0;
|
|
2539
|
+
}
|
|
2540
|
+
.cf-analytics-visualization__actions {
|
|
2541
|
+
display: flex;
|
|
2542
|
+
flex: 0 0 auto;
|
|
2543
|
+
align-items: center;
|
|
2544
|
+
gap: 6px;
|
|
2545
|
+
}
|
|
2546
|
+
.cf-analytics-visualization__title {
|
|
2547
|
+
overflow: hidden;
|
|
2548
|
+
color: var(--cf-muted);
|
|
2549
|
+
font-size: 10px;
|
|
2550
|
+
font-weight: 750;
|
|
2551
|
+
letter-spacing: .08em;
|
|
2552
|
+
text-overflow: ellipsis;
|
|
2553
|
+
text-transform: uppercase;
|
|
2554
|
+
white-space: nowrap;
|
|
2555
|
+
}
|
|
2556
|
+
.cf-analytics-meta {
|
|
2557
|
+
display: flex;
|
|
2558
|
+
flex-wrap: wrap;
|
|
2559
|
+
align-items: center;
|
|
2560
|
+
gap: 3px 7px;
|
|
2561
|
+
margin-top: 4px;
|
|
2562
|
+
color: var(--cf-muted);
|
|
2563
|
+
font-size: 9px;
|
|
2564
|
+
line-height: 1.35;
|
|
2565
|
+
}
|
|
2566
|
+
.cf-analytics-meta__model {
|
|
2567
|
+
border-radius: 999px;
|
|
2568
|
+
background: color-mix(in srgb, var(--cf-accent) 12%, transparent);
|
|
2569
|
+
padding: 2px 6px;
|
|
2570
|
+
color: var(--cf-accent);
|
|
2571
|
+
font-weight: 700;
|
|
2572
|
+
}
|
|
2573
|
+
.cf-analytics-meta__dot {
|
|
2574
|
+
display: inline-block;
|
|
2575
|
+
width: 5px;
|
|
2576
|
+
height: 5px;
|
|
2577
|
+
margin-right: 4px;
|
|
2578
|
+
border-radius: 999px;
|
|
2579
|
+
background: var(--cf-accent);
|
|
2580
|
+
}
|
|
2581
|
+
.cf-analytics-visualization__download {
|
|
2582
|
+
width: fit-content;
|
|
2583
|
+
border: 1px solid var(--cf-border) !important;
|
|
2584
|
+
border-radius: 8px;
|
|
2585
|
+
background: var(--cf-surface) !important;
|
|
2586
|
+
padding: 6px 9px;
|
|
2587
|
+
color: var(--cf-text) !important;
|
|
2588
|
+
font-size: 10px;
|
|
2589
|
+
font-weight: 700;
|
|
2590
|
+
}
|
|
2591
|
+
.cf-analytics-visualization__download:hover {
|
|
2592
|
+
border-color: var(--cf-accent) !important;
|
|
2593
|
+
color: var(--cf-accent) !important;
|
|
2594
|
+
}
|
|
2595
|
+
.cf-analytics-table-wrap {
|
|
2596
|
+
box-sizing: border-box;
|
|
2597
|
+
width: 100%;
|
|
2598
|
+
max-width: 100%;
|
|
2599
|
+
margin-top: 9px;
|
|
2600
|
+
max-height: 210px;
|
|
2601
|
+
overflow: auto;
|
|
2602
|
+
border: 1px solid var(--cf-border);
|
|
2603
|
+
border-radius: 9px;
|
|
2604
|
+
scrollbar-width: thin;
|
|
2605
|
+
}
|
|
2606
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-table-wrap {
|
|
2607
|
+
min-height: 0;
|
|
2608
|
+
max-height: none;
|
|
2609
|
+
flex: 1;
|
|
2610
|
+
margin-top: 14px;
|
|
2611
|
+
}
|
|
2612
|
+
.cf-analytics-table {
|
|
2613
|
+
width: 100%;
|
|
2614
|
+
border-collapse: collapse;
|
|
2615
|
+
color: var(--cf-text);
|
|
2616
|
+
font-size: 10px;
|
|
2617
|
+
white-space: nowrap;
|
|
2618
|
+
}
|
|
2619
|
+
.cf-analytics-table th,
|
|
2620
|
+
.cf-analytics-table td {
|
|
2621
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2622
|
+
padding: 8px 9px;
|
|
2623
|
+
text-align: left;
|
|
2624
|
+
}
|
|
2625
|
+
.cf-analytics-table th {
|
|
2626
|
+
position: sticky;
|
|
2627
|
+
top: 0;
|
|
2628
|
+
background: var(--cf-surface-2);
|
|
2629
|
+
color: var(--cf-muted);
|
|
2630
|
+
font-weight: 700;
|
|
2631
|
+
text-transform: capitalize;
|
|
2632
|
+
}
|
|
2633
|
+
.cf-analytics-table tbody tr:last-child td { border-bottom: 0; }
|
|
2634
|
+
.cf-analytics-table-note {
|
|
2635
|
+
margin: 7px 2px 0;
|
|
2636
|
+
color: var(--cf-muted);
|
|
2637
|
+
font-size: 9px;
|
|
2638
|
+
line-height: 1.4;
|
|
2639
|
+
}
|
|
2640
|
+
.cf-analytics-visualization__expand,
|
|
2641
|
+
.cf-analytics-visualization__close {
|
|
2642
|
+
display: grid;
|
|
2643
|
+
width: 30px;
|
|
2644
|
+
height: 30px;
|
|
2645
|
+
flex: 0 0 auto;
|
|
2646
|
+
place-items: center;
|
|
2647
|
+
border: 1px solid var(--cf-border) !important;
|
|
2648
|
+
border-radius: 9px;
|
|
2649
|
+
background: var(--cf-bg) !important;
|
|
2650
|
+
color: var(--cf-text) !important;
|
|
2651
|
+
}
|
|
2652
|
+
.cf-analytics-visualization__expand:hover,
|
|
2653
|
+
.cf-analytics-visualization__close:hover { background: var(--cf-surface-2) !important; }
|
|
2654
|
+
.cf-analytics-visualization__expand:focus-visible,
|
|
2655
|
+
.cf-analytics-visualization__close:focus-visible {
|
|
2656
|
+
outline: 2px solid var(--cf-accent);
|
|
2657
|
+
outline-offset: 2px;
|
|
2658
|
+
}
|
|
2659
|
+
.cf-analytics-visualization__expand svg,
|
|
2660
|
+
.cf-analytics-visualization__close svg { width: 15px; height: 15px; }
|
|
2661
|
+
.cf-analytics-visualization__kpi {
|
|
2662
|
+
padding: 8px 0 6px;
|
|
2663
|
+
color: var(--cf-text);
|
|
2664
|
+
font-size: 30px;
|
|
2665
|
+
font-weight: 750;
|
|
2666
|
+
letter-spacing: -.035em;
|
|
2667
|
+
}
|
|
2668
|
+
.cf-analytics-kpi {
|
|
2669
|
+
padding: 9px 0 5px;
|
|
2670
|
+
}
|
|
2671
|
+
.cf-analytics-kpi__label {
|
|
2672
|
+
color: var(--cf-muted);
|
|
2673
|
+
font-size: 9px;
|
|
2674
|
+
font-weight: 700;
|
|
2675
|
+
letter-spacing: .06em;
|
|
2676
|
+
text-transform: uppercase;
|
|
2677
|
+
}
|
|
2678
|
+
.cf-analytics-kpi__value {
|
|
2679
|
+
margin-top: 5px;
|
|
2680
|
+
color: var(--cf-text);
|
|
2681
|
+
font-size: 30px;
|
|
2682
|
+
font-weight: 750;
|
|
2683
|
+
letter-spacing: -.035em;
|
|
2684
|
+
line-height: 1;
|
|
2685
|
+
}
|
|
2686
|
+
.cf-analytics-kpi__detail {
|
|
2687
|
+
margin-top: 8px;
|
|
2688
|
+
color: var(--cf-muted);
|
|
2689
|
+
font-size: 10px;
|
|
2690
|
+
line-height: 1.5;
|
|
2691
|
+
}
|
|
2692
|
+
.cf-analytics-empty {
|
|
2693
|
+
margin-top: 8px;
|
|
2694
|
+
border: 1px dashed var(--cf-border);
|
|
2695
|
+
border-radius: 11px;
|
|
2696
|
+
padding: 18px 14px;
|
|
2697
|
+
color: var(--cf-text);
|
|
2698
|
+
text-align: center;
|
|
2699
|
+
}
|
|
2700
|
+
.cf-analytics-empty p { margin: 0; }
|
|
2701
|
+
.cf-analytics-empty p + p {
|
|
2702
|
+
margin-top: 4px;
|
|
2703
|
+
color: var(--cf-muted);
|
|
2704
|
+
font-size: 10px;
|
|
2705
|
+
}
|
|
2706
|
+
.cf-analytics-echart {
|
|
2707
|
+
position: relative;
|
|
2708
|
+
width: 100%;
|
|
2709
|
+
height: 196px;
|
|
2710
|
+
min-width: 0;
|
|
2711
|
+
}
|
|
2712
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-echart {
|
|
2713
|
+
height: auto;
|
|
2714
|
+
min-height: 310px;
|
|
2715
|
+
flex: 1;
|
|
2716
|
+
}
|
|
2717
|
+
.cf-analytics-echart canvas:focus-visible {
|
|
2718
|
+
outline: 2px solid var(--cf-accent);
|
|
2719
|
+
outline-offset: -2px;
|
|
2720
|
+
}
|
|
2721
|
+
.cf-analytics-echart__fallback {
|
|
2722
|
+
display: grid;
|
|
2723
|
+
height: 100%;
|
|
2724
|
+
place-items: center;
|
|
2725
|
+
border: 1px dashed var(--cf-border);
|
|
2726
|
+
border-radius: 9px;
|
|
2727
|
+
padding: 16px;
|
|
2728
|
+
color: var(--cf-muted);
|
|
2729
|
+
text-align: center;
|
|
2730
|
+
line-height: 1.5;
|
|
2731
|
+
}
|
|
2732
|
+
.cf-analytics-zoom {
|
|
2733
|
+
display: flex;
|
|
2734
|
+
min-width: 0;
|
|
2735
|
+
align-items: center;
|
|
2736
|
+
justify-content: space-between;
|
|
2737
|
+
gap: 8px;
|
|
2738
|
+
margin-top: 4px;
|
|
2739
|
+
border-top: 1px solid var(--cf-border);
|
|
2740
|
+
padding-top: 8px;
|
|
2741
|
+
}
|
|
2742
|
+
.cf-analytics-zoom__range {
|
|
2743
|
+
min-width: 0;
|
|
2744
|
+
overflow: hidden;
|
|
2745
|
+
color: var(--cf-muted);
|
|
2746
|
+
font-size: 10px;
|
|
2747
|
+
font-weight: 650;
|
|
2748
|
+
line-height: 1.3;
|
|
2749
|
+
text-overflow: ellipsis;
|
|
2750
|
+
white-space: nowrap;
|
|
2751
|
+
}
|
|
2752
|
+
.cf-analytics-zoom__controls {
|
|
2753
|
+
display: inline-flex;
|
|
2754
|
+
flex: 0 0 auto;
|
|
2755
|
+
align-items: center;
|
|
2756
|
+
overflow: hidden;
|
|
2757
|
+
border: 1px solid var(--cf-border);
|
|
2758
|
+
border-radius: 9px;
|
|
2759
|
+
background: var(--cf-bg);
|
|
1024
2760
|
}
|
|
1025
|
-
.cf-
|
|
1026
|
-
|
|
1027
|
-
/* ---------- Clear-chat confirm dialog (in-widget, replaces window.confirm) ---------- */
|
|
1028
|
-
.cf-confirm {
|
|
1029
|
-
position: absolute;
|
|
1030
|
-
inset: 0;
|
|
1031
|
-
z-index: 6;
|
|
1032
|
-
pointer-events: auto;
|
|
2761
|
+
.cf-analytics-zoom__controls button {
|
|
1033
2762
|
display: grid;
|
|
2763
|
+
min-width: 40px;
|
|
2764
|
+
height: 40px;
|
|
1034
2765
|
place-items: center;
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
2766
|
+
border: 0 !important;
|
|
2767
|
+
border-radius: 0;
|
|
2768
|
+
background: transparent !important;
|
|
2769
|
+
color: var(--cf-text) !important;
|
|
2770
|
+
font: inherit;
|
|
2771
|
+
font-size: 16px;
|
|
2772
|
+
font-weight: 700;
|
|
2773
|
+
line-height: 1;
|
|
1039
2774
|
}
|
|
1040
|
-
.cf-
|
|
1041
|
-
|
|
1042
|
-
|
|
2775
|
+
.cf-analytics-zoom__controls button + button { border-left: 1px solid var(--cf-border) !important; }
|
|
2776
|
+
.cf-analytics-zoom__controls button:hover:not(:disabled) { background: var(--cf-surface-2) !important; }
|
|
2777
|
+
.cf-analytics-zoom__controls button:focus-visible {
|
|
2778
|
+
position: relative;
|
|
2779
|
+
z-index: 1;
|
|
2780
|
+
outline: 2px solid var(--cf-accent);
|
|
2781
|
+
outline-offset: -2px;
|
|
2782
|
+
}
|
|
2783
|
+
.cf-analytics-zoom__controls button:disabled { cursor: not-allowed; opacity: .38; }
|
|
2784
|
+
.cf-analytics-zoom__controls .cf-analytics-zoom__reset {
|
|
2785
|
+
min-width: 56px;
|
|
2786
|
+
padding: 0 10px;
|
|
2787
|
+
font-size: 10px;
|
|
2788
|
+
font-weight: 700;
|
|
2789
|
+
}
|
|
2790
|
+
.cf-analytics-chart__summary {
|
|
2791
|
+
margin: 2px 0 0;
|
|
2792
|
+
color: var(--cf-muted);
|
|
2793
|
+
font-size: 11px;
|
|
2794
|
+
line-height: 1.45;
|
|
2795
|
+
}
|
|
2796
|
+
.cf-analytics-focus {
|
|
2797
|
+
height: 100%;
|
|
2798
|
+
min-height: 0;
|
|
2799
|
+
overflow: auto;
|
|
1043
2800
|
background: var(--cf-bg);
|
|
1044
|
-
border: 1px solid var(--cf-border);
|
|
1045
|
-
border-radius: 16px;
|
|
1046
|
-
box-shadow: var(--cf-shadow);
|
|
1047
2801
|
padding: 18px;
|
|
1048
|
-
text-align: center;
|
|
1049
|
-
animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1050
2802
|
}
|
|
1051
|
-
|
|
1052
|
-
.cf-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
|
2803
|
+
@media (min-width: 640px) {
|
|
2804
|
+
.cf-panel.cf-panel--analytics-focus {
|
|
2805
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2806
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
2807
|
+
grid-template-areas: 'header' 'video';
|
|
2808
|
+
}
|
|
2809
|
+
.cf-panel--analytics-focus .cf-panel__video { height: 100%; }
|
|
2810
|
+
.cf-panel--analytics-focus .cf-panel__chat { display: none; }
|
|
1060
2811
|
}
|
|
1061
|
-
.cf-
|
|
1062
|
-
|
|
1063
|
-
.cf-confirm__btn--cancel { background: var(--cf-surface); color: var(--cf-text); border: 1px solid var(--cf-border); }
|
|
1064
|
-
.cf-confirm__btn--cancel:hover { border-color: var(--cf-accent); }
|
|
1065
|
-
.cf-confirm__btn--danger { background: #f25767; color: #fff; }
|
|
1066
|
-
.cf-confirm__btn--danger:hover { opacity: 0.9; }
|
|
1067
|
-
|
|
1068
|
-
/* Visually-hidden live region (announces the final answer only). */
|
|
1069
|
-
.cf-sr-live {
|
|
1070
|
-
position: absolute;
|
|
1071
|
-
width: 1px;
|
|
1072
|
-
height: 1px;
|
|
1073
|
-
padding: 0;
|
|
1074
|
-
margin: -1px;
|
|
2812
|
+
.cf-analytics-explanation {
|
|
2813
|
+
margin-top: 10px;
|
|
1075
2814
|
overflow: hidden;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
2815
|
+
border: 1px solid var(--cf-border);
|
|
2816
|
+
border-radius: 12px;
|
|
2817
|
+
background: var(--cf-surface);
|
|
2818
|
+
color: var(--cf-text);
|
|
2819
|
+
font-size: 12px;
|
|
2820
|
+
line-height: 1.55;
|
|
1079
2821
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
.cf-
|
|
1083
|
-
.cf-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
.cf-
|
|
2822
|
+
.cf-analytics-explanation h3,
|
|
2823
|
+
.cf-analytics-explanation h4,
|
|
2824
|
+
.cf-analytics-explanation p { margin: 0; }
|
|
2825
|
+
.cf-analytics-explanation__lead {
|
|
2826
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2827
|
+
padding: 12px;
|
|
2828
|
+
}
|
|
2829
|
+
.cf-analytics-explanation__lead-meta {
|
|
2830
|
+
display: flex;
|
|
2831
|
+
flex-wrap: wrap;
|
|
2832
|
+
align-items: center;
|
|
2833
|
+
gap: 5px 8px;
|
|
2834
|
+
}
|
|
2835
|
+
.cf-analytics-explanation__eyebrow {
|
|
2836
|
+
color: var(--cf-accent);
|
|
2837
|
+
font-size: 9px;
|
|
2838
|
+
font-weight: 750;
|
|
2839
|
+
letter-spacing: .1em;
|
|
2840
|
+
text-transform: uppercase;
|
|
2841
|
+
}
|
|
2842
|
+
.cf-analytics-explanation__provenance {
|
|
1088
2843
|
display: inline-flex;
|
|
1089
2844
|
align-items: center;
|
|
1090
|
-
gap:
|
|
1091
|
-
|
|
1092
|
-
|
|
2845
|
+
gap: 5px;
|
|
2846
|
+
color: var(--cf-muted);
|
|
2847
|
+
font-size: 9px;
|
|
2848
|
+
font-weight: 650;
|
|
2849
|
+
}
|
|
2850
|
+
.cf-analytics-explanation__provenance-dot {
|
|
2851
|
+
width: 5px;
|
|
2852
|
+
height: 5px;
|
|
1093
2853
|
border-radius: 999px;
|
|
1094
|
-
background: var(--cf-
|
|
1095
|
-
|
|
2854
|
+
background: var(--cf-accent);
|
|
2855
|
+
}
|
|
2856
|
+
.cf-analytics-explanation__headline {
|
|
2857
|
+
margin-top: 8px !important;
|
|
2858
|
+
color: var(--cf-text);
|
|
2859
|
+
font-size: 15px;
|
|
2860
|
+
font-weight: 750;
|
|
2861
|
+
letter-spacing: -.012em;
|
|
2862
|
+
line-height: 1.45;
|
|
2863
|
+
}
|
|
2864
|
+
.cf-analytics-explanation__summary {
|
|
2865
|
+
margin-top: 5px !important;
|
|
2866
|
+
color: var(--cf-muted);
|
|
2867
|
+
font-size: 12px;
|
|
2868
|
+
line-height: 1.6;
|
|
2869
|
+
}
|
|
2870
|
+
.cf-analytics-explanation__body {
|
|
2871
|
+
display: grid;
|
|
2872
|
+
gap: 14px;
|
|
2873
|
+
padding: 12px;
|
|
2874
|
+
}
|
|
2875
|
+
.cf-analytics-explanation__status { color: var(--cf-muted); }
|
|
2876
|
+
.cf-analytics-explanation__error {
|
|
2877
|
+
border-radius: 8px;
|
|
2878
|
+
background: color-mix(in srgb, #d97706 10%, var(--cf-surface));
|
|
2879
|
+
padding: 9px 10px;
|
|
2880
|
+
color: var(--cf-text);
|
|
2881
|
+
}
|
|
2882
|
+
.cf-analytics-explanation__heading {
|
|
1096
2883
|
color: var(--cf-text);
|
|
1097
2884
|
font-size: 12px;
|
|
2885
|
+
font-weight: 750;
|
|
2886
|
+
line-height: 1.45;
|
|
1098
2887
|
}
|
|
1099
|
-
.cf-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
@media (max-width: 480px) {
|
|
1107
|
-
.cf-panel {
|
|
1108
|
-
bottom: 0;
|
|
1109
|
-
right: 0;
|
|
1110
|
-
width: 100vw;
|
|
1111
|
-
max-width: 100vw;
|
|
1112
|
-
height: 100dvh;
|
|
1113
|
-
max-height: 100dvh;
|
|
1114
|
-
border-radius: 0;
|
|
1115
|
-
}
|
|
1116
|
-
.cf-launcher { bottom: 16px; right: 16px; }
|
|
2888
|
+
.cf-analytics-explanation__evidence {
|
|
2889
|
+
display: grid;
|
|
2890
|
+
gap: 7px;
|
|
2891
|
+
margin: 8px 0 0;
|
|
2892
|
+
padding: 0;
|
|
2893
|
+
list-style: none;
|
|
2894
|
+
color: var(--cf-muted);
|
|
1117
2895
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
to { transform: scale(1); opacity: 1; }
|
|
2896
|
+
.cf-analytics-explanation__evidence-item {
|
|
2897
|
+
display: flex;
|
|
2898
|
+
gap: 8px;
|
|
2899
|
+
align-items: flex-start;
|
|
1123
2900
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
2901
|
+
.cf-analytics-explanation__evidence-bullet {
|
|
2902
|
+
width: 5px;
|
|
2903
|
+
height: 5px;
|
|
2904
|
+
flex: 0 0 auto;
|
|
2905
|
+
margin-top: 7px;
|
|
2906
|
+
border-radius: 999px;
|
|
2907
|
+
background: var(--cf-accent);
|
|
1127
2908
|
}
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
2909
|
+
.cf-analytics-explanation__meaning {
|
|
2910
|
+
border-left: 2px solid var(--cf-accent);
|
|
2911
|
+
border-radius: 0 8px 8px 0;
|
|
2912
|
+
background: color-mix(in srgb, var(--cf-accent) 7%, var(--cf-surface));
|
|
2913
|
+
padding: 10px 11px;
|
|
1131
2914
|
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
2915
|
+
.cf-analytics-explanation__paragraph {
|
|
2916
|
+
margin-top: 5px !important;
|
|
2917
|
+
color: var(--cf-muted);
|
|
1135
2918
|
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
2919
|
+
.cf-analytics-explanation__section-heading,
|
|
2920
|
+
.cf-analytics-explanation__outlook-header {
|
|
2921
|
+
display: flex;
|
|
2922
|
+
flex-wrap: wrap;
|
|
2923
|
+
align-items: baseline;
|
|
2924
|
+
justify-content: space-between;
|
|
2925
|
+
gap: 4px 8px;
|
|
1139
2926
|
}
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
2927
|
+
.cf-analytics-explanation__hint,
|
|
2928
|
+
.cf-analytics-explanation__outlook-badge {
|
|
2929
|
+
color: var(--cf-muted);
|
|
2930
|
+
font-size: 9px;
|
|
2931
|
+
font-weight: 650;
|
|
2932
|
+
}
|
|
2933
|
+
.cf-analytics-explanation__outlook-badge {
|
|
2934
|
+
color: var(--cf-accent);
|
|
2935
|
+
letter-spacing: .06em;
|
|
2936
|
+
text-transform: uppercase;
|
|
2937
|
+
}
|
|
2938
|
+
.cf-analytics-explanation__drivers,
|
|
2939
|
+
.cf-analytics-explanation__recommendations {
|
|
2940
|
+
display: grid;
|
|
2941
|
+
gap: 7px;
|
|
2942
|
+
margin-top: 8px;
|
|
2943
|
+
}
|
|
2944
|
+
.cf-analytics-explanation__driver {
|
|
2945
|
+
border-radius: 8px;
|
|
2946
|
+
background: var(--cf-bg);
|
|
2947
|
+
padding: 9px 10px;
|
|
2948
|
+
}
|
|
2949
|
+
.cf-analytics-explanation__driver-title,
|
|
2950
|
+
.cf-analytics-explanation__recommendation-title {
|
|
2951
|
+
color: var(--cf-text);
|
|
2952
|
+
font-weight: 750;
|
|
2953
|
+
}
|
|
2954
|
+
.cf-analytics-explanation__driver-body,
|
|
2955
|
+
.cf-analytics-explanation__recommendation-body {
|
|
2956
|
+
margin-top: 3px !important;
|
|
2957
|
+
color: var(--cf-muted);
|
|
2958
|
+
font-size: 11px;
|
|
2959
|
+
}
|
|
2960
|
+
.cf-analytics-explanation__driver-label { color: var(--cf-text); font-weight: 700; }
|
|
2961
|
+
.cf-analytics-explanation__recommendation {
|
|
2962
|
+
display: grid;
|
|
2963
|
+
grid-template-columns: 22px minmax(0, 1fr);
|
|
2964
|
+
gap: 8px;
|
|
2965
|
+
border-radius: 8px;
|
|
2966
|
+
background: var(--cf-bg);
|
|
2967
|
+
padding: 9px 10px;
|
|
2968
|
+
}
|
|
2969
|
+
.cf-analytics-explanation__recommendation-index {
|
|
2970
|
+
display: grid;
|
|
2971
|
+
width: 22px;
|
|
2972
|
+
height: 22px;
|
|
2973
|
+
place-items: center;
|
|
2974
|
+
border-radius: 999px;
|
|
2975
|
+
background: color-mix(in srgb, var(--cf-accent) 12%, var(--cf-surface));
|
|
2976
|
+
color: var(--cf-accent);
|
|
2977
|
+
font-size: 10px;
|
|
2978
|
+
font-weight: 750;
|
|
2979
|
+
}
|
|
2980
|
+
.cf-analytics-explanation__outlook {
|
|
2981
|
+
border-radius: 8px;
|
|
2982
|
+
background: var(--cf-bg);
|
|
2983
|
+
padding: 10px 11px;
|
|
2984
|
+
}
|
|
2985
|
+
.cf-analytics-explanation__follow-up {
|
|
2986
|
+
border-top: 1px solid var(--cf-border);
|
|
2987
|
+
padding-top: 12px;
|
|
2988
|
+
}
|
|
2989
|
+
.cf-analytics-explanation__questions {
|
|
2990
|
+
display: grid;
|
|
2991
|
+
gap: 6px;
|
|
2992
|
+
margin-top: 8px;
|
|
2993
|
+
}
|
|
2994
|
+
.cf-analytics-explanation__question {
|
|
2995
|
+
width: 100%;
|
|
2996
|
+
border: 1px solid var(--cf-border);
|
|
2997
|
+
border-radius: 8px;
|
|
2998
|
+
background: var(--cf-bg);
|
|
2999
|
+
padding: 8px 9px;
|
|
3000
|
+
color: var(--cf-text);
|
|
3001
|
+
font: inherit;
|
|
3002
|
+
text-align: left;
|
|
3003
|
+
cursor: pointer;
|
|
3004
|
+
}
|
|
3005
|
+
.cf-analytics-explanation__question:hover {
|
|
3006
|
+
border-color: color-mix(in srgb, var(--cf-accent) 45%, var(--cf-border));
|
|
3007
|
+
background: color-mix(in srgb, var(--cf-accent) 6%, var(--cf-bg));
|
|
3008
|
+
}
|
|
3009
|
+
.cf-analytics-explanation__question:focus-visible,
|
|
3010
|
+
.cf-analytics-explanation__limits-summary:focus-visible {
|
|
3011
|
+
outline: 2px solid var(--cf-accent);
|
|
3012
|
+
outline-offset: 2px;
|
|
3013
|
+
}
|
|
3014
|
+
.cf-analytics-explanation__limits {
|
|
3015
|
+
border-top: 1px solid var(--cf-border);
|
|
3016
|
+
padding-top: 10px;
|
|
3017
|
+
}
|
|
3018
|
+
.cf-analytics-explanation__limits-summary {
|
|
3019
|
+
cursor: pointer;
|
|
3020
|
+
color: var(--cf-text);
|
|
3021
|
+
font-weight: 700;
|
|
3022
|
+
}
|
|
3023
|
+
.cf-analytics-explanation__limits-list {
|
|
3024
|
+
margin: 8px 0 0;
|
|
3025
|
+
padding-left: 17px;
|
|
3026
|
+
color: var(--cf-muted);
|
|
3027
|
+
}
|
|
3028
|
+
.cf-analytics-explanation__source {
|
|
3029
|
+
border-top: 1px solid var(--cf-border);
|
|
3030
|
+
margin: 0;
|
|
3031
|
+
padding: 9px 12px;
|
|
3032
|
+
color: var(--cf-muted);
|
|
3033
|
+
font-size: 10px;
|
|
1143
3034
|
}
|
|
1144
3035
|
|
|
1145
|
-
@media (
|
|
1146
|
-
.cf-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
3036
|
+
@media (max-width: 639px) {
|
|
3037
|
+
.cf-panel.cf-panel--analytics-focus {
|
|
3038
|
+
inset: 12px;
|
|
3039
|
+
width: auto;
|
|
3040
|
+
height: auto;
|
|
3041
|
+
min-height: 0;
|
|
3042
|
+
max-width: none;
|
|
3043
|
+
max-height: none;
|
|
3044
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3045
|
+
grid-template-areas: 'header' 'video';
|
|
3046
|
+
transform-origin: center;
|
|
1151
3047
|
}
|
|
3048
|
+
.cf-panel--analytics-focus .cf-panel__video { height: 100%; }
|
|
3049
|
+
.cf-panel--analytics-focus .cf-panel__chat { display: none; }
|
|
3050
|
+
.cf-analytics-focus { padding: 14px; }
|
|
3051
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-echart { min-height: 260px; }
|
|
1152
3052
|
}
|
|
1153
|
-
`;function
|
|
3053
|
+
`;function K(e){"@babel/helpers - typeof";return K=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},K(e)}function q(e,t){if(K(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(K(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xt(e){var t=q(e,`string`);return K(t)==`symbol`?t:t+``}function St(e,t,n){return(t=xt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const J=`centrinfo-widget`;var Ct=class extends HTMLElement{constructor(...e){super(...e),St(this,`controls`,null)}mountWith(n){let i=e.t(n),a=this.shadowRoot??this.attachShadow({mode:`open`});if(`adoptedStyleSheets`in Document.prototype&&typeof CSSStyleSheet<`u`){let e=new CSSStyleSheet;e.replaceSync(G),a.adoptedStyleSheets=[e]}else{let e=document.createElement(`style`);e.textContent=G,a.appendChild(e)}(0,t.render)((0,r.jsx)(bt,{transport:i.demo?new e.g:i.preview?new e.h(new e._(i.apiBaseUrl,i.token,i.gifApiKey,i.analyticsContextToken,{agentName:i.agentName,agentAvatarUrl:i.agentAvatarUrl},i.identityToken,i.getIdentityToken),i.strings):new e._(i.apiBaseUrl,i.token,i.gifApiKey,i.analyticsContextToken,{agentName:i.agentName,agentAvatarUrl:i.agentAvatarUrl},i.identityToken,i.getIdentityToken),config:i,bindControls:e=>this.controls=e}),a)}open(){this.controls?.open()}close(){this.controls?.close()}toggle(){this.controls?.toggle()}identify(e){this.controls?.identify(e)}clear(){this.controls?.startNew()}shutdown(){this.controls?.shutdown()}unmount(){this.shadowRoot&&(0,t.render)(null,this.shadowRoot)}};typeof customElements<`u`&&!customElements.get(J)&&customElements.define(J,Ct);const wt=(e,t=document.body)=>{if(typeof document>`u`)throw Error(`[centrinfo-widget] createWidget must run in a browser.`);let n=document.createElement(J);return n.style.pointerEvents=`none`,n.style.position=`fixed`,n.style.inset=`0`,n.style.width=`0`,n.style.height=`0`,t.appendChild(n),n.mountWith(e),{open:()=>n.open(),close:()=>n.close(),toggle:()=>n.toggle(),show:()=>n.open(),hide:()=>n.close(),identify:e=>n.identify(e),update:e=>n.identify(e),clear:()=>n.clear(),shutdown:()=>n.shutdown(),logout:()=>n.shutdown(),destroy:()=>{n.unmount(),n.remove()}}},Tt=e=>wt(e);let Et=null;const Dt=e=>{Et?.destroy();let t=Tt(e);return Et=t,t},Ot={init:Dt,createWidget:Tt};exports.Centrinfo=Ot,exports.createWidget=Tt,exports.init=Dt;
|