@opencx/widget 3.0.52 → 3.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/designs.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react/jsx-runtime"),Tt=require("react"),ZC=require("tinycolor2"),vr=require("framer-motion"),Qk=require("clsx"),Wn=require("lucide-react"),G4=require("react-dropzone"),e_=require("react-hot-toast"),ft=require("./useUploadFiles-D4md7FH6.cjs"),$4=require("@radix-ui/react-tooltip"),Uw=require("@radix-ui/react-slot"),X4=require("@radix-ui/react-dropdown-menu"),K4=require("@radix-ui/react-dialog"),J4=require("@radix-ui/react-avatar"),Px=require("zod");function zm(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const ie=zm(Tt),jm=zm($4),Qn=zm(X4),so=zm(K4),Xf=zm(J4),Z4=350,Gk=400,$k=600,Bw={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},Xk=({primary:e="hsl(0, 0%, 0%)"})=>{const n=ZC(e).toHsl(),a=ZC(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${n.h} ${n.s*100}% ${n.l*100}%`,"--opencx-primary-foreground":a,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}},Hw="-",eI=e=>{const n=nI(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{const g=d.split(Hw);return g[0]===""&&g.length!==1&&g.shift(),Kk(g,n)||tI(d)},getConflictingClassGroupIds:(d,g)=>{const E=a[d]||[];return g&&s[d]?[...E,...s[d]]:E}}},Kk=(e,n)=>{var d;if(e.length===0)return n.classGroupId;const a=e[0],s=n.nextPart.get(a),f=s?Kk(e.slice(1),s):void 0;if(f)return f;if(n.validators.length===0)return;const h=e.join(Hw);return(d=n.validators.find(({validator:g})=>g(h)))==null?void 0:d.classGroupId},t_=/^\[(.+)\]$/,tI=e=>{if(t_.test(e)){const n=t_.exec(e)[1],a=n==null?void 0:n.substring(0,n.indexOf(":"));if(a)return"arbitrary.."+a}},nI=e=>{const{theme:n,prefix:a}=e,s={nextPart:new Map,validators:[]};return aI(Object.entries(e.classGroups),a).forEach(([h,d])=>{pw(d,s,h,n)}),s},pw=(e,n,a,s)=>{e.forEach(f=>{if(typeof f=="string"){const h=f===""?n:n_(n,f);h.classGroupId=a;return}if(typeof f=="function"){if(rI(f)){pw(f(s),n,a,s);return}n.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([h,d])=>{pw(d,n_(n,h),a,s)})})},n_=(e,n)=>{let a=e;return n.split(Hw).forEach(s=>{a.nextPart.has(s)||a.nextPart.set(s,{nextPart:new Map,validators:[]}),a=a.nextPart.get(s)}),a},rI=e=>e.isThemeGetter,aI=(e,n)=>n?e.map(([a,s])=>{const f=s.map(h=>typeof h=="string"?n+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([d,g])=>[n+d,g])):h);return[a,f]}):e,iI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,a=new Map,s=new Map;const f=(h,d)=>{a.set(h,d),n++,n>e&&(n=0,s=a,a=new Map)};return{get(h){let d=a.get(h);if(d!==void 0)return d;if((d=s.get(h))!==void 0)return f(h,d),d},set(h,d){a.has(h)?a.set(h,d):f(h,d)}}},Jk="!",oI=e=>{const{separator:n,experimentalParseClassName:a}=e,s=n.length===1,f=n[0],h=n.length,d=g=>{const E=[];let b=0,C=0,S;for(let B=0;B<g.length;B++){let H=g[B];if(b===0){if(H===f&&(s||g.slice(B,B+h)===n)){E.push(g.slice(C,B)),C=B+h;continue}if(H==="/"){S=B;continue}}H==="["?b++:H==="]"&&b--}const R=E.length===0?g:g.substring(C),k=R.startsWith(Jk),D=k?R.substring(1):R,L=S&&S>C?S-C:void 0;return{modifiers:E,hasImportantModifier:k,baseClassName:D,maybePostfixModifierPosition:L}};return a?g=>a({className:g,parseClassName:d}):d},uI=e=>{if(e.length<=1)return e;const n=[];let a=[];return e.forEach(s=>{s[0]==="["?(n.push(...a.sort(),s),a=[]):a.push(s)}),n.push(...a.sort()),n},sI=e=>({cache:iI(e.cacheSize),parseClassName:oI(e),...eI(e)}),lI=/\s+/,cI=(e,n)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:f}=n,h=[],d=e.trim().split(lI);let g="";for(let E=d.length-1;E>=0;E-=1){const b=d[E],{modifiers:C,hasImportantModifier:S,baseClassName:R,maybePostfixModifierPosition:k}=a(b);let D=!!k,L=s(D?R.substring(0,k):R);if(!L){if(!D){g=b+(g.length>0?" "+g:g);continue}if(L=s(R),!L){g=b+(g.length>0?" "+g:g);continue}D=!1}const B=uI(C).join(":"),H=S?B+Jk:B,$=H+L;if(h.includes($))continue;h.push($);const W=f(L,D);for(let J=0;J<W.length;++J){const Z=W[J];h.push(H+Z)}g=b+(g.length>0?" "+g:g)}return g};function dI(){let e=0,n,a,s="";for(;e<arguments.length;)(n=arguments[e++])&&(a=Zk(n))&&(s&&(s+=" "),s+=a);return s}const Zk=e=>{if(typeof e=="string")return e;let n,a="";for(let s=0;s<e.length;s++)e[s]&&(n=Zk(e[s]))&&(a&&(a+=" "),a+=n);return a};function fI(e,...n){let a,s,f,h=d;function d(E){const b=n.reduce((C,S)=>S(C),e());return a=sI(b),s=a.cache.get,f=a.cache.set,h=g,g(E)}function g(E){const b=s(E);if(b)return b;const C=cI(E,a);return f(E,C),C}return function(){return h(dI.apply(null,arguments))}}const hn=e=>{const n=a=>a[e]||[];return n.isThemeGetter=!0,n},eA=/^\[(?:([a-z-]+):)?(.+)\]$/i,pI=/^\d+\/\d+$/,hI=new Set(["px","full","screen"]),mI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Iu=e=>zf(e)||hI.has(e)||pI.test(e),Gs=e=>Kf(e,"length",kI),zf=e=>!!e&&!Number.isNaN(Number(e)),Fx=e=>Kf(e,"number",zf),xm=e=>!!e&&Number.isInteger(Number(e)),bI=e=>e.endsWith("%")&&zf(e.slice(0,-1)),wt=e=>eA.test(e),$s=e=>mI.test(e),xI=new Set(["length","size","percentage"]),wI=e=>Kf(e,xI,tA),TI=e=>Kf(e,"position",tA),SI=new Set(["image","url"]),CI=e=>Kf(e,SI,RI),_I=e=>Kf(e,"",AI),wm=()=>!0,Kf=(e,n,a)=>{const s=eA.exec(e);return s?s[1]?typeof n=="string"?s[1]===n:n.has(s[1]):a(s[2]):!1},kI=e=>gI.test(e)&&!vI.test(e),tA=()=>!1,AI=e=>yI.test(e),RI=e=>EI.test(e),NI=()=>{const e=hn("colors"),n=hn("spacing"),a=hn("blur"),s=hn("brightness"),f=hn("borderColor"),h=hn("borderRadius"),d=hn("borderSpacing"),g=hn("borderWidth"),E=hn("contrast"),b=hn("grayscale"),C=hn("hueRotate"),S=hn("invert"),R=hn("gap"),k=hn("gradientColorStops"),D=hn("gradientColorStopPositions"),L=hn("inset"),B=hn("margin"),H=hn("opacity"),$=hn("padding"),W=hn("saturate"),J=hn("scale"),Z=hn("sepia"),X=hn("skew"),te=hn("space"),we=hn("translate"),Me=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],Ee=()=>["auto",wt,n],ge=()=>[wt,n],Re=()=>["",Iu,Gs],Oe=()=>["auto",zf,wt],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],je=()=>["solid","dashed","dotted","double","none"],at=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],De=()=>["","0",wt],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],et=()=>[zf,wt];return{cacheSize:500,separator:":",theme:{colors:[wm],spacing:[Iu,Gs],blur:["none","",$s,wt],brightness:et(),borderColor:[e],borderRadius:["none","","full",$s,wt],borderSpacing:ge(),borderWidth:Re(),contrast:et(),grayscale:De(),hueRotate:et(),invert:De(),gap:ge(),gradientColorStops:[e],gradientColorStopPositions:[bI,Gs],inset:Ee(),margin:Ee(),opacity:et(),padding:ge(),saturate:et(),scale:et(),sepia:De(),skew:et(),space:ge(),translate:ge()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[$s]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...qe(),wt]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:Me()}],"overscroll-x":[{"overscroll-x":Me()}],"overscroll-y":[{"overscroll-y":Me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xm,wt]}],basis:[{basis:Ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:De()}],shrink:[{shrink:De()}],order:[{order:["first","last","none",xm,wt]}],"grid-cols":[{"grid-cols":[wm]}],"col-start-end":[{col:["auto",{span:["full",xm,wt]},wt]}],"col-start":[{"col-start":Oe()}],"col-end":[{"col-end":Oe()}],"grid-rows":[{"grid-rows":[wm]}],"row-start-end":[{row:["auto",{span:[xm,wt]},wt]}],"row-start":[{"row-start":Oe()}],"row-end":[{"row-end":Oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[R]}],"gap-x":[{"gap-x":[R]}],"gap-y":[{"gap-y":[R]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[$]}],px:[{px:[$]}],py:[{py:[$]}],ps:[{ps:[$]}],pe:[{pe:[$]}],pt:[{pt:[$]}],pr:[{pr:[$]}],pb:[{pb:[$]}],pl:[{pl:[$]}],m:[{m:[B]}],mx:[{mx:[B]}],my:[{my:[B]}],ms:[{ms:[B]}],me:[{me:[B]}],mt:[{mt:[B]}],mr:[{mr:[B]}],mb:[{mb:[B]}],ml:[{ml:[B]}],"space-x":[{"space-x":[te]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[te]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",wt,n]}],"min-w":[{"min-w":[wt,n,"min","max","fit"]}],"max-w":[{"max-w":[wt,n,"none","full","min","max","fit","prose",{screen:[$s]},$s]}],h:[{h:[wt,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[wt,n,"auto","min","max","fit"]}],"font-size":[{text:["base",$s,Gs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fx]}],"font-family":[{font:[wm]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",wt]}],"line-clamp":[{"line-clamp":["none",zf,Fx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Iu,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[H]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Iu,Gs]}],"underline-offset":[{"underline-offset":["auto",Iu,wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ge()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[H]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),TI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[g]}],"border-w-x":[{"border-x":[g]}],"border-w-y":[{"border-y":[g]}],"border-w-s":[{"border-s":[g]}],"border-w-e":[{"border-e":[g]}],"border-w-t":[{"border-t":[g]}],"border-w-r":[{"border-r":[g]}],"border-w-b":[{"border-b":[g]}],"border-w-l":[{"border-l":[g]}],"border-opacity":[{"border-opacity":[H]}],"border-style":[{border:[...je(),"hidden"]}],"divide-x":[{"divide-x":[g]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[g]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[H]}],"divide-style":[{divide:je()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...je()]}],"outline-offset":[{"outline-offset":[Iu,wt]}],"outline-w":[{outline:[Iu,Gs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[H]}],"ring-offset-w":[{"ring-offset":[Iu,Gs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$s,_I]}],"shadow-color":[{shadow:[wm]}],opacity:[{opacity:[H]}],"mix-blend":[{"mix-blend":[...at(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":at()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[s]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",$s,wt]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[S]}],saturate:[{saturate:[W]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[S]}],"backdrop-opacity":[{"backdrop-opacity":[H]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",wt]}],duration:[{duration:et()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:et()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[J]}],"scale-x":[{"scale-x":[J]}],"scale-y":[{"scale-y":[J]}],rotate:[{rotate:[xm,wt]}],"translate-x":[{"translate-x":[we]}],"translate-y":[{"translate-y":[we]}],"skew-x":[{"skew-x":[X]}],"skew-y":[{"skew-y":[X]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ge()}],"scroll-mx":[{"scroll-mx":ge()}],"scroll-my":[{"scroll-my":ge()}],"scroll-ms":[{"scroll-ms":ge()}],"scroll-me":[{"scroll-me":ge()}],"scroll-mt":[{"scroll-mt":ge()}],"scroll-mr":[{"scroll-mr":ge()}],"scroll-mb":[{"scroll-mb":ge()}],"scroll-ml":[{"scroll-ml":ge()}],"scroll-p":[{"scroll-p":ge()}],"scroll-px":[{"scroll-px":ge()}],"scroll-py":[{"scroll-py":ge()}],"scroll-ps":[{"scroll-ps":ge()}],"scroll-pe":[{"scroll-pe":ge()}],"scroll-pt":[{"scroll-pt":ge()}],"scroll-pr":[{"scroll-pr":ge()}],"scroll-pb":[{"scroll-pb":ge()}],"scroll-pl":[{"scroll-pl":ge()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Iu,Gs,Fx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},DI=fI(NI);function St(...e){return DI(Qk.clsx(e))}const OI="[data-opencx-widget-content-root]";function zw({fallbackHeight:e}){const n=Tt.useRef(null);return Tt.useEffect(()=>{const a=document.querySelector(OI);if(a&&n.current){const s=n.current;let f;const h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{const d=Math.max(s.offsetHeight,e);a.style.setProperty("--opencx-widget-height",`${d.toFixed(1)}px`)})});return h.observe(s),()=>{cancelAnimationFrame(f),h.unobserve(s)}}},[e]),{observedElementRef:n}}const LI=jm.Provider,II=jm.Root,MI=jm.Trigger,nA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(jm.Content,{ref:s,sideOffset:n,className:St("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));nA.displayName=jm.Content.displayName;function k1({children:e,content:n,side:a,align:s}){return n?I.jsxs(II,{children:[I.jsx(MI,{asChild:!0,children:e}),I.jsx(nA,{side:a,align:s,collisionPadding:8,avoidCollisions:!0,children:n})]}):e}const PI={ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري"},FI={ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional"},UI={ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional"},BI={ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel"},HI={ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel"},zI={ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional"},rA={en:UI,ar:PI,nl:HI,fr:BI,de:FI,pt:zI},jI=Object.keys(rA),VI=e=>jI.includes(e);function YI(e,n){const a=rA[n];return a&&a[e]||""}function Jf(){const{widgetCtx:{config:e}}=ft.useWidget();return Tt.useMemo(()=>{const a=VI(e.language)?e.language:"en";return{get:s=>YI(s,a),lang:a}},[e.language])}const WI=10,qI=(e,n)=>({initial:{opacity:0,x:-e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:e,...n.exit}}),QI=(e,n)=>({initial:{opacity:0,x:e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:-e,...n.exit}}),GI=(e,n)=>({initial:{opacity:0,y:e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:-e,...n.exit}}),$I=(e,n)=>({initial:{opacity:0,y:-e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:e,...n.exit}}),XI={right:qI,left:QI,up:GI,down:$I},Sn=Tt.forwardRef(({fadeIn:e="down",distance:n=WI,children:a,snapExit:s=!1,overrides:f={},...h},d)=>{const g=e?XI[e](n,f):{};return s&&g.exit&&typeof g.exit=="object"&&!Array.isArray(g.exit)&&(g.exit.transition={duration:0}),I.jsx(vr.motion.div,{ref:d,...h,...g,children:a})});Sn.displayName="MotionDiv";const r_=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,a_=Qk.clsx,KI=(e,n)=>a=>{var s;if((n==null?void 0:n.variants)==null)return a_(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:f,defaultVariants:h}=n,d=Object.keys(f).map(b=>{const C=a==null?void 0:a[b],S=h==null?void 0:h[b];if(C===null)return null;const R=r_(C)||r_(S);return f[b][R]}),g=a&&Object.entries(a).reduce((b,C)=>{let[S,R]=C;return R===void 0||(b[S]=R),b},{}),E=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((b,C)=>{let{class:S,className:R,...k}=C;return Object.entries(k).every(D=>{let[L,B]=D;return Array.isArray(B)?B.includes({...h,...g}[L]):{...h,...g}[L]===B})?[...b,S,R]:b},[]);return a_(e,d,E,a==null?void 0:a.class,a==null?void 0:a.className)},i_={x:2,y:2},JI={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},el=Tt.memo(Tt.forwardRef(({children:e,className:n,scale:a="1.02",off:s=!1},f)=>{const[h,d]=Tt.useState(!1),[g,E]=Tt.useState({x:0,y:0});if(s||/translate/.test(e.props.className||""))return e;const C=D=>{var we,Me;const{clientX:L,clientY:B}=D,H=D.currentTarget.getBoundingClientRect(),$=L-(H.left+H.width/2),W=B-(H.top+H.height/2),J=Math.max(-1,Math.min(1,$/(H.width/2))),Z=Math.max(-1,Math.min(1,W/(H.height/2))),X=J*i_.x,te=Z*i_.y;E({x:X,y:te}),(Me=(we=e.props).onMouseMove)==null||Me.call(we,D)},S=()=>{var D,L;d(!0),(L=(D=e.props).onMouseEnter)==null||L.call(D)},R=()=>{var D,L;d(!1),E({x:0,y:0}),(L=(D=e.props).onMouseLeave)==null||L.call(D)},k={"--opencx-wobble-x":h?`${g.x}px`:"0px","--opencx-wobble-y":h?`${g.y}px`:"0px"};return Tt.cloneElement(e,{ref:f,onMouseMove:C,onMouseEnter:S,onMouseLeave:R,style:{...k,...e.props.style},className:St("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${JI[a]}`,n,e.props.className,"transition-all ease-out")})}));el.displayName="Wobble";const ZI=KI(St("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),si=ie.forwardRef(({className:e,variant:n,size:a,asChild:s=!1,...f},h)=>{const d=s?Uw.Slot:"button";return I.jsx(el,{ref:h,children:I.jsx(d,{className:St(ZI({variant:n,size:a,className:e})),...f})})});si.displayName="Button";const B1=()=>{const[e,n]=Tt.useState("ltr");return Tt.useEffect(()=>{const a=()=>{typeof document>"u"||n(window.getComputedStyle(document.body).direction)};a();const s=new MutationObserver(a);return s.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),s.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",a),()=>{s.disconnect(),window.removeEventListener("languagechange",a)}},[]),e};function e5(){const{sendMessage:e}=ft.useMessages(),n=Jf(),a=[n.get("i-need-more-help"),n.get("this-was-helpful")],s=f=>{const h=f.trim();h&&e({content:h})};return I.jsx("div",{className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:a.map(f=>I.jsx(si,{onClick:()=>s(f),className:"flex-1 rounded-full",size:"sm",children:f},f))})}function t5({file:{status:e,file:n,error:a},onCancel:s}){const[f,h]=Tt.useState(null);Tt.useEffect(()=>{if(!n.type.startsWith("image/"))return;const E=new FileReader;return E.onload=()=>h(E.result),E.onerror=()=>console.error("Error reading file"),E.readAsDataURL(n),()=>E.abort()},[n]);const d=()=>{switch(e){case"uploading":return I.jsx(Wn.Loader2,{className:"size-4 animate-spin"});case"error":return I.jsx(Wn.AlertCircle,{className:"size-4 text-destructive"});default:return null}},g=()=>{const E=n.type.split("/")[0];return E==="image"&&f?I.jsx("img",{src:typeof f=="string"?f:"",className:"object-cover bg-secondary size-full",alt:n.name}):E==="audio"?I.jsx(Wn.FileAudio2Icon,{}):E==="video"?I.jsx(Wn.FileVideo2Icon,{}):I.jsx(Wn.FileIcon,{})};return I.jsx(k1,{side:"bottom",content:e==="error"?I.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",a]}):n.name,children:I.jsxs("div",{className:St(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[I.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d()}),I.jsx("button",{type:"button",className:St("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:s,children:I.jsx(Wn.XIcon,{className:"size-4 text-primary-foreground"})}),I.jsx(g,{})]})})}const o_=St("rounded-3xl");function n5(){var X;const e=Tt.useRef(null),{sendMessage:n}=ft.useMessages(),{sessionState:a}=ft.useSessions(),s=Jf(),f=B1(),[h,d]=Tt.useState(""),{allFiles:g,emptyTheFiles:E,handleCancelUpload:b,appendFiles:C,isUploading:S,successFiles:R}=ft.useUploadFiles(),k=!!((X=a.session)!=null&&X.isHandedOff),{isAwaitingBotReply:D}=ft.useIsAwaitingBotReply(),L=te=>{k&&C(te)},B=!h.trim()&&R.length===0,H=async()=>{if(D||B)return;if(S){const we="please wait for the file(s) to upload";e_.error(we),console.info(we)}const te=h.trim();n({content:te,attachments:R.flatMap(we=>we.fileUrl?[{url:we.fileUrl,type:we.file.type,name:we.file.name,id:we.id,size:we.file.size}]:[])}),d(""),E()},{getRootProps:$,getInputProps:W,open:J}=G4.useDropzone({onDrop:L,noClick:!0,onDropRejected(){if(k){const te="unsupported file type, or the file is too large";e_.error(te),console.error(te)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),Z=te=>{const we=te.clipboardData;we&&we.files.length>0&&L(Array.from(we.files))};return I.jsxs("div",{className:"p-2 relative space-y-1",...$(),children:[I.jsx("input",{...W()}),I.jsxs("div",{className:St(o_,"relative space-y-2 border transition-all shadow py-2"),children:[I.jsx("div",{className:"flex items-center gap-1 px-2",children:I.jsx(vr.AnimatePresence,{mode:"popLayout",children:g.map(te=>I.jsx(Sn,{snapExit:!0,children:I.jsx(t5,{onCancel:()=>b(te.id),file:te})},te.id))})}),I.jsx("textarea",{onPaste:Z,ref:e,id:"chat-input",dir:f,value:h,rows:3,className:St(o_,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:te=>d(te.target.value),onKeyDown:async te=>{te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),H())},placeholder:s.get("write-a-message")}),I.jsxs("div",{dir:f,className:"px-2 flex justify-between rtl:text-right",children:[I.jsx(k1,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:I.jsx(si,{onClick:()=>{k&&J()},size:"fit",variant:"outline",className:St("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!k,children:I.jsx(Wn.PaperclipIcon,{className:"size-4"})})}),I.jsx(k1,{content:"send message",side:"top",align:"end",children:I.jsx(si,{size:"fit",onClick:H,disabled:D||S||B,className:"rounded-full size-8 flex items-center justify-center p-0",children:I.jsx(vr.AnimatePresence,{mode:"wait",children:D||S?I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.SendHorizonal,{className:"size-4 rtl:-scale-100"})},"send")})})})]})]})]})}function r5(){const{widgetCtx:e}=ft.useWidget(),n=Jf();return I.jsx("div",{className:"p-2",children:I.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2",children:[I.jsxs("div",{className:"flex items-center gap-1",children:[I.jsx(Wn.CheckCheckIcon,{className:"size-4 text-emerald-500"}),I.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:n.get("session-closed-lead")})]}),I.jsx("div",{children:I.jsx(si,{onClick:e.resetChat,className:"rounded-2xl w-full",children:n.get("new-conversation")})})]})})}function a5(){var d,g,E;const{sessionState:e}=ft.useSessions(),{messagesState:n,sendMessage:a}=ft.useMessages(),f=(g=(d=ft.usePreludeData().data)==null?void 0:d.data)==null?void 0:g.initialQuestions,h=n.messages.length===0;return I.jsx("footer",{children:I.jsx("div",{children:I.jsx(vr.AnimatePresence,{mode:"wait",children:e.session&&!((E=e.session)!=null&&E.isOpened)?I.jsx(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:I.jsx(r5,{})},"session-closed"):I.jsxs(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[n.lastAIResMightSolveUserIssue&&I.jsx(e5,{}),h&&f&&I.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:f==null?void 0:f.map(b=>I.jsx(si,{dir:"auto",variant:"outline",size:"sm",onClick:()=>{a({content:b})},children:b},b))}),I.jsx(n5,{})]},"chat-input")})})})}const i5=Qn.Root,o5=Qn.Trigger,u5=Qn.Group,s5=ie.forwardRef(({className:e,inset:n,children:a,...s},f)=>I.jsxs(Qn.SubTrigger,{ref:f,className:St("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...s,children:[a,I.jsx(Wn.ChevronRight,{className:"ml-auto"})]}));s5.displayName=Qn.SubTrigger.displayName;const l5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.SubContent,{ref:a,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));l5.displayName=Qn.SubContent.displayName;const aA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(Qn.Content,{ref:s,sideOffset:n,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));aA.displayName=Qn.Content.displayName;const iA=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Sn,{children:I.jsx(Qn.Item,{ref:s,className:St("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...a})}));iA.displayName=Qn.Item.displayName;const c5=ie.forwardRef(({className:e,children:n,checked:a,...s},f)=>I.jsxs(Qn.CheckboxItem,{ref:f,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...s,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Check,{className:"h-4 w-4"})})}),n]}));c5.displayName=Qn.CheckboxItem.displayName;const d5=ie.forwardRef(({className:e,children:n,...a},s)=>I.jsxs(Qn.RadioItem,{ref:s,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Circle,{className:"h-2 w-2 fill-current"})})}),n]}));d5.displayName=Qn.RadioItem.displayName;const f5=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Qn.Label,{ref:s,className:St("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));f5.displayName=Qn.Label.displayName;const p5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.Separator,{ref:a,className:St("-mx-1 my-1 h-px bg-muted",e),...n}));p5.displayName=Qn.Separator.displayName;function oA({className:e,...n}){return I.jsx("div",{className:St("animate-pulse rounded-md bg-secondary",e),...n})}function h5(){const e=Jf(),[n,a]=Tt.useState(!1),{toChatScreen:s}=ft.useWidgetRouter();return I.jsxs(i5,{open:n,onOpenChange:a,children:[I.jsx(o5,{asChild:!0,children:I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",children:I.jsx(Wn.EllipsisVerticalIcon,{className:"size-4"})})}),I.jsx(aA,{align:"end",className:"min-w-56",children:I.jsx(u5,{children:I.jsxs(iA,{onSelect:()=>{a(!1),s()},children:[I.jsx(vr.motion.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:I.jsx(Wn.MessageCirclePlusIcon,{})}),e.get("new-conversation")]})})})]})}function uA(){var h,d;const{routerState:{screen:e},toSessionsScreen:n}=ft.useWidgetRouter(),{data:a,isLoading:s}=ft.usePreludeData(),f=B1();return I.jsx("header",{className:"p-2 border-b bg-background",children:I.jsxs("div",{dir:f,className:"flex items-center rtl:flex-row-reverse gap-2",children:[e==="chat"&&I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",onClick:n,children:I.jsx(Wn.ChevronLeftIcon,{className:"size-4"})}),I.jsx("div",{className:St("flex-1",e==="sessions"&&"pl-2"),children:I.jsx(vr.AnimatePresence,{mode:"wait",children:s||!((h=a==null?void 0:a.data)!=null&&h.organizationName)?I.jsx(Sn,{snapExit:!0,children:I.jsx(oA,{className:"h-5 w-1/2"})},"skeleton"):I.jsx(Sn,{children:I.jsx("h2",{className:"font-semibold",children:(d=a==null?void 0:a.data)==null?void 0:d.organizationName})},"organization-name")})}),I.jsx(h5,{})]})})}function m5(e){const n=[];let a=null;return e.forEach(s=>{var f,h,d,g;(!a||((f=a[0])==null?void 0:f.type)!==s.type)&&(a=[],n.push(a)),((h=a[0])==null?void 0:h.type)==="FROM_AGENT"&&s.type==="FROM_AGENT"&&((d=s.agent)==null?void 0:d.id)!==((g=a[0].agent)==null?void 0:g.id)&&(a=[],n.push(a)),a.push(s)}),n}function g5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_USER"}function v5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_BOT"}function y5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_AGENT"}function u_(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,f=a.indexOf(n);for(;f!==-1;)s++,f=a.indexOf(n,f+n.length);return s}const ba=sl(/[A-Za-z]/),ra=sl(/[\dA-Za-z]/),E5=sl(/[#-'*+\--9=?A-Z^-~]/);function A1(e){return e!==null&&(e<32||e===127)}const hw=sl(/\d/),b5=sl(/[\dA-Fa-f]/),x5=sl(/[!-/:-@[-`{-~]/);function ut(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const H1=sl(new RegExp("\\p{P}|\\p{S}","u")),Rc=sl(/\s/);function sl(e){return n;function n(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function w5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const z1=function(e){if(e==null)return _5;if(typeof e=="function")return j1(e);if(typeof e=="object")return Array.isArray(e)?T5(e):S5(e);if(typeof e=="string")return C5(e);throw new Error("Expected function, string, or object as test")};function T5(e){const n=[];let a=-1;for(;++a<e.length;)n[a]=z1(e[a]);return j1(s);function s(...f){let h=-1;for(;++h<n.length;)if(n[h].apply(this,f))return!0;return!1}}function S5(e){const n=e;return j1(a);function a(s){const f=s;let h;for(h in e)if(f[h]!==n[h])return!1;return!0}}function C5(e){return j1(n);function n(a){return a&&a.type===e}}function j1(e){return n;function n(a,s,f){return!!(k5(a)&&e.call(this,a,typeof s=="number"?s:void 0,f||void 0))}}function _5(){return!0}function k5(e){return e!==null&&typeof e=="object"&&"type"in e}const sA=[],A5=!0,mw=!1,R5="skip";function lA(e,n,a,s){let f;typeof n=="function"&&typeof a!="function"?(s=a,a=n):f=n;const h=z1(f),d=s?-1:1;g(e,void 0,[])();function g(E,b,C){const S=E&&typeof E=="object"?E:{};if(typeof S.type=="string"){const k=typeof S.tagName=="string"?S.tagName:typeof S.name=="string"?S.name:void 0;Object.defineProperty(R,"name",{value:"node ("+(E.type+(k?"<"+k+">":""))+")"})}return R;function R(){let k=sA,D,L,B;if((!n||h(E,b,C[C.length-1]||void 0))&&(k=N5(a(E,C)),k[0]===mw))return k;if("children"in E&&E.children){const H=E;if(H.children&&k[0]!==R5)for(L=(s?H.children.length:-1)+d,B=C.concat(H);L>-1&&L<H.children.length;){const $=H.children[L];if(D=g($,L,B)(),D[0]===mw)return D;L=typeof D[1]=="number"?D[1]:L+d}}return k}}}function N5(e){return Array.isArray(e)?e:typeof e=="number"?[A5,e]:e==null?sA:[e]}function D5(e,n,a){const f=z1((a||{}).ignore||[]),h=O5(n);let d=-1;for(;++d<h.length;)lA(e,"text",g);function g(b,C){let S=-1,R;for(;++S<C.length;){const k=C[S],D=R?R.children:void 0;if(f(k,D?D.indexOf(k):void 0,R))return;R=k}if(R)return E(b,C)}function E(b,C){const S=C[C.length-1],R=h[d][0],k=h[d][1];let D=0;const B=S.children.indexOf(b);let H=!1,$=[];R.lastIndex=0;let W=R.exec(b.value);for(;W;){const J=W.index,Z={index:W.index,input:W.input,stack:[...C,b]};let X=k(...W,Z);if(typeof X=="string"&&(X=X.length>0?{type:"text",value:X}:void 0),X===!1?R.lastIndex=J+1:(D!==J&&$.push({type:"text",value:b.value.slice(D,J)}),Array.isArray(X)?$.push(...X):X&&$.push(X),D=J+W[0].length,H=!0),!R.global)break;W=R.exec(b.value)}return H?(D<b.value.length&&$.push({type:"text",value:b.value.slice(D)}),S.children.splice(B,1,...$)):$=[b],B+$.length}}function O5(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const f=a[s];n.push([L5(f[0]),I5(f[1])])}return n}function L5(e){return typeof e=="string"?new RegExp(w5(e),"g"):e}function I5(e){return typeof e=="function"?e:function(){return e}}const Ux="phrasing",Bx=["autolink","link","image","label"];function M5(){return{transforms:[j5],enter:{literalAutolink:F5,literalAutolinkEmail:Hx,literalAutolinkHttp:Hx,literalAutolinkWww:Hx},exit:{literalAutolink:z5,literalAutolinkEmail:H5,literalAutolinkHttp:U5,literalAutolinkWww:B5}}}function P5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:":",before:"[ps]",after:"\\/",inConstruct:Ux,notInConstruct:Bx}]}}function F5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Hx(e){this.config.enter.autolinkProtocol.call(this,e)}function U5(e){this.config.exit.autolinkProtocol.call(this,e)}function B5(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function H5(e){this.config.exit.autolinkEmail.call(this,e)}function z5(e){this.exit(e)}function j5(e){D5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,V5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Y5]],{ignore:["link","linkReference"]})}function V5(e,n,a,s,f){let h="";if(!cA(f)||(/^w/i.test(n)&&(a=n+a,n="",h="http://"),!W5(a)))return!1;const d=q5(a+s);if(!d[0])return!1;const g={type:"link",title:null,url:h+n+d[0],children:[{type:"text",value:n+d[0]}]};return d[1]?[g,{type:"text",value:d[1]}]:g}function Y5(e,n,a,s){return!cA(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function W5(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function q5(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],s=a.indexOf(")");const f=u_(e,"(");let h=u_(e,")");for(;s!==-1&&f>h;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),h++;return[e,a]}function cA(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Rc(a)||H1(a))&&(!n||a!==47)}function uo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}dA.peek=rM;function Q5(){return{enter:{gfmFootnoteDefinition:$5,gfmFootnoteDefinitionLabelString:X5,gfmFootnoteCall:Z5,gfmFootnoteCallString:eM},exit:{gfmFootnoteDefinition:J5,gfmFootnoteDefinitionLabelString:K5,gfmFootnoteCall:nM,gfmFootnoteCallString:tM}}}function G5(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:aM,footnoteReference:dA}}}function $5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function X5(){this.buffer()}function K5(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function J5(e){this.exit(e)}function Z5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function eM(){this.buffer()}function tM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function nM(e){this.exit(e)}function dA(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteReference"),g=a.enter("reference");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),d(),h+=f.move("]"),h}function rM(){return"["}function aM(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteDefinition"),g=a.enter("label");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),h+=f.move("]:"+(e.children&&e.children.length>0?" ":"")),f.shift(4),h+=f.move(a.indentLines(a.containerFlow(e,f.current()),iM)),d(),h}function iM(e,n,a){return n===0?e:(a?"":" ")+e}const oM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fA.peek=dM;function uM(){return{canContainEols:["delete"],enter:{strikethrough:lM},exit:{strikethrough:cM}}}function sM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oM}],handlers:{delete:fA}}}function lM(e){this.enter({type:"delete",children:[]},e)}function cM(e){this.exit(e)}function fA(e,n,a,s){const f=a.createTracker(s),h=a.enter("strikethrough");let d=f.move("~~");return d+=a.containerPhrasing(e,{...f.current(),before:d,after:"~"}),d+=f.move("~~"),h(),d}function dM(){return"~"}function fM(e,n={}){const a=(n.align||[]).concat(),s=n.stringLength||hM,f=[],h=[],d=[],g=[];let E=0,b=-1;for(;++b<e.length;){const D=[],L=[];let B=-1;for(e[b].length>E&&(E=e[b].length);++B<e[b].length;){const H=pM(e[b][B]);if(n.alignDelimiters!==!1){const $=s(H);L[B]=$,(g[B]===void 0||$>g[B])&&(g[B]=$)}D.push(H)}h[b]=D,d[b]=L}let C=-1;if(typeof a=="object"&&"length"in a)for(;++C<E;)f[C]=s_(a[C]);else{const D=s_(a);for(;++C<E;)f[C]=D}C=-1;const S=[],R=[];for(;++C<E;){const D=f[C];let L="",B="";D===99?(L=":",B=":"):D===108?L=":":D===114&&(B=":");let H=n.alignDelimiters===!1?1:Math.max(1,g[C]-L.length-B.length);const $=L+"-".repeat(H)+B;n.alignDelimiters!==!1&&(H=L.length+H+B.length,H>g[C]&&(g[C]=H),R[C]=H),S[C]=$}h.splice(1,0,S),d.splice(1,0,R),b=-1;const k=[];for(;++b<h.length;){const D=h[b],L=d[b];C=-1;const B=[];for(;++C<E;){const H=D[C]||"";let $="",W="";if(n.alignDelimiters!==!1){const J=g[C]-(L[C]||0),Z=f[C];Z===114?$=" ".repeat(J):Z===99?J%2?($=" ".repeat(J/2+.5),W=" ".repeat(J/2-.5)):($=" ".repeat(J/2),W=$):W=" ".repeat(J)}n.delimiterStart!==!1&&!C&&B.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&H==="")&&(n.delimiterStart!==!1||C)&&B.push(" "),n.alignDelimiters!==!1&&B.push($),B.push(H),n.alignDelimiters!==!1&&B.push(W),n.padding!==!1&&B.push(" "),(n.delimiterEnd!==!1||C!==E-1)&&B.push("|")}k.push(n.delimiterEnd===!1?B.join("").replace(/ +$/,""):B.join(""))}return k.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react/jsx-runtime"),Tt=require("react"),ZC=require("tinycolor2"),vr=require("framer-motion"),Qk=require("clsx"),Wn=require("lucide-react"),G4=require("react-dropzone"),e_=require("react-hot-toast"),ft=require("./useUploadFiles-DyW8Xf7c.cjs"),$4=require("@radix-ui/react-tooltip"),Uw=require("@radix-ui/react-slot"),X4=require("@radix-ui/react-dropdown-menu"),K4=require("@radix-ui/react-dialog"),J4=require("@radix-ui/react-avatar"),Px=require("zod");function zm(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const ie=zm(Tt),jm=zm($4),Qn=zm(X4),so=zm(K4),Xf=zm(J4),Z4=350,Gk=400,$k=600,Bw={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},Xk=({primary:e="hsl(0, 0%, 0%)"})=>{const n=ZC(e).toHsl(),a=ZC(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${n.h} ${n.s*100}% ${n.l*100}%`,"--opencx-primary-foreground":a,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}},Hw="-",eI=e=>{const n=nI(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{const g=d.split(Hw);return g[0]===""&&g.length!==1&&g.shift(),Kk(g,n)||tI(d)},getConflictingClassGroupIds:(d,g)=>{const E=a[d]||[];return g&&s[d]?[...E,...s[d]]:E}}},Kk=(e,n)=>{var d;if(e.length===0)return n.classGroupId;const a=e[0],s=n.nextPart.get(a),f=s?Kk(e.slice(1),s):void 0;if(f)return f;if(n.validators.length===0)return;const h=e.join(Hw);return(d=n.validators.find(({validator:g})=>g(h)))==null?void 0:d.classGroupId},t_=/^\[(.+)\]$/,tI=e=>{if(t_.test(e)){const n=t_.exec(e)[1],a=n==null?void 0:n.substring(0,n.indexOf(":"));if(a)return"arbitrary.."+a}},nI=e=>{const{theme:n,prefix:a}=e,s={nextPart:new Map,validators:[]};return aI(Object.entries(e.classGroups),a).forEach(([h,d])=>{pw(d,s,h,n)}),s},pw=(e,n,a,s)=>{e.forEach(f=>{if(typeof f=="string"){const h=f===""?n:n_(n,f);h.classGroupId=a;return}if(typeof f=="function"){if(rI(f)){pw(f(s),n,a,s);return}n.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([h,d])=>{pw(d,n_(n,h),a,s)})})},n_=(e,n)=>{let a=e;return n.split(Hw).forEach(s=>{a.nextPart.has(s)||a.nextPart.set(s,{nextPart:new Map,validators:[]}),a=a.nextPart.get(s)}),a},rI=e=>e.isThemeGetter,aI=(e,n)=>n?e.map(([a,s])=>{const f=s.map(h=>typeof h=="string"?n+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([d,g])=>[n+d,g])):h);return[a,f]}):e,iI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,a=new Map,s=new Map;const f=(h,d)=>{a.set(h,d),n++,n>e&&(n=0,s=a,a=new Map)};return{get(h){let d=a.get(h);if(d!==void 0)return d;if((d=s.get(h))!==void 0)return f(h,d),d},set(h,d){a.has(h)?a.set(h,d):f(h,d)}}},Jk="!",oI=e=>{const{separator:n,experimentalParseClassName:a}=e,s=n.length===1,f=n[0],h=n.length,d=g=>{const E=[];let b=0,C=0,S;for(let B=0;B<g.length;B++){let H=g[B];if(b===0){if(H===f&&(s||g.slice(B,B+h)===n)){E.push(g.slice(C,B)),C=B+h;continue}if(H==="/"){S=B;continue}}H==="["?b++:H==="]"&&b--}const R=E.length===0?g:g.substring(C),k=R.startsWith(Jk),D=k?R.substring(1):R,L=S&&S>C?S-C:void 0;return{modifiers:E,hasImportantModifier:k,baseClassName:D,maybePostfixModifierPosition:L}};return a?g=>a({className:g,parseClassName:d}):d},uI=e=>{if(e.length<=1)return e;const n=[];let a=[];return e.forEach(s=>{s[0]==="["?(n.push(...a.sort(),s),a=[]):a.push(s)}),n.push(...a.sort()),n},sI=e=>({cache:iI(e.cacheSize),parseClassName:oI(e),...eI(e)}),lI=/\s+/,cI=(e,n)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:f}=n,h=[],d=e.trim().split(lI);let g="";for(let E=d.length-1;E>=0;E-=1){const b=d[E],{modifiers:C,hasImportantModifier:S,baseClassName:R,maybePostfixModifierPosition:k}=a(b);let D=!!k,L=s(D?R.substring(0,k):R);if(!L){if(!D){g=b+(g.length>0?" "+g:g);continue}if(L=s(R),!L){g=b+(g.length>0?" "+g:g);continue}D=!1}const B=uI(C).join(":"),H=S?B+Jk:B,$=H+L;if(h.includes($))continue;h.push($);const W=f(L,D);for(let J=0;J<W.length;++J){const Z=W[J];h.push(H+Z)}g=b+(g.length>0?" "+g:g)}return g};function dI(){let e=0,n,a,s="";for(;e<arguments.length;)(n=arguments[e++])&&(a=Zk(n))&&(s&&(s+=" "),s+=a);return s}const Zk=e=>{if(typeof e=="string")return e;let n,a="";for(let s=0;s<e.length;s++)e[s]&&(n=Zk(e[s]))&&(a&&(a+=" "),a+=n);return a};function fI(e,...n){let a,s,f,h=d;function d(E){const b=n.reduce((C,S)=>S(C),e());return a=sI(b),s=a.cache.get,f=a.cache.set,h=g,g(E)}function g(E){const b=s(E);if(b)return b;const C=cI(E,a);return f(E,C),C}return function(){return h(dI.apply(null,arguments))}}const hn=e=>{const n=a=>a[e]||[];return n.isThemeGetter=!0,n},eA=/^\[(?:([a-z-]+):)?(.+)\]$/i,pI=/^\d+\/\d+$/,hI=new Set(["px","full","screen"]),mI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Iu=e=>zf(e)||hI.has(e)||pI.test(e),Gs=e=>Kf(e,"length",kI),zf=e=>!!e&&!Number.isNaN(Number(e)),Fx=e=>Kf(e,"number",zf),xm=e=>!!e&&Number.isInteger(Number(e)),bI=e=>e.endsWith("%")&&zf(e.slice(0,-1)),wt=e=>eA.test(e),$s=e=>mI.test(e),xI=new Set(["length","size","percentage"]),wI=e=>Kf(e,xI,tA),TI=e=>Kf(e,"position",tA),SI=new Set(["image","url"]),CI=e=>Kf(e,SI,RI),_I=e=>Kf(e,"",AI),wm=()=>!0,Kf=(e,n,a)=>{const s=eA.exec(e);return s?s[1]?typeof n=="string"?s[1]===n:n.has(s[1]):a(s[2]):!1},kI=e=>gI.test(e)&&!vI.test(e),tA=()=>!1,AI=e=>yI.test(e),RI=e=>EI.test(e),NI=()=>{const e=hn("colors"),n=hn("spacing"),a=hn("blur"),s=hn("brightness"),f=hn("borderColor"),h=hn("borderRadius"),d=hn("borderSpacing"),g=hn("borderWidth"),E=hn("contrast"),b=hn("grayscale"),C=hn("hueRotate"),S=hn("invert"),R=hn("gap"),k=hn("gradientColorStops"),D=hn("gradientColorStopPositions"),L=hn("inset"),B=hn("margin"),H=hn("opacity"),$=hn("padding"),W=hn("saturate"),J=hn("scale"),Z=hn("sepia"),X=hn("skew"),te=hn("space"),we=hn("translate"),Me=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],Ee=()=>["auto",wt,n],ge=()=>[wt,n],Re=()=>["",Iu,Gs],Oe=()=>["auto",zf,wt],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],je=()=>["solid","dashed","dotted","double","none"],at=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],De=()=>["","0",wt],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],et=()=>[zf,wt];return{cacheSize:500,separator:":",theme:{colors:[wm],spacing:[Iu,Gs],blur:["none","",$s,wt],brightness:et(),borderColor:[e],borderRadius:["none","","full",$s,wt],borderSpacing:ge(),borderWidth:Re(),contrast:et(),grayscale:De(),hueRotate:et(),invert:De(),gap:ge(),gradientColorStops:[e],gradientColorStopPositions:[bI,Gs],inset:Ee(),margin:Ee(),opacity:et(),padding:ge(),saturate:et(),scale:et(),sepia:De(),skew:et(),space:ge(),translate:ge()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[$s]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...qe(),wt]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:Me()}],"overscroll-x":[{"overscroll-x":Me()}],"overscroll-y":[{"overscroll-y":Me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xm,wt]}],basis:[{basis:Ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:De()}],shrink:[{shrink:De()}],order:[{order:["first","last","none",xm,wt]}],"grid-cols":[{"grid-cols":[wm]}],"col-start-end":[{col:["auto",{span:["full",xm,wt]},wt]}],"col-start":[{"col-start":Oe()}],"col-end":[{"col-end":Oe()}],"grid-rows":[{"grid-rows":[wm]}],"row-start-end":[{row:["auto",{span:[xm,wt]},wt]}],"row-start":[{"row-start":Oe()}],"row-end":[{"row-end":Oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[R]}],"gap-x":[{"gap-x":[R]}],"gap-y":[{"gap-y":[R]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[$]}],px:[{px:[$]}],py:[{py:[$]}],ps:[{ps:[$]}],pe:[{pe:[$]}],pt:[{pt:[$]}],pr:[{pr:[$]}],pb:[{pb:[$]}],pl:[{pl:[$]}],m:[{m:[B]}],mx:[{mx:[B]}],my:[{my:[B]}],ms:[{ms:[B]}],me:[{me:[B]}],mt:[{mt:[B]}],mr:[{mr:[B]}],mb:[{mb:[B]}],ml:[{ml:[B]}],"space-x":[{"space-x":[te]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[te]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",wt,n]}],"min-w":[{"min-w":[wt,n,"min","max","fit"]}],"max-w":[{"max-w":[wt,n,"none","full","min","max","fit","prose",{screen:[$s]},$s]}],h:[{h:[wt,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[wt,n,"auto","min","max","fit"]}],"font-size":[{text:["base",$s,Gs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fx]}],"font-family":[{font:[wm]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",wt]}],"line-clamp":[{"line-clamp":["none",zf,Fx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Iu,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[H]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Iu,Gs]}],"underline-offset":[{"underline-offset":["auto",Iu,wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ge()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[H]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),TI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[g]}],"border-w-x":[{"border-x":[g]}],"border-w-y":[{"border-y":[g]}],"border-w-s":[{"border-s":[g]}],"border-w-e":[{"border-e":[g]}],"border-w-t":[{"border-t":[g]}],"border-w-r":[{"border-r":[g]}],"border-w-b":[{"border-b":[g]}],"border-w-l":[{"border-l":[g]}],"border-opacity":[{"border-opacity":[H]}],"border-style":[{border:[...je(),"hidden"]}],"divide-x":[{"divide-x":[g]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[g]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[H]}],"divide-style":[{divide:je()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...je()]}],"outline-offset":[{"outline-offset":[Iu,wt]}],"outline-w":[{outline:[Iu,Gs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[H]}],"ring-offset-w":[{"ring-offset":[Iu,Gs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$s,_I]}],"shadow-color":[{shadow:[wm]}],opacity:[{opacity:[H]}],"mix-blend":[{"mix-blend":[...at(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":at()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[s]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",$s,wt]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[S]}],saturate:[{saturate:[W]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[S]}],"backdrop-opacity":[{"backdrop-opacity":[H]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",wt]}],duration:[{duration:et()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:et()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[J]}],"scale-x":[{"scale-x":[J]}],"scale-y":[{"scale-y":[J]}],rotate:[{rotate:[xm,wt]}],"translate-x":[{"translate-x":[we]}],"translate-y":[{"translate-y":[we]}],"skew-x":[{"skew-x":[X]}],"skew-y":[{"skew-y":[X]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ge()}],"scroll-mx":[{"scroll-mx":ge()}],"scroll-my":[{"scroll-my":ge()}],"scroll-ms":[{"scroll-ms":ge()}],"scroll-me":[{"scroll-me":ge()}],"scroll-mt":[{"scroll-mt":ge()}],"scroll-mr":[{"scroll-mr":ge()}],"scroll-mb":[{"scroll-mb":ge()}],"scroll-ml":[{"scroll-ml":ge()}],"scroll-p":[{"scroll-p":ge()}],"scroll-px":[{"scroll-px":ge()}],"scroll-py":[{"scroll-py":ge()}],"scroll-ps":[{"scroll-ps":ge()}],"scroll-pe":[{"scroll-pe":ge()}],"scroll-pt":[{"scroll-pt":ge()}],"scroll-pr":[{"scroll-pr":ge()}],"scroll-pb":[{"scroll-pb":ge()}],"scroll-pl":[{"scroll-pl":ge()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Iu,Gs,Fx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},DI=fI(NI);function St(...e){return DI(Qk.clsx(e))}const OI="[data-opencx-widget-content-root]";function zw({fallbackHeight:e}){const n=Tt.useRef(null);return Tt.useEffect(()=>{const a=document.querySelector(OI);if(a&&n.current){const s=n.current;let f;const h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{const d=Math.max(s.offsetHeight,e);a.style.setProperty("--opencx-widget-height",`${d.toFixed(1)}px`)})});return h.observe(s),()=>{cancelAnimationFrame(f),h.unobserve(s)}}},[e]),{observedElementRef:n}}const LI=jm.Provider,II=jm.Root,MI=jm.Trigger,nA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(jm.Content,{ref:s,sideOffset:n,className:St("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));nA.displayName=jm.Content.displayName;function k1({children:e,content:n,side:a,align:s}){return n?I.jsxs(II,{children:[I.jsx(MI,{asChild:!0,children:e}),I.jsx(nA,{side:a,align:s,collisionPadding:8,avoidCollisions:!0,children:n})]}):e}const PI={ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري"},FI={ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional"},UI={ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional"},BI={ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel"},HI={ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel"},zI={ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional"},rA={en:UI,ar:PI,nl:HI,fr:BI,de:FI,pt:zI},jI=Object.keys(rA),VI=e=>jI.includes(e);function YI(e,n){const a=rA[n];return a&&a[e]||""}function Jf(){const{widgetCtx:{config:e}}=ft.useWidget();return Tt.useMemo(()=>{const a=VI(e.language)?e.language:"en";return{get:s=>YI(s,a),lang:a}},[e.language])}const WI=10,qI=(e,n)=>({initial:{opacity:0,x:-e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:e,...n.exit}}),QI=(e,n)=>({initial:{opacity:0,x:e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:-e,...n.exit}}),GI=(e,n)=>({initial:{opacity:0,y:e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:-e,...n.exit}}),$I=(e,n)=>({initial:{opacity:0,y:-e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:e,...n.exit}}),XI={right:qI,left:QI,up:GI,down:$I},Sn=Tt.forwardRef(({fadeIn:e="down",distance:n=WI,children:a,snapExit:s=!1,overrides:f={},...h},d)=>{const g=e?XI[e](n,f):{};return s&&g.exit&&typeof g.exit=="object"&&!Array.isArray(g.exit)&&(g.exit.transition={duration:0}),I.jsx(vr.motion.div,{ref:d,...h,...g,children:a})});Sn.displayName="MotionDiv";const r_=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,a_=Qk.clsx,KI=(e,n)=>a=>{var s;if((n==null?void 0:n.variants)==null)return a_(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:f,defaultVariants:h}=n,d=Object.keys(f).map(b=>{const C=a==null?void 0:a[b],S=h==null?void 0:h[b];if(C===null)return null;const R=r_(C)||r_(S);return f[b][R]}),g=a&&Object.entries(a).reduce((b,C)=>{let[S,R]=C;return R===void 0||(b[S]=R),b},{}),E=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((b,C)=>{let{class:S,className:R,...k}=C;return Object.entries(k).every(D=>{let[L,B]=D;return Array.isArray(B)?B.includes({...h,...g}[L]):{...h,...g}[L]===B})?[...b,S,R]:b},[]);return a_(e,d,E,a==null?void 0:a.class,a==null?void 0:a.className)},i_={x:2,y:2},JI={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},el=Tt.memo(Tt.forwardRef(({children:e,className:n,scale:a="1.02",off:s=!1},f)=>{const[h,d]=Tt.useState(!1),[g,E]=Tt.useState({x:0,y:0});if(s||/translate/.test(e.props.className||""))return e;const C=D=>{var we,Me;const{clientX:L,clientY:B}=D,H=D.currentTarget.getBoundingClientRect(),$=L-(H.left+H.width/2),W=B-(H.top+H.height/2),J=Math.max(-1,Math.min(1,$/(H.width/2))),Z=Math.max(-1,Math.min(1,W/(H.height/2))),X=J*i_.x,te=Z*i_.y;E({x:X,y:te}),(Me=(we=e.props).onMouseMove)==null||Me.call(we,D)},S=()=>{var D,L;d(!0),(L=(D=e.props).onMouseEnter)==null||L.call(D)},R=()=>{var D,L;d(!1),E({x:0,y:0}),(L=(D=e.props).onMouseLeave)==null||L.call(D)},k={"--opencx-wobble-x":h?`${g.x}px`:"0px","--opencx-wobble-y":h?`${g.y}px`:"0px"};return Tt.cloneElement(e,{ref:f,onMouseMove:C,onMouseEnter:S,onMouseLeave:R,style:{...k,...e.props.style},className:St("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${JI[a]}`,n,e.props.className,"transition-all ease-out")})}));el.displayName="Wobble";const ZI=KI(St("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),si=ie.forwardRef(({className:e,variant:n,size:a,asChild:s=!1,...f},h)=>{const d=s?Uw.Slot:"button";return I.jsx(el,{ref:h,children:I.jsx(d,{className:St(ZI({variant:n,size:a,className:e})),...f})})});si.displayName="Button";const B1=()=>{const[e,n]=Tt.useState("ltr");return Tt.useEffect(()=>{const a=()=>{typeof document>"u"||n(window.getComputedStyle(document.body).direction)};a();const s=new MutationObserver(a);return s.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),s.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",a),()=>{s.disconnect(),window.removeEventListener("languagechange",a)}},[]),e};function e5(){const{sendMessage:e}=ft.useMessages(),n=Jf(),a=[n.get("i-need-more-help"),n.get("this-was-helpful")],s=f=>{const h=f.trim();h&&e({content:h})};return I.jsx("div",{className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:a.map(f=>I.jsx(si,{onClick:()=>s(f),className:"flex-1 rounded-full",size:"sm",children:f},f))})}function t5({file:{status:e,file:n,error:a},onCancel:s}){const[f,h]=Tt.useState(null);Tt.useEffect(()=>{if(!n.type.startsWith("image/"))return;const E=new FileReader;return E.onload=()=>h(E.result),E.onerror=()=>console.error("Error reading file"),E.readAsDataURL(n),()=>E.abort()},[n]);const d=()=>{switch(e){case"uploading":return I.jsx(Wn.Loader2,{className:"size-4 animate-spin"});case"error":return I.jsx(Wn.AlertCircle,{className:"size-4 text-destructive"});default:return null}},g=()=>{const E=n.type.split("/")[0];return E==="image"&&f?I.jsx("img",{src:typeof f=="string"?f:"",className:"object-cover bg-secondary size-full",alt:n.name}):E==="audio"?I.jsx(Wn.FileAudio2Icon,{}):E==="video"?I.jsx(Wn.FileVideo2Icon,{}):I.jsx(Wn.FileIcon,{})};return I.jsx(k1,{side:"bottom",content:e==="error"?I.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",a]}):n.name,children:I.jsxs("div",{className:St(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[I.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d()}),I.jsx("button",{type:"button",className:St("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:s,children:I.jsx(Wn.XIcon,{className:"size-4 text-primary-foreground"})}),I.jsx(g,{})]})})}const o_=St("rounded-3xl");function n5(){var X;const e=Tt.useRef(null),{sendMessage:n}=ft.useMessages(),{sessionState:a}=ft.useSessions(),s=Jf(),f=B1(),[h,d]=Tt.useState(""),{allFiles:g,emptyTheFiles:E,handleCancelUpload:b,appendFiles:C,isUploading:S,successFiles:R}=ft.useUploadFiles(),k=!!((X=a.session)!=null&&X.isHandedOff),{isAwaitingBotReply:D}=ft.useIsAwaitingBotReply(),L=te=>{k&&C(te)},B=!h.trim()&&R.length===0,H=async()=>{if(D||B)return;if(S){const we="please wait for the file(s) to upload";e_.error(we),console.info(we)}const te=h.trim();n({content:te,attachments:R.flatMap(we=>we.fileUrl?[{url:we.fileUrl,type:we.file.type,name:we.file.name,id:we.id,size:we.file.size}]:[])}),d(""),E()},{getRootProps:$,getInputProps:W,open:J}=G4.useDropzone({onDrop:L,noClick:!0,onDropRejected(){if(k){const te="unsupported file type, or the file is too large";e_.error(te),console.error(te)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),Z=te=>{const we=te.clipboardData;we&&we.files.length>0&&L(Array.from(we.files))};return I.jsxs("div",{className:"p-2 relative space-y-1",...$(),children:[I.jsx("input",{...W()}),I.jsxs("div",{className:St(o_,"relative space-y-2 border transition-all shadow py-2"),children:[I.jsx("div",{className:"flex items-center gap-1 px-2",children:I.jsx(vr.AnimatePresence,{mode:"popLayout",children:g.map(te=>I.jsx(Sn,{snapExit:!0,children:I.jsx(t5,{onCancel:()=>b(te.id),file:te})},te.id))})}),I.jsx("textarea",{onPaste:Z,ref:e,id:"chat-input",dir:f,value:h,rows:3,className:St(o_,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:te=>d(te.target.value),onKeyDown:async te=>{te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),H())},placeholder:s.get("write-a-message")}),I.jsxs("div",{dir:f,className:"px-2 flex justify-between rtl:text-right",children:[I.jsx(k1,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:I.jsx(si,{onClick:()=>{k&&J()},size:"fit",variant:"outline",className:St("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!k,children:I.jsx(Wn.PaperclipIcon,{className:"size-4"})})}),I.jsx(k1,{content:"send message",side:"top",align:"end",children:I.jsx(si,{size:"fit",onClick:H,disabled:D||S||B,className:"rounded-full size-8 flex items-center justify-center p-0",children:I.jsx(vr.AnimatePresence,{mode:"wait",children:D||S?I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.SendHorizonal,{className:"size-4 rtl:-scale-100"})},"send")})})})]})]})]})}function r5(){const{widgetCtx:e}=ft.useWidget(),n=Jf();return I.jsx("div",{className:"p-2",children:I.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2",children:[I.jsxs("div",{className:"flex items-center gap-1",children:[I.jsx(Wn.CheckCheckIcon,{className:"size-4 text-emerald-500"}),I.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:n.get("session-closed-lead")})]}),I.jsx("div",{children:I.jsx(si,{onClick:e.resetChat,className:"rounded-2xl w-full",children:n.get("new-conversation")})})]})})}function a5(){var d,g,E;const{sessionState:e}=ft.useSessions(),{messagesState:n,sendMessage:a}=ft.useMessages(),f=(g=(d=ft.usePreludeData().data)==null?void 0:d.data)==null?void 0:g.initialQuestions,h=n.messages.length===0;return I.jsx("footer",{children:I.jsx("div",{children:I.jsx(vr.AnimatePresence,{mode:"wait",children:e.session&&!((E=e.session)!=null&&E.isOpened)?I.jsx(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:I.jsx(r5,{})},"session-closed"):I.jsxs(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[n.lastAIResMightSolveUserIssue&&I.jsx(e5,{}),h&&f&&I.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:f==null?void 0:f.map(b=>I.jsx(si,{dir:"auto",variant:"outline",size:"sm",onClick:()=>{a({content:b})},children:b},b))}),I.jsx(n5,{})]},"chat-input")})})})}const i5=Qn.Root,o5=Qn.Trigger,u5=Qn.Group,s5=ie.forwardRef(({className:e,inset:n,children:a,...s},f)=>I.jsxs(Qn.SubTrigger,{ref:f,className:St("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...s,children:[a,I.jsx(Wn.ChevronRight,{className:"ml-auto"})]}));s5.displayName=Qn.SubTrigger.displayName;const l5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.SubContent,{ref:a,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));l5.displayName=Qn.SubContent.displayName;const aA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(Qn.Content,{ref:s,sideOffset:n,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));aA.displayName=Qn.Content.displayName;const iA=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Sn,{children:I.jsx(Qn.Item,{ref:s,className:St("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...a})}));iA.displayName=Qn.Item.displayName;const c5=ie.forwardRef(({className:e,children:n,checked:a,...s},f)=>I.jsxs(Qn.CheckboxItem,{ref:f,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...s,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Check,{className:"h-4 w-4"})})}),n]}));c5.displayName=Qn.CheckboxItem.displayName;const d5=ie.forwardRef(({className:e,children:n,...a},s)=>I.jsxs(Qn.RadioItem,{ref:s,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Circle,{className:"h-2 w-2 fill-current"})})}),n]}));d5.displayName=Qn.RadioItem.displayName;const f5=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Qn.Label,{ref:s,className:St("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));f5.displayName=Qn.Label.displayName;const p5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.Separator,{ref:a,className:St("-mx-1 my-1 h-px bg-muted",e),...n}));p5.displayName=Qn.Separator.displayName;function oA({className:e,...n}){return I.jsx("div",{className:St("animate-pulse rounded-md bg-secondary",e),...n})}function h5(){const e=Jf(),[n,a]=Tt.useState(!1),{toChatScreen:s}=ft.useWidgetRouter();return I.jsxs(i5,{open:n,onOpenChange:a,children:[I.jsx(o5,{asChild:!0,children:I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",children:I.jsx(Wn.EllipsisVerticalIcon,{className:"size-4"})})}),I.jsx(aA,{align:"end",className:"min-w-56",children:I.jsx(u5,{children:I.jsxs(iA,{onSelect:()=>{a(!1),s()},children:[I.jsx(vr.motion.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:I.jsx(Wn.MessageCirclePlusIcon,{})}),e.get("new-conversation")]})})})]})}function uA(){var h,d;const{routerState:{screen:e},toSessionsScreen:n}=ft.useWidgetRouter(),{data:a,isLoading:s}=ft.usePreludeData(),f=B1();return I.jsx("header",{className:"p-2 border-b bg-background",children:I.jsxs("div",{dir:f,className:"flex items-center rtl:flex-row-reverse gap-2",children:[e==="chat"&&I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",onClick:n,children:I.jsx(Wn.ChevronLeftIcon,{className:"size-4"})}),I.jsx("div",{className:St("flex-1",e==="sessions"&&"pl-2"),children:I.jsx(vr.AnimatePresence,{mode:"wait",children:s||!((h=a==null?void 0:a.data)!=null&&h.organizationName)?I.jsx(Sn,{snapExit:!0,children:I.jsx(oA,{className:"h-5 w-1/2"})},"skeleton"):I.jsx(Sn,{children:I.jsx("h2",{className:"font-semibold",children:(d=a==null?void 0:a.data)==null?void 0:d.organizationName})},"organization-name")})}),I.jsx(h5,{})]})})}function m5(e){const n=[];let a=null;return e.forEach(s=>{var f,h,d,g;(!a||((f=a[0])==null?void 0:f.type)!==s.type)&&(a=[],n.push(a)),((h=a[0])==null?void 0:h.type)==="FROM_AGENT"&&s.type==="FROM_AGENT"&&((d=s.agent)==null?void 0:d.id)!==((g=a[0].agent)==null?void 0:g.id)&&(a=[],n.push(a)),a.push(s)}),n}function g5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_USER"}function v5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_BOT"}function y5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_AGENT"}function u_(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,f=a.indexOf(n);for(;f!==-1;)s++,f=a.indexOf(n,f+n.length);return s}const ba=sl(/[A-Za-z]/),ra=sl(/[\dA-Za-z]/),E5=sl(/[#-'*+\--9=?A-Z^-~]/);function A1(e){return e!==null&&(e<32||e===127)}const hw=sl(/\d/),b5=sl(/[\dA-Fa-f]/),x5=sl(/[!-/:-@[-`{-~]/);function ut(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const H1=sl(new RegExp("\\p{P}|\\p{S}","u")),Rc=sl(/\s/);function sl(e){return n;function n(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function w5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const z1=function(e){if(e==null)return _5;if(typeof e=="function")return j1(e);if(typeof e=="object")return Array.isArray(e)?T5(e):S5(e);if(typeof e=="string")return C5(e);throw new Error("Expected function, string, or object as test")};function T5(e){const n=[];let a=-1;for(;++a<e.length;)n[a]=z1(e[a]);return j1(s);function s(...f){let h=-1;for(;++h<n.length;)if(n[h].apply(this,f))return!0;return!1}}function S5(e){const n=e;return j1(a);function a(s){const f=s;let h;for(h in e)if(f[h]!==n[h])return!1;return!0}}function C5(e){return j1(n);function n(a){return a&&a.type===e}}function j1(e){return n;function n(a,s,f){return!!(k5(a)&&e.call(this,a,typeof s=="number"?s:void 0,f||void 0))}}function _5(){return!0}function k5(e){return e!==null&&typeof e=="object"&&"type"in e}const sA=[],A5=!0,mw=!1,R5="skip";function lA(e,n,a,s){let f;typeof n=="function"&&typeof a!="function"?(s=a,a=n):f=n;const h=z1(f),d=s?-1:1;g(e,void 0,[])();function g(E,b,C){const S=E&&typeof E=="object"?E:{};if(typeof S.type=="string"){const k=typeof S.tagName=="string"?S.tagName:typeof S.name=="string"?S.name:void 0;Object.defineProperty(R,"name",{value:"node ("+(E.type+(k?"<"+k+">":""))+")"})}return R;function R(){let k=sA,D,L,B;if((!n||h(E,b,C[C.length-1]||void 0))&&(k=N5(a(E,C)),k[0]===mw))return k;if("children"in E&&E.children){const H=E;if(H.children&&k[0]!==R5)for(L=(s?H.children.length:-1)+d,B=C.concat(H);L>-1&&L<H.children.length;){const $=H.children[L];if(D=g($,L,B)(),D[0]===mw)return D;L=typeof D[1]=="number"?D[1]:L+d}}return k}}}function N5(e){return Array.isArray(e)?e:typeof e=="number"?[A5,e]:e==null?sA:[e]}function D5(e,n,a){const f=z1((a||{}).ignore||[]),h=O5(n);let d=-1;for(;++d<h.length;)lA(e,"text",g);function g(b,C){let S=-1,R;for(;++S<C.length;){const k=C[S],D=R?R.children:void 0;if(f(k,D?D.indexOf(k):void 0,R))return;R=k}if(R)return E(b,C)}function E(b,C){const S=C[C.length-1],R=h[d][0],k=h[d][1];let D=0;const B=S.children.indexOf(b);let H=!1,$=[];R.lastIndex=0;let W=R.exec(b.value);for(;W;){const J=W.index,Z={index:W.index,input:W.input,stack:[...C,b]};let X=k(...W,Z);if(typeof X=="string"&&(X=X.length>0?{type:"text",value:X}:void 0),X===!1?R.lastIndex=J+1:(D!==J&&$.push({type:"text",value:b.value.slice(D,J)}),Array.isArray(X)?$.push(...X):X&&$.push(X),D=J+W[0].length,H=!0),!R.global)break;W=R.exec(b.value)}return H?(D<b.value.length&&$.push({type:"text",value:b.value.slice(D)}),S.children.splice(B,1,...$)):$=[b],B+$.length}}function O5(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const f=a[s];n.push([L5(f[0]),I5(f[1])])}return n}function L5(e){return typeof e=="string"?new RegExp(w5(e),"g"):e}function I5(e){return typeof e=="function"?e:function(){return e}}const Ux="phrasing",Bx=["autolink","link","image","label"];function M5(){return{transforms:[j5],enter:{literalAutolink:F5,literalAutolinkEmail:Hx,literalAutolinkHttp:Hx,literalAutolinkWww:Hx},exit:{literalAutolink:z5,literalAutolinkEmail:H5,literalAutolinkHttp:U5,literalAutolinkWww:B5}}}function P5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:":",before:"[ps]",after:"\\/",inConstruct:Ux,notInConstruct:Bx}]}}function F5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Hx(e){this.config.enter.autolinkProtocol.call(this,e)}function U5(e){this.config.exit.autolinkProtocol.call(this,e)}function B5(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function H5(e){this.config.exit.autolinkEmail.call(this,e)}function z5(e){this.exit(e)}function j5(e){D5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,V5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Y5]],{ignore:["link","linkReference"]})}function V5(e,n,a,s,f){let h="";if(!cA(f)||(/^w/i.test(n)&&(a=n+a,n="",h="http://"),!W5(a)))return!1;const d=q5(a+s);if(!d[0])return!1;const g={type:"link",title:null,url:h+n+d[0],children:[{type:"text",value:n+d[0]}]};return d[1]?[g,{type:"text",value:d[1]}]:g}function Y5(e,n,a,s){return!cA(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function W5(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function q5(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],s=a.indexOf(")");const f=u_(e,"(");let h=u_(e,")");for(;s!==-1&&f>h;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),h++;return[e,a]}function cA(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Rc(a)||H1(a))&&(!n||a!==47)}function uo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}dA.peek=rM;function Q5(){return{enter:{gfmFootnoteDefinition:$5,gfmFootnoteDefinitionLabelString:X5,gfmFootnoteCall:Z5,gfmFootnoteCallString:eM},exit:{gfmFootnoteDefinition:J5,gfmFootnoteDefinitionLabelString:K5,gfmFootnoteCall:nM,gfmFootnoteCallString:tM}}}function G5(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:aM,footnoteReference:dA}}}function $5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function X5(){this.buffer()}function K5(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function J5(e){this.exit(e)}function Z5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function eM(){this.buffer()}function tM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function nM(e){this.exit(e)}function dA(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteReference"),g=a.enter("reference");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),d(),h+=f.move("]"),h}function rM(){return"["}function aM(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteDefinition"),g=a.enter("label");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),h+=f.move("]:"+(e.children&&e.children.length>0?" ":"")),f.shift(4),h+=f.move(a.indentLines(a.containerFlow(e,f.current()),iM)),d(),h}function iM(e,n,a){return n===0?e:(a?"":" ")+e}const oM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fA.peek=dM;function uM(){return{canContainEols:["delete"],enter:{strikethrough:lM},exit:{strikethrough:cM}}}function sM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oM}],handlers:{delete:fA}}}function lM(e){this.enter({type:"delete",children:[]},e)}function cM(e){this.exit(e)}function fA(e,n,a,s){const f=a.createTracker(s),h=a.enter("strikethrough");let d=f.move("~~");return d+=a.containerPhrasing(e,{...f.current(),before:d,after:"~"}),d+=f.move("~~"),h(),d}function dM(){return"~"}function fM(e,n={}){const a=(n.align||[]).concat(),s=n.stringLength||hM,f=[],h=[],d=[],g=[];let E=0,b=-1;for(;++b<e.length;){const D=[],L=[];let B=-1;for(e[b].length>E&&(E=e[b].length);++B<e[b].length;){const H=pM(e[b][B]);if(n.alignDelimiters!==!1){const $=s(H);L[B]=$,(g[B]===void 0||$>g[B])&&(g[B]=$)}D.push(H)}h[b]=D,d[b]=L}let C=-1;if(typeof a=="object"&&"length"in a)for(;++C<E;)f[C]=s_(a[C]);else{const D=s_(a);for(;++C<E;)f[C]=D}C=-1;const S=[],R=[];for(;++C<E;){const D=f[C];let L="",B="";D===99?(L=":",B=":"):D===108?L=":":D===114&&(B=":");let H=n.alignDelimiters===!1?1:Math.max(1,g[C]-L.length-B.length);const $=L+"-".repeat(H)+B;n.alignDelimiters!==!1&&(H=L.length+H+B.length,H>g[C]&&(g[C]=H),R[C]=H),S[C]=$}h.splice(1,0,S),d.splice(1,0,R),b=-1;const k=[];for(;++b<h.length;){const D=h[b],L=d[b];C=-1;const B=[];for(;++C<E;){const H=D[C]||"";let $="",W="";if(n.alignDelimiters!==!1){const J=g[C]-(L[C]||0),Z=f[C];Z===114?$=" ".repeat(J):Z===99?J%2?($=" ".repeat(J/2+.5),W=" ".repeat(J/2-.5)):($=" ".repeat(J/2),W=$):W=" ".repeat(J)}n.delimiterStart!==!1&&!C&&B.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&H==="")&&(n.delimiterStart!==!1||C)&&B.push(" "),n.alignDelimiters!==!1&&B.push($),B.push(H),n.alignDelimiters!==!1&&B.push(W),n.padding!==!1&&B.push(" "),(n.delimiterEnd!==!1||C!==E-1)&&B.push("|")}k.push(n.delimiterEnd===!1?B.join("").replace(/ +$/,""):B.join(""))}return k.join(`
2
2
  `)}function pM(e){return e==null?"":String(e)}function hM(e){return e.length}function s_(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}const l_={}.hasOwnProperty;function pA(e,n){const a=n||{};function s(f,...h){let d=s.invalid;const g=s.handlers;if(f&&l_.call(f,e)){const E=String(f[e]);d=l_.call(g,E)?g[E]:s.unknown}if(d)return d.call(this,f,...h)}return s.handlers=a.handlers||{},s.invalid=a.invalid,s.unknown=a.unknown,s}function mM(e,n,a,s){const f=a.enter("blockquote"),h=a.createTracker(s);h.move("> "),h.shift(2);const d=a.indentLines(a.containerFlow(e,h.current()),gM);return f(),d}function gM(e,n,a){return">"+(a?"":" ")+e}function vM(e,n){return c_(e,n.inConstruct,!0)&&!c_(e,n.notInConstruct,!1)}function c_(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let s=-1;for(;++s<n.length;)if(e.includes(n[s]))return!0;return!1}function d_(e,n,a,s){let f=-1;for(;++f<a.unsafe.length;)if(a.unsafe[f].character===`
3
3
  `&&vM(a.stack,a.unsafe[f]))return/[ \t]/.test(s.before)?"":" ";return`\\
4
4
  `}function yM(e,n){const a=String(e);let s=a.indexOf(n),f=s,h=0,d=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===f?++h>d&&(d=h):h=1,f=s+n.length,s=a.indexOf(n,f);return d}function EM(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function bM(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function xM(e,n,a,s){const f=bM(a),h=e.value||"",d=f==="`"?"GraveAccent":"Tilde";if(EM(e,a)){const S=a.enter("codeIndented"),R=a.indentLines(h,wM);return S(),R}const g=a.createTracker(s),E=f.repeat(Math.max(yM(h,f)+1,3)),b=a.enter("codeFenced");let C=g.move(E);if(e.lang){const S=a.enter(`codeFencedLang${d}`);C+=g.move(a.safe(e.lang,{before:C,after:" ",encode:["`"],...g.current()})),S()}if(e.lang&&e.meta){const S=a.enter(`codeFencedMeta${d}`);C+=g.move(" "),C+=g.move(a.safe(e.meta,{before:C,after:`
@@ -199,7 +199,7 @@ Check the render method of %s.`,mt(On)||"Unknown"));var A=ku(v,w);A.payload={ele
199
199
 
200
200
  let root = createRoot(domContainer);
201
201
  root.render(<App />);`),r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onRecoverableError!==void 0&&(v=r.onRecoverableError),r.transitionCallbacks!==void 0&&r.transitionCallbacks);var w=CC(t,Zg,null,u,l,p,v);qg(w.current,t);var _=t.nodeType===Ln?t.parentNode:t;return Sh(_),new Lx(w)}function a1(t){this._internalRoot=t}function N4(t){t&&My(t)}a1.prototype.unstable_scheduleHydration=N4;function D4(t,r,u){if(!i1(t))throw new Error("hydrateRoot(...): Target container is not a DOM element.");QC(t),r===void 0&&d("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var l=u??null,p=u!=null&&u.hydratedSources||null,v=!1,w=!1,_="",A=qC;u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(_=u.identifierPrefix),u.onRecoverableError!==void 0&&(A=u.onRecoverableError));var O=_C(r,null,t,Zg,l,v,w,_,A);if(qg(O.current,t),Sh(t),p)for(var M=0;M<p.length;M++){var G=p[M];M6(O,G)}return new a1(O)}function i1(t){return!!(t&&(t.nodeType===zr||t.nodeType===Ja||t.nodeType===Jo||!Et))}function Em(t){return!!(t&&(t.nodeType===zr||t.nodeType===Ja||t.nodeType===Jo||t.nodeType===Ln&&t.nodeValue===" react-mount-point-unstable "))}function QC(t){t.nodeType===zr&&t.tagName&&t.tagName.toUpperCase()==="BODY"&&d("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."),Mh(t)&&(t._reactRootContainer?d("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):d("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}var O4=a.ReactCurrentOwner,GC;GC=function(t){if(t._reactRootContainer&&t.nodeType!==Ln){var r=AC(t._reactRootContainer.current);r&&r.parentNode!==t&&d("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}var u=!!t._reactRootContainer,l=Ix(t),p=!!(l&&Os(l));p&&!u&&d("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."),t.nodeType===zr&&t.tagName&&t.tagName.toUpperCase()==="BODY"&&d("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};function Ix(t){return t?t.nodeType===Ja?t.documentElement:t.firstChild:null}function $C(){}function L4(t,r,u,l,p){if(p){if(typeof l=="function"){var v=l;l=function(){var q=r1(w);v.call(q)}}var w=_C(r,l,t,Is,null,!1,!1,"",$C);t._reactRootContainer=w,qg(w.current,t);var _=t.nodeType===Ln?t.parentNode:t;return Sh(_),Du(),w}else{for(var A;A=t.lastChild;)t.removeChild(A);if(typeof l=="function"){var O=l;l=function(){var q=r1(M);O.call(q)}}var M=CC(t,Is,null,!1,!1,"",$C);t._reactRootContainer=M,qg(M.current,t);var G=t.nodeType===Ln?t.parentNode:t;return Sh(G),Du(function(){ym(r,M,u,l)}),M}}function I4(t,r){t!==null&&typeof t!="function"&&d("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",r,t)}function o1(t,r,u,l,p){GC(u),I4(p===void 0?null:p,"render");var v=u._reactRootContainer,w;if(!v)w=L4(u,r,t,p,l);else{if(w=v,typeof p=="function"){var _=p;p=function(){var A=r1(w);_.call(A)}}ym(r,w,t,p)}return r1(w)}var XC=!1;function M4(t){{XC||(XC=!0,d("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"));var r=O4.current;if(r!==null&&r.stateNode!==null){var u=r.stateNode._warnedAboutRefsInRender;u||d("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",Yt(r.type)||"A component"),r.stateNode._warnedAboutRefsInRender=!0}}return t==null?null:t.nodeType===zr?t:E4(t,"findDOMNode")}function P4(t,r,u){if(d("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Em(r))throw new Error("Target container is not a DOM element.");{var l=Mh(r)&&r._reactRootContainer===void 0;l&&d("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?")}return o1(null,t,r,!0,u)}function F4(t,r,u){if(d("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Em(r))throw new Error("Target container is not a DOM element.");{var l=Mh(r)&&r._reactRootContainer===void 0;l&&d("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?")}return o1(null,t,r,!1,u)}function U4(t,r,u,l){if(d("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Em(u))throw new Error("Target container is not a DOM element.");if(t==null||!Pl(t))throw new Error("parentComponent must be a valid React Component");return o1(t,r,u,!1,l)}var KC=!1;function B4(t){if(KC||(KC=!0,d("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot")),!Em(t))throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");{var r=Mh(t)&&t._reactRootContainer===void 0;r&&d("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?")}if(t._reactRootContainer){{var u=Ix(t),l=u&&!Os(u);l&&d("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.")}return Du(function(){o1(null,null,t,!1,function(){t._reactRootContainer=null,qT(t)})}),!0}else{{var p=Ix(t),v=!!(p&&Os(p)),w=t.nodeType===zr&&Em(t.parentNode)&&!!t.parentNode._reactRootContainer;v&&d("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",w?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component.")}return!1}}ys(b4),Ly(x4),Hd(w4),hg(Ia),mg(Tr),(typeof Map!="function"||Map.prototype==null||typeof Map.prototype.forEach!="function"||typeof Set!="function"||Set.prototype==null||typeof Set.prototype.clear!="function"||typeof Set.prototype.forEach!="function")&&d("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),Y0(zN),rd(dx,DL,Du);function H4(t,r){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!i1(r))throw new Error("Target container is not a DOM element.");return y4(t,r,null,u)}function z4(t,r,u,l){return U4(t,r,u,l)}var Mx={usingClientEntryPoint:!1,Events:[Os,cf,Qg,nd,Ll,dx]};function j4(t,r){return Mx.usingClientEntryPoint||d('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),R4(t,r)}function V4(t,r,u){return Mx.usingClientEntryPoint||d('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),D4(t,r,u)}function Y4(t){return aC()&&d("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),Du(t)}var W4=A4({findFiberByHostInstance:lc,bundleType:1,version:Ax,rendererPackageName:"react-dom"});if(!W4&&an&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)){var JC=window.location.protocol;/^(https?|file):$/.test(JC)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(JC==="file:"?`
202
- You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}qa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mx,qa.createPortal=H4,qa.createRoot=j4,qa.findDOMNode=M4,qa.flushSync=Y4,qa.hydrate=P4,qa.hydrateRoot=V4,qa.render=F4,qa.unmountComponentAtNode=B4,qa.unstable_batchedUpdates=dx,qa.unstable_renderSubtreeIntoContainer=z4,qa.version=Ax,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),qa}function aR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aR)}catch(e){console.error(e)}}}process.env.NODE_ENV==="production"?(aR(),Rw.exports=oz()):Rw.exports=uz();var Um=Rw.exports;function Nw(){return Nw=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)({}).hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Nw.apply(null,arguments)}function sz(e,n){if(e==null)return{};var a={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(n.includes(s))continue;a[s]=e[s]}return a}var iR,oR;typeof document<"u"&&(iR=document);typeof window<"u"&&(oR=window);var uR=Tt.createContext({document:iR,window:oR}),lz=()=>Tt.useContext(uR),cz=["children","head","initialContent","src","mountTarget"],sR=Tt.forwardRef((e,n)=>{var{children:a,head:s,initialContent:f,src:h,mountTarget:d}=e,g=sz(e,cz),[E,b]=Tt.useState(!1),[C,S]=Tt.useState(),R=J=>{J&&S(J)};Tt.useImperativeHandle(n,()=>C,[C]);var k=f||"<!DOCTYPE html><html><head></head><body></body></html>",D=()=>C?C.contentDocument:null,L=()=>{var J=D();return d?J==null?void 0:J.querySelector(d):J==null?void 0:J.body},B=Tt.useRef(),H=Tt.useCallback(J=>{B.current=J;var Z=()=>setInterval(()=>H(J),500);clearInterval(Z()),E||b(!0)},[E]);Tt.useMemo(()=>{!h&&g.onLoad&&E&&g.onLoad(B.current)},[E]),Tt.useEffect(()=>{if(C&&!h){var J;(J=C.contentWindow)==null||J.addEventListener("DOMContentLoaded",H)}return()=>{if(C&&!h){var Z;(Z=C.contentWindow)==null||Z.removeEventListener("DOMContentLoaded",H)}}},[C,H]);var $=()=>{var J,Z=D(),X=(J=D())==null?void 0:J.head,te=L(),we=(Z==null?void 0:Z.defaultView)||(Z==null?void 0:Z.parentView),Me=I.jsx(uR.Provider,{value:{document:Z,window:we},children:a});return[X&&s&&Um.createPortal(s,X),C&&te&&Um.createPortal(Me,te)]},W={};return h?(delete W.srcDoc,W.src=h,W.onLoad=g.onLoad):W.srcDoc=k,I.jsx("iframe",Nw({title:g.title,ref:R},g,{onLoad:H},W,{children:E&&$()}))});sR.displayName="IFrame";const lR="opencx-widget-portal";function J1(){return null}function dz({children:e}){var a,s;const n=(s=(a=lz())==null?void 0:a.document)==null?void 0:s.getElementById(lR);return n?Um.createPortal(e,n):(console.error("Portal container not found!"),null)}function fz(){return I.jsx("div",{id:lR,className:"absolute size-full top-0 left-0"})}J1.Portal=dz;J1.Container=fz;const pz=so.Root,hz=so.Trigger,cR=ie.forwardRef(({className:e,...n},a)=>I.jsx(so.Overlay,{ref:a,className:St("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));cR.displayName=so.Overlay.displayName;const dR=ie.forwardRef(({className:e,children:n,...a},s)=>I.jsxs(J1.Portal,{children:[I.jsx(cR,{}),I.jsxs(so.Content,{ref:s,className:St("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[n,I.jsx(so.Close,{asChild:!0,className:"absolute right-4 top-4 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:I.jsxs(si,{size:"fit",variant:"outline",children:[I.jsx(Wn.X,{className:"h-4 w-4"}),I.jsx("span",{className:"sr-only",children:"Close"})]})})]})]}));dR.displayName=so.Content.displayName;const fR=ie.forwardRef(({className:e,...n},a)=>I.jsx(so.Title,{ref:a,className:St("text-lg font-semibold leading-none tracking-tight",e),...n}));fR.displayName=so.Title.displayName;const mz=ie.forwardRef(({className:e,...n},a)=>I.jsx(so.Description,{ref:a,className:St("text-sm text-muted-foreground",e),...n}));mz.displayName=so.Description.displayName;function pR({attachment:e}){const{name:n,size:a,type:s,url:f}=e,h=s.startsWith("image/"),d=s.startsWith("video/"),g=s.startsWith("audio/");return g?I.jsx(el,{children:I.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:I.jsxs("audio",{controls:!0,className:"w-full",children:[I.jsx("source",{src:f,type:s}),"Your browser does not support the audio tag."]})})}):d?I.jsx(el,{children:I.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:I.jsxs("video",{controls:!0,children:[I.jsx("source",{src:f,type:s}),"Your browser does not support the video tag."]})})}):!h&&!d&&!g?I.jsx(el,{children:I.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:I.jsxs("div",{className:"flex items-end gap-2 p-2",children:[I.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:St("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:n}),I.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(a/1024).toFixed(2)," KB"]})]})})}):I.jsxs(pz,{children:[I.jsx(el,{children:I.jsx(hz,{children:I.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:h&&I.jsx("img",{src:f,className:"object-cover size-16",alt:n})})})}),I.jsxs(dR,{"aria-describedby":void 0,className:"size-full rounded-3xl flex items-center justify-center bg-transparent backdrop-blur border-none gap-0",children:[I.jsx(fR,{className:"sr-only",children:"Image preview"}),h&&I.jsx("div",{className:"size-fit shrink-0 rounded-2xl overflow-hidden max-h-full",children:I.jsx("img",{src:f,className:"object-cover size-auto",alt:n})})]})]})}function Dw({data:e,id:n,type:a,attachments:s}){const{message:f,variant:h="default"}=e;return h==="error"?I.jsx("div",{children:I.jsx("div",{className:"flex flex-row flex-wrap items-center justify-start",children:I.jsx("div",{className:"leading-snug text-sm text-destructive",children:f})})}):I.jsxs("div",{className:"w-5/6 flex flex-col items-start gap-1",children:[I.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:s==null?void 0:s.map(d=>I.jsx(pR,{attachment:d},d.id))}),f.length>0&&I.jsx(v3,{"data-type":a,"data-id":n,remarkPlugins:[VA],rehypePlugins:[nR],components:{a:({children:d,...g})=>I.jsx("a",{target:"_top",...g,children:d})},className:St("w-fit p-2 rounded-2xl bg-secondary border shadow-sm","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline","break-words [word-break:break-word]"),children:f})]})}function hR(e){const{componentStore:n}=ft.useWidget();if(e.data.action){const s=n.getComponent(e.data.action.name);if(s)return I.jsx(s,{...e,id:e.id})}const a=n.getComponent(e.component);return a?I.jsx(a,{...e,id:e.id}):I.jsx(Dw,{...e})}const $m=ie.forwardRef(({className:e,...n},a)=>I.jsx(Xf.Root,{ref:a,className:St("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full border bg-secondary",e),...n}));$m.displayName=Xf.Root.displayName;const Z1=ie.forwardRef(({className:e,...n},a)=>I.jsx(Xf.Image,{ref:a,className:St("aspect-square h-full w-full",e),...n}));Z1.displayName=Xf.Image.displayName;const ey=ie.forwardRef(({className:e,...n},a)=>I.jsx(Xf.Fallback,{ref:a,className:St("flex size-full text-xs items-center justify-center rounded-lg",e),...n}));ey.displayName=Xf.Fallback.displayName;function gz({message:e}){var n;return I.jsxs("div",{className:"w-5/6 flex flex-col items-end gap-1",children:[e.attachments&&e.attachments.length>0&&I.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(n=e.attachments)==null?void 0:n.map(a=>I.jsx(pR,{attachment:a},a.id))}),e.content.length>0&&I.jsx("div",{className:St("w-fit p-2 rounded-2xl text-sm","bg-primary text-primary-foreground border shadow-sm","break-words [word-break:break-word]","whitespace-pre-wrap"),children:e.content})]})}function vz({messages:e}){var a,s,f,h,d,g;const{user:n}=ft.useConfig();return I.jsxs("div",{className:St("group","flex flex-col gap-2 justify-end items-end"),children:[I.jsxs($m,{className:"bg-primary text-primary-foreground",children:[I.jsx(Z1,{src:(a=n==null?void 0:n.data)==null?void 0:a.avatarUrl,alt:((s=n==null?void 0:n.data)==null?void 0:s.name)||"User avatar"}),((f=n==null?void 0:n.data)==null?void 0:f.name)&&I.jsx(ey,{children:(g=(d=(h=n==null?void 0:n.data)==null?void 0:h.name)==null?void 0:d.slice(0,1))==null?void 0:g.toUpperCase()})]}),e.map(E=>I.jsx(gz,{message:E},E.id))]})}function yz({messages:e,agent:n}){var a,s;return I.jsxs("div",{className:St("flex flex-col items-start gap-2"),children:[I.jsx(k1,{content:n==null?void 0:n.name,side:"right",align:"end",children:I.jsxs($m,{children:[I.jsx(Z1,{src:(n==null?void 0:n.avatar)??"",alt:"Agent Icon"}),(n==null?void 0:n.name)&&I.jsx(ey,{children:(s=(a=n==null?void 0:n.name)==null?void 0:a.slice(0,1))==null?void 0:s.toUpperCase()})]})}),e.map(f=>I.jsx(hR,{...f},f.id))]})}function Ez(){const{messagesState:{messages:e}}=ft.useMessages(),{isAwaitingBotReply:n}=ft.useIsAwaitingBotReply(),{componentStore:a}=ft.useWidget(),s=ft.useConfig(),f=Tt.useMemo(()=>m5(e),[e.length]),h=!s.initialMessages||s.initialMessages.length===0?["Hello, how can I help you?"]:s.initialMessages,d=a.getComponent("loading"),g=Tt.useRef(null);function E(){setTimeout(()=>{const b=g.current;b&&(b.scrollTop=b.scrollHeight)},0)}return Tt.useEffect(()=>{E()},[e]),I.jsxs("div",{"data-messages":!0,ref:g,className:"max-h-full scroll-smooth relative flex-1 p-2 space-y-2 overflow-auto",children:[e.length===0&&h.map(b=>I.jsx(hR,{component:"bot_message",data:{message:b},id:b,type:"FROM_BOT",agent:s.bot?{...s.bot,isAi:!0,id:null}:void 0,timestamp:Date.now().toString()},b)),f.map(b=>{var R,k,D;const C=(R=b==null?void 0:b[0])==null?void 0:R.type,S=(k=b[0])==null?void 0:k.id;if(!C||!S)return null;if(g5(b))return I.jsx(vz,{messages:b},S);if(v5(b)||y5(b)){const L=(D=b[0])==null?void 0:D.agent;return I.jsx(yz,{messages:b,agent:L},S)}return null}),n&&I.jsx(d,{})]})}function mR({className:e}){return I.jsx(Wn.LoaderIcon,{className:St("size-4 animate-spin",e)})}function bz(){const{messagesState:{isInitialFetchLoading:e}}=ft.useMessages(),{sessionState:{session:n}}=ft.useSessions(),{observedElementRef:a}=zw({fallbackHeight:$k}),s=Tt.useRef((n==null?void 0:n.id)||"chat").current;return I.jsx("div",{ref:a,className:St(Bw.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:I.jsxs("div",{className:"size-full justify-between flex flex-col",children:[I.jsx(uA,{}),I.jsx(vr.AnimatePresence,{mode:"wait",children:e?I.jsx(Sn,{className:"flex flex-col items-center justify-center w-full flex-1",children:I.jsx(mR,{})},"loading"):I.jsxs(Sn,{className:"flex flex-col w-full flex-1 overflow-auto",snapExit:!0,children:[I.jsx(Ez,{}),I.jsx(a5,{})]},s)})]})})}const T1=ie.forwardRef(({className:e,type:n,...a},s)=>{const f=B1();return I.jsx(el,{ref:s,children:I.jsx("input",{dir:f,type:n,className:St("flex w-full rounded-xl border border-input bg-background p-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rtl:placeholder:text-right",e),...a})})});T1.displayName="Input";const xz=Px.z.object({name:Px.z.string().min(2),email:Px.z.string().email()});function wz(){var D,L,B,H,$,W,J,Z,X;const{createUnverifiedContact:e}=ft.useContact(),n=ft.useConfig(),a=Jf(),{data:s}=ft.usePreludeData(),{observedElementRef:f}=zw({fallbackHeight:Gk}),[h,d]=Tt.useState(((D=n.prefillUserData)==null?void 0:D.name)||""),[g,E]=Tt.useState(((L=n.prefillUserData)==null?void 0:L.email)||""),b=(n.extraDataCollectionFields||[]).filter(te=>te!=="name"&&te!=="email"&&!!te),[C,S]=Tt.useState({}),[R,k]=ft._default(async te=>{te.preventDefault();const we=xz.safeParse({name:h,email:g});we.success&&await e({email:we.data.email,name:we.data.name},Object.values(C).filter(Boolean).length?C:void 0)},[h,g,C]);return I.jsxs("div",{ref:f,className:St(Bw.widgetMinHeight,"h-fit bg-primary flex flex-col"),children:[I.jsxs("div",{dir:"auto",className:"flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10",children:[I.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(B=n.assets)!=null&&B.organizationLogo?I.jsx("img",{src:(H=n.assets)==null?void 0:H.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):I.jsx("h2",{className:"font-bold text-xl text-primary-foreground",dir:"auto",children:($=s==null?void 0:s.data)==null?void 0:$.organizationName})}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("h1",{className:"text-2xl font-bold text-primary-foreground",dir:"auto",children:((J=(W=n.textContent)==null?void 0:W.welcomeScreen)==null?void 0:J.title)||a.get("welcome-title")}),I.jsx("p",{className:"text-primary-foreground/90 text-sm max-w-[320px] leading-relaxed",dir:"auto",children:((X=(Z=n.textContent)==null?void 0:Z.welcomeScreen)==null?void 0:X.description)||a.get("welcome-description")})]})]}),I.jsx("div",{className:"p-2 bg-background rounded-t-3xl",dir:"auto",children:I.jsxs("form",{onSubmit:k,className:"space-y-2",children:[I.jsxs("div",{className:"space-y-2",children:[I.jsx(T1,{value:h,onChange:te=>d(te.target.value),required:!0,placeholder:a.get("your-name"),name:"name",className:"rounded-3xl pl-3"}),I.jsx(T1,{required:!0,value:g,onChange:te=>E(te.target.value),type:"email",placeholder:a.get("your-email"),name:"email",className:"rounded-3xl pl-3"}),b.map(te=>I.jsx(T1,{value:C[te],onChange:we=>S(Me=>({...Me,[te]:we.target.value})),placeholder:`${te} (${a.get("optional")})`,className:"rounded-3xl pl-3"},te))]}),I.jsxs(si,{disabled:R.loading,className:"w-full rounded-3xl",size:"lg",children:[R.loading?a.get("starting-chat"):a.get("start-chat"),I.jsx(Wn.SendHorizontal,{className:"size-4 rtl:-scale-100"})]})]})})]})}function Tz({session:e}){const{bot:n}=ft.useConfig(),{toChatScreen:a}=ft.useWidgetRouter(),s=e.assignee.kind==="human"?e.assignee.name||"Support Agent":(n==null?void 0:n.name)||"AI Support Agent",f=e.assignee.kind==="human"?e.assignee.avatarUrl||"":(n==null?void 0:n.avatar)||"";return I.jsxs(si,{variant:"outline",size:"lg",className:"border-muted rounded-full p-2 flex text-start justify-between w-full whitespace-normal",onClick:()=>a(e.id),children:[I.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[I.jsx(vr.AnimatePresence,{mode:"wait",children:I.jsx(Sn,{snapExit:!0,children:I.jsx($m,{className:"size-10",children:I.jsx(Z1,{src:f,alt:"Agent Icon"})})})}),I.jsxs("div",{className:"flex-1",children:[I.jsx(vr.AnimatePresence,{mode:"wait",children:I.jsx(Sn,{snapExit:!0,children:s},s)}),I.jsx(vr.AnimatePresence,{mode:"wait",children:e.lastMessage?I.jsx(Sn,{snapExit:!0,children:I.jsx(v3,{remarkPlugins:[VA],rehypePlugins:[nR],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:e.lastMessage})},e.lastMessage||"content"):I.jsx(Sn,{className:"w-1/2",snapExit:!0,children:I.jsx(oA,{className:"h-4 w-full"})},"skeleton")})]})]}),I.jsx(Wn.ChevronRightIcon,{className:"size-4 text-muted-foreground shrink-0"})]})}function Sz(){const e=Jf(),{toChatScreen:n}=ft.useWidgetRouter(),{sessionsState:{data:a,isInitialFetchLoading:s}}=ft.useSessions();return I.jsx("div",{className:"flex-1 flex flex-col overflow-scroll p-2",children:I.jsx(vr.AnimatePresence,{mode:"wait",children:s?I.jsx(Sn,{className:"flex-1 flex items-center justify-center",children:I.jsx(mR,{})},"loading"):I.jsx(Sn,{className:"flex-1 flex flex-col gap-2 relative",children:a.length?I.jsxs(I.Fragment,{children:[I.jsx(vr.AnimatePresence,{children:a.map((f,h)=>I.jsx(Sn,{snapExit:!0,children:I.jsx(Tz,{session:f})},`${f.id}-${h}`))}),I.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background",children:I.jsx(si,{size:"lg",className:"w-full rounded-3xl",onClick:()=>n(),children:e.get("new-conversation")},"new-session")})]}):I.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[I.jsx("div",{className:"flex-1 flex items-center justify-center",children:I.jsx("p",{className:"text-muted-foreground",children:"No conversations yet"})}),I.jsx(si,{size:"lg",className:"w-full rounded-3xl",onClick:()=>n(),children:e.get("new-conversation")},"new-session")]})},"sessions")})})}function Cz(){const{observedElementRef:e}=zw({fallbackHeight:$k});return I.jsx("div",{ref:e,className:St(Bw.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:I.jsxs("div",{className:"size-full flex flex-col",children:[I.jsx(uA,{}),I.jsx(Sz,{})]})})}function _z(){ft.usePreludeData();const{routerState:{screen:e}}=ft.useWidgetRouter();return I.jsxs("div",{className:"relative bg-background size-full",children:[I.jsx(J1.Container,{}),I.jsx(vr.AnimatePresence,{mode:"wait",children:(()=>{switch(e){case"welcome":return I.jsx(Sn,{fadeIn:"right",className:"size-full",snapExit:!0,children:I.jsx(wz,{})},e);case"sessions":return I.jsx(Sn,{fadeIn:"right",className:"size-full",snapExit:!0,children:I.jsx(Cz,{})},e);case"chat":return I.jsx(Sn,{fadeIn:"right",className:"size-full",snapExit:!0,children:I.jsx(bz,{})},e);default:return null}})()})]})}function nl(e,n,{checkForDefaultPrevented:a=!0}={}){return function(f){if(e==null||e(f),a===!1||!f.defaultPrevented)return n==null?void 0:n(f)}}function kz(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Az(...e){return n=>e.forEach(a=>kz(a,n))}function cl(...e){return ie.useCallback(Az(...e),e)}function Rz(e,n=[]){let a=[];function s(h,d){const g=ie.createContext(d),E=a.length;a=[...a,d];const b=S=>{var H;const{scope:R,children:k,...D}=S,L=((H=R==null?void 0:R[e])==null?void 0:H[E])||g,B=ie.useMemo(()=>D,Object.values(D));return I.jsx(L.Provider,{value:B,children:k})};b.displayName=h+"Provider";function C(S,R){var L;const k=((L=R==null?void 0:R[e])==null?void 0:L[E])||g,D=ie.useContext(k);if(D)return D;if(d!==void 0)return d;throw new Error(`\`${S}\` must be used within \`${h}\``)}return[b,C]}const f=()=>{const h=a.map(d=>ie.createContext(d));return function(g){const E=(g==null?void 0:g[e])||h;return ie.useMemo(()=>({[`__scope${e}`]:{...g,[e]:E}}),[g,E])}};return f.scopeName=e,[s,Nz(f,...n)]}function Nz(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const s=e.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(h){const d=s.reduce((g,{useScope:E,scopeName:b})=>{const S=E(h)[`__scope${b}`];return{...g,...S}},{});return ie.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}var Dz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],dl=Dz.reduce((e,n)=>{const a=ie.forwardRef((s,f)=>{const{asChild:h,...d}=s,g=h?Uw.Slot:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(g,{...d,ref:f})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function Oz(e,n){e&&Um.flushSync(()=>e.dispatchEvent(n))}function rl(e){const n=ie.useRef(e);return ie.useEffect(()=>{n.current=e}),ie.useMemo(()=>(...a)=>{var s;return(s=n.current)==null?void 0:s.call(n,...a)},[])}function Lz(e,n=globalThis==null?void 0:globalThis.document){const a=rl(e);ie.useEffect(()=>{const s=f=>{f.key==="Escape"&&a(f)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[a,n])}var Iz="DismissableLayer",Ow="dismissableLayer.update",Mz="dismissableLayer.pointerDownOutside",Pz="dismissableLayer.focusOutside",kk,gR=ie.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vR=ie.forwardRef((e,n)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:d,onDismiss:g,...E}=e,b=ie.useContext(gR),[C,S]=ie.useState(null),R=(C==null?void 0:C.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,k]=ie.useState({}),D=cl(n,te=>S(te)),L=Array.from(b.layers),[B]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),H=L.indexOf(B),$=C?L.indexOf(C):-1,W=b.layersWithOutsidePointerEventsDisabled.size>0,J=$>=H,Z=Bz(te=>{const we=te.target,Me=[...b.branches].some(K=>K.contains(we));!J||Me||(f==null||f(te),d==null||d(te),te.defaultPrevented||g==null||g())},R),X=Hz(te=>{const we=te.target;[...b.branches].some(K=>K.contains(we))||(h==null||h(te),d==null||d(te),te.defaultPrevented||g==null||g())},R);return Lz(te=>{$===b.layers.size-1&&(s==null||s(te),!te.defaultPrevented&&g&&(te.preventDefault(),g()))},R),ie.useEffect(()=>{if(C)return a&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(kk=R.body.style.pointerEvents,R.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(C)),b.layers.add(C),Ak(),()=>{a&&b.layersWithOutsidePointerEventsDisabled.size===1&&(R.body.style.pointerEvents=kk)}},[C,R,a,b]),ie.useEffect(()=>()=>{C&&(b.layers.delete(C),b.layersWithOutsidePointerEventsDisabled.delete(C),Ak())},[C,b]),ie.useEffect(()=>{const te=()=>k({});return document.addEventListener(Ow,te),()=>document.removeEventListener(Ow,te)},[]),I.jsx(dl.div,{...E,ref:D,style:{pointerEvents:W?J?"auto":"none":void 0,...e.style},onFocusCapture:nl(e.onFocusCapture,X.onFocusCapture),onBlurCapture:nl(e.onBlurCapture,X.onBlurCapture),onPointerDownCapture:nl(e.onPointerDownCapture,Z.onPointerDownCapture)})});vR.displayName=Iz;var Fz="DismissableLayerBranch",Uz=ie.forwardRef((e,n)=>{const a=ie.useContext(gR),s=ie.useRef(null),f=cl(n,s);return ie.useEffect(()=>{const h=s.current;if(h)return a.branches.add(h),()=>{a.branches.delete(h)}},[a.branches]),I.jsx(dl.div,{...e,ref:f})});Uz.displayName=Fz;function Bz(e,n=globalThis==null?void 0:globalThis.document){const a=rl(e),s=ie.useRef(!1),f=ie.useRef(()=>{});return ie.useEffect(()=>{const h=g=>{if(g.target&&!s.current){let E=function(){yR(Mz,a,b,{discrete:!0})};const b={originalEvent:g};g.pointerType==="touch"?(n.removeEventListener("click",f.current),f.current=E,n.addEventListener("click",f.current,{once:!0})):E()}else n.removeEventListener("click",f.current);s.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",h),n.removeEventListener("click",f.current)}},[n,a]),{onPointerDownCapture:()=>s.current=!0}}function Hz(e,n=globalThis==null?void 0:globalThis.document){const a=rl(e),s=ie.useRef(!1);return ie.useEffect(()=>{const f=h=>{h.target&&!s.current&&yR(Pz,a,{originalEvent:h},{discrete:!1})};return n.addEventListener("focusin",f),()=>n.removeEventListener("focusin",f)},[n,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Ak(){const e=new CustomEvent(Ow);document.dispatchEvent(e)}function yR(e,n,a,{discrete:s}){const f=a.originalEvent.target,h=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});n&&f.addEventListener(e,n,{once:!0}),s?Oz(f,h):f.dispatchEvent(h)}var aw=0;function zz(){ie.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Rk()),document.body.insertAdjacentElement("beforeend",e[1]??Rk()),aw++,()=>{aw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),aw--}},[])}function Rk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var iw="focusScope.autoFocusOnMount",ow="focusScope.autoFocusOnUnmount",Nk={bubbles:!1,cancelable:!0},jz="FocusScope",ER=ie.forwardRef((e,n)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:f,onUnmountAutoFocus:h,...d}=e,[g,E]=ie.useState(null),b=rl(f),C=rl(h),S=ie.useRef(null),R=cl(n,L=>E(L)),k=ie.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;ie.useEffect(()=>{if(s){let L=function(W){if(k.paused||!g)return;const J=W.target;g.contains(J)?S.current=J:Zs(S.current,{select:!0})},B=function(W){if(k.paused||!g)return;const J=W.relatedTarget;J!==null&&(g.contains(J)||Zs(S.current,{select:!0}))},H=function(W){if(document.activeElement===document.body)for(const Z of W)Z.removedNodes.length>0&&Zs(g)};document.addEventListener("focusin",L),document.addEventListener("focusout",B);const $=new MutationObserver(H);return g&&$.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",L),document.removeEventListener("focusout",B),$.disconnect()}}},[s,g,k.paused]),ie.useEffect(()=>{if(g){Ok.add(k);const L=document.activeElement;if(!g.contains(L)){const H=new CustomEvent(iw,Nk);g.addEventListener(iw,b),g.dispatchEvent(H),H.defaultPrevented||(Vz(Gz(bR(g)),{select:!0}),document.activeElement===L&&Zs(g))}return()=>{g.removeEventListener(iw,b),setTimeout(()=>{const H=new CustomEvent(ow,Nk);g.addEventListener(ow,C),g.dispatchEvent(H),H.defaultPrevented||Zs(L??document.body,{select:!0}),g.removeEventListener(ow,C),Ok.remove(k)},0)}}},[g,b,C,k]);const D=ie.useCallback(L=>{if(!a&&!s||k.paused)return;const B=L.key==="Tab"&&!L.altKey&&!L.ctrlKey&&!L.metaKey,H=document.activeElement;if(B&&H){const $=L.currentTarget,[W,J]=Yz($);W&&J?!L.shiftKey&&H===J?(L.preventDefault(),a&&Zs(W,{select:!0})):L.shiftKey&&H===W&&(L.preventDefault(),a&&Zs(J,{select:!0})):H===$&&L.preventDefault()}},[a,s,k.paused]);return I.jsx(dl.div,{tabIndex:-1,...d,ref:R,onKeyDown:D})});ER.displayName=jz;function Vz(e,{select:n=!1}={}){const a=document.activeElement;for(const s of e)if(Zs(s,{select:n}),document.activeElement!==a)return}function Yz(e){const n=bR(e),a=Dk(n,e),s=Dk(n.reverse(),e);return[a,s]}function bR(e){const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const f=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||f?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)n.push(a.currentNode);return n}function Dk(e,n){for(const a of e)if(!Wz(a,{upTo:n}))return a}function Wz(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qz(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:n=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&qz(e)&&n&&e.select()}}var Ok=Qz();function Qz(){let e=[];return{add(n){const a=e[0];n!==a&&(a==null||a.pause()),e=Lk(e,n),e.unshift(n)},remove(n){var a;e=Lk(e,n),(a=e[0])==null||a.resume()}}}function Lk(e,n){const a=[...e],s=a.indexOf(n);return s!==-1&&a.splice(s,1),a}function Gz(e){return e.filter(n=>n.tagName!=="A")}var Qf=globalThis!=null&&globalThis.document?ie.useLayoutEffect:()=>{},$z=ie.useId||(()=>{}),Xz=0;function Kz(e){const[n,a]=ie.useState($z());return Qf(()=>{e||a(s=>s??String(Xz++))},[e]),e||(n?`radix-${n}`:"")}const Jz=["top","right","bottom","left"],al=Math.min,oi=Math.max,M1=Math.round,p1=Math.floor,il=e=>({x:e,y:e}),Zz={left:"right",right:"left",bottom:"top",top:"bottom"},ej={start:"end",end:"start"};function Lw(e,n,a){return oi(e,al(n,a))}function Pu(e,n){return typeof e=="function"?e(n):e}function Fu(e){return e.split("-")[0]}function ap(e){return e.split("-")[1]}function lT(e){return e==="x"?"y":"x"}function cT(e){return e==="y"?"height":"width"}function ol(e){return["top","bottom"].includes(Fu(e))?"y":"x"}function dT(e){return lT(ol(e))}function tj(e,n,a){a===void 0&&(a=!1);const s=ap(e),f=dT(e),h=cT(f);let d=f==="x"?s===(a?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[h]>n.floating[h]&&(d=P1(d)),[d,P1(d)]}function nj(e){const n=P1(e);return[Iw(e),n,Iw(n)]}function Iw(e){return e.replace(/start|end/g,n=>ej[n])}function rj(e,n,a){const s=["left","right"],f=["right","left"],h=["top","bottom"],d=["bottom","top"];switch(e){case"top":case"bottom":return a?n?f:s:n?s:f;case"left":case"right":return n?h:d;default:return[]}}function aj(e,n,a,s){const f=ap(e);let h=rj(Fu(e),a==="start",s);return f&&(h=h.map(d=>d+"-"+f),n&&(h=h.concat(h.map(Iw)))),h}function P1(e){return e.replace(/left|right|bottom|top/g,n=>Zz[n])}function ij(e){return{top:0,right:0,bottom:0,left:0,...e}}function xR(e){return typeof e!="number"?ij(e):{top:e,right:e,bottom:e,left:e}}function F1(e){const{x:n,y:a,width:s,height:f}=e;return{width:s,height:f,top:a,left:n,right:n+s,bottom:a+f,x:n,y:a}}function Ik(e,n,a){let{reference:s,floating:f}=e;const h=ol(n),d=dT(n),g=cT(d),E=Fu(n),b=h==="y",C=s.x+s.width/2-f.width/2,S=s.y+s.height/2-f.height/2,R=s[g]/2-f[g]/2;let k;switch(E){case"top":k={x:C,y:s.y-f.height};break;case"bottom":k={x:C,y:s.y+s.height};break;case"right":k={x:s.x+s.width,y:S};break;case"left":k={x:s.x-f.width,y:S};break;default:k={x:s.x,y:s.y}}switch(ap(n)){case"start":k[d]-=R*(a&&b?-1:1);break;case"end":k[d]+=R*(a&&b?-1:1);break}return k}const oj=async(e,n,a)=>{const{placement:s="bottom",strategy:f="absolute",middleware:h=[],platform:d}=a,g=h.filter(Boolean),E=await(d.isRTL==null?void 0:d.isRTL(n));let b=await d.getElementRects({reference:e,floating:n,strategy:f}),{x:C,y:S}=Ik(b,s,E),R=s,k={},D=0;for(let L=0;L<g.length;L++){const{name:B,fn:H}=g[L],{x:$,y:W,data:J,reset:Z}=await H({x:C,y:S,initialPlacement:s,placement:R,strategy:f,middlewareData:k,rects:b,platform:d,elements:{reference:e,floating:n}});C=$??C,S=W??S,k={...k,[B]:{...k[B],...J}},Z&&D<=50&&(D++,typeof Z=="object"&&(Z.placement&&(R=Z.placement),Z.rects&&(b=Z.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:f}):Z.rects),{x:C,y:S}=Ik(b,R,E)),L=-1)}return{x:C,y:S,placement:R,strategy:f,middlewareData:k}};async function Bm(e,n){var a;n===void 0&&(n={});const{x:s,y:f,platform:h,rects:d,elements:g,strategy:E}=e,{boundary:b="clippingAncestors",rootBoundary:C="viewport",elementContext:S="floating",altBoundary:R=!1,padding:k=0}=Pu(n,e),D=xR(k),B=g[R?S==="floating"?"reference":"floating":S],H=F1(await h.getClippingRect({element:(a=await(h.isElement==null?void 0:h.isElement(B)))==null||a?B:B.contextElement||await(h.getDocumentElement==null?void 0:h.getDocumentElement(g.floating)),boundary:b,rootBoundary:C,strategy:E})),$=S==="floating"?{x:s,y:f,width:d.floating.width,height:d.floating.height}:d.reference,W=await(h.getOffsetParent==null?void 0:h.getOffsetParent(g.floating)),J=await(h.isElement==null?void 0:h.isElement(W))?await(h.getScale==null?void 0:h.getScale(W))||{x:1,y:1}:{x:1,y:1},Z=F1(h.convertOffsetParentRelativeRectToViewportRelativeRect?await h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:$,offsetParent:W,strategy:E}):$);return{top:(H.top-Z.top+D.top)/J.y,bottom:(Z.bottom-H.bottom+D.bottom)/J.y,left:(H.left-Z.left+D.left)/J.x,right:(Z.right-H.right+D.right)/J.x}}const uj=e=>({name:"arrow",options:e,async fn(n){const{x:a,y:s,placement:f,rects:h,platform:d,elements:g,middlewareData:E}=n,{element:b,padding:C=0}=Pu(e,n)||{};if(b==null)return{};const S=xR(C),R={x:a,y:s},k=dT(f),D=cT(k),L=await d.getDimensions(b),B=k==="y",H=B?"top":"left",$=B?"bottom":"right",W=B?"clientHeight":"clientWidth",J=h.reference[D]+h.reference[k]-R[k]-h.floating[D],Z=R[k]-h.reference[k],X=await(d.getOffsetParent==null?void 0:d.getOffsetParent(b));let te=X?X[W]:0;(!te||!await(d.isElement==null?void 0:d.isElement(X)))&&(te=g.floating[W]||h.floating[D]);const we=J/2-Z/2,Me=te/2-L[D]/2-1,K=al(S[H],Me),Ee=al(S[$],Me),ge=K,Re=te-L[D]-Ee,Oe=te/2-L[D]/2+we,qe=Lw(ge,Oe,Re),je=!E.arrow&&ap(f)!=null&&Oe!==qe&&h.reference[D]/2-(Oe<ge?K:Ee)-L[D]/2<0,at=je?Oe<ge?Oe-ge:Oe-Re:0;return{[k]:R[k]+at,data:{[k]:qe,centerOffset:Oe-qe-at,...je&&{alignmentOffset:at}},reset:je}}}),sj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var a,s;const{placement:f,middlewareData:h,rects:d,initialPlacement:g,platform:E,elements:b}=n,{mainAxis:C=!0,crossAxis:S=!0,fallbackPlacements:R,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:D="none",flipAlignment:L=!0,...B}=Pu(e,n);if((a=h.arrow)!=null&&a.alignmentOffset)return{};const H=Fu(f),$=ol(g),W=Fu(g)===g,J=await(E.isRTL==null?void 0:E.isRTL(b.floating)),Z=R||(W||!L?[P1(g)]:nj(g)),X=D!=="none";!R&&X&&Z.push(...aj(g,L,D,J));const te=[g,...Z],we=await Bm(n,B),Me=[];let K=((s=h.flip)==null?void 0:s.overflows)||[];if(C&&Me.push(we[H]),S){const Oe=tj(f,d,J);Me.push(we[Oe[0]],we[Oe[1]])}if(K=[...K,{placement:f,overflows:Me}],!Me.every(Oe=>Oe<=0)){var Ee,ge;const Oe=(((Ee=h.flip)==null?void 0:Ee.index)||0)+1,qe=te[Oe];if(qe)return{data:{index:Oe,overflows:K},reset:{placement:qe}};let je=(ge=K.filter(at=>at.overflows[0]<=0).sort((at,he)=>at.overflows[1]-he.overflows[1])[0])==null?void 0:ge.placement;if(!je)switch(k){case"bestFit":{var Re;const at=(Re=K.filter(he=>{if(X){const De=ol(he.placement);return De===$||De==="y"}return!0}).map(he=>[he.placement,he.overflows.filter(De=>De>0).reduce((De,F)=>De+F,0)]).sort((he,De)=>he[1]-De[1])[0])==null?void 0:Re[0];at&&(je=at);break}case"initialPlacement":je=g;break}if(f!==je)return{reset:{placement:je}}}return{}}}};function Mk(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Pk(e){return Jz.some(n=>e[n]>=0)}const lj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:a}=n,{strategy:s="referenceHidden",...f}=Pu(e,n);switch(s){case"referenceHidden":{const h=await Bm(n,{...f,elementContext:"reference"}),d=Mk(h,a.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Pk(d)}}}case"escaped":{const h=await Bm(n,{...f,altBoundary:!0}),d=Mk(h,a.floating);return{data:{escapedOffsets:d,escaped:Pk(d)}}}default:return{}}}}};async function cj(e,n){const{placement:a,platform:s,elements:f}=e,h=await(s.isRTL==null?void 0:s.isRTL(f.floating)),d=Fu(a),g=ap(a),E=ol(a)==="y",b=["left","top"].includes(d)?-1:1,C=h&&E?-1:1,S=Pu(n,e);let{mainAxis:R,crossAxis:k,alignmentAxis:D}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return g&&typeof D=="number"&&(k=g==="end"?D*-1:D),E?{x:k*C,y:R*b}:{x:R*b,y:k*C}}const dj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var a,s;const{x:f,y:h,placement:d,middlewareData:g}=n,E=await cj(n,e);return d===((a=g.offset)==null?void 0:a.placement)&&(s=g.arrow)!=null&&s.alignmentOffset?{}:{x:f+E.x,y:h+E.y,data:{...E,placement:d}}}}},fj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:a,y:s,placement:f}=n,{mainAxis:h=!0,crossAxis:d=!1,limiter:g={fn:B=>{let{x:H,y:$}=B;return{x:H,y:$}}},...E}=Pu(e,n),b={x:a,y:s},C=await Bm(n,E),S=ol(Fu(f)),R=lT(S);let k=b[R],D=b[S];if(h){const B=R==="y"?"top":"left",H=R==="y"?"bottom":"right",$=k+C[B],W=k-C[H];k=Lw($,k,W)}if(d){const B=S==="y"?"top":"left",H=S==="y"?"bottom":"right",$=D+C[B],W=D-C[H];D=Lw($,D,W)}const L=g.fn({...n,[R]:k,[S]:D});return{...L,data:{x:L.x-a,y:L.y-s,enabled:{[R]:h,[S]:d}}}}}},pj=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:a,y:s,placement:f,rects:h,middlewareData:d}=n,{offset:g=0,mainAxis:E=!0,crossAxis:b=!0}=Pu(e,n),C={x:a,y:s},S=ol(f),R=lT(S);let k=C[R],D=C[S];const L=Pu(g,n),B=typeof L=="number"?{mainAxis:L,crossAxis:0}:{mainAxis:0,crossAxis:0,...L};if(E){const W=R==="y"?"height":"width",J=h.reference[R]-h.floating[W]+B.mainAxis,Z=h.reference[R]+h.reference[W]-B.mainAxis;k<J?k=J:k>Z&&(k=Z)}if(b){var H,$;const W=R==="y"?"width":"height",J=["top","left"].includes(Fu(f)),Z=h.reference[S]-h.floating[W]+(J&&((H=d.offset)==null?void 0:H[S])||0)+(J?0:B.crossAxis),X=h.reference[S]+h.reference[W]+(J?0:(($=d.offset)==null?void 0:$[S])||0)-(J?B.crossAxis:0);D<Z?D=Z:D>X&&(D=X)}return{[R]:k,[S]:D}}}},hj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var a,s;const{placement:f,rects:h,platform:d,elements:g}=n,{apply:E=()=>{},...b}=Pu(e,n),C=await Bm(n,b),S=Fu(f),R=ap(f),k=ol(f)==="y",{width:D,height:L}=h.floating;let B,H;S==="top"||S==="bottom"?(B=S,H=R===(await(d.isRTL==null?void 0:d.isRTL(g.floating))?"start":"end")?"left":"right"):(H=S,B=R==="end"?"top":"bottom");const $=L-C.top-C.bottom,W=D-C.left-C.right,J=al(L-C[B],$),Z=al(D-C[H],W),X=!n.middlewareData.shift;let te=J,we=Z;if((a=n.middlewareData.shift)!=null&&a.enabled.x&&(we=W),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(te=$),X&&!R){const K=oi(C.left,0),Ee=oi(C.right,0),ge=oi(C.top,0),Re=oi(C.bottom,0);k?we=D-2*(K!==0||Ee!==0?K+Ee:oi(C.left,C.right)):te=L-2*(ge!==0||Re!==0?ge+Re:oi(C.top,C.bottom))}await E({...n,availableWidth:we,availableHeight:te});const Me=await d.getDimensions(g.floating);return D!==Me.width||L!==Me.height?{reset:{rects:!0}}:{}}}};function ty(){return typeof window<"u"}function ip(e){return wR(e)?(e.nodeName||"").toLowerCase():"#document"}function ui(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Qo(e){var n;return(n=(wR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function wR(e){return ty()?e instanceof Node||e instanceof ui(e).Node:!1}function lo(e){return ty()?e instanceof Element||e instanceof ui(e).Element:!1}function Yo(e){return ty()?e instanceof HTMLElement||e instanceof ui(e).HTMLElement:!1}function Fk(e){return!ty()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ui(e).ShadowRoot}function Xm(e){const{overflow:n,overflowX:a,overflowY:s,display:f}=co(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+a)&&!["inline","contents"].includes(f)}function mj(e){return["table","td","th"].includes(ip(e))}function ny(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function fT(e){const n=pT(),a=lo(e)?co(e):e;return a.transform!=="none"||a.perspective!=="none"||(a.containerType?a.containerType!=="normal":!1)||!n&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!n&&(a.filter?a.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(a.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(a.contain||"").includes(s))}function gj(e){let n=ul(e);for(;Yo(n)&&!Gf(n);){if(fT(n))return n;if(ny(n))return null;n=ul(n)}return null}function pT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Gf(e){return["html","body","#document"].includes(ip(e))}function co(e){return ui(e).getComputedStyle(e)}function ry(e){return lo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ul(e){if(ip(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Fk(e)&&e.host||Qo(e);return Fk(n)?n.host:n}function TR(e){const n=ul(e);return Gf(n)?e.ownerDocument?e.ownerDocument.body:e.body:Yo(n)&&Xm(n)?n:TR(n)}function Hm(e,n,a){var s;n===void 0&&(n=[]),a===void 0&&(a=!0);const f=TR(e),h=f===((s=e.ownerDocument)==null?void 0:s.body),d=ui(f);if(h){const g=Mw(d);return n.concat(d,d.visualViewport||[],Xm(f)?f:[],g&&a?Hm(g):[])}return n.concat(f,Hm(f,[],a))}function Mw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function SR(e){const n=co(e);let a=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const f=Yo(e),h=f?e.offsetWidth:a,d=f?e.offsetHeight:s,g=M1(a)!==h||M1(s)!==d;return g&&(a=h,s=d),{width:a,height:s,$:g}}function hT(e){return lo(e)?e:e.contextElement}function Vf(e){const n=hT(e);if(!Yo(n))return il(1);const a=n.getBoundingClientRect(),{width:s,height:f,$:h}=SR(n);let d=(h?M1(a.width):a.width)/s,g=(h?M1(a.height):a.height)/f;return(!d||!Number.isFinite(d))&&(d=1),(!g||!Number.isFinite(g))&&(g=1),{x:d,y:g}}const vj=il(0);function CR(e){const n=ui(e);return!pT()||!n.visualViewport?vj:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function yj(e,n,a){return n===void 0&&(n=!1),!a||n&&a!==ui(e)?!1:n}function Nc(e,n,a,s){n===void 0&&(n=!1),a===void 0&&(a=!1);const f=e.getBoundingClientRect(),h=hT(e);let d=il(1);n&&(s?lo(s)&&(d=Vf(s)):d=Vf(e));const g=yj(h,a,s)?CR(h):il(0);let E=(f.left+g.x)/d.x,b=(f.top+g.y)/d.y,C=f.width/d.x,S=f.height/d.y;if(h){const R=ui(h),k=s&&lo(s)?ui(s):s;let D=R,L=Mw(D);for(;L&&s&&k!==D;){const B=Vf(L),H=L.getBoundingClientRect(),$=co(L),W=H.left+(L.clientLeft+parseFloat($.paddingLeft))*B.x,J=H.top+(L.clientTop+parseFloat($.paddingTop))*B.y;E*=B.x,b*=B.y,C*=B.x,S*=B.y,E+=W,b+=J,D=ui(L),L=Mw(D)}}return F1({width:C,height:S,x:E,y:b})}function Ej(e){let{elements:n,rect:a,offsetParent:s,strategy:f}=e;const h=f==="fixed",d=Qo(s),g=n?ny(n.floating):!1;if(s===d||g&&h)return a;let E={scrollLeft:0,scrollTop:0},b=il(1);const C=il(0),S=Yo(s);if((S||!S&&!h)&&((ip(s)!=="body"||Xm(d))&&(E=ry(s)),Yo(s))){const R=Nc(s);b=Vf(s),C.x=R.x+s.clientLeft,C.y=R.y+s.clientTop}return{width:a.width*b.x,height:a.height*b.y,x:a.x*b.x-E.scrollLeft*b.x+C.x,y:a.y*b.y-E.scrollTop*b.y+C.y}}function bj(e){return Array.from(e.getClientRects())}function Pw(e,n){const a=ry(e).scrollLeft;return n?n.left+a:Nc(Qo(e)).left+a}function xj(e){const n=Qo(e),a=ry(e),s=e.ownerDocument.body,f=oi(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),h=oi(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let d=-a.scrollLeft+Pw(e);const g=-a.scrollTop;return co(s).direction==="rtl"&&(d+=oi(n.clientWidth,s.clientWidth)-f),{width:f,height:h,x:d,y:g}}function wj(e,n){const a=ui(e),s=Qo(e),f=a.visualViewport;let h=s.clientWidth,d=s.clientHeight,g=0,E=0;if(f){h=f.width,d=f.height;const b=pT();(!b||b&&n==="fixed")&&(g=f.offsetLeft,E=f.offsetTop)}return{width:h,height:d,x:g,y:E}}function Tj(e,n){const a=Nc(e,!0,n==="fixed"),s=a.top+e.clientTop,f=a.left+e.clientLeft,h=Yo(e)?Vf(e):il(1),d=e.clientWidth*h.x,g=e.clientHeight*h.y,E=f*h.x,b=s*h.y;return{width:d,height:g,x:E,y:b}}function Uk(e,n,a){let s;if(n==="viewport")s=wj(e,a);else if(n==="document")s=xj(Qo(e));else if(lo(n))s=Tj(n,a);else{const f=CR(e);s={...n,x:n.x-f.x,y:n.y-f.y}}return F1(s)}function _R(e,n){const a=ul(e);return a===n||!lo(a)||Gf(a)?!1:co(a).position==="fixed"||_R(a,n)}function Sj(e,n){const a=n.get(e);if(a)return a;let s=Hm(e,[],!1).filter(g=>lo(g)&&ip(g)!=="body"),f=null;const h=co(e).position==="fixed";let d=h?ul(e):e;for(;lo(d)&&!Gf(d);){const g=co(d),E=fT(d);!E&&g.position==="fixed"&&(f=null),(h?!E&&!f:!E&&g.position==="static"&&!!f&&["absolute","fixed"].includes(f.position)||Xm(d)&&!E&&_R(e,d))?s=s.filter(C=>C!==d):f=g,d=ul(d)}return n.set(e,s),s}function Cj(e){let{element:n,boundary:a,rootBoundary:s,strategy:f}=e;const d=[...a==="clippingAncestors"?ny(n)?[]:Sj(n,this._c):[].concat(a),s],g=d[0],E=d.reduce((b,C)=>{const S=Uk(n,C,f);return b.top=oi(S.top,b.top),b.right=al(S.right,b.right),b.bottom=al(S.bottom,b.bottom),b.left=oi(S.left,b.left),b},Uk(n,g,f));return{width:E.right-E.left,height:E.bottom-E.top,x:E.left,y:E.top}}function _j(e){const{width:n,height:a}=SR(e);return{width:n,height:a}}function kj(e,n,a){const s=Yo(n),f=Qo(n),h=a==="fixed",d=Nc(e,!0,h,n);let g={scrollLeft:0,scrollTop:0};const E=il(0);if(s||!s&&!h)if((ip(n)!=="body"||Xm(f))&&(g=ry(n)),s){const k=Nc(n,!0,h,n);E.x=k.x+n.clientLeft,E.y=k.y+n.clientTop}else f&&(E.x=Pw(f));let b=0,C=0;if(f&&!s&&!h){const k=f.getBoundingClientRect();C=k.top+g.scrollTop,b=k.left+g.scrollLeft-Pw(f,k)}const S=d.left+g.scrollLeft-E.x-b,R=d.top+g.scrollTop-E.y-C;return{x:S,y:R,width:d.width,height:d.height}}function uw(e){return co(e).position==="static"}function Bk(e,n){if(!Yo(e)||co(e).position==="fixed")return null;if(n)return n(e);let a=e.offsetParent;return Qo(e)===a&&(a=a.ownerDocument.body),a}function kR(e,n){const a=ui(e);if(ny(e))return a;if(!Yo(e)){let f=ul(e);for(;f&&!Gf(f);){if(lo(f)&&!uw(f))return f;f=ul(f)}return a}let s=Bk(e,n);for(;s&&mj(s)&&uw(s);)s=Bk(s,n);return s&&Gf(s)&&uw(s)&&!fT(s)?a:s||gj(e)||a}const Aj=async function(e){const n=this.getOffsetParent||kR,a=this.getDimensions,s=await a(e.floating);return{reference:kj(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Rj(e){return co(e).direction==="rtl"}const Nj={convertOffsetParentRelativeRectToViewportRelativeRect:Ej,getDocumentElement:Qo,getClippingRect:Cj,getOffsetParent:kR,getElementRects:Aj,getClientRects:bj,getDimensions:_j,getScale:Vf,isElement:lo,isRTL:Rj};function Dj(e,n){let a=null,s;const f=Qo(e);function h(){var g;clearTimeout(s),(g=a)==null||g.disconnect(),a=null}function d(g,E){g===void 0&&(g=!1),E===void 0&&(E=1),h();const{left:b,top:C,width:S,height:R}=e.getBoundingClientRect();if(g||n(),!S||!R)return;const k=p1(C),D=p1(f.clientWidth-(b+S)),L=p1(f.clientHeight-(C+R)),B=p1(b),$={rootMargin:-k+"px "+-D+"px "+-L+"px "+-B+"px",threshold:oi(0,al(1,E))||1};let W=!0;function J(Z){const X=Z[0].intersectionRatio;if(X!==E){if(!W)return d();X?d(!1,X):s=setTimeout(()=>{d(!1,1e-7)},1e3)}W=!1}try{a=new IntersectionObserver(J,{...$,root:f.ownerDocument})}catch{a=new IntersectionObserver(J,$)}a.observe(e)}return d(!0),h}function Oj(e,n,a,s){s===void 0&&(s={});const{ancestorScroll:f=!0,ancestorResize:h=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:E=!1}=s,b=hT(e),C=f||h?[...b?Hm(b):[],...Hm(n)]:[];C.forEach(H=>{f&&H.addEventListener("scroll",a,{passive:!0}),h&&H.addEventListener("resize",a)});const S=b&&g?Dj(b,a):null;let R=-1,k=null;d&&(k=new ResizeObserver(H=>{let[$]=H;$&&$.target===b&&k&&(k.unobserve(n),cancelAnimationFrame(R),R=requestAnimationFrame(()=>{var W;(W=k)==null||W.observe(n)})),a()}),b&&!E&&k.observe(b),k.observe(n));let D,L=E?Nc(e):null;E&&B();function B(){const H=Nc(e);L&&(H.x!==L.x||H.y!==L.y||H.width!==L.width||H.height!==L.height)&&a(),L=H,D=requestAnimationFrame(B)}return a(),()=>{var H;C.forEach($=>{f&&$.removeEventListener("scroll",a),h&&$.removeEventListener("resize",a)}),S==null||S(),(H=k)==null||H.disconnect(),k=null,E&&cancelAnimationFrame(D)}}const Lj=dj,Ij=fj,Mj=sj,Pj=hj,Fj=lj,Hk=uj,Uj=pj,Bj=(e,n,a)=>{const s=new Map,f={platform:Nj,...a},h={...f.platform,_c:s};return oj(e,n,{...f,platform:h})};var S1=typeof document<"u"?Tt.useLayoutEffect:Tt.useEffect;function U1(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let a,s,f;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==n.length)return!1;for(s=a;s--!==0;)if(!U1(e[s],n[s]))return!1;return!0}if(f=Object.keys(e),a=f.length,a!==Object.keys(n).length)return!1;for(s=a;s--!==0;)if(!{}.hasOwnProperty.call(n,f[s]))return!1;for(s=a;s--!==0;){const h=f[s];if(!(h==="_owner"&&e.$$typeof)&&!U1(e[h],n[h]))return!1}return!0}return e!==e&&n!==n}function AR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zk(e,n){const a=AR(e);return Math.round(n*a)/a}function sw(e){const n=ie.useRef(e);return S1(()=>{n.current=e}),n}function Hj(e){e===void 0&&(e={});const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:f,elements:{reference:h,floating:d}={},transform:g=!0,whileElementsMounted:E,open:b}=e,[C,S]=ie.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[R,k]=ie.useState(s);U1(R,s)||k(s);const[D,L]=ie.useState(null),[B,H]=ie.useState(null),$=ie.useCallback(he=>{he!==X.current&&(X.current=he,L(he))},[]),W=ie.useCallback(he=>{he!==te.current&&(te.current=he,H(he))},[]),J=h||D,Z=d||B,X=ie.useRef(null),te=ie.useRef(null),we=ie.useRef(C),Me=E!=null,K=sw(E),Ee=sw(f),ge=sw(b),Re=ie.useCallback(()=>{if(!X.current||!te.current)return;const he={placement:n,strategy:a,middleware:R};Ee.current&&(he.platform=Ee.current),Bj(X.current,te.current,he).then(De=>{const F={...De,isPositioned:ge.current!==!1};Oe.current&&!U1(we.current,F)&&(we.current=F,Um.flushSync(()=>{S(F)}))})},[R,n,a,Ee,ge]);S1(()=>{b===!1&&we.current.isPositioned&&(we.current.isPositioned=!1,S(he=>({...he,isPositioned:!1})))},[b]);const Oe=ie.useRef(!1);S1(()=>(Oe.current=!0,()=>{Oe.current=!1}),[]),S1(()=>{if(J&&(X.current=J),Z&&(te.current=Z),J&&Z){if(K.current)return K.current(J,Z,Re);Re()}},[J,Z,Re,K,Me]);const qe=ie.useMemo(()=>({reference:X,floating:te,setReference:$,setFloating:W}),[$,W]),je=ie.useMemo(()=>({reference:J,floating:Z}),[J,Z]),at=ie.useMemo(()=>{const he={position:a,left:0,top:0};if(!je.floating)return he;const De=zk(je.floating,C.x),F=zk(je.floating,C.y);return g?{...he,transform:"translate("+De+"px, "+F+"px)",...AR(je.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:De,top:F}},[a,g,je.floating,C.x,C.y]);return ie.useMemo(()=>({...C,update:Re,refs:qe,elements:je,floatingStyles:at}),[C,Re,qe,je,at])}const zj=e=>{function n(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:s,padding:f}=typeof e=="function"?e(a):e;return s&&n(s)?s.current!=null?Hk({element:s.current,padding:f}).fn(a):{}:s?Hk({element:s,padding:f}).fn(a):{}}}},jj=(e,n)=>({...Lj(e),options:[e,n]}),Vj=(e,n)=>({...Ij(e),options:[e,n]}),Yj=(e,n)=>({...Uj(e),options:[e,n]}),Wj=(e,n)=>({...Mj(e),options:[e,n]}),qj=(e,n)=>({...Pj(e),options:[e,n]}),Qj=(e,n)=>({...Fj(e),options:[e,n]}),Gj=(e,n)=>({...zj(e),options:[e,n]});var $j="Arrow",RR=ie.forwardRef((e,n)=>{const{children:a,width:s=10,height:f=5,...h}=e;return I.jsx(dl.svg,{...h,ref:n,width:s,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:I.jsx("polygon",{points:"0,0 30,0 15,10"})})});RR.displayName=$j;var Xj=RR;function Kj(e,n=[]){let a=[];function s(h,d){const g=ie.createContext(d),E=a.length;a=[...a,d];function b(S){const{scope:R,children:k,...D}=S,L=(R==null?void 0:R[e][E])||g,B=ie.useMemo(()=>D,Object.values(D));return I.jsx(L.Provider,{value:B,children:k})}function C(S,R){const k=(R==null?void 0:R[e][E])||g,D=ie.useContext(k);if(D)return D;if(d!==void 0)return d;throw new Error(`\`${S}\` must be used within \`${h}\``)}return b.displayName=h+"Provider",[b,C]}const f=()=>{const h=a.map(d=>ie.createContext(d));return function(g){const E=(g==null?void 0:g[e])||h;return ie.useMemo(()=>({[`__scope${e}`]:{...g,[e]:E}}),[g,E])}};return f.scopeName=e,[s,Jj(f,...n)]}function Jj(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const s=e.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(h){const d=s.reduce((g,{useScope:E,scopeName:b})=>{const S=E(h)[`__scope${b}`];return{...g,...S}},{});return ie.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function Zj(e){const[n,a]=ie.useState(void 0);return Qf(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(f=>{if(!Array.isArray(f)||!f.length)return;const h=f[0];let d,g;if("borderBoxSize"in h){const E=h.borderBoxSize,b=Array.isArray(E)?E[0]:E;d=b.inlineSize,g=b.blockSize}else d=e.offsetWidth,g=e.offsetHeight;a({width:d,height:g})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else a(void 0)},[e]),n}var mT="Popper",[NR,DR]=Kj(mT),[eV,OR]=NR(mT),LR=e=>{const{__scopePopper:n,children:a}=e,[s,f]=ie.useState(null);return I.jsx(eV,{scope:n,anchor:s,onAnchorChange:f,children:a})};LR.displayName=mT;var IR="PopperAnchor",MR=ie.forwardRef((e,n)=>{const{__scopePopper:a,virtualRef:s,...f}=e,h=OR(IR,a),d=ie.useRef(null),g=cl(n,d);return ie.useEffect(()=>{h.onAnchorChange((s==null?void 0:s.current)||d.current)}),s?null:I.jsx(dl.div,{...f,ref:g})});MR.displayName=IR;var gT="PopperContent",[tV,nV]=NR(gT),PR=ie.forwardRef((e,n)=>{var ar,cn,Rn,kr,Nn,Br;const{__scopePopper:a,side:s="bottom",sideOffset:f=0,align:h="center",alignOffset:d=0,arrowPadding:g=0,avoidCollisions:E=!0,collisionBoundary:b=[],collisionPadding:C=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:k="optimized",onPlaced:D,...L}=e,B=OR(gT,a),[H,$]=ie.useState(null),W=cl(n,an=>$(an)),[J,Z]=ie.useState(null),X=Zj(J),te=(X==null?void 0:X.width)??0,we=(X==null?void 0:X.height)??0,Me=s+(h!=="center"?"-"+h:""),K=typeof C=="number"?C:{top:0,right:0,bottom:0,left:0,...C},Ee=Array.isArray(b)?b:[b],ge=Ee.length>0,Re={padding:K,boundary:Ee.filter(aV),altBoundary:ge},{refs:Oe,floatingStyles:qe,placement:je,isPositioned:at,middlewareData:he}=Hj({strategy:"fixed",placement:Me,whileElementsMounted:(...an)=>Oj(...an,{animationFrame:k==="always"}),elements:{reference:B.anchor},middleware:[jj({mainAxis:f+we,alignmentAxis:d}),E&&Vj({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?Yj():void 0,...Re}),E&&Wj({...Re}),qj({...Re,apply:({elements:an,rects:Fn,availableWidth:ir,availableHeight:yr})=>{const{width:$n,height:oa}=Fn.reference,Hr=an.floating.style;Hr.setProperty("--radix-popper-available-width",`${ir}px`),Hr.setProperty("--radix-popper-available-height",`${yr}px`),Hr.setProperty("--radix-popper-anchor-width",`${$n}px`),Hr.setProperty("--radix-popper-anchor-height",`${oa}px`)}}),J&&Gj({element:J,padding:g}),iV({arrowWidth:te,arrowHeight:we}),R&&Qj({strategy:"referenceHidden",...Re})]}),[De,F]=BR(je),et=rl(D);Qf(()=>{at&&(et==null||et())},[at,et]);const Et=(ar=he.arrow)==null?void 0:ar.x,V=(cn=he.arrow)==null?void 0:cn.y,Gt=((Rn=he.arrow)==null?void 0:Rn.centerOffset)!==0,[Gn,Nt]=ie.useState();return Qf(()=>{H&&Nt(window.getComputedStyle(H).zIndex)},[H]),I.jsx("div",{ref:Oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...qe,transform:at?qe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Gn,"--radix-popper-transform-origin":[(kr=he.transformOrigin)==null?void 0:kr.x,(Nn=he.transformOrigin)==null?void 0:Nn.y].join(" "),...((Br=he.hide)==null?void 0:Br.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:I.jsx(tV,{scope:a,placedSide:De,onArrowChange:Z,arrowX:Et,arrowY:V,shouldHideArrow:Gt,children:I.jsx(dl.div,{"data-side":De,"data-align":F,...L,ref:W,style:{...L.style,animation:at?void 0:"none"}})})})});PR.displayName=gT;var FR="PopperArrow",rV={top:"bottom",right:"left",bottom:"top",left:"right"},UR=ie.forwardRef(function(n,a){const{__scopePopper:s,...f}=n,h=nV(FR,s),d=rV[h.placedSide];return I.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[h.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[h.placedSide],visibility:h.shouldHideArrow?"hidden":void 0},children:I.jsx(Xj,{...f,ref:a,style:{...f.style,display:"block"}})})});UR.displayName=FR;function aV(e){return e!==null}var iV=e=>({name:"transformOrigin",options:e,fn(n){var B,H,$;const{placement:a,rects:s,middlewareData:f}=n,d=((B=f.arrow)==null?void 0:B.centerOffset)!==0,g=d?0:e.arrowWidth,E=d?0:e.arrowHeight,[b,C]=BR(a),S={start:"0%",center:"50%",end:"100%"}[C],R=(((H=f.arrow)==null?void 0:H.x)??0)+g/2,k=((($=f.arrow)==null?void 0:$.y)??0)+E/2;let D="",L="";return b==="bottom"?(D=d?S:`${R}px`,L=`${-E}px`):b==="top"?(D=d?S:`${R}px`,L=`${s.floating.height+E}px`):b==="right"?(D=`${-E}px`,L=d?S:`${k}px`):b==="left"&&(D=`${s.floating.width+E}px`,L=d?S:`${k}px`),{data:{x:D,y:L}}}});function BR(e){const[n,a="center"]=e.split("-");return[n,a]}var oV=LR,HR=MR,uV=PR,sV=UR;function lV(e,n){return ie.useReducer((a,s)=>n[a][s]??a,e)}var zR=e=>{const{present:n,children:a}=e,s=cV(n),f=typeof a=="function"?a({present:s.isPresent}):ie.Children.only(a),h=cl(s.ref,dV(f));return typeof a=="function"||s.isPresent?ie.cloneElement(f,{ref:h}):null};zR.displayName="Presence";function cV(e){const[n,a]=ie.useState(),s=ie.useRef({}),f=ie.useRef(e),h=ie.useRef("none"),d=e?"mounted":"unmounted",[g,E]=lV(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ie.useEffect(()=>{const b=h1(s.current);h.current=g==="mounted"?b:"none"},[g]),Qf(()=>{const b=s.current,C=f.current;if(C!==e){const R=h.current,k=h1(b);e?E("MOUNT"):k==="none"||(b==null?void 0:b.display)==="none"?E("UNMOUNT"):E(C&&R!==k?"ANIMATION_OUT":"UNMOUNT"),f.current=e}},[e,E]),Qf(()=>{if(n){let b;const C=n.ownerDocument.defaultView??window,S=k=>{const L=h1(s.current).includes(k.animationName);if(k.target===n&&L&&(E("ANIMATION_END"),!f.current)){const B=n.style.animationFillMode;n.style.animationFillMode="forwards",b=C.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=B)})}},R=k=>{k.target===n&&(h.current=h1(s.current))};return n.addEventListener("animationstart",R),n.addEventListener("animationcancel",S),n.addEventListener("animationend",S),()=>{C.clearTimeout(b),n.removeEventListener("animationstart",R),n.removeEventListener("animationcancel",S),n.removeEventListener("animationend",S)}}else E("ANIMATION_END")},[n,E]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:ie.useCallback(b=>{b&&(s.current=getComputedStyle(b)),a(b)},[])}}function h1(e){return(e==null?void 0:e.animationName)||"none"}function dV(e){var s,f;let n=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function fV({prop:e,defaultProp:n,onChange:a=()=>{}}){const[s,f]=pV({defaultProp:n,onChange:a}),h=e!==void 0,d=h?e:s,g=rl(a),E=ie.useCallback(b=>{if(h){const S=typeof b=="function"?b(e):b;S!==e&&g(S)}else f(b)},[h,e,f,g]);return[d,E]}function pV({defaultProp:e,onChange:n}){const a=ie.useState(e),[s]=a,f=ie.useRef(s),h=rl(n);return ie.useEffect(()=>{f.current!==s&&(h(s),f.current=s)},[s,f,h]),a}var hV=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Pf=new WeakMap,m1=new WeakMap,g1={},lw=0,jR=function(e){return e&&(e.host||jR(e.parentNode))},mV=function(e,n){return n.map(function(a){if(e.contains(a))return a;var s=jR(a);return s&&e.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},gV=function(e,n,a,s){var f=mV(n,Array.isArray(e)?e:[e]);g1[a]||(g1[a]=new WeakMap);var h=g1[a],d=[],g=new Set,E=new Set(f),b=function(S){!S||g.has(S)||(g.add(S),b(S.parentNode))};f.forEach(b);var C=function(S){!S||E.has(S)||Array.prototype.forEach.call(S.children,function(R){if(g.has(R))C(R);else try{var k=R.getAttribute(s),D=k!==null&&k!=="false",L=(Pf.get(R)||0)+1,B=(h.get(R)||0)+1;Pf.set(R,L),h.set(R,B),d.push(R),L===1&&D&&m1.set(R,!0),B===1&&R.setAttribute(a,"true"),D||R.setAttribute(s,"true")}catch(H){console.error("aria-hidden: cannot operate on ",R,H)}})};return C(n),g.clear(),lw++,function(){d.forEach(function(S){var R=Pf.get(S)-1,k=h.get(S)-1;Pf.set(S,R),h.set(S,k),R||(m1.has(S)||S.removeAttribute(s),m1.delete(S)),k||S.removeAttribute(a)}),lw--,lw||(Pf=new WeakMap,Pf=new WeakMap,m1=new WeakMap,g1={})}},vV=function(e,n,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),f=hV(e);return f?(s.push.apply(s,Array.from(f.querySelectorAll("[aria-live]"))),gV(s,f,a,"aria-hidden")):function(){return null}},C1="right-scroll-bar-position",_1="width-before-scroll-bar",yV="with-scroll-bars-hidden",EV="--removed-body-scroll-bar-size";function cw(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function bV(e,n){var a=Tt.useState(function(){return{value:e,callback:n,facade:{get current(){return a.value},set current(s){var f=a.value;f!==s&&(a.value=s,a.callback(s,f))}}}})[0];return a.callback=n,a.facade}var xV=typeof window<"u"?ie.useLayoutEffect:ie.useEffect,jk=new WeakMap;function wV(e,n){var a=bV(null,function(s){return e.forEach(function(f){return cw(f,s)})});return xV(function(){var s=jk.get(a);if(s){var f=new Set(s),h=new Set(e),d=a.current;f.forEach(function(g){h.has(g)||cw(g,null)}),h.forEach(function(g){f.has(g)||cw(g,d)})}jk.set(a,e)},[e]),a}function TV(e){return e}function SV(e,n){n===void 0&&(n=TV);var a=[],s=!1,f={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(h){var d=n(h,s);return a.push(d),function(){a=a.filter(function(g){return g!==d})}},assignSyncMedium:function(h){for(s=!0;a.length;){var d=a;a=[],d.forEach(h)}a={push:function(g){return h(g)},filter:function(){return a}}},assignMedium:function(h){s=!0;var d=[];if(a.length){var g=a;a=[],g.forEach(h),d=a}var E=function(){var C=d;d=[],C.forEach(h)},b=function(){return Promise.resolve().then(E)};b(),a={push:function(C){d.push(C),b()},filter:function(C){return d=d.filter(C),a}}}};return f}function CV(e){e===void 0&&(e={});var n=SV(null);return n.options=ft.__assign({async:!0,ssr:!1},e),n}var VR=function(e){var n=e.sideCar,a=ft.__rest(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=n.read();if(!s)throw new Error("Sidecar medium not found");return ie.createElement(s,ft.__assign({},a))};VR.isSideCarExport=!0;function _V(e,n){return e.useMedium(n),VR}var YR=CV(),dw=function(){},ay=ie.forwardRef(function(e,n){var a=ie.useRef(null),s=ie.useState({onScrollCapture:dw,onWheelCapture:dw,onTouchMoveCapture:dw}),f=s[0],h=s[1],d=e.forwardProps,g=e.children,E=e.className,b=e.removeScrollBar,C=e.enabled,S=e.shards,R=e.sideCar,k=e.noIsolation,D=e.inert,L=e.allowPinchZoom,B=e.as,H=B===void 0?"div":B,$=e.gapMode,W=ft.__rest(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),J=R,Z=wV([a,n]),X=ft.__assign(ft.__assign({},W),f);return ie.createElement(ie.Fragment,null,C&&ie.createElement(J,{sideCar:YR,removeScrollBar:b,shards:S,noIsolation:k,inert:D,setCallbacks:h,allowPinchZoom:!!L,lockRef:a,gapMode:$}),d?ie.cloneElement(ie.Children.only(g),ft.__assign(ft.__assign({},X),{ref:Z})):ie.createElement(H,ft.__assign({},X,{className:E,ref:Z}),g))});ay.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ay.classNames={fullWidth:_1,zeroRight:C1};var kV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=kV();return n&&e.setAttribute("nonce",n),e}function RV(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function NV(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var DV=function(){var e=0,n=null;return{add:function(a){e==0&&(n=AV())&&(RV(n,a),NV(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},OV=function(){var e=DV();return function(n,a){ie.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&a])}},WR=function(){var e=OV(),n=function(a){var s=a.styles,f=a.dynamic;return e(s,f),null};return n},LV={left:0,top:0,right:0,gap:0},fw=function(e){return parseInt(e||"",10)||0},IV=function(e){var n=window.getComputedStyle(document.body),a=n[e==="padding"?"paddingLeft":"marginLeft"],s=n[e==="padding"?"paddingTop":"marginTop"],f=n[e==="padding"?"paddingRight":"marginRight"];return[fw(a),fw(s),fw(f)]},MV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LV;var n=IV(e),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-a+n[2]-n[0])}},PV=WR(),Yf="data-scroll-locked",FV=function(e,n,a,s){var f=e.left,h=e.top,d=e.right,g=e.gap;return a===void 0&&(a="margin"),`
202
+ You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}qa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mx,qa.createPortal=H4,qa.createRoot=j4,qa.findDOMNode=M4,qa.flushSync=Y4,qa.hydrate=P4,qa.hydrateRoot=V4,qa.render=F4,qa.unmountComponentAtNode=B4,qa.unstable_batchedUpdates=dx,qa.unstable_renderSubtreeIntoContainer=z4,qa.version=Ax,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),qa}function aR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aR)}catch(e){console.error(e)}}}process.env.NODE_ENV==="production"?(aR(),Rw.exports=oz()):Rw.exports=uz();var Um=Rw.exports;function Nw(){return Nw=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)({}).hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Nw.apply(null,arguments)}function sz(e,n){if(e==null)return{};var a={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(n.includes(s))continue;a[s]=e[s]}return a}var iR,oR;typeof document<"u"&&(iR=document);typeof window<"u"&&(oR=window);var uR=Tt.createContext({document:iR,window:oR}),lz=()=>Tt.useContext(uR),cz=["children","head","initialContent","src","mountTarget"],sR=Tt.forwardRef((e,n)=>{var{children:a,head:s,initialContent:f,src:h,mountTarget:d}=e,g=sz(e,cz),[E,b]=Tt.useState(!1),[C,S]=Tt.useState(),R=J=>{J&&S(J)};Tt.useImperativeHandle(n,()=>C,[C]);var k=f||"<!DOCTYPE html><html><head></head><body></body></html>",D=()=>C?C.contentDocument:null,L=()=>{var J=D();return d?J==null?void 0:J.querySelector(d):J==null?void 0:J.body},B=Tt.useRef(),H=Tt.useCallback(J=>{B.current=J;var Z=()=>setInterval(()=>H(J),500);clearInterval(Z()),E||b(!0)},[E]);Tt.useMemo(()=>{!h&&g.onLoad&&E&&g.onLoad(B.current)},[E]),Tt.useEffect(()=>{if(C&&!h){var J;(J=C.contentWindow)==null||J.addEventListener("DOMContentLoaded",H)}return()=>{if(C&&!h){var Z;(Z=C.contentWindow)==null||Z.removeEventListener("DOMContentLoaded",H)}}},[C,H]);var $=()=>{var J,Z=D(),X=(J=D())==null?void 0:J.head,te=L(),we=(Z==null?void 0:Z.defaultView)||(Z==null?void 0:Z.parentView),Me=I.jsx(uR.Provider,{value:{document:Z,window:we},children:a});return[X&&s&&Um.createPortal(s,X),C&&te&&Um.createPortal(Me,te)]},W={};return h?(delete W.srcDoc,W.src=h,W.onLoad=g.onLoad):W.srcDoc=k,I.jsx("iframe",Nw({title:g.title,ref:R},g,{onLoad:H},W,{children:E&&$()}))});sR.displayName="IFrame";const lR="opencx-widget-portal";function J1(){return null}function dz({children:e}){var a,s;const n=(s=(a=lz())==null?void 0:a.document)==null?void 0:s.getElementById(lR);return n?Um.createPortal(e,n):(console.error("Portal container not found!"),null)}function fz(){return I.jsx("div",{id:lR,className:"absolute size-full top-0 left-0"})}J1.Portal=dz;J1.Container=fz;const pz=so.Root,hz=so.Trigger,cR=ie.forwardRef(({className:e,...n},a)=>I.jsx(so.Overlay,{ref:a,className:St("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));cR.displayName=so.Overlay.displayName;const dR=ie.forwardRef(({className:e,children:n,...a},s)=>I.jsxs(J1.Portal,{children:[I.jsx(cR,{}),I.jsxs(so.Content,{ref:s,className:St("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[n,I.jsx(so.Close,{asChild:!0,className:"absolute right-4 top-4 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:I.jsxs(si,{size:"fit",variant:"outline",children:[I.jsx(Wn.X,{className:"h-4 w-4"}),I.jsx("span",{className:"sr-only",children:"Close"})]})})]})]}));dR.displayName=so.Content.displayName;const fR=ie.forwardRef(({className:e,...n},a)=>I.jsx(so.Title,{ref:a,className:St("text-lg font-semibold leading-none tracking-tight",e),...n}));fR.displayName=so.Title.displayName;const mz=ie.forwardRef(({className:e,...n},a)=>I.jsx(so.Description,{ref:a,className:St("text-sm text-muted-foreground",e),...n}));mz.displayName=so.Description.displayName;function pR({attachment:e}){const{name:n,size:a,type:s,url:f}=e,h=s.startsWith("image/"),d=s.startsWith("video/"),g=s.startsWith("audio/");return g?I.jsx(el,{children:I.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:I.jsxs("audio",{controls:!0,className:"w-full",children:[I.jsx("source",{src:f,type:s}),"Your browser does not support the audio tag."]})})}):d?I.jsx(el,{children:I.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:I.jsxs("video",{controls:!0,children:[I.jsx("source",{src:f,type:s}),"Your browser does not support the video tag."]})})}):!h&&!d&&!g?I.jsx(el,{children:I.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:I.jsxs("div",{className:"flex items-end gap-2 p-2",children:[I.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:St("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:n}),I.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(a/1024).toFixed(2)," KB"]})]})})}):I.jsxs(pz,{children:[I.jsx(el,{children:I.jsx(hz,{children:I.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:h&&I.jsx("img",{src:f,className:"object-cover size-16",alt:n})})})}),I.jsxs(dR,{"aria-describedby":void 0,className:"size-full rounded-3xl flex items-center justify-center bg-transparent backdrop-blur border-none gap-0",children:[I.jsx(fR,{className:"sr-only",children:"Image preview"}),h&&I.jsx("div",{className:"size-fit shrink-0 rounded-2xl overflow-hidden max-h-full",children:I.jsx("img",{src:f,className:"object-cover size-auto",alt:n})})]})]})}function Dw({data:e,id:n,type:a,attachments:s}){const{message:f,variant:h="default"}=e;return h==="error"?I.jsx("div",{children:I.jsx("div",{className:"flex flex-row flex-wrap items-center justify-start",children:I.jsx("div",{className:"leading-snug text-sm text-destructive",children:f})})}):I.jsxs("div",{className:"w-5/6 flex flex-col items-start gap-1",children:[I.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:s==null?void 0:s.map(d=>I.jsx(pR,{attachment:d},d.id))}),f.length>0&&I.jsx(v3,{"data-type":a,"data-id":n,remarkPlugins:[VA],rehypePlugins:[nR],components:{a:({children:d,...g})=>I.jsx("a",{target:"_top",...g,children:d})},className:St("w-fit p-2 rounded-2xl bg-secondary border shadow-sm","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline","break-words [word-break:break-word]"),children:f})]})}function hR(e){const{componentStore:n}=ft.useWidget();if(e.data.action){const s=n.getComponent(e.data.action.name);if(s)return I.jsx(s,{...e,id:e.id})}const a=n.getComponent(e.component);return a?I.jsx(a,{...e,id:e.id}):I.jsx(Dw,{...e})}const $m=ie.forwardRef(({className:e,...n},a)=>I.jsx(Xf.Root,{ref:a,className:St("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full border bg-secondary",e),...n}));$m.displayName=Xf.Root.displayName;const Z1=ie.forwardRef(({className:e,...n},a)=>I.jsx(Xf.Image,{ref:a,className:St("aspect-square h-full w-full",e),...n}));Z1.displayName=Xf.Image.displayName;const ey=ie.forwardRef(({className:e,...n},a)=>I.jsx(Xf.Fallback,{ref:a,className:St("flex size-full text-xs items-center justify-center rounded-lg",e),...n}));ey.displayName=Xf.Fallback.displayName;function gz({message:e}){var n;return I.jsxs("div",{className:"w-5/6 flex flex-col items-end gap-1",children:[e.attachments&&e.attachments.length>0&&I.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(n=e.attachments)==null?void 0:n.map(a=>I.jsx(pR,{attachment:a},a.id))}),e.content.length>0&&I.jsx("div",{className:St("w-fit p-2 rounded-2xl text-sm","bg-primary text-primary-foreground border shadow-sm","break-words [word-break:break-word]","whitespace-pre-wrap"),children:e.content})]})}function vz({messages:e}){var a,s,f,h,d,g;const{user:n}=ft.useConfig();return I.jsxs("div",{className:St("group","flex flex-col gap-2 justify-end items-end"),children:[I.jsxs($m,{className:"bg-primary text-primary-foreground",children:[I.jsx(Z1,{src:(a=n==null?void 0:n.data)==null?void 0:a.avatarUrl,alt:((s=n==null?void 0:n.data)==null?void 0:s.name)||"User avatar"}),((f=n==null?void 0:n.data)==null?void 0:f.name)&&I.jsx(ey,{children:(g=(d=(h=n==null?void 0:n.data)==null?void 0:h.name)==null?void 0:d.slice(0,1))==null?void 0:g.toUpperCase()})]}),e.map(E=>I.jsx(gz,{message:E},E.id))]})}function yz({messages:e,agent:n}){var a,s;return I.jsxs("div",{className:St("flex flex-col items-start gap-2"),children:[I.jsx(k1,{content:n==null?void 0:n.name,side:"right",align:"end",children:I.jsxs($m,{children:[I.jsx(Z1,{src:(n==null?void 0:n.avatar)??"",alt:"Agent Icon"}),(n==null?void 0:n.name)&&I.jsx(ey,{children:(s=(a=n==null?void 0:n.name)==null?void 0:a.slice(0,1))==null?void 0:s.toUpperCase()})]})}),e.map(f=>I.jsx(hR,{...f},f.id))]})}function Ez(){const{messagesState:{messages:e}}=ft.useMessages(),{isAwaitingBotReply:n}=ft.useIsAwaitingBotReply(),{componentStore:a}=ft.useWidget(),s=ft.useConfig(),f=Tt.useMemo(()=>m5(e),[e.length]),h=!s.initialMessages||s.initialMessages.length===0?["Hello, how can I help you?"]:s.initialMessages,d=a.getComponent("loading"),g=Tt.useRef(null);function E(){setTimeout(()=>{const b=g.current;b&&(b.scrollTop=b.scrollHeight)},0)}return Tt.useEffect(()=>{E()},[e]),I.jsxs("div",{"data-messages":!0,ref:g,className:"max-h-full scroll-smooth relative flex-1 p-2 space-y-2 overflow-auto",children:[e.length===0&&h.map(b=>I.jsx(hR,{component:"bot_message",data:{message:b},id:b,type:"FROM_BOT",agent:s.bot?{...s.bot,isAi:!0,id:null}:void 0,timestamp:Date.now().toString()},b)),f.map(b=>{var R,k,D;const C=(R=b==null?void 0:b[0])==null?void 0:R.type,S=(k=b[0])==null?void 0:k.id;if(!C||!S)return null;if(g5(b))return I.jsx(vz,{messages:b},S);if(v5(b)||y5(b)){const L=(D=b[0])==null?void 0:D.agent;return I.jsx(yz,{messages:b,agent:L},S)}return null}),n&&I.jsx(d,{})]})}function mR({className:e}){return I.jsx(Wn.LoaderIcon,{className:St("size-4 animate-spin",e)})}function bz(){const{messagesState:{isInitialFetchLoading:e}}=ft.useMessages(),{sessionState:{session:n}}=ft.useSessions(),{observedElementRef:a}=zw({fallbackHeight:$k}),s=Tt.useRef((n==null?void 0:n.id)||"chat").current;return I.jsx("div",{ref:a,className:St(Bw.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:I.jsxs("div",{className:"size-full justify-between flex flex-col",children:[I.jsx(uA,{}),I.jsx(vr.AnimatePresence,{mode:"wait",children:e?I.jsx(Sn,{className:"flex flex-col items-center justify-center w-full flex-1",children:I.jsx(mR,{})},"loading"):I.jsxs(Sn,{className:"flex flex-col w-full flex-1 overflow-auto",snapExit:!0,children:[I.jsx(Ez,{}),I.jsx(a5,{})]},s)})]})})}const T1=ie.forwardRef(({className:e,type:n,...a},s)=>{const f=B1();return I.jsx(el,{ref:s,children:I.jsx("input",{dir:f,type:n,className:St("flex w-full rounded-xl border border-input bg-background p-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rtl:placeholder:text-right",e),...a})})});T1.displayName="Input";const xz=Px.z.object({name:Px.z.string().min(2),email:Px.z.string().email()});function wz(){var D,L,B,H,$,W,J,Z,X;const{createUnverifiedContact:e}=ft.useContact(),n=ft.useConfig(),a=Jf(),{data:s}=ft.usePreludeData(),{observedElementRef:f}=zw({fallbackHeight:Gk}),[h,d]=Tt.useState(((D=n.prefillUserData)==null?void 0:D.name)||""),[g,E]=Tt.useState(((L=n.prefillUserData)==null?void 0:L.email)||""),b=(n.extraDataCollectionFields||[]).filter(te=>te!=="name"&&te!=="email"&&!!te),[C,S]=Tt.useState({}),[R,k]=ft._default(async te=>{te.preventDefault();const we=xz.safeParse({name:h,email:g});we.success&&await e({email:we.data.email,non_verified_name:we.data.name},Object.values(C).filter(Boolean).length?C:void 0)},[h,g,C]);return I.jsxs("div",{ref:f,className:St(Bw.widgetMinHeight,"h-fit bg-primary flex flex-col"),children:[I.jsxs("div",{dir:"auto",className:"flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10",children:[I.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(B=n.assets)!=null&&B.organizationLogo?I.jsx("img",{src:(H=n.assets)==null?void 0:H.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):I.jsx("h2",{className:"font-bold text-xl text-primary-foreground",dir:"auto",children:($=s==null?void 0:s.data)==null?void 0:$.organizationName})}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("h1",{className:"text-2xl font-bold text-primary-foreground",dir:"auto",children:((J=(W=n.textContent)==null?void 0:W.welcomeScreen)==null?void 0:J.title)||a.get("welcome-title")}),I.jsx("p",{className:"text-primary-foreground/90 text-sm max-w-[320px] leading-relaxed",dir:"auto",children:((X=(Z=n.textContent)==null?void 0:Z.welcomeScreen)==null?void 0:X.description)||a.get("welcome-description")})]})]}),I.jsx("div",{className:"p-2 bg-background rounded-t-3xl",dir:"auto",children:I.jsxs("form",{onSubmit:k,className:"space-y-2",children:[I.jsxs("div",{className:"space-y-2",children:[I.jsx(T1,{value:h,onChange:te=>d(te.target.value),required:!0,placeholder:a.get("your-name"),name:"name",className:"rounded-3xl pl-3"}),I.jsx(T1,{required:!0,value:g,onChange:te=>E(te.target.value),type:"email",placeholder:a.get("your-email"),name:"email",className:"rounded-3xl pl-3"}),b.map(te=>I.jsx(T1,{value:C[te],onChange:we=>S(Me=>({...Me,[te]:we.target.value})),placeholder:`${te} (${a.get("optional")})`,className:"rounded-3xl pl-3"},te))]}),I.jsxs(si,{disabled:R.loading,className:"w-full rounded-3xl",size:"lg",children:[R.loading?a.get("starting-chat"):a.get("start-chat"),I.jsx(Wn.SendHorizontal,{className:"size-4 rtl:-scale-100"})]})]})})]})}function Tz({session:e}){const{bot:n}=ft.useConfig(),{toChatScreen:a}=ft.useWidgetRouter(),s=e.assignee.kind==="human"?e.assignee.name||"Support Agent":(n==null?void 0:n.name)||"AI Support Agent",f=e.assignee.kind==="human"?e.assignee.avatarUrl||"":(n==null?void 0:n.avatar)||"";return I.jsxs(si,{variant:"outline",size:"lg",className:"border-muted rounded-full p-2 flex text-start justify-between w-full whitespace-normal",onClick:()=>a(e.id),children:[I.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[I.jsx(vr.AnimatePresence,{mode:"wait",children:I.jsx(Sn,{snapExit:!0,children:I.jsx($m,{className:"size-10",children:I.jsx(Z1,{src:f,alt:"Agent Icon"})})})}),I.jsxs("div",{className:"flex-1",children:[I.jsx(vr.AnimatePresence,{mode:"wait",children:I.jsx(Sn,{snapExit:!0,children:s},s)}),I.jsx(vr.AnimatePresence,{mode:"wait",children:e.lastMessage?I.jsx(Sn,{snapExit:!0,children:I.jsx(v3,{remarkPlugins:[VA],rehypePlugins:[nR],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:e.lastMessage})},e.lastMessage||"content"):I.jsx(Sn,{className:"w-1/2",snapExit:!0,children:I.jsx(oA,{className:"h-4 w-full"})},"skeleton")})]})]}),I.jsx(Wn.ChevronRightIcon,{className:"size-4 text-muted-foreground shrink-0"})]})}function Sz(){const e=Jf(),{toChatScreen:n}=ft.useWidgetRouter(),{sessionsState:{data:a,isInitialFetchLoading:s}}=ft.useSessions();return I.jsx("div",{className:"flex-1 flex flex-col overflow-scroll p-2",children:I.jsx(vr.AnimatePresence,{mode:"wait",children:s?I.jsx(Sn,{className:"flex-1 flex items-center justify-center",children:I.jsx(mR,{})},"loading"):I.jsx(Sn,{className:"flex-1 flex flex-col gap-2 relative",children:a.length?I.jsxs(I.Fragment,{children:[I.jsx(vr.AnimatePresence,{children:a.map((f,h)=>I.jsx(Sn,{snapExit:!0,children:I.jsx(Tz,{session:f})},`${f.id}-${h}`))}),I.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background",children:I.jsx(si,{size:"lg",className:"w-full rounded-3xl",onClick:()=>n(),children:e.get("new-conversation")},"new-session")})]}):I.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[I.jsx("div",{className:"flex-1 flex items-center justify-center",children:I.jsx("p",{className:"text-muted-foreground",children:"No conversations yet"})}),I.jsx(si,{size:"lg",className:"w-full rounded-3xl",onClick:()=>n(),children:e.get("new-conversation")},"new-session")]})},"sessions")})})}function Cz(){const{observedElementRef:e}=zw({fallbackHeight:$k});return I.jsx("div",{ref:e,className:St(Bw.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:I.jsxs("div",{className:"size-full flex flex-col",children:[I.jsx(uA,{}),I.jsx(Sz,{})]})})}function _z(){ft.usePreludeData();const{routerState:{screen:e}}=ft.useWidgetRouter();return I.jsxs("div",{className:"relative bg-background size-full",children:[I.jsx(J1.Container,{}),I.jsx(vr.AnimatePresence,{mode:"wait",children:(()=>{switch(e){case"welcome":return I.jsx(Sn,{fadeIn:"right",className:"size-full",snapExit:!0,children:I.jsx(wz,{})},e);case"sessions":return I.jsx(Sn,{fadeIn:"right",className:"size-full",snapExit:!0,children:I.jsx(Cz,{})},e);case"chat":return I.jsx(Sn,{fadeIn:"right",className:"size-full",snapExit:!0,children:I.jsx(bz,{})},e);default:return null}})()})]})}function nl(e,n,{checkForDefaultPrevented:a=!0}={}){return function(f){if(e==null||e(f),a===!1||!f.defaultPrevented)return n==null?void 0:n(f)}}function kz(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Az(...e){return n=>e.forEach(a=>kz(a,n))}function cl(...e){return ie.useCallback(Az(...e),e)}function Rz(e,n=[]){let a=[];function s(h,d){const g=ie.createContext(d),E=a.length;a=[...a,d];const b=S=>{var H;const{scope:R,children:k,...D}=S,L=((H=R==null?void 0:R[e])==null?void 0:H[E])||g,B=ie.useMemo(()=>D,Object.values(D));return I.jsx(L.Provider,{value:B,children:k})};b.displayName=h+"Provider";function C(S,R){var L;const k=((L=R==null?void 0:R[e])==null?void 0:L[E])||g,D=ie.useContext(k);if(D)return D;if(d!==void 0)return d;throw new Error(`\`${S}\` must be used within \`${h}\``)}return[b,C]}const f=()=>{const h=a.map(d=>ie.createContext(d));return function(g){const E=(g==null?void 0:g[e])||h;return ie.useMemo(()=>({[`__scope${e}`]:{...g,[e]:E}}),[g,E])}};return f.scopeName=e,[s,Nz(f,...n)]}function Nz(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const s=e.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(h){const d=s.reduce((g,{useScope:E,scopeName:b})=>{const S=E(h)[`__scope${b}`];return{...g,...S}},{});return ie.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}var Dz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],dl=Dz.reduce((e,n)=>{const a=ie.forwardRef((s,f)=>{const{asChild:h,...d}=s,g=h?Uw.Slot:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(g,{...d,ref:f})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function Oz(e,n){e&&Um.flushSync(()=>e.dispatchEvent(n))}function rl(e){const n=ie.useRef(e);return ie.useEffect(()=>{n.current=e}),ie.useMemo(()=>(...a)=>{var s;return(s=n.current)==null?void 0:s.call(n,...a)},[])}function Lz(e,n=globalThis==null?void 0:globalThis.document){const a=rl(e);ie.useEffect(()=>{const s=f=>{f.key==="Escape"&&a(f)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[a,n])}var Iz="DismissableLayer",Ow="dismissableLayer.update",Mz="dismissableLayer.pointerDownOutside",Pz="dismissableLayer.focusOutside",kk,gR=ie.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vR=ie.forwardRef((e,n)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:d,onDismiss:g,...E}=e,b=ie.useContext(gR),[C,S]=ie.useState(null),R=(C==null?void 0:C.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,k]=ie.useState({}),D=cl(n,te=>S(te)),L=Array.from(b.layers),[B]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),H=L.indexOf(B),$=C?L.indexOf(C):-1,W=b.layersWithOutsidePointerEventsDisabled.size>0,J=$>=H,Z=Bz(te=>{const we=te.target,Me=[...b.branches].some(K=>K.contains(we));!J||Me||(f==null||f(te),d==null||d(te),te.defaultPrevented||g==null||g())},R),X=Hz(te=>{const we=te.target;[...b.branches].some(K=>K.contains(we))||(h==null||h(te),d==null||d(te),te.defaultPrevented||g==null||g())},R);return Lz(te=>{$===b.layers.size-1&&(s==null||s(te),!te.defaultPrevented&&g&&(te.preventDefault(),g()))},R),ie.useEffect(()=>{if(C)return a&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(kk=R.body.style.pointerEvents,R.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(C)),b.layers.add(C),Ak(),()=>{a&&b.layersWithOutsidePointerEventsDisabled.size===1&&(R.body.style.pointerEvents=kk)}},[C,R,a,b]),ie.useEffect(()=>()=>{C&&(b.layers.delete(C),b.layersWithOutsidePointerEventsDisabled.delete(C),Ak())},[C,b]),ie.useEffect(()=>{const te=()=>k({});return document.addEventListener(Ow,te),()=>document.removeEventListener(Ow,te)},[]),I.jsx(dl.div,{...E,ref:D,style:{pointerEvents:W?J?"auto":"none":void 0,...e.style},onFocusCapture:nl(e.onFocusCapture,X.onFocusCapture),onBlurCapture:nl(e.onBlurCapture,X.onBlurCapture),onPointerDownCapture:nl(e.onPointerDownCapture,Z.onPointerDownCapture)})});vR.displayName=Iz;var Fz="DismissableLayerBranch",Uz=ie.forwardRef((e,n)=>{const a=ie.useContext(gR),s=ie.useRef(null),f=cl(n,s);return ie.useEffect(()=>{const h=s.current;if(h)return a.branches.add(h),()=>{a.branches.delete(h)}},[a.branches]),I.jsx(dl.div,{...e,ref:f})});Uz.displayName=Fz;function Bz(e,n=globalThis==null?void 0:globalThis.document){const a=rl(e),s=ie.useRef(!1),f=ie.useRef(()=>{});return ie.useEffect(()=>{const h=g=>{if(g.target&&!s.current){let E=function(){yR(Mz,a,b,{discrete:!0})};const b={originalEvent:g};g.pointerType==="touch"?(n.removeEventListener("click",f.current),f.current=E,n.addEventListener("click",f.current,{once:!0})):E()}else n.removeEventListener("click",f.current);s.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",h),n.removeEventListener("click",f.current)}},[n,a]),{onPointerDownCapture:()=>s.current=!0}}function Hz(e,n=globalThis==null?void 0:globalThis.document){const a=rl(e),s=ie.useRef(!1);return ie.useEffect(()=>{const f=h=>{h.target&&!s.current&&yR(Pz,a,{originalEvent:h},{discrete:!1})};return n.addEventListener("focusin",f),()=>n.removeEventListener("focusin",f)},[n,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Ak(){const e=new CustomEvent(Ow);document.dispatchEvent(e)}function yR(e,n,a,{discrete:s}){const f=a.originalEvent.target,h=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});n&&f.addEventListener(e,n,{once:!0}),s?Oz(f,h):f.dispatchEvent(h)}var aw=0;function zz(){ie.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Rk()),document.body.insertAdjacentElement("beforeend",e[1]??Rk()),aw++,()=>{aw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),aw--}},[])}function Rk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var iw="focusScope.autoFocusOnMount",ow="focusScope.autoFocusOnUnmount",Nk={bubbles:!1,cancelable:!0},jz="FocusScope",ER=ie.forwardRef((e,n)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:f,onUnmountAutoFocus:h,...d}=e,[g,E]=ie.useState(null),b=rl(f),C=rl(h),S=ie.useRef(null),R=cl(n,L=>E(L)),k=ie.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;ie.useEffect(()=>{if(s){let L=function(W){if(k.paused||!g)return;const J=W.target;g.contains(J)?S.current=J:Zs(S.current,{select:!0})},B=function(W){if(k.paused||!g)return;const J=W.relatedTarget;J!==null&&(g.contains(J)||Zs(S.current,{select:!0}))},H=function(W){if(document.activeElement===document.body)for(const Z of W)Z.removedNodes.length>0&&Zs(g)};document.addEventListener("focusin",L),document.addEventListener("focusout",B);const $=new MutationObserver(H);return g&&$.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",L),document.removeEventListener("focusout",B),$.disconnect()}}},[s,g,k.paused]),ie.useEffect(()=>{if(g){Ok.add(k);const L=document.activeElement;if(!g.contains(L)){const H=new CustomEvent(iw,Nk);g.addEventListener(iw,b),g.dispatchEvent(H),H.defaultPrevented||(Vz(Gz(bR(g)),{select:!0}),document.activeElement===L&&Zs(g))}return()=>{g.removeEventListener(iw,b),setTimeout(()=>{const H=new CustomEvent(ow,Nk);g.addEventListener(ow,C),g.dispatchEvent(H),H.defaultPrevented||Zs(L??document.body,{select:!0}),g.removeEventListener(ow,C),Ok.remove(k)},0)}}},[g,b,C,k]);const D=ie.useCallback(L=>{if(!a&&!s||k.paused)return;const B=L.key==="Tab"&&!L.altKey&&!L.ctrlKey&&!L.metaKey,H=document.activeElement;if(B&&H){const $=L.currentTarget,[W,J]=Yz($);W&&J?!L.shiftKey&&H===J?(L.preventDefault(),a&&Zs(W,{select:!0})):L.shiftKey&&H===W&&(L.preventDefault(),a&&Zs(J,{select:!0})):H===$&&L.preventDefault()}},[a,s,k.paused]);return I.jsx(dl.div,{tabIndex:-1,...d,ref:R,onKeyDown:D})});ER.displayName=jz;function Vz(e,{select:n=!1}={}){const a=document.activeElement;for(const s of e)if(Zs(s,{select:n}),document.activeElement!==a)return}function Yz(e){const n=bR(e),a=Dk(n,e),s=Dk(n.reverse(),e);return[a,s]}function bR(e){const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const f=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||f?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)n.push(a.currentNode);return n}function Dk(e,n){for(const a of e)if(!Wz(a,{upTo:n}))return a}function Wz(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qz(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:n=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&qz(e)&&n&&e.select()}}var Ok=Qz();function Qz(){let e=[];return{add(n){const a=e[0];n!==a&&(a==null||a.pause()),e=Lk(e,n),e.unshift(n)},remove(n){var a;e=Lk(e,n),(a=e[0])==null||a.resume()}}}function Lk(e,n){const a=[...e],s=a.indexOf(n);return s!==-1&&a.splice(s,1),a}function Gz(e){return e.filter(n=>n.tagName!=="A")}var Qf=globalThis!=null&&globalThis.document?ie.useLayoutEffect:()=>{},$z=ie.useId||(()=>{}),Xz=0;function Kz(e){const[n,a]=ie.useState($z());return Qf(()=>{e||a(s=>s??String(Xz++))},[e]),e||(n?`radix-${n}`:"")}const Jz=["top","right","bottom","left"],al=Math.min,oi=Math.max,M1=Math.round,p1=Math.floor,il=e=>({x:e,y:e}),Zz={left:"right",right:"left",bottom:"top",top:"bottom"},ej={start:"end",end:"start"};function Lw(e,n,a){return oi(e,al(n,a))}function Pu(e,n){return typeof e=="function"?e(n):e}function Fu(e){return e.split("-")[0]}function ap(e){return e.split("-")[1]}function lT(e){return e==="x"?"y":"x"}function cT(e){return e==="y"?"height":"width"}function ol(e){return["top","bottom"].includes(Fu(e))?"y":"x"}function dT(e){return lT(ol(e))}function tj(e,n,a){a===void 0&&(a=!1);const s=ap(e),f=dT(e),h=cT(f);let d=f==="x"?s===(a?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[h]>n.floating[h]&&(d=P1(d)),[d,P1(d)]}function nj(e){const n=P1(e);return[Iw(e),n,Iw(n)]}function Iw(e){return e.replace(/start|end/g,n=>ej[n])}function rj(e,n,a){const s=["left","right"],f=["right","left"],h=["top","bottom"],d=["bottom","top"];switch(e){case"top":case"bottom":return a?n?f:s:n?s:f;case"left":case"right":return n?h:d;default:return[]}}function aj(e,n,a,s){const f=ap(e);let h=rj(Fu(e),a==="start",s);return f&&(h=h.map(d=>d+"-"+f),n&&(h=h.concat(h.map(Iw)))),h}function P1(e){return e.replace(/left|right|bottom|top/g,n=>Zz[n])}function ij(e){return{top:0,right:0,bottom:0,left:0,...e}}function xR(e){return typeof e!="number"?ij(e):{top:e,right:e,bottom:e,left:e}}function F1(e){const{x:n,y:a,width:s,height:f}=e;return{width:s,height:f,top:a,left:n,right:n+s,bottom:a+f,x:n,y:a}}function Ik(e,n,a){let{reference:s,floating:f}=e;const h=ol(n),d=dT(n),g=cT(d),E=Fu(n),b=h==="y",C=s.x+s.width/2-f.width/2,S=s.y+s.height/2-f.height/2,R=s[g]/2-f[g]/2;let k;switch(E){case"top":k={x:C,y:s.y-f.height};break;case"bottom":k={x:C,y:s.y+s.height};break;case"right":k={x:s.x+s.width,y:S};break;case"left":k={x:s.x-f.width,y:S};break;default:k={x:s.x,y:s.y}}switch(ap(n)){case"start":k[d]-=R*(a&&b?-1:1);break;case"end":k[d]+=R*(a&&b?-1:1);break}return k}const oj=async(e,n,a)=>{const{placement:s="bottom",strategy:f="absolute",middleware:h=[],platform:d}=a,g=h.filter(Boolean),E=await(d.isRTL==null?void 0:d.isRTL(n));let b=await d.getElementRects({reference:e,floating:n,strategy:f}),{x:C,y:S}=Ik(b,s,E),R=s,k={},D=0;for(let L=0;L<g.length;L++){const{name:B,fn:H}=g[L],{x:$,y:W,data:J,reset:Z}=await H({x:C,y:S,initialPlacement:s,placement:R,strategy:f,middlewareData:k,rects:b,platform:d,elements:{reference:e,floating:n}});C=$??C,S=W??S,k={...k,[B]:{...k[B],...J}},Z&&D<=50&&(D++,typeof Z=="object"&&(Z.placement&&(R=Z.placement),Z.rects&&(b=Z.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:f}):Z.rects),{x:C,y:S}=Ik(b,R,E)),L=-1)}return{x:C,y:S,placement:R,strategy:f,middlewareData:k}};async function Bm(e,n){var a;n===void 0&&(n={});const{x:s,y:f,platform:h,rects:d,elements:g,strategy:E}=e,{boundary:b="clippingAncestors",rootBoundary:C="viewport",elementContext:S="floating",altBoundary:R=!1,padding:k=0}=Pu(n,e),D=xR(k),B=g[R?S==="floating"?"reference":"floating":S],H=F1(await h.getClippingRect({element:(a=await(h.isElement==null?void 0:h.isElement(B)))==null||a?B:B.contextElement||await(h.getDocumentElement==null?void 0:h.getDocumentElement(g.floating)),boundary:b,rootBoundary:C,strategy:E})),$=S==="floating"?{x:s,y:f,width:d.floating.width,height:d.floating.height}:d.reference,W=await(h.getOffsetParent==null?void 0:h.getOffsetParent(g.floating)),J=await(h.isElement==null?void 0:h.isElement(W))?await(h.getScale==null?void 0:h.getScale(W))||{x:1,y:1}:{x:1,y:1},Z=F1(h.convertOffsetParentRelativeRectToViewportRelativeRect?await h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:$,offsetParent:W,strategy:E}):$);return{top:(H.top-Z.top+D.top)/J.y,bottom:(Z.bottom-H.bottom+D.bottom)/J.y,left:(H.left-Z.left+D.left)/J.x,right:(Z.right-H.right+D.right)/J.x}}const uj=e=>({name:"arrow",options:e,async fn(n){const{x:a,y:s,placement:f,rects:h,platform:d,elements:g,middlewareData:E}=n,{element:b,padding:C=0}=Pu(e,n)||{};if(b==null)return{};const S=xR(C),R={x:a,y:s},k=dT(f),D=cT(k),L=await d.getDimensions(b),B=k==="y",H=B?"top":"left",$=B?"bottom":"right",W=B?"clientHeight":"clientWidth",J=h.reference[D]+h.reference[k]-R[k]-h.floating[D],Z=R[k]-h.reference[k],X=await(d.getOffsetParent==null?void 0:d.getOffsetParent(b));let te=X?X[W]:0;(!te||!await(d.isElement==null?void 0:d.isElement(X)))&&(te=g.floating[W]||h.floating[D]);const we=J/2-Z/2,Me=te/2-L[D]/2-1,K=al(S[H],Me),Ee=al(S[$],Me),ge=K,Re=te-L[D]-Ee,Oe=te/2-L[D]/2+we,qe=Lw(ge,Oe,Re),je=!E.arrow&&ap(f)!=null&&Oe!==qe&&h.reference[D]/2-(Oe<ge?K:Ee)-L[D]/2<0,at=je?Oe<ge?Oe-ge:Oe-Re:0;return{[k]:R[k]+at,data:{[k]:qe,centerOffset:Oe-qe-at,...je&&{alignmentOffset:at}},reset:je}}}),sj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var a,s;const{placement:f,middlewareData:h,rects:d,initialPlacement:g,platform:E,elements:b}=n,{mainAxis:C=!0,crossAxis:S=!0,fallbackPlacements:R,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:D="none",flipAlignment:L=!0,...B}=Pu(e,n);if((a=h.arrow)!=null&&a.alignmentOffset)return{};const H=Fu(f),$=ol(g),W=Fu(g)===g,J=await(E.isRTL==null?void 0:E.isRTL(b.floating)),Z=R||(W||!L?[P1(g)]:nj(g)),X=D!=="none";!R&&X&&Z.push(...aj(g,L,D,J));const te=[g,...Z],we=await Bm(n,B),Me=[];let K=((s=h.flip)==null?void 0:s.overflows)||[];if(C&&Me.push(we[H]),S){const Oe=tj(f,d,J);Me.push(we[Oe[0]],we[Oe[1]])}if(K=[...K,{placement:f,overflows:Me}],!Me.every(Oe=>Oe<=0)){var Ee,ge;const Oe=(((Ee=h.flip)==null?void 0:Ee.index)||0)+1,qe=te[Oe];if(qe)return{data:{index:Oe,overflows:K},reset:{placement:qe}};let je=(ge=K.filter(at=>at.overflows[0]<=0).sort((at,he)=>at.overflows[1]-he.overflows[1])[0])==null?void 0:ge.placement;if(!je)switch(k){case"bestFit":{var Re;const at=(Re=K.filter(he=>{if(X){const De=ol(he.placement);return De===$||De==="y"}return!0}).map(he=>[he.placement,he.overflows.filter(De=>De>0).reduce((De,F)=>De+F,0)]).sort((he,De)=>he[1]-De[1])[0])==null?void 0:Re[0];at&&(je=at);break}case"initialPlacement":je=g;break}if(f!==je)return{reset:{placement:je}}}return{}}}};function Mk(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Pk(e){return Jz.some(n=>e[n]>=0)}const lj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:a}=n,{strategy:s="referenceHidden",...f}=Pu(e,n);switch(s){case"referenceHidden":{const h=await Bm(n,{...f,elementContext:"reference"}),d=Mk(h,a.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Pk(d)}}}case"escaped":{const h=await Bm(n,{...f,altBoundary:!0}),d=Mk(h,a.floating);return{data:{escapedOffsets:d,escaped:Pk(d)}}}default:return{}}}}};async function cj(e,n){const{placement:a,platform:s,elements:f}=e,h=await(s.isRTL==null?void 0:s.isRTL(f.floating)),d=Fu(a),g=ap(a),E=ol(a)==="y",b=["left","top"].includes(d)?-1:1,C=h&&E?-1:1,S=Pu(n,e);let{mainAxis:R,crossAxis:k,alignmentAxis:D}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return g&&typeof D=="number"&&(k=g==="end"?D*-1:D),E?{x:k*C,y:R*b}:{x:R*b,y:k*C}}const dj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var a,s;const{x:f,y:h,placement:d,middlewareData:g}=n,E=await cj(n,e);return d===((a=g.offset)==null?void 0:a.placement)&&(s=g.arrow)!=null&&s.alignmentOffset?{}:{x:f+E.x,y:h+E.y,data:{...E,placement:d}}}}},fj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:a,y:s,placement:f}=n,{mainAxis:h=!0,crossAxis:d=!1,limiter:g={fn:B=>{let{x:H,y:$}=B;return{x:H,y:$}}},...E}=Pu(e,n),b={x:a,y:s},C=await Bm(n,E),S=ol(Fu(f)),R=lT(S);let k=b[R],D=b[S];if(h){const B=R==="y"?"top":"left",H=R==="y"?"bottom":"right",$=k+C[B],W=k-C[H];k=Lw($,k,W)}if(d){const B=S==="y"?"top":"left",H=S==="y"?"bottom":"right",$=D+C[B],W=D-C[H];D=Lw($,D,W)}const L=g.fn({...n,[R]:k,[S]:D});return{...L,data:{x:L.x-a,y:L.y-s,enabled:{[R]:h,[S]:d}}}}}},pj=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:a,y:s,placement:f,rects:h,middlewareData:d}=n,{offset:g=0,mainAxis:E=!0,crossAxis:b=!0}=Pu(e,n),C={x:a,y:s},S=ol(f),R=lT(S);let k=C[R],D=C[S];const L=Pu(g,n),B=typeof L=="number"?{mainAxis:L,crossAxis:0}:{mainAxis:0,crossAxis:0,...L};if(E){const W=R==="y"?"height":"width",J=h.reference[R]-h.floating[W]+B.mainAxis,Z=h.reference[R]+h.reference[W]-B.mainAxis;k<J?k=J:k>Z&&(k=Z)}if(b){var H,$;const W=R==="y"?"width":"height",J=["top","left"].includes(Fu(f)),Z=h.reference[S]-h.floating[W]+(J&&((H=d.offset)==null?void 0:H[S])||0)+(J?0:B.crossAxis),X=h.reference[S]+h.reference[W]+(J?0:(($=d.offset)==null?void 0:$[S])||0)-(J?B.crossAxis:0);D<Z?D=Z:D>X&&(D=X)}return{[R]:k,[S]:D}}}},hj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var a,s;const{placement:f,rects:h,platform:d,elements:g}=n,{apply:E=()=>{},...b}=Pu(e,n),C=await Bm(n,b),S=Fu(f),R=ap(f),k=ol(f)==="y",{width:D,height:L}=h.floating;let B,H;S==="top"||S==="bottom"?(B=S,H=R===(await(d.isRTL==null?void 0:d.isRTL(g.floating))?"start":"end")?"left":"right"):(H=S,B=R==="end"?"top":"bottom");const $=L-C.top-C.bottom,W=D-C.left-C.right,J=al(L-C[B],$),Z=al(D-C[H],W),X=!n.middlewareData.shift;let te=J,we=Z;if((a=n.middlewareData.shift)!=null&&a.enabled.x&&(we=W),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(te=$),X&&!R){const K=oi(C.left,0),Ee=oi(C.right,0),ge=oi(C.top,0),Re=oi(C.bottom,0);k?we=D-2*(K!==0||Ee!==0?K+Ee:oi(C.left,C.right)):te=L-2*(ge!==0||Re!==0?ge+Re:oi(C.top,C.bottom))}await E({...n,availableWidth:we,availableHeight:te});const Me=await d.getDimensions(g.floating);return D!==Me.width||L!==Me.height?{reset:{rects:!0}}:{}}}};function ty(){return typeof window<"u"}function ip(e){return wR(e)?(e.nodeName||"").toLowerCase():"#document"}function ui(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Qo(e){var n;return(n=(wR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function wR(e){return ty()?e instanceof Node||e instanceof ui(e).Node:!1}function lo(e){return ty()?e instanceof Element||e instanceof ui(e).Element:!1}function Yo(e){return ty()?e instanceof HTMLElement||e instanceof ui(e).HTMLElement:!1}function Fk(e){return!ty()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ui(e).ShadowRoot}function Xm(e){const{overflow:n,overflowX:a,overflowY:s,display:f}=co(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+a)&&!["inline","contents"].includes(f)}function mj(e){return["table","td","th"].includes(ip(e))}function ny(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function fT(e){const n=pT(),a=lo(e)?co(e):e;return a.transform!=="none"||a.perspective!=="none"||(a.containerType?a.containerType!=="normal":!1)||!n&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!n&&(a.filter?a.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(a.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(a.contain||"").includes(s))}function gj(e){let n=ul(e);for(;Yo(n)&&!Gf(n);){if(fT(n))return n;if(ny(n))return null;n=ul(n)}return null}function pT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Gf(e){return["html","body","#document"].includes(ip(e))}function co(e){return ui(e).getComputedStyle(e)}function ry(e){return lo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ul(e){if(ip(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Fk(e)&&e.host||Qo(e);return Fk(n)?n.host:n}function TR(e){const n=ul(e);return Gf(n)?e.ownerDocument?e.ownerDocument.body:e.body:Yo(n)&&Xm(n)?n:TR(n)}function Hm(e,n,a){var s;n===void 0&&(n=[]),a===void 0&&(a=!0);const f=TR(e),h=f===((s=e.ownerDocument)==null?void 0:s.body),d=ui(f);if(h){const g=Mw(d);return n.concat(d,d.visualViewport||[],Xm(f)?f:[],g&&a?Hm(g):[])}return n.concat(f,Hm(f,[],a))}function Mw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function SR(e){const n=co(e);let a=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const f=Yo(e),h=f?e.offsetWidth:a,d=f?e.offsetHeight:s,g=M1(a)!==h||M1(s)!==d;return g&&(a=h,s=d),{width:a,height:s,$:g}}function hT(e){return lo(e)?e:e.contextElement}function Vf(e){const n=hT(e);if(!Yo(n))return il(1);const a=n.getBoundingClientRect(),{width:s,height:f,$:h}=SR(n);let d=(h?M1(a.width):a.width)/s,g=(h?M1(a.height):a.height)/f;return(!d||!Number.isFinite(d))&&(d=1),(!g||!Number.isFinite(g))&&(g=1),{x:d,y:g}}const vj=il(0);function CR(e){const n=ui(e);return!pT()||!n.visualViewport?vj:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function yj(e,n,a){return n===void 0&&(n=!1),!a||n&&a!==ui(e)?!1:n}function Nc(e,n,a,s){n===void 0&&(n=!1),a===void 0&&(a=!1);const f=e.getBoundingClientRect(),h=hT(e);let d=il(1);n&&(s?lo(s)&&(d=Vf(s)):d=Vf(e));const g=yj(h,a,s)?CR(h):il(0);let E=(f.left+g.x)/d.x,b=(f.top+g.y)/d.y,C=f.width/d.x,S=f.height/d.y;if(h){const R=ui(h),k=s&&lo(s)?ui(s):s;let D=R,L=Mw(D);for(;L&&s&&k!==D;){const B=Vf(L),H=L.getBoundingClientRect(),$=co(L),W=H.left+(L.clientLeft+parseFloat($.paddingLeft))*B.x,J=H.top+(L.clientTop+parseFloat($.paddingTop))*B.y;E*=B.x,b*=B.y,C*=B.x,S*=B.y,E+=W,b+=J,D=ui(L),L=Mw(D)}}return F1({width:C,height:S,x:E,y:b})}function Ej(e){let{elements:n,rect:a,offsetParent:s,strategy:f}=e;const h=f==="fixed",d=Qo(s),g=n?ny(n.floating):!1;if(s===d||g&&h)return a;let E={scrollLeft:0,scrollTop:0},b=il(1);const C=il(0),S=Yo(s);if((S||!S&&!h)&&((ip(s)!=="body"||Xm(d))&&(E=ry(s)),Yo(s))){const R=Nc(s);b=Vf(s),C.x=R.x+s.clientLeft,C.y=R.y+s.clientTop}return{width:a.width*b.x,height:a.height*b.y,x:a.x*b.x-E.scrollLeft*b.x+C.x,y:a.y*b.y-E.scrollTop*b.y+C.y}}function bj(e){return Array.from(e.getClientRects())}function Pw(e,n){const a=ry(e).scrollLeft;return n?n.left+a:Nc(Qo(e)).left+a}function xj(e){const n=Qo(e),a=ry(e),s=e.ownerDocument.body,f=oi(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),h=oi(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let d=-a.scrollLeft+Pw(e);const g=-a.scrollTop;return co(s).direction==="rtl"&&(d+=oi(n.clientWidth,s.clientWidth)-f),{width:f,height:h,x:d,y:g}}function wj(e,n){const a=ui(e),s=Qo(e),f=a.visualViewport;let h=s.clientWidth,d=s.clientHeight,g=0,E=0;if(f){h=f.width,d=f.height;const b=pT();(!b||b&&n==="fixed")&&(g=f.offsetLeft,E=f.offsetTop)}return{width:h,height:d,x:g,y:E}}function Tj(e,n){const a=Nc(e,!0,n==="fixed"),s=a.top+e.clientTop,f=a.left+e.clientLeft,h=Yo(e)?Vf(e):il(1),d=e.clientWidth*h.x,g=e.clientHeight*h.y,E=f*h.x,b=s*h.y;return{width:d,height:g,x:E,y:b}}function Uk(e,n,a){let s;if(n==="viewport")s=wj(e,a);else if(n==="document")s=xj(Qo(e));else if(lo(n))s=Tj(n,a);else{const f=CR(e);s={...n,x:n.x-f.x,y:n.y-f.y}}return F1(s)}function _R(e,n){const a=ul(e);return a===n||!lo(a)||Gf(a)?!1:co(a).position==="fixed"||_R(a,n)}function Sj(e,n){const a=n.get(e);if(a)return a;let s=Hm(e,[],!1).filter(g=>lo(g)&&ip(g)!=="body"),f=null;const h=co(e).position==="fixed";let d=h?ul(e):e;for(;lo(d)&&!Gf(d);){const g=co(d),E=fT(d);!E&&g.position==="fixed"&&(f=null),(h?!E&&!f:!E&&g.position==="static"&&!!f&&["absolute","fixed"].includes(f.position)||Xm(d)&&!E&&_R(e,d))?s=s.filter(C=>C!==d):f=g,d=ul(d)}return n.set(e,s),s}function Cj(e){let{element:n,boundary:a,rootBoundary:s,strategy:f}=e;const d=[...a==="clippingAncestors"?ny(n)?[]:Sj(n,this._c):[].concat(a),s],g=d[0],E=d.reduce((b,C)=>{const S=Uk(n,C,f);return b.top=oi(S.top,b.top),b.right=al(S.right,b.right),b.bottom=al(S.bottom,b.bottom),b.left=oi(S.left,b.left),b},Uk(n,g,f));return{width:E.right-E.left,height:E.bottom-E.top,x:E.left,y:E.top}}function _j(e){const{width:n,height:a}=SR(e);return{width:n,height:a}}function kj(e,n,a){const s=Yo(n),f=Qo(n),h=a==="fixed",d=Nc(e,!0,h,n);let g={scrollLeft:0,scrollTop:0};const E=il(0);if(s||!s&&!h)if((ip(n)!=="body"||Xm(f))&&(g=ry(n)),s){const k=Nc(n,!0,h,n);E.x=k.x+n.clientLeft,E.y=k.y+n.clientTop}else f&&(E.x=Pw(f));let b=0,C=0;if(f&&!s&&!h){const k=f.getBoundingClientRect();C=k.top+g.scrollTop,b=k.left+g.scrollLeft-Pw(f,k)}const S=d.left+g.scrollLeft-E.x-b,R=d.top+g.scrollTop-E.y-C;return{x:S,y:R,width:d.width,height:d.height}}function uw(e){return co(e).position==="static"}function Bk(e,n){if(!Yo(e)||co(e).position==="fixed")return null;if(n)return n(e);let a=e.offsetParent;return Qo(e)===a&&(a=a.ownerDocument.body),a}function kR(e,n){const a=ui(e);if(ny(e))return a;if(!Yo(e)){let f=ul(e);for(;f&&!Gf(f);){if(lo(f)&&!uw(f))return f;f=ul(f)}return a}let s=Bk(e,n);for(;s&&mj(s)&&uw(s);)s=Bk(s,n);return s&&Gf(s)&&uw(s)&&!fT(s)?a:s||gj(e)||a}const Aj=async function(e){const n=this.getOffsetParent||kR,a=this.getDimensions,s=await a(e.floating);return{reference:kj(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Rj(e){return co(e).direction==="rtl"}const Nj={convertOffsetParentRelativeRectToViewportRelativeRect:Ej,getDocumentElement:Qo,getClippingRect:Cj,getOffsetParent:kR,getElementRects:Aj,getClientRects:bj,getDimensions:_j,getScale:Vf,isElement:lo,isRTL:Rj};function Dj(e,n){let a=null,s;const f=Qo(e);function h(){var g;clearTimeout(s),(g=a)==null||g.disconnect(),a=null}function d(g,E){g===void 0&&(g=!1),E===void 0&&(E=1),h();const{left:b,top:C,width:S,height:R}=e.getBoundingClientRect();if(g||n(),!S||!R)return;const k=p1(C),D=p1(f.clientWidth-(b+S)),L=p1(f.clientHeight-(C+R)),B=p1(b),$={rootMargin:-k+"px "+-D+"px "+-L+"px "+-B+"px",threshold:oi(0,al(1,E))||1};let W=!0;function J(Z){const X=Z[0].intersectionRatio;if(X!==E){if(!W)return d();X?d(!1,X):s=setTimeout(()=>{d(!1,1e-7)},1e3)}W=!1}try{a=new IntersectionObserver(J,{...$,root:f.ownerDocument})}catch{a=new IntersectionObserver(J,$)}a.observe(e)}return d(!0),h}function Oj(e,n,a,s){s===void 0&&(s={});const{ancestorScroll:f=!0,ancestorResize:h=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:E=!1}=s,b=hT(e),C=f||h?[...b?Hm(b):[],...Hm(n)]:[];C.forEach(H=>{f&&H.addEventListener("scroll",a,{passive:!0}),h&&H.addEventListener("resize",a)});const S=b&&g?Dj(b,a):null;let R=-1,k=null;d&&(k=new ResizeObserver(H=>{let[$]=H;$&&$.target===b&&k&&(k.unobserve(n),cancelAnimationFrame(R),R=requestAnimationFrame(()=>{var W;(W=k)==null||W.observe(n)})),a()}),b&&!E&&k.observe(b),k.observe(n));let D,L=E?Nc(e):null;E&&B();function B(){const H=Nc(e);L&&(H.x!==L.x||H.y!==L.y||H.width!==L.width||H.height!==L.height)&&a(),L=H,D=requestAnimationFrame(B)}return a(),()=>{var H;C.forEach($=>{f&&$.removeEventListener("scroll",a),h&&$.removeEventListener("resize",a)}),S==null||S(),(H=k)==null||H.disconnect(),k=null,E&&cancelAnimationFrame(D)}}const Lj=dj,Ij=fj,Mj=sj,Pj=hj,Fj=lj,Hk=uj,Uj=pj,Bj=(e,n,a)=>{const s=new Map,f={platform:Nj,...a},h={...f.platform,_c:s};return oj(e,n,{...f,platform:h})};var S1=typeof document<"u"?Tt.useLayoutEffect:Tt.useEffect;function U1(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let a,s,f;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==n.length)return!1;for(s=a;s--!==0;)if(!U1(e[s],n[s]))return!1;return!0}if(f=Object.keys(e),a=f.length,a!==Object.keys(n).length)return!1;for(s=a;s--!==0;)if(!{}.hasOwnProperty.call(n,f[s]))return!1;for(s=a;s--!==0;){const h=f[s];if(!(h==="_owner"&&e.$$typeof)&&!U1(e[h],n[h]))return!1}return!0}return e!==e&&n!==n}function AR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zk(e,n){const a=AR(e);return Math.round(n*a)/a}function sw(e){const n=ie.useRef(e);return S1(()=>{n.current=e}),n}function Hj(e){e===void 0&&(e={});const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:f,elements:{reference:h,floating:d}={},transform:g=!0,whileElementsMounted:E,open:b}=e,[C,S]=ie.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[R,k]=ie.useState(s);U1(R,s)||k(s);const[D,L]=ie.useState(null),[B,H]=ie.useState(null),$=ie.useCallback(he=>{he!==X.current&&(X.current=he,L(he))},[]),W=ie.useCallback(he=>{he!==te.current&&(te.current=he,H(he))},[]),J=h||D,Z=d||B,X=ie.useRef(null),te=ie.useRef(null),we=ie.useRef(C),Me=E!=null,K=sw(E),Ee=sw(f),ge=sw(b),Re=ie.useCallback(()=>{if(!X.current||!te.current)return;const he={placement:n,strategy:a,middleware:R};Ee.current&&(he.platform=Ee.current),Bj(X.current,te.current,he).then(De=>{const F={...De,isPositioned:ge.current!==!1};Oe.current&&!U1(we.current,F)&&(we.current=F,Um.flushSync(()=>{S(F)}))})},[R,n,a,Ee,ge]);S1(()=>{b===!1&&we.current.isPositioned&&(we.current.isPositioned=!1,S(he=>({...he,isPositioned:!1})))},[b]);const Oe=ie.useRef(!1);S1(()=>(Oe.current=!0,()=>{Oe.current=!1}),[]),S1(()=>{if(J&&(X.current=J),Z&&(te.current=Z),J&&Z){if(K.current)return K.current(J,Z,Re);Re()}},[J,Z,Re,K,Me]);const qe=ie.useMemo(()=>({reference:X,floating:te,setReference:$,setFloating:W}),[$,W]),je=ie.useMemo(()=>({reference:J,floating:Z}),[J,Z]),at=ie.useMemo(()=>{const he={position:a,left:0,top:0};if(!je.floating)return he;const De=zk(je.floating,C.x),F=zk(je.floating,C.y);return g?{...he,transform:"translate("+De+"px, "+F+"px)",...AR(je.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:De,top:F}},[a,g,je.floating,C.x,C.y]);return ie.useMemo(()=>({...C,update:Re,refs:qe,elements:je,floatingStyles:at}),[C,Re,qe,je,at])}const zj=e=>{function n(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:s,padding:f}=typeof e=="function"?e(a):e;return s&&n(s)?s.current!=null?Hk({element:s.current,padding:f}).fn(a):{}:s?Hk({element:s,padding:f}).fn(a):{}}}},jj=(e,n)=>({...Lj(e),options:[e,n]}),Vj=(e,n)=>({...Ij(e),options:[e,n]}),Yj=(e,n)=>({...Uj(e),options:[e,n]}),Wj=(e,n)=>({...Mj(e),options:[e,n]}),qj=(e,n)=>({...Pj(e),options:[e,n]}),Qj=(e,n)=>({...Fj(e),options:[e,n]}),Gj=(e,n)=>({...zj(e),options:[e,n]});var $j="Arrow",RR=ie.forwardRef((e,n)=>{const{children:a,width:s=10,height:f=5,...h}=e;return I.jsx(dl.svg,{...h,ref:n,width:s,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:I.jsx("polygon",{points:"0,0 30,0 15,10"})})});RR.displayName=$j;var Xj=RR;function Kj(e,n=[]){let a=[];function s(h,d){const g=ie.createContext(d),E=a.length;a=[...a,d];function b(S){const{scope:R,children:k,...D}=S,L=(R==null?void 0:R[e][E])||g,B=ie.useMemo(()=>D,Object.values(D));return I.jsx(L.Provider,{value:B,children:k})}function C(S,R){const k=(R==null?void 0:R[e][E])||g,D=ie.useContext(k);if(D)return D;if(d!==void 0)return d;throw new Error(`\`${S}\` must be used within \`${h}\``)}return b.displayName=h+"Provider",[b,C]}const f=()=>{const h=a.map(d=>ie.createContext(d));return function(g){const E=(g==null?void 0:g[e])||h;return ie.useMemo(()=>({[`__scope${e}`]:{...g,[e]:E}}),[g,E])}};return f.scopeName=e,[s,Jj(f,...n)]}function Jj(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const s=e.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(h){const d=s.reduce((g,{useScope:E,scopeName:b})=>{const S=E(h)[`__scope${b}`];return{...g,...S}},{});return ie.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function Zj(e){const[n,a]=ie.useState(void 0);return Qf(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(f=>{if(!Array.isArray(f)||!f.length)return;const h=f[0];let d,g;if("borderBoxSize"in h){const E=h.borderBoxSize,b=Array.isArray(E)?E[0]:E;d=b.inlineSize,g=b.blockSize}else d=e.offsetWidth,g=e.offsetHeight;a({width:d,height:g})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else a(void 0)},[e]),n}var mT="Popper",[NR,DR]=Kj(mT),[eV,OR]=NR(mT),LR=e=>{const{__scopePopper:n,children:a}=e,[s,f]=ie.useState(null);return I.jsx(eV,{scope:n,anchor:s,onAnchorChange:f,children:a})};LR.displayName=mT;var IR="PopperAnchor",MR=ie.forwardRef((e,n)=>{const{__scopePopper:a,virtualRef:s,...f}=e,h=OR(IR,a),d=ie.useRef(null),g=cl(n,d);return ie.useEffect(()=>{h.onAnchorChange((s==null?void 0:s.current)||d.current)}),s?null:I.jsx(dl.div,{...f,ref:g})});MR.displayName=IR;var gT="PopperContent",[tV,nV]=NR(gT),PR=ie.forwardRef((e,n)=>{var ar,cn,Rn,kr,Nn,Br;const{__scopePopper:a,side:s="bottom",sideOffset:f=0,align:h="center",alignOffset:d=0,arrowPadding:g=0,avoidCollisions:E=!0,collisionBoundary:b=[],collisionPadding:C=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:k="optimized",onPlaced:D,...L}=e,B=OR(gT,a),[H,$]=ie.useState(null),W=cl(n,an=>$(an)),[J,Z]=ie.useState(null),X=Zj(J),te=(X==null?void 0:X.width)??0,we=(X==null?void 0:X.height)??0,Me=s+(h!=="center"?"-"+h:""),K=typeof C=="number"?C:{top:0,right:0,bottom:0,left:0,...C},Ee=Array.isArray(b)?b:[b],ge=Ee.length>0,Re={padding:K,boundary:Ee.filter(aV),altBoundary:ge},{refs:Oe,floatingStyles:qe,placement:je,isPositioned:at,middlewareData:he}=Hj({strategy:"fixed",placement:Me,whileElementsMounted:(...an)=>Oj(...an,{animationFrame:k==="always"}),elements:{reference:B.anchor},middleware:[jj({mainAxis:f+we,alignmentAxis:d}),E&&Vj({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?Yj():void 0,...Re}),E&&Wj({...Re}),qj({...Re,apply:({elements:an,rects:Fn,availableWidth:ir,availableHeight:yr})=>{const{width:$n,height:oa}=Fn.reference,Hr=an.floating.style;Hr.setProperty("--radix-popper-available-width",`${ir}px`),Hr.setProperty("--radix-popper-available-height",`${yr}px`),Hr.setProperty("--radix-popper-anchor-width",`${$n}px`),Hr.setProperty("--radix-popper-anchor-height",`${oa}px`)}}),J&&Gj({element:J,padding:g}),iV({arrowWidth:te,arrowHeight:we}),R&&Qj({strategy:"referenceHidden",...Re})]}),[De,F]=BR(je),et=rl(D);Qf(()=>{at&&(et==null||et())},[at,et]);const Et=(ar=he.arrow)==null?void 0:ar.x,V=(cn=he.arrow)==null?void 0:cn.y,Gt=((Rn=he.arrow)==null?void 0:Rn.centerOffset)!==0,[Gn,Nt]=ie.useState();return Qf(()=>{H&&Nt(window.getComputedStyle(H).zIndex)},[H]),I.jsx("div",{ref:Oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...qe,transform:at?qe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Gn,"--radix-popper-transform-origin":[(kr=he.transformOrigin)==null?void 0:kr.x,(Nn=he.transformOrigin)==null?void 0:Nn.y].join(" "),...((Br=he.hide)==null?void 0:Br.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:I.jsx(tV,{scope:a,placedSide:De,onArrowChange:Z,arrowX:Et,arrowY:V,shouldHideArrow:Gt,children:I.jsx(dl.div,{"data-side":De,"data-align":F,...L,ref:W,style:{...L.style,animation:at?void 0:"none"}})})})});PR.displayName=gT;var FR="PopperArrow",rV={top:"bottom",right:"left",bottom:"top",left:"right"},UR=ie.forwardRef(function(n,a){const{__scopePopper:s,...f}=n,h=nV(FR,s),d=rV[h.placedSide];return I.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[h.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[h.placedSide],visibility:h.shouldHideArrow?"hidden":void 0},children:I.jsx(Xj,{...f,ref:a,style:{...f.style,display:"block"}})})});UR.displayName=FR;function aV(e){return e!==null}var iV=e=>({name:"transformOrigin",options:e,fn(n){var B,H,$;const{placement:a,rects:s,middlewareData:f}=n,d=((B=f.arrow)==null?void 0:B.centerOffset)!==0,g=d?0:e.arrowWidth,E=d?0:e.arrowHeight,[b,C]=BR(a),S={start:"0%",center:"50%",end:"100%"}[C],R=(((H=f.arrow)==null?void 0:H.x)??0)+g/2,k=((($=f.arrow)==null?void 0:$.y)??0)+E/2;let D="",L="";return b==="bottom"?(D=d?S:`${R}px`,L=`${-E}px`):b==="top"?(D=d?S:`${R}px`,L=`${s.floating.height+E}px`):b==="right"?(D=`${-E}px`,L=d?S:`${k}px`):b==="left"&&(D=`${s.floating.width+E}px`,L=d?S:`${k}px`),{data:{x:D,y:L}}}});function BR(e){const[n,a="center"]=e.split("-");return[n,a]}var oV=LR,HR=MR,uV=PR,sV=UR;function lV(e,n){return ie.useReducer((a,s)=>n[a][s]??a,e)}var zR=e=>{const{present:n,children:a}=e,s=cV(n),f=typeof a=="function"?a({present:s.isPresent}):ie.Children.only(a),h=cl(s.ref,dV(f));return typeof a=="function"||s.isPresent?ie.cloneElement(f,{ref:h}):null};zR.displayName="Presence";function cV(e){const[n,a]=ie.useState(),s=ie.useRef({}),f=ie.useRef(e),h=ie.useRef("none"),d=e?"mounted":"unmounted",[g,E]=lV(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ie.useEffect(()=>{const b=h1(s.current);h.current=g==="mounted"?b:"none"},[g]),Qf(()=>{const b=s.current,C=f.current;if(C!==e){const R=h.current,k=h1(b);e?E("MOUNT"):k==="none"||(b==null?void 0:b.display)==="none"?E("UNMOUNT"):E(C&&R!==k?"ANIMATION_OUT":"UNMOUNT"),f.current=e}},[e,E]),Qf(()=>{if(n){let b;const C=n.ownerDocument.defaultView??window,S=k=>{const L=h1(s.current).includes(k.animationName);if(k.target===n&&L&&(E("ANIMATION_END"),!f.current)){const B=n.style.animationFillMode;n.style.animationFillMode="forwards",b=C.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=B)})}},R=k=>{k.target===n&&(h.current=h1(s.current))};return n.addEventListener("animationstart",R),n.addEventListener("animationcancel",S),n.addEventListener("animationend",S),()=>{C.clearTimeout(b),n.removeEventListener("animationstart",R),n.removeEventListener("animationcancel",S),n.removeEventListener("animationend",S)}}else E("ANIMATION_END")},[n,E]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:ie.useCallback(b=>{b&&(s.current=getComputedStyle(b)),a(b)},[])}}function h1(e){return(e==null?void 0:e.animationName)||"none"}function dV(e){var s,f;let n=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function fV({prop:e,defaultProp:n,onChange:a=()=>{}}){const[s,f]=pV({defaultProp:n,onChange:a}),h=e!==void 0,d=h?e:s,g=rl(a),E=ie.useCallback(b=>{if(h){const S=typeof b=="function"?b(e):b;S!==e&&g(S)}else f(b)},[h,e,f,g]);return[d,E]}function pV({defaultProp:e,onChange:n}){const a=ie.useState(e),[s]=a,f=ie.useRef(s),h=rl(n);return ie.useEffect(()=>{f.current!==s&&(h(s),f.current=s)},[s,f,h]),a}var hV=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Pf=new WeakMap,m1=new WeakMap,g1={},lw=0,jR=function(e){return e&&(e.host||jR(e.parentNode))},mV=function(e,n){return n.map(function(a){if(e.contains(a))return a;var s=jR(a);return s&&e.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},gV=function(e,n,a,s){var f=mV(n,Array.isArray(e)?e:[e]);g1[a]||(g1[a]=new WeakMap);var h=g1[a],d=[],g=new Set,E=new Set(f),b=function(S){!S||g.has(S)||(g.add(S),b(S.parentNode))};f.forEach(b);var C=function(S){!S||E.has(S)||Array.prototype.forEach.call(S.children,function(R){if(g.has(R))C(R);else try{var k=R.getAttribute(s),D=k!==null&&k!=="false",L=(Pf.get(R)||0)+1,B=(h.get(R)||0)+1;Pf.set(R,L),h.set(R,B),d.push(R),L===1&&D&&m1.set(R,!0),B===1&&R.setAttribute(a,"true"),D||R.setAttribute(s,"true")}catch(H){console.error("aria-hidden: cannot operate on ",R,H)}})};return C(n),g.clear(),lw++,function(){d.forEach(function(S){var R=Pf.get(S)-1,k=h.get(S)-1;Pf.set(S,R),h.set(S,k),R||(m1.has(S)||S.removeAttribute(s),m1.delete(S)),k||S.removeAttribute(a)}),lw--,lw||(Pf=new WeakMap,Pf=new WeakMap,m1=new WeakMap,g1={})}},vV=function(e,n,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),f=hV(e);return f?(s.push.apply(s,Array.from(f.querySelectorAll("[aria-live]"))),gV(s,f,a,"aria-hidden")):function(){return null}},C1="right-scroll-bar-position",_1="width-before-scroll-bar",yV="with-scroll-bars-hidden",EV="--removed-body-scroll-bar-size";function cw(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function bV(e,n){var a=Tt.useState(function(){return{value:e,callback:n,facade:{get current(){return a.value},set current(s){var f=a.value;f!==s&&(a.value=s,a.callback(s,f))}}}})[0];return a.callback=n,a.facade}var xV=typeof window<"u"?ie.useLayoutEffect:ie.useEffect,jk=new WeakMap;function wV(e,n){var a=bV(null,function(s){return e.forEach(function(f){return cw(f,s)})});return xV(function(){var s=jk.get(a);if(s){var f=new Set(s),h=new Set(e),d=a.current;f.forEach(function(g){h.has(g)||cw(g,null)}),h.forEach(function(g){f.has(g)||cw(g,d)})}jk.set(a,e)},[e]),a}function TV(e){return e}function SV(e,n){n===void 0&&(n=TV);var a=[],s=!1,f={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(h){var d=n(h,s);return a.push(d),function(){a=a.filter(function(g){return g!==d})}},assignSyncMedium:function(h){for(s=!0;a.length;){var d=a;a=[],d.forEach(h)}a={push:function(g){return h(g)},filter:function(){return a}}},assignMedium:function(h){s=!0;var d=[];if(a.length){var g=a;a=[],g.forEach(h),d=a}var E=function(){var C=d;d=[],C.forEach(h)},b=function(){return Promise.resolve().then(E)};b(),a={push:function(C){d.push(C),b()},filter:function(C){return d=d.filter(C),a}}}};return f}function CV(e){e===void 0&&(e={});var n=SV(null);return n.options=ft.__assign({async:!0,ssr:!1},e),n}var VR=function(e){var n=e.sideCar,a=ft.__rest(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=n.read();if(!s)throw new Error("Sidecar medium not found");return ie.createElement(s,ft.__assign({},a))};VR.isSideCarExport=!0;function _V(e,n){return e.useMedium(n),VR}var YR=CV(),dw=function(){},ay=ie.forwardRef(function(e,n){var a=ie.useRef(null),s=ie.useState({onScrollCapture:dw,onWheelCapture:dw,onTouchMoveCapture:dw}),f=s[0],h=s[1],d=e.forwardProps,g=e.children,E=e.className,b=e.removeScrollBar,C=e.enabled,S=e.shards,R=e.sideCar,k=e.noIsolation,D=e.inert,L=e.allowPinchZoom,B=e.as,H=B===void 0?"div":B,$=e.gapMode,W=ft.__rest(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),J=R,Z=wV([a,n]),X=ft.__assign(ft.__assign({},W),f);return ie.createElement(ie.Fragment,null,C&&ie.createElement(J,{sideCar:YR,removeScrollBar:b,shards:S,noIsolation:k,inert:D,setCallbacks:h,allowPinchZoom:!!L,lockRef:a,gapMode:$}),d?ie.cloneElement(ie.Children.only(g),ft.__assign(ft.__assign({},X),{ref:Z})):ie.createElement(H,ft.__assign({},X,{className:E,ref:Z}),g))});ay.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ay.classNames={fullWidth:_1,zeroRight:C1};var kV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=kV();return n&&e.setAttribute("nonce",n),e}function RV(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function NV(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var DV=function(){var e=0,n=null;return{add:function(a){e==0&&(n=AV())&&(RV(n,a),NV(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},OV=function(){var e=DV();return function(n,a){ie.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&a])}},WR=function(){var e=OV(),n=function(a){var s=a.styles,f=a.dynamic;return e(s,f),null};return n},LV={left:0,top:0,right:0,gap:0},fw=function(e){return parseInt(e||"",10)||0},IV=function(e){var n=window.getComputedStyle(document.body),a=n[e==="padding"?"paddingLeft":"marginLeft"],s=n[e==="padding"?"paddingTop":"marginTop"],f=n[e==="padding"?"paddingRight":"marginRight"];return[fw(a),fw(s),fw(f)]},MV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LV;var n=IV(e),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-a+n[2]-n[0])}},PV=WR(),Yf="data-scroll-locked",FV=function(e,n,a,s){var f=e.left,h=e.top,d=e.right,g=e.gap;return a===void 0&&(a="margin"),`
203
203
  .`.concat(yV,` {
204
204
  overflow: hidden `).concat(s,`;
205
205
  padding-right: `).concat(g,"px ").concat(s,`;