PageSourceSearch

https://demo.sonraisecurity.com/_next/static/chunks/3208-19404e4bd955e1c6.js

js sonraisecurity.com collected 2026-09-24 09:24:17 UTC 93,803 bytes, 5 lines download raw bytes

1"use strict";
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f351075f-e90b-50fc-8ab5-3025a80a344a")}catch(e){}}();
3(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3208],{1423:(e,t,n)=>{n.d(t,{O:()=>tw});var r=n(6029),a=n(55729);let i=(0,a.createContext)({isMuted:!1});function l(e){let{isMuted:t,children:n}=e,l=(0,a.useMemo)(()=>({isMuted:t}),[t]);return(0,r.jsx)(i.Provider,{value:l,children:n})}function o(){return(0,a.useContext)(i)}var s=n(39363),c=n(94245),u=n(3947),d=n(531),m=n(96074),g=n(91048),p=n(8756),f=n(35387),h=n(62019);function x(e){fetch("".concat(d.A.COPILOT_URL,"/agent-demo-feedback"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>{e.ok||console.error("Failed to submit agent demo feedback:",e.status)}).catch(e=>{console.error("Failed to submit agent demo feedback:",e)})}var v=n(34584),b=n(33532),y=n(45553),k=n(42931),w=n(97549),j=n(39322),C=n(23397),N=n(48642),S=n(22391),I=n(16135),M=n(10394),E=n(46887),A=n(68740);let P="There might be high call volume. Please try again later.",D={"requesting-mic":"Requesting microphone access…",connecting:"Joining call…"};var L=n(64236);function T(e,t,n,r){let i=function(e,t,n){let r=(0,a.useMemo)(()=>({contrastColor:(0,L.u)(e,t),backgroundColor:(0,L.He)(e,t)}),[e,t]),[i,l]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let r;if(l(null),(null==e?void 0:e.__typename)!=="AgentDemoImageBackground")return;let a=!1,i=()=>{(0,L.rf)(e,t,n).then(e=>{a||l({backgroundColor:e,contrastColor:(0,L.r7)(e)})})},o=()=>{null!=r&&cancelAnimationFrame(r),r=requestAnimationFrame(i)};return i(),n||window.addEventListener("resize",o),()=>{a=!0,n||window.removeEventListener("resize",o),null!=r&&cancelAnimationFrame(r)}},[e,t,n]),null!=i?i:r}(e,t,n),l=null==r?void 0:r.whiteOverlayOpacities;return(0,a.useMemo)(()=>{if(!(null==l?void 0:l.length))return{contrastColor:i.contrastColor,backgroundColor:i.backgroundColor,isDarkBackground:(0,L.$c)(i.contrastColor),isLightestBackground:(0,L.uC)(i.backgroundColor)};let e=(0,L.Of)(i.backgroundColor,l),t=null!=i.backgroundColor?(0,L.K4)(i.backgroundColor,l):null;return{contrastColor:e,backgroundColor:i.backgroundColor,isDarkBackground:(0,L.$c)(e),isLightestBackground:(0,L.uC)(t)}},[i.backgroundColor,i.contrastColor,l])}function R(e,t,n,r,i){let[l,o]=(0,a.useState)({point:r});return(0,a.useEffect)(()=>{let e=n.current;if(!t||!e)return void o({point:r});let a=()=>{let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();if(r.width<=0||r.height<=0)return;let a={point:{x:Math.max(0,Math.min(1,(n.left+n.width/2-r.left)/r.width)),y:Math.max(0,Math.min(1,(n.top+n.height/2-r.top)/r.height))},area:{width:r.width,height:r.height}};o(e=>{var t,n,r,i;return e.point.x===a.point.x&&e.point.y===a.point.y&&(null==(t=e.area)?void 0:t.width)===(null==(n=a.area)?void 0:n.width)&&(null==(r=e.area)?void 0:r.height)===(null==(i=a.area)?void 0:i.height)?e:a})};a();let i=new ResizeObserver(a);return i.observe(t),i.observe(e),window.addEventListener("resize",a),()=>{i.disconnect(),window.removeEventListener("resize",a)}},[n,t,r]),T(e,l.point,l.area,i)}function B(){var e,t;let n=window;return null!=(t=null!=(e=n.SpeechRecognition)?e:n.webkitSpeechRecognition)?t:null}let F={cancelled:!1,realtimeConfirmed:!1,browserDriving:!1,optimisticItemId:null,realtimeItemId:null};function _(e){let t=e.trim();return t?t.split(/\s+/).length:0}function z(e){let t=(0,a.useRef)(e);return t.current=e,t}var O=n(44101),U=n(85393),V=n(40503);function H(e){var t,n;let{config:a,onFormSubmit:i}=e;switch(a.__typename){case"AgentDemoHubspotFormConfig":return(0,r.jsx)("div",{className:"w-full max-w-[500px]",children:(0,r.jsx)(U.A,{formId:null!=(t=a.formId)?t:"",portalId:a.portalId,region:a.region,onFormSubmit:i})});case"AgentDemoMarketoFormConfig":return(0,r.jsx)("div",{className:"w-full max-w-[500px]",children:(0,r.jsx)(V.A,{formId:null!=(n=a.formId)?n:"",munchkinId:a.munchkinId,onFormSubmit:i})})}}var K=n(44376),W=n(34039),G=n(46408),q=n(94076),J=n(63357),$=n.n(J);function Y(e){let{form:t,language:n,themeConfig:i,onSubmit:l}=e,o=(0,a.useRef)(!1),s=(0,a.useCallback)(async e=>(o.current||(o.current=!0,l(e)),{isValid:!1}),[l]),c=(0,q.ID)(t,n,t.defaultLanguage);return(0,r.jsx)(K.s,{themeVersion:i,children:(0,r.jsx)("div",{className:"rounded-ct-dialog-radius bg-ct-dialog-bg text-ct-dialog-text text-ct-dialog-font-size font-ct-dialog-font-family w-full max-w-[500px] overflow-y-auto p-6 text-left shadow-lg",children:(0,r.jsx)(W.Z,{enhancedForm:c,state:void 0,guideId:void 0,step:void 0,layout:u.lEI.Dialog,allowSubmit:!0,disableTracking:!0,hideNonWorkspaceProperties:!1,onValidateAndEnrichSubmit:s})})})}var X=n(73179);function Q(e){let{agentDemoVersion:t,themeConfig:n,onSubmit:i}=e,[l,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>o(!0),[]);let{formConfig:s}=t,c=(0,a.useCallback)(e=>{(null==s?void 0:s.__typename)==="AgentDemoNavatticFormConfig"&&s.enhancedForm&&i(function(e,t){var n;let r=$()(),a=[];for(let{multilingualDescription:i,multilingualLabel:l,multilingualPlaceholder:o,...s}of null!=(n=e.fields)?n:[]){if(!s.customPropertyId||!s.customProperty)continue;let n=t[s.customPropertyId];if(void 0===n||""===n)continue;let i=(0,G.RE)({field:s,value:n});a.push({name:s.customProperty.name,object:s.customProperty.object,value:i,source:u.GfC.Form,captureMethod:u.rMg.Demo,form:{id:e.id,versionId:e.versionId,submissionId:r}})}return a}(s.enhancedForm,e))},[s,i]),d=(0,a.useCallback)(e=>{i((0,X.C)(e))},[i]);if(!l||!s)return null;switch(s.__typename){case"AgentDemoNavatticFormConfig":if(!s.enhancedForm)return null;return(0,r.jsx)(Y,{form:s.enhancedForm,language:t.language,themeConfig:n,onSubmit:c});case"AgentDemoHubspotFormConfig":case"AgentDemoMarketoFormConfig":return(0,r.jsx)(H,{config:s,onFormSubmit:d})}}var Z=n(53525),ee=n(55613),et=n(68840),en=n(73096),er=n(69222),ea=n(82211);let ei=[{id:"demo",label:"Demo (configured)",shortLabel:"Demo"},{id:"light",label:"Light solid",shortLabel:"Light"},{id:"dark",label:"Dark solid",shortLabel:"Dark"},{id:"gradient",label:"Gradient",shortLabel:"Gradient"},{id:"image",label:"Image",shortLabel:"Image"},{id:"custom",label:"Custom color",shortLabel:"Custom"}
3],el={light:{__typename:"AgentDemoColorBackground",type:u.hKJ.Color,color:"#e2e2e2"},dark:{__typename:"AgentDemoColorBackground",type:u.hKJ.Color,color:"#0f172a"},gradient:{__typename:"AgentDemoGradientBackground",type:u.hKJ.Gradient,gradient:{angle:180,stops:[{color:"#011B49",position:0},{color:"#6A91D7",position:50},{color:"#E1E9F6",position:100}]}},image:{__typename:"AgentDemoImageBackground",type:u.hKJ.Image,imageUrl:"https://i.imgur.com/o7lt9k0.jpeg"}};var eo=n(33612),es=n.n(eo);function ec(e){var t,n;let{preset:a,onPresetChange:i,customColor:l,onCustomColorChange:o}=e,s=es()(l).toHexString(),c="custom"===a?s.toUpperCase():null!=(n=null==(t=ei.find(e=>e.id===a))?void 0:t.shortLabel)?n:"Demo",u=(0,Z.mP)({name:"Background",value:a,onValueChange:i},ei.map(e=>({id:e.id,label:e.label,value:e.id})));return(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(Z.W1,{items:u,side:"bottom",align:"center",styles:{content:{zIndex:C.hxu}},children:(0,r.jsxs)(ee.$,{size:"xs",variant:"outline",iconLeft:"palette",className:"rounded-lg",children:["BG: ",c]})}),(0,r.jsxs)("label",{className:"border-default relative inline-flex h-6 w-6 shrink-0 cursor-pointer overflow-hidden rounded border",title:"Custom background color (preview only)",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute inset-0",style:{backgroundColor:s}}),(0,r.jsx)("input",{type:"color",value:s,"aria-label":"Custom background color",className:"absolute inset-0 cursor-pointer opacity-0",onChange:e=>{o(e.target.value),i("custom")}})]})]})}function eu(e){let{sessionId:t,backgroundControl:n}=e,[i,l]=(0,a.useState)(!1),o=(0,a.useRef)(void 0);return(0,a.useEffect)(()=>()=>clearTimeout(o.current),[]),(0,r.jsxs)("div",{className:"border-default sticky top-0 left-0 flex h-8 w-full items-center justify-center gap-3 border-b bg-gray-50",style:{zIndex:C.hxu},children:[(0,r.jsx)(et.m_,{title:"Preview mode",content:"This link is not intended for sharing. Sessions in preview mode are not tracked, do not run playbooks, and do not count toward your workspace's agent minutes.",appearance:"light",styles:{content:{zIndex:C.hxu}},children:(0,r.jsx)(en.E,{size:"md",iconRight:"info",colorScheme:"gray",className:"cursor-help bg-gray-100",children:"Preview mode"})}),n&&(0,r.jsx)(ec,{...n}),t&&(0,r.jsxs)("div",{className:"flex items-center gap-1 font-mono text-xs text-gray-400",children:[(0,r.jsx)("span",{className:"select-all",children:t}),(0,r.jsx)(er.K,{icon:i?"check":"copy",size:"xs",variant:"ghost",tooltip:i?"Copied!":"Copy session ID",onClick:()=>{(0,ea.l)(t),l(!0),clearTimeout(o.current),o.current=setTimeout(()=>l(!1),2e3)}})]})]})}var ed=n(42902),em=n(63681),eg=n(10404);let ep={encoding:"pcm_s16le",sampleRate:em.Z,channels:1};function ef(e){let{sessionToken:t,registerSink:n,onRenderStart:i,onServerWarning:l,onError:s,className:c,applyChromaKey:u,onFirstFrame:d}=e,[m,g]=(0,a.useState)(null),[p,f]=(0,a.useState)(null),{isMuted:h}=o(),x=(0,a.useRef)(n),v=(0,a.useRef)(i),b=(0,a.useRef)(l),y=(0,a.useRef)(s);return(0,a.useEffect)(()=>{x.current=n,v.current=i,b.current=l,y.current=s}),(0,a.useEffect)(()=>{let e=!1,n=(0,eg.UU)(t,{disableInputAudio:!0}),r={current:null};return n.addListener(eg.es.VIDEO_STREAM_STARTED,t=>{e||g(t)}),n.addListener(eg.es.AUDIO_STREAM_STARTED,t=>{e||f(t)}),n.addListener(eg.es.SESSION_READY,()=>{if(e)return;let t=n.createAgentAudioInputStream(ep);r.current=t,x.current({feedChunk:e=>t.sendAudioChunk(e),endSequence:()=>t.endSequence(),interrupt:()=>{n.interruptPersona(),t.endSequence()}})}),n.addListener(eg.es.SERVER_WARNING,e=>{var t;console.warn("[AnamAvatarTile] Server warning:",e),null==(t=b.current)||t.call(b,e)}),n.addListener(eg.es.CONNECTION_CLOSED,t=>{if(!e){var n;x.current(null),null==(n=y.current)||n.call(y,"Anam connection closed: ".concat(String(t)))}}),n.stream().then(()=>{e&&n.stopStreaming().catch(()=>{})},t=>{if(!e){var n;null==(n=y.current)||n.call(y,t instanceof Error?t.message:"Anam stream failed to start")}}),()=>{e=!0,x.current(null),n.stopStreaming().catch(()=>{}),g(null),f(null)}},[t]),(0,a.useEffect)(()=>
3{if(!p)return;let e=new AudioContext,t=e.createMediaStreamSource(p),n=e.createAnalyser();n.fftSize=2048,t.connect(n);let r=new Float32Array(n.fftSize),a=250,i=setInterval(()=>{n.getFloatTimeDomainData(r);let e=0;for(let t of r)e+=t*t;Math.sqrt(e/r.length)>.01?(a>=250&&v.current(a),a=0):a+=50},50);return()=>{clearInterval(i),t.disconnect(),e.close().catch(()=>{})}},[p]),(0,r.jsx)(ed.J,{videoStream:m,audioStream:p,isMuted:h,className:c,applyChromaKey:u,onFirstFrame:d})}var eh=n(43582),ex=n(27962),ev=n(70395);function eb(e){let{livekitUrl:t,livekitClientToken:n,className:i,applyChromaKey:l,onFirstFrame:s,onError:c}=e,[u,d]=(0,a.useState)(null),[m,g]=(0,a.useState)(null),{isMuted:p}=o(),f=(0,a.useRef)(c);return(0,a.useEffect)(()=>{f.current=c}),(0,a.useEffect)(()=>{let e=!1,r=new ev.Wv,a=e=>{let t=new MediaStream([e.mediaStreamTrack]);e.kind===ev.CC.Kind.Video?d(t):e.kind===ev.CC.Kind.Audio&&g(t)},i=()=>{var e;null==(e=f.current)||e.call(f,"LiveKit disconnected")};return r.on(ev.u9.TrackSubscribed,a),r.on(ev.u9.Disconnected,i),r.connect(t,n).catch(t=>{if(!e){var n;null==(n=f.current)||n.call(f,t instanceof Error?t.message:"LiveKit connect failed")}}),()=>{e=!0,r.off(ev.u9.TrackSubscribed,a),r.off(ev.u9.Disconnected,i),r.disconnect().catch(()=>{}),d(null),g(null)}},[t,n]),(0,r.jsx)(ed.J,{videoStream:u,audioStream:m,isMuted:p,className:i,applyChromaKey:l,onFirstFrame:s})}function ey(e){let{outcome:t,identifiedProperties:n,onBooked:i}=e,[l]=(0,a.useState)(()=>(0,h.jH)((0,m.Qu)({url:t.config.schedulerUrl,properties:n}))),o=(0,a.useCallback)(e=>{if("object"!=typeof e.data||null===e.data)return;let t=e.data.event;"string"==typeof t&&t.startsWith("calendly")&&"calendly.event_scheduled"===t&&i()},[i]);return(0,a.useEffect)(()=>(window.addEventListener("message",o),()=>window.removeEventListener("message",o)),[o]),(0,r.jsx)("iframe",{src:l,title:"Scheduling",className:"h-full w-full border-0",sandbox:"allow-forms allow-popups allow-scripts allow-same-origin",allow:"clipboard-read; clipboard-write",referrerPolicy:"strict-origin-when-cross-origin",loading:"lazy"})}function ek(e){return"CALENDAR"===e.type}var ew=n(47035);function ej(e){let{outcome:t,identifiedProperties:n,horizontalLogo:a,isMeetingBookingConfirmed:i=!1,onCtaClick:l,onScheduleClick:o}=e;return"CTA"===t.type?(0,r.jsx)(eC,{horizontalLogo:a,title:t.config.title,description:t.config.description||void 0,href:(0,h.jH)((0,m.Qu)({url:t.config.buttonUrl,properties:n})),buttonText:t.config.buttonText,onClick:l}):ek(t)?(0,r.jsx)(eS,{horizontalLogo:a,isMeetingBookingConfirmed:i,title:t.config.title,description:t.config.description||void 0,buttonText:t.config.buttonText||eN,onSchedule:o}):"MESSAGE_ONLY"===t.type?(0,r.jsx)(ew.Z_,{children:(0,r.jsx)("p",{className:"text-sm text-gray-500",children:t.finalMessage})}):null}function eC(e){let{title:t,description:n,href:a,buttonText:i,horizontalLogo:l,onClick:o}=e;return(0,r.jsxs)(ew.Z_,{children:[l&&(0,r.jsx)("div",{className:"mb-1 max-w-[180px]",children:(0,r.jsx)("img",{src:l,alt:"Logo",className:"h-4 w-auto"})}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:t}),n&&(0,r.jsx)("p",{className:"text-sm text-gray-500",children:n})]}),(0,r.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"mt-3 w-full",onClick:o,children:(0,r.jsx)(ee.$,{variant:"outline",size:"md",className:"w-full",children:i})})]})}let eN="Schedule a call";function eS(e){let{horizontalLogo:t,isMeetingBookingConfirmed:n,title:a,description:i,buttonText:l,onSchedule:o}=e;return n?(0,r.jsxs)(ew.Z_,{children:[t&&(0,r.jsx)("div",{className:"mb-1 max-w-[180px]",children:(0,r.jsx)("img",{src:t,alt:"Logo",className:"h-4 w-auto"})}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:"Meeting booked"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"Check your inbox for a calendar invite."})]})]}):(0,r.jsxs)(ew.Z_,{children:[t&&(0,r.jsx)("div",{className:"mb-1 max-w-[180px]",children:(0,r.jsx)("img",{src:t,alt:"Logo",className:"h-4 w-auto"})}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:a}),i&&(0,r.jsx)("p",{className:"text-sm text-gray-500",children:i})]}),(0,r.jsx)(ee.$,{variant:"outline",size:"md",className:"mt-3 w-full",onClick:o,children:l})]})}var eI=n(95632),eM=n(87275),eE=n(90491),eA=n(92869),eP=n(8253),eD=n(52412);function eL(e){let{themeConfig:t,children:n}=e;return(0,eD.DE)()?(0,r.jsx)(K.s,{themeVersion:t,children:n}):null}function eT(e){let{className:t,children:n}=e;return(0,r.jsx)("div",{className:(0,eI.cn)("rounded-ct-dialog-radius bg-ct-dialog-bg text-ct-dialog-text text-ct-dialog-font-size font-ct-dialog-font-family max-h-[90vh] w-full overflow-y-auto p-6 text-left shadow-lg",t),children:n})}function eR(e){let{shareLinkId:t,themeConfig:n,onComplete:i}=e,[l,o]=(0,a.useState)(!1),[s,c]=(0,a.useState)(!1),u=(0,a.useCallback)(async e=>{try{c(!0),await (0,eM.f)({shareLinkId:t,passcode:e})?i():o(!0)}finally{c(!1)}},[t,i]);return(0,r.jsx)(eL,{themeConfig:n,children:(0,r.jsx)(eE.A,{passcodeRequired:!0,passcodeIncorrect:l,passcodeLoading:s,onSubmit:u,onClearIncorrect:()=>o(!1)})})}function eB(e){let{projectShareLink:t,workspaceCustomProperties:n,workspaceLogoUrl:i,language:l,trackEngagement:o,themeConfig:s,onComplete:c}=e,d=(0,a.useCallback)(e=>{let t=Object.entries(e).map(e=>{let[t,n]=e;return{propertyId:t,value:null==n?null:String(n)}});c((0,y.ui)(t,n,u.GfC.Form))},[c,n]);return(0,r.jsx)(eL,{themeConfig:s,children:(0,r.jsx)(eT,{className:"max-w-135",children:(0,r.jsx)(eA.A,{projectShareLink:t,workspaceLogoUrl:i,workspaceCustomProperties:n,language:l,trackEngagement:null!=o?o:"on",onValidated:d,hideNonWorkspaceProperties:!1})})})}function eF(e){let{projectShareLink:t,workspaceLogoUrl:n,language:a,themeConfig:i,onComplete:l}=e;return t.introVideo?(0,r.jsx)(eL,{themeConfig:i,children:(0,r.jsx)(eT,{className:"max-w-160 p-0",children:(0,r.jsx)(eP.A,{introVideo:t.introVideo,workspaceLogoUrl:n,creator:t.creator,language:a,onContinue:l,videoSize:u.zrK.Large})})}):null}var e_=n(22743),ez=n(14720),eO=n(99214),eU=n(14759);let eV=eU.k5n(["up","down"]),eH=eU.aig().int().min(1).max(5),eK=eU.Ikc({kind:eU.euz("turn"),sessionId:eU.YjP().min(1),turnIndex:eU.aig().int().nonnegative(),rating:eV,comment:eU.YjP().min(1).max(2e3).optional()}),eW=eU.Ikc({kind:eU.euz("session"),sessionId:eU.YjP().min(1),rating:eH,comment:eU.YjP().min(1).max(2e3).optional()});eU.gMt("kind",[eK,eW]);var eG=n(78845),eq=n(65341),eJ=n(50646),e$=n(7172),eY=n(75761),eX=n(87173),eQ=n(34281);let eZ="flex size-5 shrink-0 items-center justify-center rounded-full border border-black/5 bg-white/90 text-[11px] tabular-nums text-gray-700",e0={opacity:[1,.55,1],scale:[1,1.06,1],y:0,transition:{duration:.3,times:[0,.35,1],ease:"easeInOut"}},e1={opacity:.4,scale:1,y:0,transition:{duration:.2}},e2={opacity:0,scale:1.08,transition:{duration:.2}},e5={opacity:0,scale:.9,y:8,transition:{duration:.18}};
3function e3(e){let{title:t,options:n,onSelect:i,isDarkBackground:l,isLightestBackground:o}=e,s=(0,a.useMemo)(()=>n.slice(0,9),[n]),[c,u]=(0,a.useState)(null),[d,m]=(0,a.useState)("idle"),g=(0,a.useRef)(null),p=(0,a.useRef)(i);p.current=i;let f=(0,a.useCallback)(()=>{let e=g.current;e&&(g.current=null,p.current(e.id,e.value,e.optionNumber))},[]),h=(0,a.useCallback)((e,t)=>{"idle"===d&&(g.current={id:e.id,value:e.value,optionNumber:t},u(e.id),m("selected"))},[d]);(0,a.useEffect)(()=>{if("selected"!==d)return;let e=setTimeout(()=>{m("exiting"),f()},360);return()=>{clearTimeout(e)}},[d,f]),(0,a.useEffect)(()=>()=>{f()},[f]),(0,a.useEffect)(()=>{if("idle"===d)return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)};function e(e){if(e.metaKey||e.ctrlKey||e.altKey||function(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||e.isContentEditable}(e.target))return;let t=Number(e.key)-1;!Number.isInteger(t)||t<0||t>=s.length||(e.preventDefault(),h(s[t],t+1))}},[h,d,s]);let x=(0,eI.cn)("px-1 text-xs font-medium",l?"text-white/80":"text-gray-600"),v="exiting"!==d;return(0,r.jsx)(eY.x,{transition:{type:"spring",visualDuration:.2,bounce:0},children:(0,r.jsx)("div",{className:"flex flex-col gap-1.5 @max-[1200px]/agent-player:gap-1",children:(0,r.jsxs)(eX.N,{mode:"popLayout",custom:c,onExitComplete:f,children:[v&&(0,r.jsx)(eQ.P.div,{initial:{opacity:0,x:-2},animate:{opacity:1,x:0},exit:{opacity:0,y:-2,transition:{duration:.18}},className:x,children:t},"multiple-choice-title"),v&&s.map((e,t)=>{let n=c===e.id,a="selected"===d&&!n,i="selected"===d&&n;return(0,r.jsxs)(eQ.P.button,{type:"button",layout:!0,initial:{opacity:0,scale:.5,y:16},animate:function(e){let{isHighlighting:t,isDimmed:n,index:r}=e;return t?e0:n?e1:{opacity:1,scale:1,y:0,transition:{type:"spring",visualDuration:.32,bounce:.25,delay:.09*r}}}({isHighlighting:i,isDimmed:a,index:t}),variants:{exit:t=>t===e.id?e2:e5},exit:"exit",whileTap:"idle"===d?{scale:.98}:void 0,"aria-keyshortcuts":String(t+1),className:(0,eI.cn)("flex w-full items-center gap-2.5 px-2 py-1.5 text-left text-sm backdrop-blur-md","@max-[1200px]/agent-player:gap-2 @max-[1200px]/agent-player:px-1.5 @max-[1200px]/agent-player:py-1.5","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current/30",(0,e$.EX)(l,o)),disabled:"idle"!==d,onClick:()=>h(e,t+1),children:[(0,r.jsx)("span",{"aria-hidden":!0,className:eZ,children:t+1}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.value})]},e.id)})]})})})}let e9={right:{standalone:"rounded-tl-2xl rounded-tr-2xl rounded-bl-2xl rounded-br-sm",first:"rounded-tl-2xl rounded-tr-2xl rounded-bl-2xl rounded-br-sm",middle:"rounded-tl-2xl rounded-tr-sm rounded-bl-2xl rounded-br-sm",last:"rounded-tl-2xl rounded-tr-sm rounded-bl-2xl rounded-br-sm"},left:{standalone:"rounded-tl-2xl rounded-tr-2xl rounded-bl-sm rounded-br-2xl",first:"rounded-tl-2xl rounded-tr-2xl rounded-bl-sm rounded-br-2xl",middle:"rounded-tl-sm rounded-tr-2xl rounded-bl-sm rounded-br-2xl",last:"rounded-tl-sm rounded-tr-2xl rounded-bl-sm rounded-br-2xl"}};function e6(e){switch(e.kind){case"resource":return e.sharedAt;case"text":case"choice":return e.timestamp;default:return}}var e4=n(11956);let e8="px-3.5 max-w-[75%] py-2 leading-[160%] whitespace-pre-wrap wrap-anywhere @max-[1200px]/agent-player:px-2.5 @max-[1200px]/agent-player:py-1.5",e7=(0,a.memo)(function(e){let{message:t,clusterPosition:n="standalone",getFileDownloadUrl:i,resourceVariant:l="glass",isLightestBackground:o,size:s="sm",onRate:c,isLatestAssistantMessage:u=!1,hasVisibleEntrance:d=!1}=e,[m,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{g(!0)},[]);let p={layout:"position",initial:!1,animate:m?{opacity:1,y:0,scale:1}:{opacity:+!!d,y:10,scale:.98},transition:{duration:.22,ease:[.16,1,.3,1]},exit:{opacity:0,y:-4,scale:.98}};if("resource"===t.kind)return(0,r.jsx)(eQ.P.div,{...p,className:"flex justify-start",children:(0,r.jsx)(e4.o,{resource:t.resource,getFileDownloadUrl:i,variant:l})});if("activity"===t.kind)return(0,r.jsx)(eQ.P.div,{...p,className:"flex justify-start",children:(0,r.jsx)("div",{className:"w-full px-1.5 py-1",children:(0,r.jsx)(eG.H,{rows:t.rows,active:t.active,size:s})})});if("plan"===t.kind)return(0,r.jsx)(eQ.P.div,{...p,className:"flex justify-start",children:(0,r.jsx)("div",{className:"w-full px-1.5 py-1",children:(0,r.jsx)(eJ.w,{title:t.title,steps:t.steps,size:s})})});let f="choice"===t.kind,h="user"===t.role,x="text"===t.kind?t.rating:void 0,v=!h&&!f&&null!=c,b=v&&u,y=v&&!u;return(0,r.jsxs)(eQ.P.div,{...p,className:(0,eI.cn)("flex",h?"justify-end":"justify-start",v&&"flex-col items-start",y&&"group"),children:[(0,r.jsxs)("div",{className:(0,eI.cn)(e8,eG.u[s].text,e9[h?"right":"left"][n],h?(0,e$.SA)(o):(0,e$.s9)(o),f&&"flex items-center gap-2"),children:["choice"===t.kind&&null!=t.optionNumber&&(0,r.jsx)("span",{"aria-hidden":!0,
3className:eZ,children:t.optionNumber}),t.content]}),b&&(0,r.jsx)("div",{className:"-mt-1 px-1.5",children:(0,r.jsx)(eq.z,{rating:x,onRate:e=>c(t.id,e),revealOnHover:!1})}),y&&(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(eq.z,{rating:x,onRate:e=>c(t.id,e),collapseWhenHidden:!0,className:"px-1.5"})})]})});var te=n(95678),tt=n(16697);function tn(e){let{rating:t,defaultRating:n=null,onRatingChange:a,onRequestComment:i,hasComment:l,isDarkBackground:o,isLightestBackground:s}=e,[c,u]=(0,tt.i)({prop:t,defaultProp:n,onChange:a}),d=e=>{let t=c===e?null:e;u(t),"down"===t&&(null==i||i())},m=(0,e$.EX)(o,s),g=e=>{let t=c===e,n=null!=c&&!t;return(0,eI.cn)("backdrop-blur-md",m,t&&(o?(0,eI.cn)("bg-white/25 text-white","shadow-[inset_0_0_0_1px_rgba(255,255,255,0.28),0_1px_3px_0_rgba(0,0,0,0.35)]"):(0,eI.cn)("bg-white/45 text-gray-900","shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12),0_1px_2px_0_rgba(0,0,0,0.08)]")),n&&"opacity-45",!t&&!n&&(o?"text-white/80":s?"text-gray-700":"text-gray-800"))};return(0,r.jsxs)("div",{className:"mt-1 flex items-center gap-1 px-0.5",children:[(0,r.jsx)(er.K,{icon:"thumbs-up",size:"xs",variant:"ghost","aria-label":"Good response",tooltip:"Good response",isActive:"up"===c,className:g("up"),onClick:()=>d("up")}),(0,r.jsx)(er.K,{icon:"thumbs-down",size:"xs",variant:"ghost","aria-label":"Bad response",tooltip:"Bad response",isActive:"down"===c,className:g("down"),onClick:()=>d("down")}),(0,r.jsx)(eX.N,{initial:!1,children:l&&(0,r.jsxs)(eQ.P.span,{initial:{opacity:0,x:-2},animate:{opacity:1,x:0},exit:{opacity:0},transition:{duration:.2},className:(0,eI.cn)("flex items-center gap-1 text-[11px] pl-1",o?"text-white/50":"text-gray-400"),children:[(0,r.jsx)(te.I,{name:"check",size:"xs"}),"Noted"]},"feedback-sent")})]})}function tr(e){var t,n;let{messages:i,className:l,leadingContent:o,trailingContent:s,hasVisibleLatestAssistantEntrance:c=!1,getFileDownloadUrl:u,resourceVariant:d="glass",isDarkBackground:m,isLightestBackground:g,size:p="sm",onRateMessage:f,showTurnFeedback:h=!1,turnRatings:x,onTurnFeedback:v,onRequestTurnComment:b,commentedTurnIds:y}=e,k=(0,a.useRef)(null),w=i.length,j=(0,a.useMemo)(()=>(function(e){let{timeGapMs:t=9e4}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];for(let r of e){let e=n[n.length-1],a=null==e?void 0:e.messages[e.messages.length-1];if(!e||!a||!function(e,t,n){if(e.role!==t.role)return!1;let r=e6(e),a=e6(t);return void 0===r||void 0===a||a-r<=n}(a.message,r,t)){n.push({key:r.id,role:r.role,messages:[{message:r,clusterPosition:"standalone"}]});continue}a.clusterPosition="standalone"===a.clusterPosition?"first":"middle",e.messages.push({message:r,clusterPosition:"last"})}return n})(i),[i]),C=null==(t=[...i].reverse().find(e=>"text"===e.kind&&"assistant"===e.role))?void 0:t.id,N=null!=s,S=(0,a.useMemo)(()=>i.reduce((e,t)=>e+("text"===t.kind?t.content.length:0),0),[i]);return(0,a.useEffect)(()=>{let e=k.current;e&&(w>0||N)&&(e.scrollTop=e.scrollHeight)},[w,N,S]),(0,r.jsx)("div",{className:(0,eI.cn)("relative z-0 flex min-h-0 flex-1 flex-col isolate overflow-clip rounded-[10px] [clip-path:inset(0_round_10px)] transform-gpu",l),children:(0,r.jsxs)("div",{ref:k,className:(0,eI.cn)("relative flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto py-3 @max-[1200px]/agent-player:gap-2 @max-[1200px]/agent-player:py-2","[scrollbar-width:thin] [scrollbar-color:transparent_transparent]","hover:[scrollbar-color:rgba(156,163,175,0.7)_transparent]","[&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar]:h-1.5","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-transparent","hover:[&::-webkit-scrollbar-thumb]:bg-gray-400/70","[&::-webkit-scrollbar-track]:bg-transparent"),children:[o?(0,r.jsx)("div",{className:"flex w-full flex-col gap-1",children:o}):null,j.map(e=>{var t;let n=e.key,a=h&&"assistant"===e.role&&null!=n,i=e.messages.map(e=>{let{message:t}=e;return t});return(0,r.jsxs)("div",{className:"flex flex-col gap-0.5",children:[e.messages.map(e=>{let{message:t,clusterPosition:n}=e;return(0,r.jsx)(e7,{message:t,clusterPosition:n,getFileDownloadUrl:u,resourceVariant:d,isLightestBackgroun
3d:g,size:p,onRate:f,isLatestAssistantMessage:t.id===C,hasVisibleEntrance:c&&t.id===C},t.id)}),a?(0,r.jsx)(tn,{rating:null!=(t=null==x?void 0:x[n])?t:null,onRatingChange:e=>null==v?void 0:v(n,e),onRequestComment:()=>null==b?void 0:b(n,i),hasComment:null==y?void 0:y.includes(n),isDarkBackground:m,isLightestBackground:g}):null]},e.key)}),(0,r.jsx)(eX.N,{initial:!1,mode:"popLayout",children:s?(0,r.jsx)(eQ.P.div,{className:"flex w-full flex-col gap-1",children:s},null!=(n=s.key)?n:"chat-trailing"):null})]})})}var ta=n(55507);function ti(e){let{starters:t,onStarterClick:n,isDarkBackground:i,isLightestBackground:l}=e,o=(0,a.useMemo)(()=>{var e;return null!=(e=null==t?void 0:t.filter(e=>e.value.trim().length>0).slice(0,5))?e:[]},[t]);return(0,r.jsx)(eY.x,{transition:{type:"spring",visualDuration:.2,bounce:0},children:(0,r.jsx)("div",{className:"flex flex-wrap justify-start gap-1 empty:hidden",children:(0,r.jsx)(eX.N,{mode:"popLayout",children:o.map((e,t)=>(0,r.jsx)(eQ.P.div,{layout:!0,initial:{opacity:0,scale:0,y:16},animate:{opacity:1,scale:1,y:0,transition:{type:"spring",visualDuration:.32,bounce:.25,delay:.09*t}},exit:{opacity:0,scale:.7,transition:{duration:.15}},whileTap:{scale:.98},className:"will-change-transform shrink-0",children:(0,r.jsx)(ta.v,{size:"sm",removeOnClick:!1,colorScheme:"white",className:(0,eI.cn)("px-2 backdrop-blur-md",(0,e$.EX)(i,l)),onClick:()=>null==n?void 0:n(e.id,e.value),children:e.value})},e.id))})})})}let tl=[0,.15,.3];function to(e){let{isLightestBackground:t,size:n="sm"}=e;return(0,r.jsx)(eQ.P.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9,transition:{duration:.08,ease:[.4,0,1,1]}},transition:{duration:.28,ease:[.34,1.56,.64,1]},className:"flex origin-bottom-left justify-start",role:"status","aria-label":"The agent is thinking",children:(0,r.jsx)("div",{className:(0,eI.cn)(e8,eG.u[n].text,e9.left.standalone,(0,e$.s9)(t)),children:(0,r.jsx)("span",{className:"flex items-center gap-1 py-[0.35em]",children:tl.map(e=>(0,r.jsx)(eQ.P.span,{"aria-hidden":!0,className:"block size-1.5 rounded-full bg-current",initial:{opacity:.25},animate:{opacity:[.25,.8,.25]},transition:{duration:1.1,times:[0,.4,1],repeat:1/0,ease:"easeInOut",delay:e}},e))})})})}var ts=n(40041);function tc(e){let{value:t,onValueChange:n,onSubmit:i,placeholder:l="Ask anything...",inputRef:o,submitRef:s,autoFocus:c,isSubmitDisabled:u=!1,isDarkBackground:d,isLightestBackground:m}=e,g=(0,a.useRef)(null),p=(0,ts.s)(g,o),f=(0,a.useRef)(!1);(0,a.useLayoutEffect)(()=>{let e=g.current;if(e){if(f.current){f.current=!1;return}let t=e.value.length;e.scrollLeft=e.scrollWidth,document.activeElement===e&&e.setSelectionRange(t,t)}},[t]);let h=()=>{if(u)return;let e=t.trim();e&&(i(e),n(""))};return(0,r.jsxs)("div",{className:"relative flex w-full min-w-0 items-center",children:[(0,r.jsx)("input",{ref:p,type:"text",value:t,onChange:e=>{f.current=!0,n(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),h())},placeholder:l,autoFocus:c,className:(0,eI.cn)("h-10 w-full min-w-0 rounded-full border-none pl-4 pr-11 text-sm backdrop-blur-md",d?"bg-white/0":"bg-white/20",d?"text-gray-100 placeholder:text-white/50":"text-gray-700 placeholder:text-gray-500","focus:outline-none",(0,e$.CL)(d,m))}),(0,r.jsx)(er.K,{ref:s,icon:"arrow-up",variant:"solid",size:"sm",className:"absolute right-1.5 rounded-full","aria-label":"Submit prompt",onClick:h,isDisabled:u})]})}var tu=n(96888),td=n(58086);function tm(){let e=(0,tu.MF)(),t=(0,a.useRef)(null),[n,i]=(0,a.useState)(0),[l,o]=(0,a.useState)(!1),s=(0,td.I)();if((0,a.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let n=e=>{i(t=>t===e?t:e)};n(e.clientWidth);let r=new ResizeObserver(e=>{var t;let r=null==(t=e[0])?void 0:t.contentRect.width;null!=r&&n(Math.round(r))});return r.observe(e),()=>r.disconnect()},[]),(0,a.useEffect)(()=>{n>0&&o(!0)},[n]),!e)return null;let{markerRef:c,aspectRatio:u,isAvatarHidden:d,isSlotVacated:m,isAvatarPending:g}=e,p=d&&!m&&!g,f=p||m||g,h=m||g?0:p?tu.D1:u>0?n/u:0,x=m||g?0:p?6:8,v=f?tu.b5:tu.Mn,b=f?tu.oA:tu.W9;return(0,r.jsxs)("div",{className:(0,eI.cn)("relative z-10 w-full shrink-0 overflow-visible px-3 @max-[1200px]/agent-player:px-2",m||g?"pt-0":"pt-3 @max-[1200px]/agent-player:pt-2"),style:{transition:l&&!s?"padding-top ".concat(v,"ms ").concat(b):void 0},children:[(0,r.jsx)("div",{ref:t,className:"pointer-events-none absolute inset-x-3 top-0 h-px overflow-hidden @max-[1200px]/agent-player:inset-x-2","aria-hidden":!0}),(0,r.jsx)("div",{ref:c,className:"pointer-events-none absolute inset-x-3 top-3 h-0 @max-[1200px]/agent-player:inset-x-2 @max-[1200px]/agent-player:top-2"}),(0,r.jsx)("div",{className:"pointer-events-none w-full",style:{height:h,marginBottom:x,contain:"layout",transition:l&&!s?"height ".concat(v,"ms ").concat(b,", margin-bottom ").concat(v,"ms ").concat(b):void 0}})]})}let tg={layout:"position",initial:{opacity:0,scale:.98}
3,animate:{opacity:1,scale:1},transition:{duration:.75,ease:[.16,1,.3,1]}};function tp(e){let{messages:t,className:n,showInitialConnectedMessage:i=!1,onInitialConnectedMessageDismissed:l,showDisconnectedMessage:o=!1,showThinkingMessage:s=!1,getFileDownloadUrl:c,resourceVariant:u="glass",isDarkBackground:d,isLightestBackground:m,isFooterDarkBackground:g,isFooterLightestBackground:p,footerContainerRef:f,onSubmitMessage:h,promptValue:x,defaultPromptValue:v="",onPromptValueChange:b,isSubmitDisabled:y=!1,starters:k,onStarterClick:w,choicePrompt:j,onChoiceSelect:C,size:N="sm",onRateMessage:S,showTurnFeedback:I=!1,defaultTurnRatings:M,onTurnFeedback:E,onTurnFeedbackComment:A}=e,[P="",D]=(0,tt.i)({prop:x,defaultProp:v,onChange:b}),[L,T]=(0,a.useState)(!1),[R,B]=(0,a.useState)(()=>null!=M?M:{}),[F,_]=(0,a.useState)(!1),z=(0,a.useRef)(l);z.current=l;let O=(0,a.useRef)(!1),U=(0,a.useCallback)((e,t)=>{B(n=>({...n,[e]:t})),null==E||E(e,t)},[E]),{commentTarget:V,commentDraft:H,setCommentDraft:K,isCommentSubmitted:W,commentedTurnIds:G,requestComment:q,dismissComment:J,submitComment:$}=function(){let{onSubmit:e,confirmationMs:t=1400}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[n,r]=(0,a.useState)(null),[i,l]=(0,a.useState)(""),[o,s]=(0,a.useState)(!1),[c,u]=(0,a.useState)([]),d=(0,a.useRef)(null),m=(0,a.useCallback)(()=>{null!=d.current&&(window.clearTimeout(d.current),d.current=null)},[]);(0,a.useEffect)(()=>()=>{null!=d.current&&window.clearTimeout(d.current)},[]);let g=(0,a.useCallback)((e,t)=>{m(),l(""),s(!1),r({turnId:e,messages:t})},[m]),p=(0,a.useCallback)(()=>{m(),r(null)},[m]),f=(0,a.useCallback)(a=>{if(!n)return;let{turnId:i}=n;null==e||e(i,a),u(e=>e.includes(i)?e:[...e,i]),s(!0),m(),d.current=window.setTimeout(()=>{d.current=null,r(null)},t)},[m,n,t,e]);return{commentTarget:n,commentDraft:i,setCommentDraft:l,isCommentSubmitted:o,commentedTurnIds:c,requestComment:g,dismissComment:p,submitComment:f}}({onSubmit:A});(0,a.useEffect)(()=>{i&&T(!0)},[i]),(0,a.useEffect)(()=>{if(!L)return;let e=window.setTimeout(()=>{_(!0)},700);return()=>{window.clearTimeout(e)}},[L]);let[Y,X]=(0,a.useState)(s),[Q,Z]=(0,a.useState)(!1);s!==Y&&(X(s),Z(!s));let ee=(0,eI.cn)("w-full px-1.5 text-center text-xs",d?"text-white/60":"text-black/50"),et=L&&F?(0,r.jsx)(eQ.P.div,{...tg,"aria-live":"polite",onAnimationComplete:()=>{var e;O.current||(O.current=!0,null==(e=z.current)||e.call(z))},className:"flex justify-start pt-2",children:(0,r.jsx)("div",{className:ee,children:"Chat connected"})}):void 0,en=(0,a.useMemo)(()=>o?(0,a.createElement)(eQ.P.div,{...tg,key:"chat-disconnected","aria-live":"polite",className:"flex justify-start"},(0,r.jsx)("div",{className:ee,children:"Disconnected"})):s?(0,r.jsx)(to,{isLightestBackground:m,size:N},"chat-thinking"):void 0,[o,s,ee,m,N]);return(0,r.jsxs)("div",{className:(0,eI.cn)("relative flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden bg-white/20 rounded-xl",(0,e$.D_)(d,m),n),children:[(0,r.jsx)(tm,{}),(0,r.jsx)("div",{className:"mx-3 mb-2 flex min-h-0 flex-1 flex-col @max-[1200px]/agent-player:mx-2",children:(0,r.jsx)(tr,{messages:t,hasVisibleLatestAssistantEntrance:Q,leadingContent:et,trailingContent:en,getFileDownloadUrl:c,resourceVariant:u,isDarkBackground:d,isLightestBackground:m,size:N,onRateMessage:S,showTurnFeedback:I,turnRatings:R,onTurnFeedback:U,onRequestTurnComment:q,commentedTurnIds:G})}),(0,r.jsx)(eX.N,{children:j?(0,r.jsx)(eQ.P.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.2,ease:[.16,1,.3,1]},className:"relative z-10 shrink-0 p-3 pt-1 @max-[1200px]/agent-player:px-2 @max-[1200px]/agent-player:pb-2",children:(0,r.jsx)(e3,{title:j.title,options:j.options,onSelect:(e,t,n)=>null==C?void 0:C(e,t,n),isDarkBackground:g,isLightestBackground:p})},"choice-".concat(j.id)):null}),h?(0,r.jsxs)("div",{ref:f,className:"flex shrink-0 flex-col gap-3 px-2.5 pb-3",children:[(0,r.jsx)(ti,{starters:j?void 0:k,onStarterClick:w,isDarkBackground:g,isLightestBackground:p}),(0,r.jsx)(tc,{value:P,onValueChange:D,onSubmit:h,isSubmitDisabled:y,isDarkBackgroun
3d:g,isLightestBackground:p})]}):null,(0,r.jsxs)(eX.N,{children:[V&&(0,r.jsx)(eQ.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-10 bg-white/60 backdrop-blur-[2px]",onClick:J},"turn-comment-backdrop"),V&&(0,r.jsxs)(eQ.P.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1},className:"absolute inset-x-3 top-1/4 z-20 flex flex-col gap-2 rounded-xl border border-gray-100 bg-white/50 backdrop-blur-md p-2.5 shadow-lg",onKeyDown:e=>{"Escape"===e.key&&J()},children:[(0,r.jsxs)("div",{className:(0,eI.cn)("flex flex-col gap-3",W&&"invisible"),children:[V.messages.map(e=>"text"===e.kind&&(0,r.jsxs)("div",{className:"text-xs whitespace-pre-wrap text-gray-600 [overflow-wrap:anywhere] italic border-l-2 border-gray-300 pl-2",children:['"',e.content,'"']},e.id)),(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("div",{className:"px-0.5 text-[11px] font-medium text-gray-500",children:"Leave feedback"}),(0,r.jsxs)("div",{className:"relative flex w-full min-w-0 items-center",children:[(0,r.jsx)("input",{type:"text",value:H,onChange:e=>K(e.target.value),onKeyDown:e=>{if("Enter"!==e.key)return;e.preventDefault();let t=H.trim();t&&!W&&$(t)},placeholder:"What went wrong?",autoFocus:!0,maxLength:2e3,disabled:W,className:(0,eI.cn)("h-7 w-full min-w-0 rounded-full border border-gray-300 bg-white","pl-2.5 pr-8 text-xs text-gray-700 placeholder:text-gray-400","focus:border-gray-200 focus:outline-none")}),(0,r.jsx)(er.K,{icon:"arrow-up",variant:"solid",size:"xs",className:"absolute right-0.5 rounded-full","aria-label":"Submit feedback",onClick:()=>{let e=H.trim();e&&!W&&$(e)},isDisabled:W||!H.trim()})]})]})]}),W&&(0,r.jsxs)(eQ.P.div,{initial:{opacity:0}
3,animate:{opacity:1},transition:{duration:.2},className:"absolute inset-0 flex items-center justify-center gap-1.5 text-xs text-gray-600","aria-live":"polite",children:[(0,r.jsxs)("svg",{className:"h-5 w-5 text-green-600",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[(0,r.jsx)(eQ.P.circle,{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",fill:"none",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{type:"spring",duration:.35,bounce:.1,delay:.05}}),(0,r.jsx)(eQ.P.path,{d:"m9 12 2 2 4-4",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{type:"spring",duration:.3,bounce:.1,delay:.22}})]}),"Thanks for your feedback"]})]},"turn-comment-".concat(V.turnId))]})]})}let tf=[1,2,3,4,5];function th(e){let{title:t="How was this session?",description:n="We'd love your thoughts before you go.",ctaLabel:i,onCtaClick:l,onSubmitFeedback:o,className:s}=e,[c,u]=(0,a.useState)(0),[d,m]=(0,a.useState)(0),[g,p]=(0,a.useState)(""),[f,h]=(0,a.useState)(!1);return(0,r.jsx)(eQ.P.div,{initial:{opacity:0}
3,animate:{opacity:1},transition:{duration:.3,ease:[.16,1,.3,1]},className:(0,eI.cn)("flex h-full w-full items-center justify-center bg-white p-6",s),children:f?(0,r.jsxs)(eQ.P.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.25,ease:[.16,1,.3,1]},className:"flex flex-col items-center gap-2 text-center","aria-live":"polite",children:[(0,r.jsx)("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-green-50",children:(0,r.jsx)(te.I,{name:"check",className:"h-4 w-4 text-green-600"})}),(0,r.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Thanks for your feedback"}),(0,r.jsx)("div",{className:"text-xs text-gray-500",children:"It helps us make these demos better."}),i&&(0,r.jsx)(ee.$,{variant:"solid",className:"mt-2",onClick:l,children:i})]}):(0,r.jsxs)("div",{className:"flex w-full max-w-sm flex-col gap-3 text-left",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("div",{className:"text-lg font-medium text-gray-900",children:t}),(0,r.jsx)("div",{className:"text-xs text-gray-500",children:n})]}),(0,r.jsx)("div",{className:"flex items-center gap-1",onMouseLeave:()=>m(0),children:tf.map(e=>{let t=e<=(d||c);return(0,r.jsx)("button",{type:"button","aria-label":"Rate ".concat(e," of 5"),"aria-pressed":e===c,onMouseEnter:()=>m(e),onClick:()=>u(e),className:"p-0.5",children:(0,r.jsx)(te.I,{name:t?"star-filled":"star",className:(0,eI.cn)("h-6 w-6 transition-colors",t?"text-gray-800":"text-gray-300")})},e)})}),(0,r.jsx)("textarea",{value:g,onChange:e=>p(e.target.value),placeholder:"Tell us more about your experience...",rows:3,maxLength:2e3,className:(0,eI.cn)("w-full resize-none rounded-xl border border-gray-300 bg-white px-3 py-2 text-xs text-gray-700 placeholder:text-gray-400","focus:border-gray-400 focus:outline-none")}),(0,r.jsx)(ee.$,{variant:"solid",className:"w-full",isDisabled:0===c||!o,onClick:()=>{0!==c&&o&&(o(c,g.trim()),h(!0))},children:"Submit feedback"})]})})}var tx=n(7339),tv=n(95669),tb=n.n(tv),ty=n(51652),tk=n(29989);function tw(e){let{agentDemoVersion:t,mode:n,themeConfig:i,showNavatticBranding:l,isInternalUser:o,showFeedbackMode:d,isNavatticAgentWorkerEnabled:m,trackEngagement:g,homepageSteps:p,shareLink:f,isPreview:h=!1}=e,[x,v]=(0,a.useState)("demo"),[b,y]=(0,a.useState)("#6366f1"),k=(0,a.useRef)(null),w=(0,a.useMemo)(()=>{var e;return h?(e=t.background,"demo"===x?e:"custom"===x?{__typename:"AgentDemoColorBackground",type:u.hKJ.Color,color:b}:el[x]):t.background},[t.background,x,b,h]),j=(0,O.U)(w),C=(0,a.useMemo)(()=>o?{preset:x,onPresetChange:v,customColor:b,onCustomColorChange:y}:void 0,[x,b,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ty.bV,{title:t.title}),(0,r.jsx)(tb(),{children:(0,r.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, viewport-fit=cover"})}),(0,r.jsx)(e_.B,{children:(0,r.jsx)("div",{ref:k,className:"relative flex h-screen w-screen flex-col overflow-hidden bg-gray-50",style:j,children:(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:(0,r.jsx)(c.e,{children:(0,r.jsx)(s.U,{children:(0,r.jsx)(tj,{agentDemoVersion:t,mode:n,trackEngagement:g,themeConfig:i,showNavatticBranding:l,showPauseControls:o,showFeedbackMode:d,isNavatticAgentWorkerEnabled:m,homepageSteps:p,shareLink:f,isPreview:h,effectiveBackground:w,backgroundElementRef:k,previewBackgroundControl:C})})})})})})]})}function tj(e){var t,n,i,o,s,O,U,V,H,K,W,G,q,J;let{agentDemoVersion:$,mode:Y,trackEngagement:X,themeConfig:Z,showNavatticBranding:ee,showPauseControls:et,showFeedbackMode:en,isNavatticAgentWorkerEnabled:er,homepageSteps:ea,shareLink:ei,isPreview:el,effectiveBackground:eo,backgroundElementRef:es,previewBackgroundControl:ec}=e,ed=(0,a.useRef)("chat"),{addTranscriptMessage:em,updateTranscriptMessage:eg,removeTranscriptMessage:ep,updateTranscriptItem:ev}=(0,c.c)(),ew=(0,a.useRef)(void 0),[eC,eN]=(0,a.useState)(null),eS=(0,a.useCallback)(()=>eN(null),[]),[eI,eM]=(0,a.useState)(!1),[eE,eA]=(0,a.useState)(!1),[eP,eD]=(0,a.useState)(!1),[eL,eT]=(0,a.useState)(null),[e_,eU]=(0,a.useState)(null),eV=function(e){if(!e)return!1;switch(e.__typename){case"AgentDemoNavatticFormConfig":return!!e.enhancedForm;case"AgentDemoHubspotFormConfig":return!!e.formId&&!!e.portalId;case"AgentDemoMarketoFormConfig":return!!e.formId&&!!e.munchkinId;default:return!1}}($.formConfig),eH=(0,a.useMemo)(()=>[(null==ei?void 0:ei.projectShareLink.needsPasscode)&&"passcode",(null==ei?void 0:ei.projectShareLink.recipientGateForm)&&"recipient-gate",(null==ei?void 0:ei.projectShareLink.introVideo)&&"recipient-intro","welcome",eV&&"form","active"].filter(e=>!!e),[ei,eV]),[eK,eW]=(0,a.useState)(eH[0]),eG=(0,a.useCallback)(()=>{eW(e=>{var t;return null!=(t=eH[eH.indexOf(e)+1])?t:e})},[eH]),eq=T(eo,L.d8),eJ=R(eo,eL,es,L.AE),e$=R(eo,e_,es,L.xL,{whiteOverlayOpacities:L.Uz}
3),eY=eq.contrastColor,eX=eq.isDarkBackground,eQ=eq.isLightestBackground,eZ=eJ.isDarkBackground,e0=eJ.isLightestBackground,e1=e$.isDarkBackground,e2=e$.isLightestBackground,e5=eJ.contrastColor,e3=null!=(o=$.environment.liveVersion)?o:$.environment.editVersion,e9=(0,ex.J)(e3),e6={width:e9.viewportWidth,height:e9.viewportHeight},e4=(0,a.useRef)(null),e8=(0,a.useCallback)(()=>{var e;return null==(e=e4.current)?void 0:e.pauseVideo()},[]),e7=(0,a.useCallback)(()=>{var e;return null==(e=e4.current)?void 0:e.playVideo()},[]),te=function(e){var t,n,r;let{agentDemoVersion:i,mode:l,isNavatticAgentWorkerEnabled:o,trackEngagement:s,shareLink:L,workspaceCustomProperties:T,initialMode:R,formProperties:B,onFormPropertiesIdentified:F,showPauseControls:_=!1,pauseCaptureVideo:z,playCaptureVideo:O,onUserVoiceTranscription:U}=e,[V,H]=(0,a.useState)("chat"===R?"connecting":"requesting-mic"),[K,W]=(0,a.useState)("active"),[G,q]=(0,a.useState)(!1),[J,$]=(0,a.useState)(!1),[Y,X]=(0,a.useState)(null),[Q,Z]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!0),en=(0,a.useRef)(!1),{bridgedAnonymousIdRef:er,setBridgedAnonymousId:ea,waitForBridgedAnonymousId:ei}=function(){let e=(0,a.useRef)(null),t=(0,a.useRef)([]),n=(0,a.useRef)(!1),r=(0,a.useCallback)(n=>{e.current=n;let r=t.current;for(let e of(t.current=[],r))e(n)},[]),i=(0,a.useCallback)(r=>{let{timeoutMs:a}=r;return new Promise(r=>{if(e.current)return void r(e.current);if(n.current)return void r(null);let i=!1,l=e=>{i||(i=!0,r(e))};t.current.push(l),window.setTimeout(()=>{e.current||(n.current=!0),l(e.current)},a)})},[]);return{bridgedAnonymousIdRef:e,setBridgedAnonymousId:r,waitForBridgedAnonymousId:i}}(),{sessionId:el,endUser:eo,customerId:es,sessionState:ec,sessionStatus:eu,isConnected:ed,isConnecting:em,connectToRealtime:eg,disconnectFromRealtime:ep,sendUserMessage:ef,sendEvent:eh,isAudioPlaybackEnabled:ex,setIsAudioPlaybackEnabled:ev,isRelayTransport:eb,isAgentMutedByHold:ey,isMicActive:ek,micButtonMode:ew,micAnalyser:ej,isPushToTalkHeld:eC,setMicActive:eN,triggerInitialIntroMessage:eS,isPaused:eI,pause:eM,resume:eE,setVideoPlaying:eA,notifyVideoEnded:eP,notifyVideoStalled:eD,notifyStepVisible:eL,isEscalationActive:eT,activeMultipleChoice:eR,clearMultipleChoice:eB,sendFlowPick:eF,activeStarters:e_,dismissStarter:ez,isIntroStage:eO,isInputEnabled:eU,agentState:eV,reachedOutcomeId:eH,isMeetingBookingConfirmed:eK,confirmMeetingBooked:eW,notifyOutcomeCtaClicked:eG,isAvatarHidden:eq,toggleAvatarHidden:eJ,liveAvatarTransport:e$,clearLiveAvatarTransport:eY,avatarRendersGreenScreen:eX,anamAvatarSessionToken:eQ,clearAnamAvatarSession:eZ,registerAvatarSink:e0,reportAvatarRenderStart:e1,reportAvatarServerWarning:e2,sharedResources:e5}=(0,A.M)({agentDemoVersionId:i.id,mode:l,isNavatticAgentWorkerEnabled:o,hasAnamAvatar:i.avatarVariant===u.fNK.LiveAvatar&&(0,p.ih)(i.liveAvatar),trackEngagement:s,shareLinkId:null==L?void 0:L.id,bridgedAnonymousIdRef:er,waitForBridgedAnonymousId:ei,autoConnect:!1,autoStartSimulatedUserMessage:!1,enableAutoDisconnectMs:(0,g.nn)(i.maxSessionDurationMinutes),micMode:i.micMode,pauseCaptureVideo:z,playCaptureVideo:O,onUserVoiceTranscription:U,onTermination:(0,a.useCallback)(()=>{$(!0),W("closing")},[]),onSessionExpired:(0,a.useCallback)(()=>{q(!0)},[]),onConnectionLost:(0,a.useCallback)(()=>{q(!0)},[])}),{transcriptItems:e3}=(0,c.c)(),e9=(0,a.useMemo)(()=>e3.filter(e=>"MESSAGE"===e.type&&!e.isHidden&&!!e.role&&!!e.title),[e3]),e6=(0,a.useMemo)(()=>(function(e,t){let n=[];for(let t of e)n.push({message:{kind:"text",id:t.itemId,role:t.role,content:t.title},timestamp:t.createdAtMs});for(let{resource:e,sharedAt:r}of t)n.push({message:{kind:"resource",id:"resource:".concat(e.id,":").concat(r),role:"resource",resource:e,sharedAt:r},timestamp:r});return n.sort((e,t)=>e.timestamp-t.timestamp),n.map(e=>e.message)})(e9,e5),[e9,e5]),{submitTurnFeedback:e4,submitTurnFeedbackComment:e8,submitSessionFeedback:e7}=function(e){let{mode:t,sessionId:n,turnIndexByMessageId:r}=e,i=(0,a.useRef)(null);(0,a.useEffect)(()=>{n&&(i.current=n)},[n]);let l=(0,a.useRef)(new Map);(0,a.useEffect)(()=>
3{l.current=new Map},[n]);let o=(0,a.useCallback)((e,n)=>{if(null==n)return void l.current.delete(e);l.current.set(e,n);let a=i.current,o=r.get(e);"live"===t&&a&&null!=o&&x({kind:"turn",sessionId:a,turnIndex:o,rating:n})},[t,r]);return{submitTurnFeedback:o,submitTurnFeedbackComment:(0,a.useCallback)((e,n)=>{var a;let o=i.current,s=r.get(e),c=n.trim();"live"===t&&o&&null!=s&&c&&x({kind:"turn",sessionId:o,turnIndex:s,rating:null!=(a=l.current.get(e))?a:"down",comment:c})},[t,r]),submitSessionFeedback:(0,a.useCallback)((e,n)=>{let r=i.current,a=n.trim();"live"===t&&r&&x({kind:"session",sessionId:r,rating:e,...a?{comment:a}:{}})},[t])}}({mode:l,sessionId:el,turnIndexByMessageId:(0,a.useMemo)(()=>{let e=new Map,t=0;for(let n of e9)e.set(n.itemId,t),t+=1;return e},[e9])}),[te,tt]=(0,a.useState)(0),tn=ee?0:e5.length-te,tr=(0,a.useCallback)(()=>et(!0),[]),ta=(0,a.useCallback)(()=>{et(!1),tt(e5.length)},[e5.length]),ti=(0,a.useCallback)(e=>"".concat(d.A.COPILOT_URL,"/agent-demo-resource/").concat(i.id,"/").concat(e.replace(/^documents\//,"")),[i.id]),{identifyVisitor:tl,visitor:to,properties:ts}=function(e){let{agentDemoVersionId:t,agentDemoSessionId:n,mode:r,trackEngagement:i,endUser:l,customerId:o,shareLink:s,workspaceCustomProperties:c,onIdentifyAnonymousId:d,bridgedAnonymousIdRef:m}=e,g=(0,M.T)({mode:r,trackEngagement:i}),[p,f]=(0,a.useState)([]),[h,x]=(0,a.useState)(g),A=(0,a.useRef)(null),P=(0,a.useRef)(!1),D=(0,a.useRef)(!1),L=(0,a.useRef)(!1),T=(0,a.useRef)(!1),R=(0,a.useCallback)(async e=>{if(g&&l&&n){f(t=>(function(e){if((0,y.vs)(e))return e;let t=(0,y.jy)(e),n=(0,N.gG)(null==t?void 0:t.value);return t&&n?[...e,{name:I.pd.CompanyDomain,value:n,object:u.$N4.CompanyAccount,source:t.source,captureMethod:t.captureMethod}]:e})([...t,...e]));try{await fetch((0,v.nLk)(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentDemoSessionId:n,endUserId:l.id,properties:e})})}catch(e){console.error("Failed to identify visitor:",e)}}},[g,l,n]);(0,a.useEffect)(()=>{o&&(0,j.xe)(o)},[o]),(0,a.useEffect)(()=>{var e;if(!g||!n||!l||A.current===n)return;let t=!1;x(!0);let r=null!=(e=null==m?void 0:m.current)?e:E.A.get(C.eSu);return(async()=>{for(let e=0;e<8;e++){if(t)return;try{let e=await fetch((0,v.TH1)(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n,uid:r})});if(t)return;if(e.ok){let r=await e.json().catch(()=>null);if(t)return;if((null==r?void 0:r.ready)!==!1){A.current=n;return}}else if(404!==e.status)return void console.error("Failed to enrich Navattic agent session:",e.status)}catch(e){console.error("Failed to enrich Navattic agent session:",e);return}e<7&&await (0,S.yy)(500)}t||console.error("Failed to enrich Navattic agent session: session row never materialized",{sessionId:n})})().finally(()=>{t||x(!1)}),()=>{t=!0}},[n,g,l,m]),(0,a.useEffect)(()=>{if(!l||!n||P.current)return;P.current=!0;let e=(0,k.cp)();if(0===Object.keys(e).length)return;let t=(0,y.kO)(e);t.length>0&&R(t)},[l,n,R]),(0,a.useEffect)(()=>{if(!l||!n||!s)return;let e=T.current||!!l.mostRecentEmail,t=!!s.recipientGateForm;if(e||t)return;let r=(0,k.VE)(),a=s.recipients.find(e=>{let{id:t}=e;return t===r});a&&!a.endUserId&&a.recipientType===u.Tir.Visitor&&(0,N.Bf)(a.recipientInfo)&&(T.current=!0,R([(0,y.IL)({name:I.pd.Email,value:a.recipientInfo,object:u.$N4.EndUser,source:u.GfC.ShareLink})]))},[l,n,s,R]),(0,a.useEffect)(()=>{if(!l||!n||!s||!c||D.current)return;D.current=!0;let e=(0,y.ui)(s.prefilledCustomPropertyValues,c,u.GfC.ShareLink);e.length>0&&R(e)},[l,n,s,c,R]),(0,a.useEffect)(()=>{l&&n&&!L.current&&(L.current=!0,fetch((0,v.gkt)(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentDemoVersionId:t,endUserId:l.id,agentDemoSessionId:n})}).catch(e=>{console.error("Failed to enrich Navattic agent visitor:",e)}))},[l,n,t]);let B=(0,a.useRef)([]);return(0,a.useEffect)(()=>{if(!l||!n||0===B.current.length)return;let e=B.current;B.current=[],R(e)},[l,n,R]),(0,b.M)({onIdentify:e=>{l&&n?R(e):B.current.push(...e)},onIdentifyAnonymousUser:e=>null==d?void 0:d(e),onCookieConsent:e=>(0,w.br)(e)}),{visitor:l,properties:p,isLoading:h,identifyVisitor:R}}({agentDemoVersionId:i.id,agentDemoSessionId:el,mode:l,trackEngagement:s,endUser:eo,customerId:es,shareLink:L,workspaceCustomProperties:T,onIdentifyAnonymousId:ea,bridgedAnonymousIdRef:er});(0,a.useEffect)(()=>{el&&to&&(null==B?void 0:B.length)&&(tl(B),F())},[el,to,B,tl,F]);let tc=(0,a.useCallback)(async()=>{H("requesting-mic");try{(await navigator.mediaDevices.getUserMedia({audio:!0}
3)).getTracks().forEach(e=>e.stop()),H("connecting"),eg({audioInput:!0,micMuted:!0})}catch(e){console.error(e instanceof Error?e.message:e),X("Microphone access is required to join the live demo."),H("error")}},[eg]);(0,a.useEffect)(()=>{!en.current&&R&&(en.current=!0,"chat"===R?eg({audioInput:!1}):tc())},[eg,R,tc]),(0,a.useEffect)(()=>{if("error"!==V){if(ed)return void H("viewing");em&&"viewing"!==V&&H("connecting")}},[em,ed,V]),(0,a.useEffect)(()=>{ed&&!Q&&(Z(!0),eS())},[ed,Q,eS]),(0,a.useEffect)(()=>{eu===u.xVo.Failed&&(X(null!=Y?Y:P),H("error"))},[Y,eu]),(0,a.useEffect)(()=>{if("connecting"!==V)return;let e=window.setTimeout(()=>{X(P),H("error")},2e4);return()=>window.clearTimeout(e)},[V]),(0,a.useEffect)(()=>{eH&&W("closing")},[eH]);let tu=(0,a.useCallback)(()=>{$(!0),ep(),W("closing")},[ep]),td=(0,a.useCallback)(()=>{eY(),q(!1),H("connecting"),W("active"),$(!1),Z(!1),eg({audioInput:"chat"!==R,micMuted:!0})},[eY,eg,R]);(0,a.useEffect)(()=>{if(!_)return;let e=e=>{if("Space"!==e.code)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),eI?eE():eM())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[_,eI,eM,eE]);let tm="error"===V,tg="requesting-mic"===V||"connecting"===V?D[V]:void 0,tp=(0,a.useMemo)(()=>i.ctaLink?(0,h.jH)((0,m.Qu)({url:i.ctaLink,properties:ts})):void 0,[i.ctaLink,ts]),tf=(0,a.useCallback)(()=>{eh({type:"cta.clicked",ctaHref:tp})},[eh,tp]),th=i.ctaEnabled&&i.ctaText?{text:i.ctaText,href:null!=tp?tp:"#",isHighlighted:eT,onClick:tf}:void 0,tx=th&&i.ctaAlwaysShowInPlayer?th:void 0,tv=(0,a.useMemo)(()=>{var e,t;return eH&&null!=(t=null==(e=i.outcomes)?void 0:e.find(e=>e.id===eH))?t:null},[eH,i.outcomes]),tb=(0,a.useMemo)(()=>{var e,t;if(!eR||0===eR.choices.length)return;let n=eR.choices.map((e,t)=>{var n;return{id:null!=(n=e.id)?n:"choice-".concat(t),value:e.label}});return{id:[null!=(e=eR.title)?e:"untitled",...n.map(e=>e.id)].join("|"),title:null!=(t=eR.title)?t:"Choose an option",options:n}},[eR]),ty=(0,a.useRef)(eR);ty.current=eR;let tk=(0,a.useCallback)((e,t)=>{let n=ty.current;(null==n?void 0:n.selectionKind)==="flow"?e===f.FL?ef(f.du):eF(e,t):ef(t),eB()},[eF,ef,eB]),tw=(0,a.useCallback)((e,t)=>{ez(e),ef(t)},[ez,ef]);return{sessionId:el,phase:V,isViewerReady:ed,isError:tm,connectionError:null!=Y?Y:P,loadingMessage:tg,captureSteps:ec.steps,startFromStepIndex:null!=(t=ec.startFromStepIndex)?t:0,flowStepIndex:null!=(n=ec.activeFlowStepIndex)?n:void 0,firstStepCaptureIds:ec.firstStepCaptureIds,activeFlowId:ec.activeFlowId,flowPlayback:ec.flowPlayback,agentState:eV,isAudioPlaybackEnabled:ex,setIsAudioPlaybackEnabled:ev,isRelayTransport:eb,isAgentMutedByHold:ey,isMicActive:ek,micButtonMode:ew,micAnalyser:ej,isPushToTalkHeld:eC,setMicActive:eN,setVideoPlaying:eA,notifyVideoEnded:eP,notifyVideoStalled:eD,notifyStepVisible:eL,sendUserMessage:ef,sendEvent:eh,handleLeave:tu,choicePrompt:tb,onMultipleChoiceSelect:tk,activeStarters:e_,onStarterClick:tw,isIntroStage:eO,isInputEnabled:eU,isChatPanelOpen:ee,openChatPanel:tr,closeChatPanel:ta,chatMessages:e6,pendingResourceCount:tn,getFileDownloadUrl:ti,submitTurnFeedback:e4,submitTurnFeedbackComment:e8,submitSessionFeedback:e7,identifiedProperties:ts,ctaButton:tx,horizontalLogo:null!=(r=i.horizontalLogo)?r:void 0,playerPhase:K,hasUserRequestedLeave:J,isDisconnected:G,disconnected:G?{onReconnect:td}:void 0,closing:{ctaButton:th},reachedOutcome:tv,isMeetingBookingConfirmed:eK,confirmMeetingBooked:eW,notifyOutcomeCtaClicked:eG,isAvatarHidden:eq,toggleAvatarHidden:eJ,liveAvatarTransport:e$,clearLiveAvatarTransport:eY,avatarRendersGreenScreen:eX,anamAvatarSessionToken:eQ,clearAnamAvatarSession:eZ,registerAvatarSink:e0,reportAvatarRenderStart:e1,reportAvatarServerWarning:e2}}({agentDemoVersion:$,mode:Y,isNavatticAgentWorkerEnabled:er,trackEngagement:X,shareLink:null==ei?void 0:ei.projectShareLink,workspaceCustomProperties:null==ei?void 0:ei.workspaceCustomProperties,initialMode:"active"===eK?ed.current:null,formProperties:eC,onFormPropertiesIdentified:eS,showPauseControls:et,pauseCaptureVideo:e8,playCaptureVideo:e7,onUserVoiceTranscription:e=>{var t;null==(t=ew.current)||t.call(ew,e)}}),tt=te.hasUserRequestedLeave||"closing"===te.playerPhase,tn="thinking"===te.agentState&&!te.isIntroStage,{promptValue:tr,onPromptValueChange:ta,onMicActiveChange:ti,onUserVoiceTranscription:tl,cancelVoiceUtterance:to,isVoiceUtterancePending:ts}=function(){let{language:e,isBrowserPreviewEnabled:t=!0,sendDraftMessage:n,
3clearInputAudioBuffer:r,commitInputAudioBuffer:i,promoteDraftMessage:l,removeDraftMessage:o,hideTranscriptMessage:s,updateDraftMessage:c}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[u,d]=(0,a.useState)(""),[m,g]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),h=(0,a.useRef)("idle"),x=(0,a.useRef)({...F}),v=(0,a.useRef)(null),b=z({sendDraftMessage:n,clearInputAudioBuffer:r,commitInputAudioBuffer:i,promoteDraftMessage:l,removeDraftMessage:o,hideTranscriptMessage:s,updateDraftMessage:c}),y=z(t),{sync:k,reset:w,flushTarget:j,clearTimer:C,targetRef:N}=function(e){let t=(0,a.useRef)(""),n=(0,a.useRef)(0),r=(0,a.useRef)(!1),i=(0,a.useRef)(null),l=(0,a.useCallback)(()=>{null!==i.current&&(clearTimeout(i.current),i.current=null)},[]),o=(0,a.useCallback)((t,r)=>{let a=_(t),i=Math.min(r,a);n.current=i,e(i>=a?t:function(e,t){var n,r;if(t<=0)return"";let a=null!=(r=null==(n=e.match(/^\s*/))?void 0:n[0])?r:"",i=e.slice(a.length);if(!i)return a;let l=0,o=0;for(;o<i.length&&l<t;){for(;o<i.length&&/\s/.test(i[o]);)o++;if(o>=i.length)break;for(;o<i.length&&!/\s/.test(i[o]);)o++;l++}return a+i.slice(0,o)}(t,i))},[e]),s=(0,a.useCallback)(()=>{null===i.current&&(i.current=setTimeout(()=>{i.current=null;let e=t.current,r=_(e);if(n.current>=r)return void o(e,r);o(e,n.current+1),n.current<_(t.current)&&s()},r.current?18:55))},[o]),c=(0,a.useCallback)((e,a)=>{let{flush:c}=a;t.current=e;let u=_(e),d=n.current;if(c){r.current=!0,l(),o(e,u);return}if(u<=d){l(),o(e,u);return}return null!==i.current?void o(e,d):u===d+1?void o(e,u):void(o(e,d+1),s())},[o,l,s]);return{sync:c,reset:(0,a.useCallback)(()=>{l(),t.current="",n.current=0,r.current=!1},[l]),flushTarget:(0,a.useCallback)(()=>(l(),r.current=!0,n.current=_(t.current),t.current.trim()),[l]),clearTimer:l,targetRef:t}}(d),S=(0,a.useCallback)(()=>{null!==v.current&&(clearTimeout(v.current),v.current=null)},[]),I=(0,a.useCallback)(()=>{x.current={...F}},[]),M=(0,a.useCallback)(()=>{let{realtimeItemId:e,optimisticItemId:t}=x.current,n=b.current.removeDraftMessage;e&&(null==n||n(e)),t&&(null==n||n(t)),x.current.optimisticItemId=null,x.current.realtimeItemId=null},[b]),E=(0,a.useCallback)(e=>{var t,n,r,a;let i=x.current,l=i.optimisticItemId;l&&(e.itemId&&(i.realtimeItemId=e.itemId,null==(t=(n=b.current).hideTranscriptMessage)||t.call(n,e.itemId)),!i.browserDriving&&e.isFinal&&e.transcript.trim()&&(null==(r=(a=b.current).updateDraftMessage)||r.call(a,l,e.transcript.trim())))},[b]),A=(0,a.useCallback)(()=>{S(),h.current="idle",g(!1),f(!1),w(),d("")},[S,w]),P=(0,a.useCallback)(()=>{if(v.current=null,"settling"!==h.current)return;let e=x.current,t=N.current.trim();if(!e.cancelled&&!e.realtimeConfirmed&&t){var n,r,a,i;null==(n=(r=b.current).clearInputAudioBuffer)||n.call(r),null==(a=(i=b.current).sendDraftMessage)||a.call(i,t)}A()},[N,b,A]);(0,a.useEffect)(()=>()=>{S(),C()},[C,S]),function(e){let{active:t,language:n,onTranscript:r,onUnavailable:i}=e,l=(0,a.useRef)(r);l.current=r;let o=(0,a.useRef)(i);o.current=i;let s=(0,a.useRef)(t);s.current=t;let c=(0,a.useRef)(n);c.current=n;let u=(0,a.useRef)(!1);(0,a.useEffect)(()=>{var e,n;if(!t)return;if(u.current){null==(e=o.current)||e.call(o);return}let r=B();if(!r){u.current=!0,null==(n=o.current)||n.call(o);return}let a=null,i=!1,d="",m=()=>{var e;u.current=!0,null==(e=o.current)||e.call(o)},g=()=>{if(i||!s.current||u.current)return;let e=new r;a=e,e.continuous=!0,e.interimResults=!0,e.lang=function(e){if(!e)return"en-US";switch(e){case"en":return"en-US";case"zhCN":return"zh-CN";case"zhTW":return"zh-TW";case"yue":return"zh-HK";case"pt":return"pt-BR";default:return e}}(c.current),e.onresult=e=>{let t="";for(let a=e.resultIndex;a<e.results.length;a++){var n,r;let i=e.results[a],l=null!=(r=null==(n=i[0])?void 0:n.transcript)?r:"";i.isFinal?d+=l:t+=l}let a="".concat(d).concat(t).trimStart();l.current(a)},e.onerror=t=>{if("no-speech"!==t.error&&"aborted"!==t.error&&("not-allowed"===t.error||"service-not-allowed"===t.error||"network"===t.error)){m(),i=!0;try{e.abort()}catch(e){}}},e.onend=()=>{if(a=null,!i&&s.current&&!u.current)try{g()}catch(e){m()}};try{e.start()}catch(e){m()}};return g(),()=>{i=!0;let e=a;if(a=null,e){e.onresult=null,e.onerror=null,e.onend=null;try{e.abort()}catch(t){try{e.stop()}catch(e){}}}}},[t])}({active:m,language:e,onTranscript:e=>{"holding"!==h.current||x.current.cancelled||(x.current.browserDriving=!0,k(e,{flush:!1}))},onUnavailable:()=>{x.current.browserDriving=!1}});let D=(0,a.useCallback)(e=>{var t,n,r,a,i,l;if(S(),e){I(),h.current="holding",w(),d(""),f(!0),g(y.current&&null!==B());return}if(g(!1),x.current.cancelled)return void A();let o=j(),s=x.current;if(o&&!s.optimisticItemId){let e=null==(t=(n=b.current).promoteDraftMessage)?void 0:t.call(n,o);e&&(s.optimisticItemId=e,s.realtimeItemId&&(null==(r=(a=b.current).hideTranscriptMessage)||r.call(a,s.realtimeItemId))),d("")}(s.realtimeConfirmed||!o)&&(null==(i=(l=b.current).commitInputAudioBuffer)||i.call(l)),h.current="settling",f(!0),v.current=setTimeout(P,s.realtimeConfirmed?400:1200)},[S,b,A,j,y,w,I,P]),L=(0,a.useCallback)(e=>{var t,n,r,a,i,l;let{transcript:o,isFinal:s}=e,c=x.current,u=h.current;if(function(e){let{transcript:t,isFinal:n,itemId:r}=e;return!!(r||n||t.trim())}(e)&&(c.realtimeConfirmed=!0),e.itemId&&!c.realtimeItemId&&(c.realtimeItemId=e.itemId),c.cancelled){e.itemId&&(null==(t=(n=b.current).removeDraftMessage)||t.call(n,e.itemId),c.realtimeItemId===e.itemId&&(c.realtimeItemId=null));return}if(c.optimisticItemId){E(e),"settling"===u&&c.realtimeConfirmed&&(S(),A());return}if("holding"===u){if(c.browserDriving){e.itemId&&(null==(r=(a=b.current).hideTranscriptMessage)||r.call(a,e.itemId));return}e.itemId&&o.trim()&&(null==(i=(l=b.current).hideTranscriptMessage)||i.call(l,e.itemId)),k(o,{flush:s});return}if("settling"===u){if(c.realtimeConfirmed){S(),o.trim()&&k(o,{flush:!0}),A();return}c.browserDriving&&N.current.trim()||k(o,{flush:!1})}},[S,N,b,A,E,k]);return{promptValue:u,onPromptValueChange:(0,a.useCallback)(e=>{if("settling"===h.current){if(!x.current.realtimeConfirmed){var t,n;null==(t=(n=b.current).clearInputAudioBuffer)||t.call(n)}M()}S(),w(),h.current="idle",I(),g(!1),f(!1),d(e)},[S,b,w,I,M]),onMicActiveChange:D,onUserVoiceTranscription:L,cancelVoiceUtterance:(0,a.useCallback)(()=>{var e,t;return"idle"!==h.current&&(x.current.cancelled=!0,null==(e=(t=b.current).clearInputAudioBuffer)||e.call(t),M(),A(),!0)},[b,A,M]),isVoiceUtterancePending:p}}({language:$.language,isBrowserPreviewEnabled:!te.isRelayTransport,sendDraftMessage:e=>{te.isIntroStage||tt||te.sendUserMessage(e,{skipTranscript:!0})},clearInputAudioBuffer:()=>{te.sendEvent({type:"input_audio_buffer.clear"})},commitInputAudioBuffer:()=>{te.isIntroStage||tt||te.sendEvent({type:"input_audio_buffer.commit"})},promoteDraftMessage:e=>{let t=(0,tk.A)().slice(0,32);return em(t,"user",e,!1,"voice"),t},removeDraftMessage:ep,hideTranscriptMessage:e=>{ev(e,{isHidden:!0})},updateDraftMessage:(e,t)=>
3{eg(e,t,!1)}});ew.current=tl;let tc=$.avatarVariant===u.fNK.LiveAvatar&&!!$.liveAvatar,tu=te.liveAvatarTransport,td=null!=(s=null==(t=$.liveAvatar)?void 0:t.endsWith("STANDING"))&&s,tm=te.avatarRendersGreenScreen,[tg,tf]=(0,a.useState)(!1),tv=(0,a.useRef)(te.activeFlowId);if(tv.current!==te.activeFlowId){let e=null!=tv.current&&null==te.activeFlowId;tv.current=te.activeFlowId,e&&!tg&&tf(!0)}(0,a.useEffect)(()=>{tg&&"idle"===te.agentState&&tf(!1)},[tg,te.agentState]);let tb=$.liveAvatarDisplayMode,ty=tb===u.jYB.FullScreen?"body":tb===u.jYB.Fixed||tb===u.jYB.Corner||"playing"===te.flowPlayback&&(null!=te.activeFlowId||tg)?"sidebar":"body",tw=tc&&tb===u.jYB.FullScreen,tj=tb===u.jYB.Corner||tb===u.jYB.Fixed,tC=$.liveAvatarHideEnabled&&tc&&tj;(0,a.useEffect)(()=>{var e,t;!tw&&(null==(e=te.firstStepCaptureIds)?void 0:e.length)&&(null==(t=e4.current)||t.warmCache(te.firstStepCaptureIds))},[tw,te.firstStepCaptureIds]);let tN=(null!=(O=null==(n=te.captureSteps)?void 0:n.length)?O:0)>0,tS=tw||!eI?[]:tN?te.captureSteps:ea,tI="active"===eK,tM=tI&&(!te.isViewerReady||!eI)&&!te.isError&&!te.isDisconnected,tE=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2200,r=(0,a.useMemo)(()=>(null!=e?e:[]).map(e=>e.trim()).filter(Boolean).slice(0,4),[e]),[i,l]=(0,a.useState)(0);if((0,a.useEffect)(()=>{if(!t||r.length<=1)return void l(0);let e=window.setInterval(()=>{l(e=>(e+1)%r.length)},n);return()=>window.clearInterval(e)},[t,r.length,n]),0!==r.length)return r[i%r.length]}($.loadingMessages,tM),tA=$.schedulerEnabled&&$.schedulerUrl?{url:(0,m.Qu)({url:$.schedulerUrl,properties:te.identifiedProperties}),hoverLabel:null!=(U=$.schedulerHoverLabel)?U:void 0}:void 0,tP=(0,a.useCallback)(e=>{"hold"===te.micButtonMode&&ti(e),te.setMicActive(e)},[ti,te.micButtonMode,te.setMicActive]),tD=(0,a.useCallback)(()=>{to(),te.isPushToTalkHeld&&tP(!1)},[to,tP,te.isPushToTalkHeld]);(0,a.useEffect)(()=>{(tt||!te.isViewerReady)&&te.isPushToTalkHeld&&tD()},[tt,te.isViewerReady,te.isPushToTalkHeld,tD]);let tL=e=>{eN(t=>[...null!=t?t:[],...e]),eG()},tT={title:$.title,description:null!=(V=$.welcomeDescription)?V:void 0,ctaText:null!=(H=$.welcomeButtonText)?H:void 0,logo:null!=(K=$.horizontalLogo)?K:void 0,showMicrophoneStep:(0,tx.A)($),onContinue:e=>{ed.current=(null==e?void 0:e.microphoneEnabledByDefault)===!0?"voice":"chat",te.setIsAudioPlaybackEnabled(!0),eG()}},tR={...ei&&{passcode:(0,r.jsx)(eR,{shareLinkId:ei.projectShareLink.id,themeConfig:Z,onComplete:eG}),"recipient-gate":(0,r.jsx)(eB,{projectShareLink:ei.projectShareLink,workspaceCustomProperties:ei.workspaceCustomProperties,workspaceLogoUrl:ei.workspaceLogoUrl,language:null!=(W=$.language)?W:void 0,trackEngagement:X,themeConfig:Z,onComplete:tL}),"recipient-intro":(0,r.jsx)(eF,{projectShareLink:ei.projectShareLink,workspaceLogoUrl:ei.workspaceLogoUrl,language:null!=(G=$.language)?G:void 0,themeConfig:Z,onComplete:eG})},form:(0,r.jsx)(Q,{agentDemoVersion:$,themeConfig:Z,onSubmit:tL})}[eK];(0,a.useEffect)(()=>{if(!tI||tt)return;let e=e=>{"Escape"===e.key&&!e.defaultPrevented&&(te.isPushToTalkHeld||ts)&&(document.querySelector('[role="dialog"][data-state="open"]')||(e.preventDefault(),tD()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[tD,tI,ts,te.isPushToTalkHeld,tt]);let tB=tI&&"closing"===te.playerPhase&&!!te.reachedOutcome&&ek(te.reachedOutcome)&&!te.isMeetingBookingConfirmed&&!!te.reachedOutcome&&ek(te.reachedOutcome)&&te.reachedOutcome.config.schedulerUrl.trim().length>0&&eP,tF=en&&"live"===Y,t_=tF&&tI&&"closing"===te.playerPhase&&!te.reachedOutcome;return(0,a.useEffect)(()=>{te.reachedOutcome||eD(!1)},[te.reachedOutcome]),(0,r.jsxs)(r.Fragment,{children:[el&&(0,r.jsx)(eu,{sessionId:te.sessionId,backgroundControl:ec}),(0,r.jsx)("div",{className:"relative flex min-h-0 w-full flex-1",children:(0,r.jsx)(l,{isMuted:!te.isAudioPlaybackEnabled||te.isAgentMutedByHold,children:(0,r.jsx)(ez.xb,{phase:tI?te.playerPhase:"lobby",controlBarContainerRef:eT,showNavatticBranding:ee,brandingWatermarkColor:eY,isDarkBackground:eX,isLightestBackground:eQ,closing:te.reachedOutcome&&!tB?{...te.closing,content:(0,r.jsx)(ej,{outcome:te.reachedOutcome,identifiedProperties:te.identifiedProperties,horizontalLogo:null!=(q=$.horizontalLogo)?q:void 0,isMeetingBookingConfirmed:te.isMeetingBookingConfirmed,onCtaClick:te.notifyOutcomeCtaClicked,onScheduleClick:()=>{eD(!0),te.notifyOutcomeCtaClicked()}})}:te.closing,showClosingDialog:!tB&&!t_,disconnected:tI?te.disconnected:void 0,connectionError:tI&&te.isError?{description:te.connectionError}:void 0,onChatSidebarToggle:tI&&!t_?te.isChatPanelOpen?te.closeChatPanel:te.openChatPanel:void 0,isChatSidebarOpen:tI&&!t_&&te.isChatPanelOpen,chatSidebarBadgeCount:tI?te.pendingResourceCount:0,lockChatSidebarOpen:tc&&!t_,showAvatarToggle:tC,isAvatarHidden:te.isAvatarHidden,onAvatarToggle:te.toggleAvatarHidden,scheduler:tA,onLobbyExitComplete:()=>eM(!0),browser:{aspectRatio:e6,ctaButton:tI&&eI?te.ctaButton:void 0,horizontalLogo:te.horizontalLogo,isLoading:tM&&!t_,loadingMessage:tI?null!=(J=null!=tE?tE:te.loadingMessage)?J:eI?void 0:"Joining call…":void 0},lobby:tR?{content:tR}:tT,controlBar:tI&&!tt?(0,r.jsx)(eO.s,{micActive:te.isMicActive,micMode:te.micButtonMode,micAnalyser:te.micAnalyser,isMicInputOpen:te.isInputEnabled,showMicInput:$.micInputEnabled,onMicChange:tP,agentMuted:!te.isAudioPlaybackEnabled,onAgentMutedChange:e=>{te.setIsAudioPlaybackEnabled(!e)}
3,onEndCall:te.handleLeave,waveformColor:e5,isDarkBackground:eZ,isLightestBackground:e0}):void 0,chatPanel:tI&&!t_&&(te.isChatPanelOpen||tc)?(0,r.jsx)(tp,{messages:te.chatMessages,showInitialConnectedMessage:!eE,onInitialConnectedMessageDismissed:()=>eA(!0),showDisconnectedMessage:tt,showThinkingMessage:tn,getFileDownloadUrl:te.getFileDownloadUrl,showTurnFeedback:tF,onTurnFeedback:te.submitTurnFeedback,onTurnFeedbackComment:te.submitTurnFeedbackComment,isDarkBackground:eX,choicePrompt:tt?void 0:te.choicePrompt,onChoiceSelect:te.onMultipleChoiceSelect,isLightestBackground:eQ,isFooterDarkBackground:e1,isFooterLightestBackground:e2,footerContainerRef:eU,promptValue:tr,onPromptValueChange:ta,onSubmitMessage:tt?void 0:te.sendUserMessage,isSubmitDisabled:te.isIntroStage||!te.isInputEnabled,starters:tt?void 0:te.activeStarters,onStarterClick:tt?void 0:te.onStarterClick}):void 0,liveAvatarPlacement:ty,liveAvatar:tI&&tc&&!te.isDisconnected&&!te.hasUserRequestedLeave?te.anamAvatarSessionToken?(0,r.jsx)(ef,{sessionToken:te.anamAvatarSessionToken,registerSink:te.registerAvatarSink,onRenderStart:te.reportAvatarRenderStart,onServerWarning:te.reportAvatarServerWarning,applyChromaKey:tm,onError:te.clearAnamAvatarSession,className:"h-full w-full"}):tu?(0,r.jsx)(eb,{livekitUrl:tu.livekitUrl,livekitClientToken:tu.livekitClientToken,applyChromaKey:td,onError:te.clearLiveAvatarTransport,className:"h-full w-full"}):(0,r.jsx)("div",{className:"h-full w-full animate-pulse rounded-[10px] bg-gray-200/60"}):void 0,children:t_?(0,r.jsx)(th,{ctaLabel:null==(i=te.closing.ctaButton)?void 0:i.text,onSubmitFeedback:te.submitSessionFeedback,onCtaClick:()=>{var e;let t=te.closing.ctaButton;t&&(null==(e=t.onClick)||e.call(t),window.open(t.href,"_blank","noopener"))}}):tB&&te.reachedOutcome&&ek(te.reachedOutcome)?(0,r.jsx)(ey,{outcome:te.reachedOutcome,identifiedProperties:te.identifiedProperties,onBooked:te.confirmMeetingBooked}):(0,r.jsx)(eh.A,{ref:e4,captureSteps:tS,startFromStepIndex:tI?te.
3startFromStepIndex:0,flowStepIndex:tI?te.flowStepIndex:void 0,isVisible:tI,isInteractive:tI&&$.allowCaptureInteraction,hideCursorWithoutTrigger:$.hideCursorWithoutTrigger,pace:$.pace,displayConfig:e9,agentMuted:!te.isAudioPlaybackEnabled,holdVideo:!te.isViewerReady||tt,onVideoPlayingChange:te.setVideoPlaying,onVideoEnded:te.notifyVideoEnded,onVideoStalled:te.notifyVideoStalled,onStepVisible:tI?te.notifyStepVisible:void 0})})})})]})}},7339:(e,t,n)=>{n.d(t,{A:()=>a});let r={OpenMic:"OPEN_MIC"},a=e=>{let{micInputEnabled:t,startWithVoice:n,micMode:a}=e;return t&&(n||a===r.OpenMic)}},11956:(e,t,n)=>{n.d(t,{o:()=>c});var r=n(6029),a=n(10115),i=n(7172),l=n(95632),o=n(95678),s=n(69222);function c(e){let{resource:t,getFileDownloadUrl:n,variant:c="solid"}=e,u="LINK"===t.type,d="FILE"===t.type,m=!u&&n?n(t.fileKey):null,g=u?t.url:m,p=null!=g,f=u?function(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch(t){return e}}(t.url):t.fileName,h="glass"===c,x=(0,l.cn)("flex flex-col w-[90%] max-w-[90%] gap-2 rounded-2xl rounded-bl-sm p-2 text-xs",h?(0,l.cn)(i.CY,p&&"transition-colors hover:bg-white/40"):(0,l.cn)("bg-white/75 border border-gray-100 text-gray-800","shadow-[inset_0px_1px_1px_0px_rgba(255,255,255,0.6)]",p&&"transition-colors hover:bg-white")),v=(0,r.jsxs)(r.Fragment,{children:[t.previewImageUrl&&(0,r.jsx)("div",{className:(0,l.cn)("relative overflow-hidden rounded-xl",h?"bg-white/20":"bg-gray-100"),children:(0,r.jsx)("img",{src:t.previewImageUrl,alt:"",className:"h-32 w-full object-cover",loading:"lazy"})}),(0,r.jsx)("div",{className:"flex items-start gap-2 px-1",children:(0,r.jsxs)("div",{className:(0,l.cn)("flex min-w-0 flex-1 flex-col",h?"gap-1":"gap-0.5"),children:[(0,r.jsxs)("div",{className:"flex gap-2 justify-between items-center",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-col justify-center",children:[(0,r.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,r.jsx)(o.I,{name:(0,a.v5)(t),size:"xs",className:h?"text-current":"text-gray-500"}),(0,r.jsx)("div",{className:"min-w-0 truncate font-semibold text-sm",children:t.title})]}),(0,r.jsx)("div",{className:(0,l.cn)("truncate",h?"text-[10px] text-current opacity-70":"text-[11px] text-gray-500"),children:f})]}),d&&p&&(0,r.jsx)(s.K,{icon:"download",size:"sm",variant:"ghost",className:h?"text-gray-900 enabled:hover:text-gray-900":"text-gray-500"})]}),t.description&&(0,r.jsx)("div",{className:(0,l.cn)("line-clamp-2 mt-1",h?"text-xs text-current leading-[150%]":"text-[11px] text-gray-600"),children:t.description})]})})]});return p?(0,r.jsx)("a",{href:g,target:"_blank",rel:"noopener noreferrer",download:u?void 0:t.fileName,className:x,children:v}):(0,r.jsx)("div",{className:x,children:v})}},22743:(e,t,n)=>{n.d(t,{B:()=>i});var r=n(6029),a=n(41456);function i(e){return(0,r.jsx)(a.Bc,{...e})}},25889:(e,t,n)=>{function r(e){let t=o(e);if(!t)return!1;let[n,r,a]=t;return 180>Math.round((299*n+587*r+114*a)/1e3)}n.d(t,{E2:()=>o,HD:()=>r,IK:()=>c,UW:()=>u,bq:()=>s});let a=/^#(?:[0-9a-f]{6}|[0-9a-f]{8})$/i,i=/^#[0-9a-f]{3}$/i,l=/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:\s*[,/]\s*(\d*\.?\d+%?))?\s*\)$/i;function o(e){return e?a.test(e)?[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]:i.test(e)?[parseInt(e.charAt(1).repeat(2),16),parseInt(e.charAt(2).repeat(2),16),parseInt(e.charAt(3).repeat(2),16)]:null:null}function s(e){var t;if(!e)return null;let n=e.trim(),r=o(n);if(r){let e=n.slice(7,9);return[...r,e?parseInt(e,16)/255:1]}let a=l.exec(n);if(!a)return null;let[,i,s,c,u]=a;return[Number(i),Number(s),Number(c),(t=u)?Math.min(Math.max(t.endsWith("%")?Number(t.slice(0,-1))/100:Number(t),0),1):1]}let c=[24,144,255,1];function u(e){var t;let[n,r,a]=null!=(t=s(e))?t:c;return"".concat(n,", ").concat(r,", ").concat(a)}},32916:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(34584),a=n(531),i=n(85053);let l=a.A.APP_URL;class o{async requestSessionToken(e){let t=l+(0,r.P_H)(),n=await fetch(t,{method:i.A.POST,cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)return null;let{token:a}=await n.json();return a||null}async generateFrontUserHash(){let e=l+(0,r.DX7)(),t=await fetch(e,{cache:"no-store"});if(!t.ok)return{userHash:null};let{userHash:n}=await t.json();return{userHash:n}}async checkSubmittedEmail(e){let t=await fetch(l+(0,r.Mmx)(),{method:i.A.POST,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.ok?await t.json():{accountExists:!1,organization:""}}async fetchWorkosToken(e){let t=new URL("https://api.workos.com/sso/token"),n=new URLSearchParams;for(let t in n.set("grant_type","authorization_code"),e)n.set(t,e[t]);t.search=n.toString();let r=await fetch(t,{method:i.A.POST,cache:"no-store"});return await r.json()}}let s=new o},44101:(e,t,n)=>{n.d(t,{U:()=>a});var r=n(70109);function a(e){if(!e)return{};
3switch(e.__typename){case"AgentDemoColorBackground":return{backgroundColor:e.color};case"AgentDemoImageBackground":return{backgroundImage:"url(".concat(e.imageUrl,")"),backgroundSize:"cover",backgroundPosition:"center"};case"AgentDemoGradientBackground":return{backgroundImage:(0,r.$_)(e.gradient)}}}},50646:(e,t,n)=>{n.d(t,{w:()=>s});var r=n(6029),a=n(78845),i=n(95678),l=n(85835);function o(e){let{step:t,size:n}=e,{text:o,icon:s}=a.u[n];if("in_progress"===t.status)return(0,r.jsxs)("div",{className:"flex items-start gap-x-2",children:[(0,r.jsx)(i.I,{name:"spinner",className:"text-subtle mt-0.5 shrink-0 ".concat(s)}),(0,r.jsx)(l.n,{className:o,children:t.title})]});let c="done"===t.status;return(0,r.jsxs)("div",{className:"flex items-start gap-x-2 ".concat(o," ").concat(c?"text-subtle":"text-default"),children:[(0,r.jsx)(i.I,{name:c?"circle-check":"circle-dashed",className:"mt-0.5 shrink-0 ".concat(s," ").concat(c?"text-success":"text-subtle")}),(0,r.jsx)("span",{children:t.title})]})}function s(e){let{title:t,steps:n,size:l="sm"}=e,{text:s,icon:c}=a.u[l],u=n.filter(e=>"done"===e.status).length;return(0,r.jsxs)("div",{className:"bg-default rounded-lg border",children:[(0,r.jsxs)("div",{className:"flex items-center gap-x-2 border-b px-3 py-2",children:[(0,r.jsx)(i.I,{name:"list-checks",className:"text-subtle shrink-0 ".concat(c)}),(0,r.jsx)("span",{className:"text-default font-medium ".concat(s),children:t}),(0,r.jsxs)("span",{className:"text-subtle ml-auto ".concat(s),children:[u,"/",n.length]})]}),(0,r.jsx)("div",{className:"space-y-1.5 px-3 py-2",children:n.map((e,t)=>(0,r.jsx)(o,{step:e,size:l},t))})]})}},64236:(e,t,n)=>{n.d(t,{$c:()=>x,AE:()=>m,He:()=>y,K4:()=>f,Of:()=>h,Uz:()=>u,d8:()=>d,r7:()=>p,rf:()=>k,u:()=>w,uC:()=>v,xL:()=>g});var r=n(33612),a=n.n(r);let i="#e5e7eb",l="#374151",o="#111827",s="#ffffff",c="#f9fafb",u=[.2,.3],d={x:1,y:0},m={x:.5,y:1},g={x:1,y:.85};function p(e){let t=a()(e);return t.isValid()&&t.isDark()?i:l}function f(e,t){let n=a()(e);if(!n.isValid())return c;for(let e of t){let t=Math.max(0,Math.min(1,e));n=a().mix(n,"#ffffff",100*t)}return n.toHexString()}function h(e,t){return e?function(e){let t=a()(e);if(!t.isValid())return l;let n=a().readability(o,t),r=a().readability(s,t);return n>=4.5?o:r>=4.5?s:n>=r?o:s}(f(e,t)):o}function x(e){return a()(e).isLight()}function v(e){if(!e)return!1;let t=a()(e);return t.isValid()&&t.getBrightness()/255>=.95}function b(e,t){switch(e.__typename){case"AgentDemoColorBackground":return e.color;case"AgentDemoGradientBackground":return function(e,t){let n=[...e].sort((e,t)=>e.position-t.position);if(t<=n[0].position)return n[0].color;if(t>=n[n.length-1].position)return n[n.length-1].color;for(let e=0;e<n.length-1;e++){let r=n[e],i=n[e+1];if(t>=r.position&&t<=i.position){let e=(t-r.position)/(i.position-r.position);return a().mix(r.color,i.color,100*e).toHexString()}}return n[n.length-1].color}(e.gradient.stops,function(e,t,n){let r=(e-90)*Math.PI/180,a=Math.cos(r),i=Math.sin(r),l=[[0,0],[1,0],[0,1],[1,1]].map(e=>{let[t,n]=e;return t*a+n*i}),o=Math.min(...l);return(t*a+n*i-o)/(Math.max(...l)-o)*100}(e.gradient.angle,t.x,t.y));case"AgentDemoImageBackground":return c}}function y(e,t){return e?"AgentDemoImageBackground"===e.__typename?null:b(e,t):c}async function k(e,t,n){var r,i;return(null==e?void 0:e.__typename)==="AgentDemoImageBackground"?(i=e.imageUrl,new Promise((e,r)=>{let l=new Image;l.crossOrigin="anonymous",l.onload=()=>{try{var i,o;let s=document.createElement("canvas");s.width=1,s.height=1;let c=s.getContext("2d");if(!c)return void r(Error("Canvas 2D context is unavailable"));let u=Math.max(null!=(i=null==n?void 0:n.width)?i:window.innerWidth,1),d=Math.max(null!=(o=null==n?void 0:n.height)?o:window.innerHeight,1),m=Math.max(u/l.naturalWidth,d/l.naturalHeight),g=l.naturalWidth*m,p=l.naturalHeight*m,f=(g-u)/(2*m)+t.x*(u/m),h=(p-d)/(2*m)+t.y*(d/m),x=Math.max(1,.025*l.naturalWidth),v=Math.max(1,.025*l.naturalHeight),b=Math.max(0,Math.min(l.naturalWidth-x,f-x/2)),y=Math.max(0,Math.min(l.naturalHeight-v,h-v/2));c.drawImage(l,b,y,x,v,0,0,1,1);let[k,w,j]=c.getImageData(0,0,1,1).data;e(a()({r:k,g:w,b:j}).toHexString())}catch(e){r(e)}},l.onerror=r,l.src=i})).catch(()=>c):null!=(r=y(e,t))?r:c}
3function w(e,t){return e?"AgentDemoImageBackground"===e.__typename?i:p(b(e,t)):p(c)}},65341:(e,t,n)=>{n.d(t,{z:()=>o});var r=n(6029),a=n(95632),i=n(26100),l=n(69222);function o(e){let{rating:t,isSubmitting:n=!1,onRate:o,revealOnHover:s=!0,collapseWhenHidden:c=!1,className:u}=e,d=!s||void 0!==t||n,m=(0,r.jsxs)(i.e,{size:"xs",variant:"ghost",className:(0,a.cn)(!c&&["transition-opacity",!d&&"opacity-0 focus-within:opacity-100 group-hover:opacity-100"],u),children:[(0,r.jsx)(l.K,{icon:"thumbs-up","aria-label":"Good response",tooltip:"Good response",isActive:!0===t,isDisabled:n,onClick:()=>o(!0)}),(0,r.jsx)(l.K,{icon:"thumbs-down","aria-label":"Poor response",tooltip:"Poor response",isActive:!1===t,isDisabled:n,onClick:()=>o(!1)})]});return c?(0,r.jsx)("div",{className:(0,a.cn)("grid transition-[grid-template-rows] duration-200",d?"grid-rows-[1fr]":"grid-rows-[0fr] focus-within:grid-rows-[1fr] group-hover:grid-rows-[1fr]"),children:(0,r.jsx)("div",{className:"overflow-hidden",children:m})}):m}},70109:(e,t,n)=>{n.d(t,{$A:()=>b,$_:()=>h,vK:()=>d});var r=n(6029),a=n(95632),i=n(40380),l=n(69222),o=n(55809),s=n(78869),c=n(16697),u=n(55729);let d={angle:180,stops:[{color:"#FFFFFF",position:0},{color:"#E5E7EB",position:100}]},m={backgroundImage:"linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%)",backgroundSize:"10px 10px",backgroundPosition:"0 0, 0 5px, 5px -5px, -5px 0px"},g=[{angle:180,label:"Top to bottom"},{angle:0,label:"Bottom to top"},{angle:90,label:"Left to right"},{angle:270,label:"Right to left"},{angle:135,label:"Top-left to bottom-right"},{angle:225,label:"Top-right to bottom-left"},{angle:45,label:"Bottom-left to top-right"},{angle:315,label:"Bottom-right to top-left"}],p="custom",f=[...g.map(e=>({label:e.label,value:String(e.angle)})),{label:"Custom angle",value:p}];function h(e){let t=[...e.stops].sort((e,t)=>e.position-t.position).map(e=>"".concat(e.color," ").concat(e.position,"%")).join(", ");return"linear-gradient(".concat(e.angle,"deg, ").concat(t,")")}function x(e,t,n){return Math.max(t,Math.min(n,e))}function v(e){return(e%360+360)%360}function b(e){let{value:t,defaultValue:n=d,onValueChange:i,className:l}=e,[o=n,s]=(0,c.i)({prop:t,defaultProp:n,onChange:i}),{angle:m,stops:g}=o,[p,f]=(0,u.useState)(0),b=(0,u.useRef)(null),k=(0,u.useRef)(null),C=(0,u.useRef)(null);(0,u.useEffect)(()=>{p>=g.length&&f(Math.max(0,g.length-1))},[g.length,p]);let N=(0,u.useCallback)(e=>{s(e)},[s]),S=(0,u.useCallback)((e,t)=>{N({angle:m,stops:g.map((n,r)=>r===e?{...n,...t}:n)})},[m,g,N]),I=(0,u.useCallback)(e=>{var t,n;if(g.length>=8)return;let r=[...g].sort((e,t)=>e.position-t.position),a=null!=(n=null==(t=r[0])?void 0:t.color)?n:"#000000";for(let t=0;t<r.length-1;t++)if(e>=r[t].position&&e<=r[t+1].position){a=r[t].color;break}let i=[...g,{color:a,position:e}];N({angle:m,stops:i}),f(i.length-1)},[g,m,N]),M=(0,u.useCallback)(e=>{if(g.length<=2)return;let t=g.filter((t,n)=>n!==e);N({angle:m,stops:t}),f(n=>x(n>e?n-1:n,0,t.length-1))},[g,m,N]),E=(0,u.useCallback)(e=>{e&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),C.current=null},[]),A=g[p],P=(0,u.useMemo)(()=>h(o),[o]),D=(0,u.useMemo)(()=>h({angle:90,stops:g}),[g]);return(0,r.jsxs)("div",{ref:b,tabIndex:-1,onKeyDown:e=>{!("Delete"!==e.key&&"Backspace"!==e.key||e.target.closest('input, textarea, select, [contenteditable="true"]'))&&(g.length<=2||(e.preventDefault(),M(p)))},className:(0,a.cn)("flex flex-col gap-4 outline-none",l),children:[(0,r.jsx)(y,{ref:k,barGradientCss:D,stops:g,selectedIdx:p,canAdd:g.length<8,onBarPointerDown:e=>{var t;if(!k.current||e.target!==e.currentTarget)return;let n=k.current.getBoundingClientRect();I(x(Math.round((e.clientX-n.left)/n.width*100),0,100)),null==(t=b.current)||t.focus({preventScroll:!0})},onHandlePointerDown:(e,t)=>{var n;e.stopPropagation(),e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),C.current={idx:t,moved:!1},f(t),null==(n=b.current)||n.focus({preventScroll:!0})},onHandlePointerMove:(e,t)=>
3{let n=C.current;if(!n||n.idx!==t||!k.current||!e.currentTarget.hasPointerCapture(e.pointerId))return;n.moved=!0;let r=k.current.getBoundingClientRect(),a=x(Math.round((e.clientX-r.left)/r.width*100),0,100);a!==g[t].position&&S(t,{position:a})},onHandlePointerUp:E}),A&&(0,r.jsx)(w,{stop:A,canRemove:g.length>2,onColorChange:e=>S(p,{color:e}),onPositionChange:e=>S(p,{position:e}),onRemove:()=>M(p)}),(0,r.jsx)("div",{className:"h-px bg-gradient-to-r from-gray-200/0 via-gray-200 to-gray-200/0"}),(0,r.jsx)(j,{angle:m,previewGradientCss:P,onChange:e=>N({angle:v(e),stops:g})})]})}b.displayName="GradientInput";let y=e=>{let{ref:t,barGradientCss:n,stops:i,selectedIdx:l,canAdd:o,onBarPointerDown:s,onHandlePointerDown:c,onHandlePointerMove:u,onHandlePointerUp:d}=e;return(0,r.jsxs)("div",{className:"relative pt-2",children:[(0,r.jsx)("div",{ref:t,className:(0,a.cn)("relative overflow-hidden rounded-lg border border-gray-200",o?"cursor-copy":"cursor-default"),style:{height:35,...m},onPointerDown:s,"aria-label":"Gradient preview. Click to add a color stop.",children:(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{backgroundImage:n}})}),(0,r.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-2",children:i.map((e,t)=>(0,r.jsx)(k,{stop:e,isSelected:l===t,onPointerDown:e=>c(e,t),onPointerMove:e=>u(e,t),onPointerUp:d},t))})]})};function k(e){let{stop:t,isSelected:n,onPointerDown:i,onPointerMove:l,onPointerUp:o}=e;return(0,r.jsx)("button",{type:"button","aria-label":"Color stop at ".concat(t.position,"%, ").concat(t.color),onPointerDown:i,onPointerMove:l,onPointerUp:o,onPointerCancel:o,onLostPointerCapture:o,className:(0,a.cn)("pointer-events-auto absolute top-0 -translate-x-1/2 -translate-y-[12px] cursor-grab touch-none transition-transform","hover:-translate-y-[14px] active:cursor-grabbing focus-visible:outline-none"),style:{left:"".concat(t.position,"%")},children:(0,r.jsxs)("svg",{width:"28",height:"36",viewBox:"0 0 28 36",fill:"none",className:"drop-shadow-sm",children:[(0,r.jsx)("path",{d:"M5 1 H23 Q27 1 27 5 V20 Q27 24 23 24 H17 L14 32 L11 24 H5 Q1 24 1 20 V5 Q1 1 5 1 Z",fill:n?"#3b82f6":"white",stroke:n?"#2563eb":"#D1D5DB",strokeWidth:"1"}),(0,r.jsx)("rect",{x:"7",y:"6",width:"14",height:"12",rx:"3",fill:t.color,stroke:"rgba(0,0,0,0.12)",strokeWidth:"0.5"})]})})}function w(e){let{stop:t,canRemove:n,onColorChange:a,onPositionChange:s,onRemove:c}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-subtle w-14 shrink-0 text-xs font-medium uppercase tracking-wide",children:"Stop"}),(0,r.jsx)(i.A,{value:t.color,onValueChange:a,allowAlpha:!1,size:"sm",className:"flex-1","aria-label":"Stop color"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(o.p,{type:"text",inputMode:"numeric",size:"sm",value:String(t.position),onValueChange:e=>{let t=Number.parseInt(e.replace(/\D/g,""),10);Number.isFinite(t)&&s(x(t,0,100))},className:"w-20",inputClassName:"pr-6 tabular-nums text-right","aria-label":"Stop position"}),(0,r.jsx)("span",{className:"text-subtle pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"%"})]}),(0,r.jsx)(l.K,{icon:"trash",size:"sm",variant:"ghost",isDisabled:!n,onClick:c,"aria-label":"Remove stop",tooltip:n?"Remove stop":"Need at least 2 stops"})]})}function j(e){let{angle:t,previewGradientCss:n,onChange:i}=e,l=(0,u.useRef)(null),c=(0,u.useRef)(!1),d=g.find(e=>e.angle===t),[m,h]=(0,u.useState)(!d),x=m||!d,b=x?p:String(t),y=(0,u.useCallback)((e,t)=>{let n=l.current;if(!n)return;let r=n.getBoundingClientRect(),a=r.left+r.width/2;i(v(Math.round(180/Math.PI*Math.atan2(t-(r.top+r.height/2),e-a))+90))},[i]),k=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),c.current=!1};return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-subtle w-14 shrink-0 text-xs font-medium uppercase tracking-wide",children:"Angle"}),(0,r.jsx)(s.l6,{items:f,value:b,onValueChange:e=>{e===p?h(!0):(h(!1),i(v(Number(e))))},size:"sm",wrapperClassName:"flex-1",className:"min-w-0","aria-label":"Gradient direction"}),x?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{ref:l,role:"slider","aria-label":"Gradient angle","aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":t,tabIndex:0,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),c.current=!0,y(e.clientX,e.clientY)},onPointerMove:e=>{c.current&&y(e.clientX,e.clientY)},onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),i(v(t-(e.shiftKey?10:1)))):("ArrowRight"===e.key||"ArrowUp"===e.key)&&
3(e.preventDefault(),i(v(t+(e.shiftKey?10:1))))},className:(0,a.cn)("relative h-7 w-7 shrink-0 cursor-grab touch-none rounded-full border border-gray-200 shadow-xs transition-shadow","hover:shadow-sm active:cursor-grabbing focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900/30 focus-visible:ring-offset-1"),style:{backgroundImage:n},children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"absolute left-1/2 top-1/2 origin-bottom",style:{transform:"translate(-50%, -100%) rotate(".concat(t,"deg)"),transformOrigin:"50% 100%",width:"2px",height:"11px"},children:(0,r.jsx)("span",{className:"block h-full w-full rounded-full bg-gray-900"})}),(0,r.jsx)("span",{"aria-hidden":!0,className:"absolute left-1/2 top-1/2 h-1 w-1 -translate-x-1/2 -translate-y-1/2 rounded-full bg-gray-900 ring-1 ring-default"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(o.p,{type:"text",inputMode:"numeric",size:"sm",value:String(t),onValueChange:e=>{let t=Number.parseInt(e.replace(/\D/g,""),10);Number.isFinite(t)&&i(v(t))},className:"w-20",inputClassName:"pr-6 tabular-nums text-right","aria-label":"Angle in degrees"}),(0,r.jsx)("span",{className:"text-subtle pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"\xb0"})]})]}):(0,r.jsx)("div",{"aria-hidden":!0,className:"w-[116px] shrink-0"})]})}},78845:(e,t,n)=>{n.d(t,{H:()=>u,u:()=>s});var r=n(6029),a=n(44580),i=n(95678),l=n(85835),o=n(55729);let s={xs:{text:"text-xs",icon:"size-3"},sm:{text:"text-sm",icon:"size-3.5"}};function c(e){let{row:t,size:n}=e,{text:a,icon:o}=s[n];if("running"===t.status)return(0,r.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,r.jsx)(i.I,{name:"spinner",className:"text-subtle shrink-0 ".concat(o)}),(0,r.jsx)(l.n,{className:a,children:t.label})]});let c="error"===t.status;return(0,r.jsxs)("div",{className:"flex items-center gap-x-2 ".concat(a," ").concat(c?"text-danger":"text-subtle"),children:[(0,r.jsx)(i.I,{name:c?"triangle-alert":t.icon,className:"shrink-0 ".concat(o," ").concat(c?"text-danger":"text-subtle")}),(0,r.jsx)("span",{children:t.label}),"pending"===t.status&&(0,r.jsx)("span",{className:"italic",children:"— needs approval"}),"denied"===t.status&&(0,r.jsx)("span",{className:"italic",children:"— cancelled"})]})}function u(e){var t;let{rows:n,active:l=!1,size:u="sm"}=e,[d,m]=(0,o.useState)(!1),{text:g,icon:p}=s[u];if(0===n.length)return null;if(1===n.length)return(0,r.jsx)(c,{row:n[0],size:u});let f=n[n.length-1],h=l&&null!=(t=f.activeLabel)?t:f.label,x="".concat(h,", ").concat(n.length," tools used");return(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{type:"button",onClick:()=>m(e=>!e),className:"text-subtle hover:text-default flex items-center gap-x-2 transition-colors ".concat(g),children:[(0,r.jsx)(i.I,{name:l?"spinner":f.icon,className:"shrink-0 ".concat(p)}),(0,r.jsx)("span",{children:x}),(0,r.jsx)(i.I,{name:d?"chevron-down":"chevron-right",className:"shrink-0 ".concat(p)})]}),(0,r.jsx)(a.S,{isOpen:d,withTriggerSpacing:!1,children:(0,r.jsx)("div",{className:"mt-1.5 space-y-1.5 pl-1",children:n.map(e=>(0,r.jsx)(c,{row:e,size:u},e.id))})})]})}},82211:(e,t,n)=>{n.d(t,{l:()=>r});let r=e=>{let t=document.createElement("div");t.textContent=null!=e?e:null,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);let n=document.getSelection(),r=document.createRange();r.selectNodeContents(t),n&&(n.removeAllRanges(),n.addRange(r));let a=document.execCommand("copy");return document.body.removeChild(t),a}},85835:(e,t,n)=>{n.d(t,{n:()=>o});var r=n(6029),a=n(95632),i=n(34281),l=n(55729);let o=l.memo(function(e){let{children:t,as:n="div",className:o,duration:s=2,spread:c=2,style:u,playAnimation:d=!0,loop:m=!0,sweeps:g=1}=e,p=(0,l.useMemo)(()=>t.length*c,[t,c]);if(!d)return(0,r.jsx)(n,{className:(0,a.cn)("relative text-gray-900",o),style:u,children:t});let f=i.P.create(n);return(0,r.jsx)(f,{className:(0,a.cn)("relative inline-block bg-clip-text text-transparent",o),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:m?1/0:Math.max(g-1,0),duration:s,ease:"linear"},style:{"--spread":"".concat(p,"px"),"--base-color":"hsl(var(--color-gray-400))","--base-gradient-color":"hsl(var(--color-gray-900))","--bg":"linear-gradient(90deg, #0000 calc(50% - var(--spread)), var(--base-gradient-color), #0000 calc(50% + var(--spread)))",backgroundImage:"var(--bg), linear-gradient(var(--base-color), var(--base-color))",backgroundSize:"275% 100%, auto",backgroundRepeat:"no-repeat, repeat",WebkitBackgroun
3dClip:"text",backgroundClip:"text",...u},children:t})})}}]);
4//# sourceMappingURL=3208-19404e4bd955e1c6.js.map
5//# debugId=f351075f-e90b-50fc-8ab5-3025a80a344a

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.