@smarttalks.ai/widget 0.9.5 → 0.9.7
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/lib/index.js +118 -126
- package/lib/index.umd.cjs +5 -5
- package/package.json +1 -1
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(At){typeof define=="function"&&define.amd?define(At):At()})(function(){"use strict";function At(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=At(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function go(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=At(e))&&(r&&(r+=" "),r+=t);return r}const jn="-",ia=e=>{const t=la(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(jn);return a[0]===""&&a.length!==1&&a.shift(),po(a,t)||aa(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},po=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?po(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(jn);return t.validators.find(({validator:i})=>i(s))?.classGroupId},mo=/^\[(.+)\]$/,aa=e=>{if(mo.test(e)){const t=mo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},la=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ua(Object.entries(e.classGroups),n).forEach(([s,i])=>{qn(i,r,s,t)}),r},qn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:yo(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ca(o)){qn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{qn(i,yo(t,s),n,r)})})},yo=(e,t)=>{let n=e;return t.split(jn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ca=e=>e.isThemeGetter,ua=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,da=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},bo="!",fa=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let c=0,d=0,u;for(let m=0;m<a.length;m++){let b=a[m];if(c===0){if(b===o&&(r||a.slice(m,m+s)===t)){l.push(a.slice(d,m)),d=m+s;continue}if(b==="/"){u=m;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?a:a.substring(d),p=h.startsWith(bo),f=p?h.substring(1):h,g=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},ha=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ga=e=>({cache:da(e.cacheSize),parseClassName:fa(e),...ia(e)}),pa=/\s+/,ma=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(pa);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let f=!!p,g=r(f?h.substring(0,p):h);if(!g){if(!f){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}f=!1}const m=ha(d).join(":"),b=u?m+bo:m,v=b+g;if(s.includes(v))continue;s.push(v);const w=o(g,f);for(let x=0;x<w.length;++x){const O=w[x];s.push(b+O)}a=c+(a.length>0?" "+a:a)}return a};function ya(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vo(t))&&(r&&(r+=" "),r+=n);return r}const vo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vo(e[r]))&&(n&&(n+=" "),n+=t);return n};function ba(e,...t){let n,r,o,s=i;function i(l){const c=t.reduce((d,u)=>u(d),e());return n=ga(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=ma(l,n);return o(l,d),d}return function(){return s(ya.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wo=/^\[(?:([a-z-]+):)?(.+)\]$/i,va=/^\d+\/\d+$/,wa=new Set(["px","full","screen"]),xa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sa=/\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$/,Ea=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ka=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ca=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ct(e)||wa.has(e)||va.test(e),He=e=>ut(e,"length",Ma),ct=e=>!!e&&!Number.isNaN(Number(e)),Hn=e=>ut(e,"number",ct),Tt=e=>!!e&&Number.isInteger(Number(e)),Oa=e=>e.endsWith("%")&&ct(e.slice(0,-1)),N=e=>wo.test(e),We=e=>xa.test(e),_a=new Set(["length","size","percentage"]),Pa=e=>ut(e,_a,xo),Aa=e=>ut(e,"position",xo),Ta=new Set(["image","url"]),La=e=>ut(e,Ta,Ra),Da=e=>ut(e,"",Ia),Lt=()=>!0,ut=(e,t,n)=>{const r=wo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ma=e=>Sa.test(e)&&!Ea.test(e),xo=()=>!1,Ia=e=>ka.test(e),Ra=e=>Ca.test(e),Fa=ba(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),s=X("borderRadius"),i=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),h=X("gap"),p=X("gradientColorStops"),f=X("gradientColorStopPositions"),g=X("inset"),m=X("margin"),b=X("opacity"),v=X("padding"),w=X("saturate"),x=X("scale"),O=X("sepia"),k=X("skew"),E=X("space"),F=X("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",N,t],I=()=>[N,t],re=()=>["",Ne,He],Y=()=>["auto",ct,N],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",N],Pt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[ct,N];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[Ne,He],blur:["none","",We,N],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",We,N],borderSpacing:I(),borderWidth:re(),contrast:Ae(),grayscale:ie(),hueRotate:Ae(),invert:ie(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Oa,He],inset:D(),margin:D(),opacity:Ae(),padding:I(),saturate:Ae(),scale:Ae(),sepia:ie(),skew:Ae(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":Pt()}],"break-before":[{"break-before":Pt()}],"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:[...fe(),N]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tt,N]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",Tt,N]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Tt,N]},N]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Tt,N]},N]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[We]},We]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",We,He]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hn]}],"font-family":[{font:[Lt]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",ct,Hn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ne,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ne,He]}],"underline-offset":[{"underline-offset":["auto",Ne,N]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],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",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),Aa]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Pa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},La]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Ne,N]}],"outline-w":[{outline:[Ne,He]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ne,He]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,Da]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",We,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Ae()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Tt,N]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],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",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ne,He,Hn]}],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"]}}});function Ge(...e){return Fa(go(e))}function $a(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",Yt(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Yt(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Yt(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Yt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Yt(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),s=Math.max(t,n,r),i=s-o,a=0,l=0,c=0;return i==0?a=0:s==t?a=(n-r)/i%6:s==n?a=(r-t)/i+2:a=(t-n)/i+4,a=Math.round(a*60),a<0&&(a+=360),c=(s+o)/2,l=i==0?0:i/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Na(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function Ka(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function Xt(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Ba={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function dt(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Ba[n][e]}const Jt="https://heimdall.smarttalks.ai/api",za="wss://heimdall.smarttalks.ai",So="smarttalkswidget";function ee(e,...t){window.postMessage({from:So,command:e,args:t})}function ne(e,t){window.addEventListener("message",n=>{n.data?.from===So&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function Va(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ee("registerContactData",e)},open:e=>{ee("open"),e&&ee("setInput",e)},close:()=>{ee("close")},toggle:()=>{ee("toggle")},toggleFullscreen:()=>{ee("toggleFullscreen")},reset:()=>{ee("reset")},onOpen:e=>{ne("onOpen",e)},onClose:e=>{ne("onClose",e)},onToggle:e=>{ne("onToggle",e)},onReset:e=>{ne("onReset",e)},onInput:e=>{ne("onInput",e)},onAnswer:e=>{ne("onAnswer",e)},onLoad:e=>{ne("onLoad",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function ko(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Ua(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),_o(o.value)&&!Ga(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function ja(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=_o(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Wa(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function qa(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Ha(e,t){const n=Ua(t);return Object.keys(t).forEach(o=>{const s=n[o],i=e.getAttribute(s.attribute),a=e[o];i!=null&&(s.value=s.parse?Co(i):i),a!=null&&(s.value=Array.isArray(a)?a.slice(0):a),s.reflect&&Oo(e,s.attribute,s.value,!!s.parse),Object.defineProperty(e,o,{get(){return s.value},set(l){const c=s.value;s.value=l,s.reflect&&Oo(this,s.attribute,s.value,!!s.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function Co(e){if(e)try{return JSON.parse(e)}catch{return e}}function Oo(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Wa(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function _o(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Ga(e){return Object.prototype.toString.call(e)==="[object Function]"}function Ya(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Wn;function Xa(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Ha(this,t);const o=qa(this.props),s=this.Component,i=Wn;try{Wn=this,this.__initialized=!0,Ya(s)?new s(o,{element:this}):s(o,{element:this})}finally{Wn=i}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,s,i){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(i==null&&!this[o])return;this[o]=t[o].parse?Co(i):i}}lookupProp(o){if(t)return n.find(s=>o===s||o===t[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function Ja(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:s=window.customElements}=n;return i=>{let a=s.get(e);return a?(a.prototype.Component=i,a):(a=Xa(r,ja(t)),a.prototype.Component=i,a.prototype.registeredTag=e,s.define(e,a,o),a)}}const B={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Po(this.context.count)},getNextContextId(){return Po(this.context.count++)}};function Po(e){const t=String(e),n=t.length-1;return B.context.id+(n?String.fromCharCode(96+n):"")+t}function Za(e){B.context=e}const Qa=!1,el=(e,t)=>e===t,ve=Symbol("solid-proxy"),Ao=typeof Proxy=="function",Gn=Symbol("solid-track"),Zt={equals:el};let To=Fo;const Ke=1,Qt=2,Lo={owned:null,cleanups:null,context:null,owner:null},Yn={};var q=null;let Xn=null,tl=null,W=null,ae=null,Be=null,en=0;function ze(e,t){const n=W,r=q,o=e.length===0,s=t===void 0?r:t,i=o?Lo:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=o?e:()=>e(()=>H(()=>Dt(i)));q=i,W=null;try{return Ve(a,!0)}finally{W=n,q=r}}function P(e,t){t=t?Object.assign({},Zt,t):Zt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ro(n,o));return[Io.bind(n),r]}function Do(e,t,n){const r=nn(e,t,!0,Ke);ft(r)}function oe(e,t,n){const r=nn(e,t,!1,Ke);ft(r)}function L(e,t,n){To=ll;const r=nn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),Be?Be.push(r):ft(r)}function C(e,t,n){n=n?Object.assign({},Zt,n):Zt;const r=nn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ft(r),Io.bind(r)}function nl(e){return e&&typeof e=="object"&&"then"in e}function rl(e,t,n){let r,o,s;typeof t=="function"?(r=e,o=t,s={}):(r=!0,o=e,s=t||{});let i=null,a=Yn,l=null,c=!1,d="initialValue"in s,u=typeof r=="function"&&C(r);const h=new Set,[p,f]=(s.storage||P)(s.initialValue),[g,m]=P(void 0),[b,v]=P(void 0,{equals:!1}),[w,x]=P(d?"ready":"unresolved");B.context&&(l=B.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:B.load&&B.has(l)&&(a=B.load(l)));function O(_,R,D,I){return i===_&&(i=null,I!==void 0&&(d=!0),(_===a||R===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(I,{value:R})),a=Yn,k(R,D)),R}function k(_,R){Ve(()=>{R===void 0&&f(()=>_),x(R!==void 0?"errored":d?"ready":"unresolved"),m(R);for(const D of h.keys())D.decrement();h.clear()},!1)}function E(){const _=sl,R=p(),D=g();if(D!==void 0&&!i)throw D;return W&&W.user,R}function F(_=!0){if(_!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){O(i,H(p));return}const D=a!==Yn?a:H(()=>o(R,{value:p(),refetching:_}));return nl(D)?(i=D,"value"in D?(D.status==="success"?O(i,D.value,void 0,R):O(i,void 0,Qn(D.value),R),D):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),v()},!1),D.then(I=>O(D,I,void 0,R),I=>O(D,void 0,Qn(I),R)))):(O(i,D,void 0,R),D)}return Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const _=w();return _==="pending"||_==="refreshing"}},latest:{get(){if(!d)return E();const _=g();if(_&&!i)throw _;return p()}}}),u?Do(()=>F(!1)):F(!1),[E,{refetch:F,mutate:f}]}function Ee(e){return Ve(e,!1)}function H(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function et(e,t,n){const r=Array.isArray(e);let o,s=n&&n.defer;return i=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(s)return s=!1,i;const l=H(()=>t(a,o,i));return o=a,l}}function tn(e){L(()=>H(e))}function K(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Jn(){return W}function Mo(){return q}function ol(e,t){const n=q,r=W;q=e,W=null;try{return Ve(t,!0)}catch(o){er(o)}finally{q=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:cl(n),defaultValue:e}}function he(e){let t;return q&&q.context&&(t=q.context[e.id])!==void 0?t:e.defaultValue}function Zn(e){const t=C(e),n=C(()=>tr(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let sl;function Io(){if(this.sources&&this.state)if(this.state===Ke)ft(this);else{const e=ae;ae=null,Ve(()=>on(this),!1),ae=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function Ro(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{for(let o=0;o<e.observers.length;o+=1){const s=e.observers[o],i=Xn&&Xn.running;i&&Xn.disposed.has(s),(i?!s.tState:!s.state)&&(s.pure?ae.push(s):Be.push(s),s.observers&&$o(s)),i||(s.state=Ke)}if(ae.length>1e6)throw ae=[],new Error},!1)),t}function ft(e){if(!e.fn)return;Dt(e);const t=en;il(e,e.value,t)}function il(e,t,n){let r;const o=q,s=W;W=q=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Dt),e.owned=null),e.updatedAt=n+1,er(i)}finally{W=s,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ro(e,r):e.value=r,e.updatedAt=n)}function nn(e,t,n,r=Ke,o){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==Lo&&(q.owned?q.owned.push(s):q.owned=[s]),s}function rn(e){if(e.state===0)return;if(e.state===Qt)return on(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<en);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)ft(e);else if(e.state===Qt){const r=ae;ae=null,Ve(()=>on(e,t[0]),!1),ae=r}}function Ve(e,t){if(ae)return e();let n=!1;t||(ae=[]),Be?n=!0:Be=[],en++;try{const r=e();return al(n),r}catch(r){n||(Be=null),ae=null,er(r)}}function al(e){if(ae&&(Fo(ae),ae=null),e)return;const t=Be;Be=null,t.length&&Ve(()=>To(t),!1)}function Fo(e){for(let t=0;t<e.length;t++)rn(e[t])}function ll(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rn(r)}if(B.context){if(B.count){B.effects||(B.effects=[]),B.effects.push(...e.slice(0,n));return}Za()}for(B.effects&&(B.done||!B.count)&&(e=[...B.effects,...e],n+=B.effects.length,delete B.effects),t=0;t<n;t++)rn(e[t])}function on(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Ke?r!==t&&(!r.updatedAt||r.updatedAt<en)&&rn(r):o===Qt&&on(r,t)}}}function $o(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Qt,n.pure?ae.push(n):Be.push(n),n.observers&&$o(n))}}function Dt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const s=o.pop(),i=n.observerSlots.pop();r<o.length&&(s.sourceSlots[i]=r,o[r]=s,n.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Qn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function er(e,t=q){throw Qn(e)}function tr(e){if(typeof e=="function"&&!e.length)return tr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=tr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function cl(e,t){return function(r){let o;return oe(()=>o=H(()=>(q.context={...q.context,[e]:r.value},Zn(()=>r.children))),void 0),o}}const ul=Symbol("fallback");function No(e){for(let t=0;t<e.length;t++)e[t]()}function dl(e,t,n={}){let r=[],o=[],s=[],i=0,a=t.length>1?[]:null;return K(()=>No(s)),()=>{let l=e()||[],c=l.length,d,u;return l[Gn],H(()=>{let p,f,g,m,b,v,w,x,O;if(c===0)i!==0&&(No(s),s=[],r=[],o=[],i=0,a&&(a=[])),n.fallback&&(r=[ul],o[0]=ze(k=>(s[0]=k,n.fallback())),i=1);else if(i===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=ze(h);i=c}else{for(g=new Array(c),m=new Array(c),a&&(b=new Array(c)),v=0,w=Math.min(i,c);v<w&&r[v]===l[v];v++);for(w=i-1,x=c-1;w>=v&&x>=v&&r[w]===l[x];w--,x--)g[x]=o[w],m[x]=s[w],a&&(b[x]=a[w]);for(p=new Map,f=new Array(x+1),u=x;u>=v;u--)O=l[u],d=p.get(O),f[u]=d===void 0?-1:d,p.set(O,u);for(d=v;d<=w;d++)O=r[d],u=p.get(O),u!==void 0&&u!==-1?(g[u]=o[d],m[u]=s[d],a&&(b[u]=a[d]),u=f[u],p.set(O,u)):s[d]();for(u=v;u<c;u++)u in g?(o[u]=g[u],s[u]=m[u],a&&(a[u]=b[u],a[u](u))):o[u]=ze(h);o=o.slice(0,i=c),r=l.slice(0)}return o});function h(p){if(s[u]=p,a){const[f,g]=P(u);return a[u]=g,t(l[u],f)}return t(l[u])}}}function y(e,t){return H(()=>e(t||{}))}function sn(){return!0}const nr={get(e,t,n){return t===ve?n:e.get(t)},has(e,t){return t===ve?!0:e.has(t)},set:sn,deleteProperty:sn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:sn,deleteProperty:sn}},ownKeys(e){return e.keys()}};function rr(e){return(e=typeof e=="function"?e():e)?e:{}}function fl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function T(...e){let t=!1;for(let i=0;i<e.length;i++){const a=e[i];t=t||!!a&&ve in a,e[i]=typeof a=="function"?(t=!0,C(a)):a}if(Ao&&t)return new Proxy({get(i){for(let a=e.length-1;a>=0;a--){const l=rr(e[a])[i];if(l!==void 0)return l}},has(i){for(let a=e.length-1;a>=0;a--)if(i in rr(e[a]))return!0;return!1},keys(){const i=[];for(let a=0;a<e.length;a++)i.push(...Object.keys(rr(e[a])));return[...new Set(i)]}},nr);const n={},r=Object.create(null);for(let i=e.length-1;i>=0;i--){const a=e[i];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:fl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const h=n[d];h&&(u.get?h.push(u.get.bind(a)):u.value!==void 0&&h.push(()=>u.value))}}}const o={},s=Object.keys(r);for(let i=s.length-1;i>=0;i--){const a=s[i],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(Ao&&ve in e){const o=new Set(t.length>1?t.flat():t[0]),s=t.map(i=>new Proxy({get(a){return i.includes(a)?e[a]:void 0},has(a){return i.includes(a)&&a in e},keys(){return i.filter(a=>a in e)}},nr));return s.push(new Proxy({get(i){return o.has(i)?void 0:e[i]},has(i){return o.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!o.has(i))}},nr)),s}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,o),i=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,i?r[l][o]=s.value:Object.defineProperty(r[l],o,s)),++l;a||(i?n[o]=s.value:Object.defineProperty(n,o,s))}return[...r,n]}let hl=0;function Te(){return B.context?B.getNextContextId():`cl-${hl++}`}const Ko=e=>`Stale read from <${e}>.`;function ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return C(dl(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(o,s)=>!o==!s});return C(()=>{const o=r();if(o){const s=e.children;return typeof s=="function"&&s.length>0?H(()=>s(t?o:()=>{if(!H(r))throw Ko("Show");return n()})):s}return e.fallback},void 0,void 0)}function Bo(e){const t=Zn(()=>e.children),n=C(()=>{const r=t(),o=Array.isArray(r)?r:[r];let s=()=>{};for(let i=0;i<o.length;i++){const a=i,l=o[i],c=s,d=C(()=>c()?void 0:l.when,void 0,void 0),u=l.keyed?d:C(d,void 0,{equals:(h,p)=>!h==!p});s=()=>c()||(u()?[a,d,l]:void 0)}return s});return C(()=>{const r=n()();if(!r)return e.fallback;const[o,s,i]=r,a=i.children;return typeof a=="function"&&a.length>0?H(()=>a(i.keyed?s():()=>{if(H(n)()?.[0]!==o)throw Ko("Match");return s()})):a},void 0,void 0)}function Mt(e){return e}const gl=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],pl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...gl]),ml=new Set(["innerHTML","textContent","innerText","children"]),yl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),bl=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function vl(e,t){const n=bl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const wl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xl=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Sl={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function El(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,l=t[o-1].nextSibling,c=null;for(;i<o||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===i){const d=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],d)}else if(s===a)for(;i<o;)(!c||!c.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],d),t[o]=n[s]}else{if(!c){c=new Map;let u=a;for(;u<s;)c.set(n[u],u++)}const d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let u=i,h=1,p;for(;++u<o&&u<s&&!((p=c.get(t[u]))==null||p!==d+h);)h++;if(h>d-a){const f=t[i];for(;a<d;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const zo="_$DX_DELEGATE";function M(e,t,n,r){let o;const s=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},i=()=>(o||(o=s())).cloneNode(!0);return i.cloneNode=i,i}function kl(e,t=window.document){const n=t[zo]||(t[zo]=new Set);for(let r=0,o=e.length;r<o;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,Dl))}}function ue(e,t,n){nt(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Cl(e,t,n,r){nt(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ol(e,t,n){nt(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function gt(e,t){nt(e)||(t==null?e.removeAttribute("class"):e.className=t)}function _l(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Pl(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let s,i;for(s=0,i=o.length;s<i;s++){const a=o[s];!a||a==="undefined"||t[a]||(Vo(e,a,!1),delete n[a])}for(s=0,i=r.length;s<i;s++){const a=r[s],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Vo(e,a,!0),n[a]=l)}return n}function an(e,t,n){if(!t)return n?ue(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function tt(e,t={},n,r){const o={};return r||oe(()=>o.children=It(e,t.children,o.children)),oe(()=>typeof t.ref=="function"&&or(t.ref,e)),oe(()=>Al(e,t,n,!0,o,!0)),o}function or(e,t,n){return H(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return It(e,t,r,n);oe(o=>It(e,t(),o,n),r)}function Al(e,t,n,r,o={},s=!1){t||(t={});for(const i in o)if(!(i in t)){if(i==="children")continue;o[i]=Uo(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=Uo(e,i,a,o[i],n,s,t)}}function Tl(e){let t,n;return!nt()||!(t=B.registry.get(n=Ml()))?e():(B.completed&&B.completed.add(t),B.registry.delete(n),t)}function nt(e){return!!B.context&&!B.done&&(!e||e.isConnected)}function Ll(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Vo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,s=r.length;o<s;o++)e.classList.toggle(r[o],n)}function Uo(e,t,n,r,o,s,i){let a,l,c,d,u;if(t==="style")return an(e,n,r);if(t==="classList")return Pl(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),p=wl.has(h);if(!p&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(p||n)&&(_l(e,h,n,p),p&&kl([h]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Ol(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=ml.has(t))||!o&&((d=vl(t,e.tagName))||(l=pl.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(u)t=t.slice(5),l=!0;else if(nt(e))return n;t==="class"||t==="className"?gt(e,n):a&&!l&&!c?e[Ll(t)]=n:e[d||t]=n}else{const h=o&&t.indexOf(":")>-1&&Sl[t.split(":")[0]];h?Cl(e,h,t,n):ue(e,yl[t]||t,n)}return n}function Dl(e){if(B.registry&&B.events&&B.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),i=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),B.registry&&!B.done&&(B.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!i());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function It(e,t,n,r,o){const s=nt(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(s||i==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=pt(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(s)return n;n=pt(e,n,r)}else{if(i==="function")return oe(()=>{let l=t();for(;typeof l=="function";)l=l();n=It(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(sr(l,t,n,o))return oe(()=>n=It(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const u=[d];for(;(d=d.nextSibling)!==r;)u.push(d);return n=u}if(l.length===0){if(n=pt(e,n,r),a)return n}else c?n.length===0?jo(e,l,r):El(e,n,l):(n&&pt(e),jo(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=pt(e,n,r,t);pt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function sr(e,t,n,r){let o=!1;for(let s=0,i=t.length;s<i;s++){let a=t[s],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=sr(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=sr(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function jo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function pt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const l=a.parentNode===e;!s&&!i?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function Ml(){return B.getNextContextId()}const Il=!1,Rl="http://www.w3.org/2000/svg";function qo(e,t=!1){return t?document.createElementNS(Rl,e):document.createElement(e)}function Ho(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Mo();let s,i=!!B.context;return L(()=>{i&&(Mo().user=i=!1),s||(s=ol(o,()=>C(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),d=()=>c(!0);ze(u=>A(a,()=>l()?u():s(),null)),K(d)}else{const l=qo(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,s),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!i}),n}function Fl(e,t){const n=C(e);return C(()=>{const r=n();switch(typeof r){case"function":return H(()=>r(t));case"string":const o=xl.has(r),s=B.context?Tl():qo(r,o);return tt(s,t,o),s}})}function ln(e){const[,t]=j(e,["component"]);return Fl(()=>e.component,t)}function $l(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,s]=P(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(i){s(()=>i)}})}return n}function Nl(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Kl(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const s=$l(t);r.addPropertyChangedCallback((a,l)=>s[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const i=e(s,n);return A(r.renderRoot,i)},Nl(r))}}function Bl(e,t,n){return arguments.length===2&&(n=t,t={}),Ja(e,t)(Kl(n))}const zl='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-6{top:-1.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-9{left:2.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-80{max-width:20rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:.125rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-6{padding-bottom:1.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:1rem;line-height:1.5rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}.md\\:file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Wo,ir]=P(!1),Go=[],Vl=e=>Go.push(e),Yo=()=>{Go.forEach(e=>e())},Ul=()=>{const e=!Wo();ir(e),ee("onToggle"),ee(e?"onOpen":"onClose"),Yo()},jl=()=>{ir(!1),ee("onClose")},ql=()=>{ir(!0),ee("onOpen"),Yo()},Xo=()=>({bubble:Wo,show:ql,hide:jl,toggle:Ul,onOpen:Vl}),ar=Symbol("store-raw"),mt=Symbol("store-node"),Ue=Symbol("store-has"),Jo=Symbol("store-self");function Zo(e){let t=e[ve];if(!t&&(Object.defineProperty(e,ve,{value:t=new Proxy(e,Gl)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,s=n.length;o<s;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function cn(e){let t;return e!=null&&typeof e=="object"&&(e[ve]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Rt(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[ar])return n;if(!cn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,a=e.length;i<a;i++)o=e[i],(r=Rt(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=i.length;l<c;l++)s=i[l],!a[s].get&&(o=e[s],(r=Rt(o,t))!==o&&(e[s]=r))}return e}function un(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Ft(e,t,n){if(e[t])return e[t];const[r,o]=P(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Hl(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===ve||t===mt||(delete n.value,delete n.writable,n.get=()=>e[ve][t]),n}function Qo(e){Jn()&&Ft(un(e,mt),Jo)()}function Wl(e){return Qo(e),Reflect.ownKeys(e)}const Gl={get(e,t,n){if(t===ar)return e;if(t===ve)return n;if(t===Gn)return Qo(e),n;const r=un(e,mt),o=r[t];let s=o?o():e[t];if(t===mt||t===Ue||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);Jn()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=Ft(r,t,s)())}return cn(s)?Zo(s):s},has(e,t){return t===ar||t===ve||t===Gn||t===mt||t===Ue||t==="__proto__"?!0:(Jn()&&Ft(un(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Wl,getOwnPropertyDescriptor:Hl};function dn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],s=e.length;n===void 0?(delete e[t],e[Ue]&&e[Ue][t]&&o!==void 0&&e[Ue][t].$()):(e[t]=n,e[Ue]&&e[Ue][t]&&o===void 0&&e[Ue][t].$());let i=un(e,mt),a;if((a=Ft(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let l=e.length;l<s;l++)(a=i[l])&&a.$();(a=Ft(i,"length",s))&&a.$(e.length)}(a=i[Jo])&&a.$()}function es(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];dn(e,o,t[o])}}function Yl(e,t){if(typeof t=="function"&&(t=t(e)),t=Rt(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&dn(e,n,o)}dn(e,"length",r)}else es(e,t)}function $t(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)$t(e,[r[l]].concat(t),n);return}else if(a&&i==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&$t(e,[l].concat(t),n);return}else if(a&&i==="object"){const{from:l=0,to:c=e.length-1,by:d=1}=r;for(let u=l;u<=c;u+=d)$t(e,[u].concat(t),n);return}else if(t.length>1){$t(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(o,n),s===o)||r===void 0&&s==null||(s=Rt(s),r===void 0||cn(o)&&cn(s)&&!Array.isArray(s)?es(o,s):dn(e,r,s))}function Xl(...[e,t]){const n=Rt(e||{}),r=Array.isArray(n),o=Zo(n);function s(...i){Ee(()=>{r&&i.length===1?Yl(n,i[0]):$t(n,i)})}return[o,s]}function ts(e,t,n){return ze(()=>{const r=ko(e),[o,s]=Xl(r?JSON.parse(r):t);return L(()=>Eo(e,JSON.stringify(o),n)),[o,s]})}function Jl(e,t,n){return ze(()=>{const r=ko(e),[o,s]=P(r?JSON.parse(r):t);return L(()=>Eo(e,JSON.stringify(o()),n)),[o,s]})}const[gm,pm]=Jl("lang","en");function Zl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function Ql(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const ec=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Jt}/v1/widget/${n}`,{result:s}=await(await fetch(o,{credentials:"include"})).json();if(s.type==="flow")return Zl(s);if(s.type==="entity")return Ql(s);if(s.type==="chat"&&r.includes("showSettings")&&(s.showSettings=!0),(r.includes("right")||r.includes("left"))&&(s.style.position=r.includes("right")?"right":"left"),r.some(i=>i.includes("margin"))){const i=r.find(a=>a.includes("margin"));i&&(s.style.margin=Number(i.split("=")[1]??"5"))}if(r.some(i=>i.includes("mode"))){const i=r.find(a=>a.includes("mode"))?.split("=")[1];(i==="popup"||i==="static"||i==="standard")&&(s.mode=i)}return ne("registerContactData",i=>{i&&Object.keys(i).length&&fetch(`${Jt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).catch(console.error)}),s._id=n,s},[ns,tc]=P(""),[rt]=ze(()=>rl(ns,ec)),nc=()=>{if(rt()?.type==="chat")return rt()},rc=()=>{if(rt()?.type==="form")return rt()};ze(()=>L(()=>{$a(rt()),rt()&&ee("onLoad")}));const se=()=>({widgetId:ns,setWidgetId:tc,widget:rt,chatWidget:nc,formWidget:rc}),rs=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,os=go,oc=(e,t)=>n=>{var r;if(t?.variants==null)return os(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n?.[c],u=s?.[c];if(d===null)return null;const h=rs(d)||rs(u);return o[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,h]=d;return h===void 0||(c[u]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:h,...p}=d;return Object.entries(p).every(f=>{let[g,m]=f;return Array.isArray(m)?m.includes({...s,...a}[g]):{...s,...a}[g]===m})?[...c,u,h]:c},[]);return os(e,i,l,n?.class,n?.className)};var sc=M("<button>");const ic=oc("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ke=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=sc();return tt(n,T({get class(){return Ge(ic({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var ac=M('<img alt="widget logo">');const ss=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=ac();return tt(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var lc=M('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const cc=()=>{const{chatWidget:e}=se(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=lc(),o=r.firstChild,s=o.firstChild,i=s.nextSibling;return A(r,y(ss,{get src(){return e()?.avatar}}),o),A(s,t),A(i,n),r})()};var uc=M("<svg stroke-width=0>");function ge(e,t){const n=T(e.a,t),[r,o]=j(n,["src"]),[s,i]=P(""),a=C(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return L(()=>i(a())),K(()=>{i("")}),(()=>{var l=uc();return tt(l,T({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return s()}}),!0,!0),A(l,()=>Il),l})()}function dc(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function fc(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function hc(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function gc(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const lr={equals:!1};function is(e){return(...t)=>{for(const n of e)n&&n(...t)}}function pc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,as=e=>Array.isArray(e)?e:e?[e]:[];function mc(e,...t){return typeof e=="function"?e(...t):e}const yc=K;function bc(e,t,n,r){return e.addEventListener(t,n,r),yc(e.removeEventListener.bind(e,t,n,r))}function vc(e,t,n,r){const o=()=>{as(S(e)).forEach(s=>{s&&as(S(t)).forEach(i=>bc(s,i,n,r))})};typeof e=="function"?L(o):oe(o)}function fn(){return!0}const wc={get(e,t,n){return t===ve?n:e.get(t)},has(e,t){return e.has(t)},set:fn,deleteProperty:fn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:fn,deleteProperty:fn}},ownKeys(e){return e.keys()}},xc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ls(e){const t={};let n;for(;n=xc.exec(e);)t[n[1]]=n[2];return t}function Sc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ls(e)}else typeof t=="string"&&(t=ls(t));return{...e,...t}}const cr=(e,t,n)=>{let r;for(const o of e){const s=S(o)[t];r?s&&(r=n(r,s)):r=s}return r};function Ec(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?pc:is,o={};for(const i of n){const a=S(i);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const s=T(...n);return new Proxy({get(i){if(typeof i!="string")return Reflect.get(s,i);if(i==="style")return cr(n,"style",Sc);if(i==="ref"){const a=[];for(const l of n){const c=S(l)[i];typeof c=="function"&&a.push(c)}return r(a)}if(i[0]==="o"&&i[1]==="n"&&i[2]){const a=o[i.toLowerCase()];return a?r(a):Reflect.get(s,i)}return i==="class"||i==="className"?cr(n,i,(a,l)=>`${a} ${l}`):i==="classList"?cr(n,i,(a,l)=>({...a,...l})):Reflect.get(s,i)},has(i){return Reflect.has(s,i)},keys(){return Object.keys(s)}},wc)}function ot(...e){return is(e)}function kc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ur(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Cc(e){return typeof e=="number"}function Oc(e){return Array.isArray(e)}function yt(e){return Object.prototype.toString.call(e)==="[object String]"}function _c(e){return typeof e=="function"}function cs(e){return t=>`${e()}-${t}`}function Le(e,t){return e?e===t||e.contains(t):!1}function Nt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(us(n)&&n.contentDocument)return Nt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function us(e){return e.tagName==="IFRAME"}var ds=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ds||{});function dr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function hn(){return dr(/^Mac/i)}function Pc(){return dr(/^iPhone/i)}function Ac(){return dr(/^iPad/i)||hn()&&navigator.maxTouchPoints>1}function Tc(){return Pc()||Ac()}function Lc(){return hn()||Tc()}function pe(e,t){return t&&(_c(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function we(e){return t=>{for(const n of e)pe(t,n)}}function Dc(e){return hn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Mc())e.focus({preventScroll:!0});else{const t=Ic(e);e.focus(),Rc(t)}}var gn=null;function Mc(){if(gn==null){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch{}}return gn}function Ic(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Rc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fs=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Fc=[...fs,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fr=`${fs.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,$c=Fc.join(':not([hidden]):not([tabindex="-1"]),');function hs(e,t){const r=Array.from(e.querySelectorAll(fr)).filter(gs);return t&&gs(e)&&r.unshift(e),r.forEach((o,s)=>{if(us(o)&&o.contentDocument){const i=o.contentDocument.body,a=hs(i,!1);r.splice(s,1,...a)}}),r}function gs(e){return ps(e)&&!Nc(e)}function ps(e){return e.matches(fr)&&hr(e)}function Nc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function hr(e,t){return e.nodeName!=="#comment"&&Kc(e)&&Bc(e,t)&&(!e.parentElement||hr(e.parentElement,e))}function Kc(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:s,visibility:i}=o(e);r=s!=="none"&&i!=="hidden"&&i!=="collapse"}return r}function Bc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function zc(e,t,n){const r=t?.tabbable?$c:fr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return t?.from?.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&hr(s)&&(!t?.accept||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function ms(e){let t=e;for(;t&&!Vc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Vc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Uc(){}function jc(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=s,a=0,l=i-1;a<i;l=a++){const[c,d]=t[a],[u,h]=t[l],[,p]=t[l===0?i-1:l-1]||[0,0],f=(d-h)*(n-c)-(c-u)*(r-d);if(h<d){if(r>=h&&r<d){if(f===0)return!0;f>0&&(r===h?r>p&&(o=!o):o=!o)}}else if(d<h){if(r>d&&r<=h){if(f===0)return!0;f<0&&(r===h?r<p&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function De(e,t){return T(e,t)}var Kt=new Map,ys=new Set;function bs(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Kt.get(n.target);r||(r=new Set,Kt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Kt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Kt.delete(n.target)),Kt.size===0)){for(const o of ys)o();ys.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?bs():document.addEventListener("DOMContentLoaded",bs));function gr(e,t){const n=vs(e,t,"left"),r=vs(e,t,"top"),o=t.offsetWidth,s=t.offsetHeight;let i=e.scrollLeft,a=e.scrollTop;const l=i+e.offsetWidth,c=a+e.offsetHeight;n<=i?i=n:n+o>l&&(i+=n+o-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=i,e.scrollTop=a}function vs(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function qc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=ms(e);for(;e&&o&&e!==n&&o!==n;)gr(o,e),e=o,o=ms(e)}else{const{left:o,top:s}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:i,top:a}=e.getBoundingClientRect();(Math.abs(o-i)>1||Math.abs(s-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Hc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function pr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(yt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return yt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(yt(l)||Cc(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:i(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const d=pr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...d),t+=d.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:s(l),disabled:i(l),level:n,index:t}),t++}return r}/*!
|
|
1
|
+
(function(At){typeof define=="function"&&define.amd?define(At):At()})(function(){"use strict";function At(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=At(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function go(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=At(e))&&(r&&(r+=" "),r+=t);return r}const jn="-",ia=e=>{const t=la(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(jn);return a[0]===""&&a.length!==1&&a.shift(),po(a,t)||aa(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},po=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?po(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(jn);return t.validators.find(({validator:i})=>i(s))?.classGroupId},mo=/^\[(.+)\]$/,aa=e=>{if(mo.test(e)){const t=mo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},la=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ua(Object.entries(e.classGroups),n).forEach(([s,i])=>{qn(i,r,s,t)}),r},qn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:yo(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ca(o)){qn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{qn(i,yo(t,s),n,r)})})},yo=(e,t)=>{let n=e;return t.split(jn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ca=e=>e.isThemeGetter,ua=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,da=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},bo="!",fa=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let c=0,d=0,u;for(let m=0;m<a.length;m++){let b=a[m];if(c===0){if(b===o&&(r||a.slice(m,m+s)===t)){l.push(a.slice(d,m)),d=m+s;continue}if(b==="/"){u=m;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?a:a.substring(d),p=h.startsWith(bo),f=p?h.substring(1):h,g=u&&u>d?u-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},ha=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ga=e=>({cache:da(e.cacheSize),parseClassName:fa(e),...ia(e)}),pa=/\s+/,ma=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(pa);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let f=!!p,g=r(f?h.substring(0,p):h);if(!g){if(!f){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}f=!1}const m=ha(d).join(":"),b=u?m+bo:m,v=b+g;if(s.includes(v))continue;s.push(v);const w=o(g,f);for(let x=0;x<w.length;++x){const O=w[x];s.push(b+O)}a=c+(a.length>0?" "+a:a)}return a};function ya(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vo(t))&&(r&&(r+=" "),r+=n);return r}const vo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vo(e[r]))&&(n&&(n+=" "),n+=t);return n};function ba(e,...t){let n,r,o,s=i;function i(l){const c=t.reduce((d,u)=>u(d),e());return n=ga(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=ma(l,n);return o(l,d),d}return function(){return s(ya.apply(null,arguments))}}const X=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wo=/^\[(?:([a-z-]+):)?(.+)\]$/i,va=/^\d+\/\d+$/,wa=new Set(["px","full","screen"]),xa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sa=/\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$/,Ea=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ka=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ca=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ct(e)||wa.has(e)||va.test(e),He=e=>ut(e,"length",Ma),ct=e=>!!e&&!Number.isNaN(Number(e)),Hn=e=>ut(e,"number",ct),Tt=e=>!!e&&Number.isInteger(Number(e)),Oa=e=>e.endsWith("%")&&ct(e.slice(0,-1)),N=e=>wo.test(e),We=e=>xa.test(e),_a=new Set(["length","size","percentage"]),Pa=e=>ut(e,_a,xo),Aa=e=>ut(e,"position",xo),Ta=new Set(["image","url"]),La=e=>ut(e,Ta,Ra),Da=e=>ut(e,"",Ia),Lt=()=>!0,ut=(e,t,n)=>{const r=wo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ma=e=>Sa.test(e)&&!Ea.test(e),xo=()=>!1,Ia=e=>ka.test(e),Ra=e=>Ca.test(e),Fa=ba(()=>{const e=X("colors"),t=X("spacing"),n=X("blur"),r=X("brightness"),o=X("borderColor"),s=X("borderRadius"),i=X("borderSpacing"),a=X("borderWidth"),l=X("contrast"),c=X("grayscale"),d=X("hueRotate"),u=X("invert"),h=X("gap"),p=X("gradientColorStops"),f=X("gradientColorStopPositions"),g=X("inset"),m=X("margin"),b=X("opacity"),v=X("padding"),w=X("saturate"),x=X("scale"),O=X("sepia"),k=X("skew"),E=X("space"),F=X("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",N,t],I=()=>[N,t],re=()=>["",Ne,He],Y=()=>["auto",ct,N],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",N],Pt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[ct,N];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[Ne,He],blur:["none","",We,N],brightness:Ae(),borderColor:[e],borderRadius:["none","","full",We,N],borderSpacing:I(),borderWidth:re(),contrast:Ae(),grayscale:ie(),hueRotate:Ae(),invert:ie(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Oa,He],inset:D(),margin:D(),opacity:Ae(),padding:I(),saturate:Ae(),scale:Ae(),sepia:ie(),skew:Ae(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":Pt()}],"break-before":[{"break-before":Pt()}],"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:[...fe(),N]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tt,N]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",Tt,N]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Tt,N]},N]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Tt,N]},N]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[We]},We]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",We,He]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hn]}],"font-family":[{font:[Lt]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",ct,Hn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ne,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ne,He]}],"underline-offset":[{"underline-offset":["auto",Ne,N]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],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",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),Aa]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Pa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},La]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Ne,N]}],"outline-w":[{outline:[Ne,He]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ne,He]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,Da]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",We,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Ae()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Tt,N]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],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",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ne,He,Hn]}],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"]}}});function Ge(...e){return Fa(go(e))}function $a(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",Yt(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",Yt(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",Yt(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",Yt(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Yt(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),s=Math.max(t,n,r),i=s-o,a=0,l=0,c=0;return i==0?a=0:s==t?a=(n-r)/i%6:s==n?a=(r-t)/i+2:a=(t-n)/i+4,a=Math.round(a*60),a<0&&(a+=360),c=(s+o)/2,l=i==0?0:i/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Na(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function Ka(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function Xt(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Ba={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function dt(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Ba[n][e]}const Jt="https://heimdall.smarttalks.ai/api",za="wss://heimdall.smarttalks.ai",So="smarttalkswidget";function ee(e,...t){window.postMessage({from:So,command:e,args:t})}function ne(e,t){window.addEventListener("message",n=>{n.data?.from===So&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function Va(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ee("registerContactData",e)},open:e=>{ee("open"),e&&ee("setInput",e)},close:()=>{ee("close")},toggle:()=>{ee("toggle")},toggleFullscreen:()=>{ee("toggleFullscreen")},reset:()=>{ee("reset")},onOpen:e=>{ne("onOpen",e)},onClose:e=>{ne("onClose",e)},onToggle:e=>{ne("onToggle",e)},onReset:e=>{ne("onReset",e)},onInput:e=>{ne("onInput",e)},onAnswer:e=>{ne("onAnswer",e)},onLoad:e=>{ne("onLoad",e)}})}function Eo(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function ko(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function Ua(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),_o(o.value)&&!Ga(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function ja(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=_o(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Wa(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function qa(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Ha(e,t){const n=Ua(t);return Object.keys(t).forEach(o=>{const s=n[o],i=e.getAttribute(s.attribute),a=e[o];i!=null&&(s.value=s.parse?Co(i):i),a!=null&&(s.value=Array.isArray(a)?a.slice(0):a),s.reflect&&Oo(e,s.attribute,s.value,!!s.parse),Object.defineProperty(e,o,{get(){return s.value},set(l){const c=s.value;s.value=l,s.reflect&&Oo(this,s.attribute,s.value,!!s.parse);for(let d=0,u=this.__propertyChangedCallbacks.length;d<u;d++)this.__propertyChangedCallbacks[d](o,l,c)},enumerable:!0,configurable:!0})}),n}function Co(e){if(e)try{return JSON.parse(e)}catch{return e}}function Oo(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function Wa(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function _o(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Ga(e){return Object.prototype.toString.call(e)==="[object Function]"}function Ya(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Wn;function Xa(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Ha(this,t);const o=qa(this.props),s=this.Component,i=Wn;try{Wn=this,this.__initialized=!0,Ya(s)?new s(o,{element:this}):s(o,{element:this})}finally{Wn=i}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,s,i){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(i==null&&!this[o])return;this[o]=t[o].parse?Co(i):i}}lookupProp(o){if(t)return n.find(s=>o===s||o===t[s].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function Ja(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:s=window.customElements}=n;return i=>{let a=s.get(e);return a?(a.prototype.Component=i,a):(a=Xa(r,ja(t)),a.prototype.Component=i,a.prototype.registeredTag=e,s.define(e,a,o),a)}}const B={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Po(this.context.count)},getNextContextId(){return Po(this.context.count++)}};function Po(e){const t=String(e),n=t.length-1;return B.context.id+(n?String.fromCharCode(96+n):"")+t}function Za(e){B.context=e}const Qa=!1,el=(e,t)=>e===t,be=Symbol("solid-proxy"),Ao=typeof Proxy=="function",Gn=Symbol("solid-track"),Zt={equals:el};let To=Fo;const Ke=1,Qt=2,Lo={owned:null,cleanups:null,context:null,owner:null},Yn={};var q=null;let Xn=null,tl=null,W=null,ae=null,Be=null,en=0;function ze(e,t){const n=W,r=q,o=e.length===0,s=t===void 0?r:t,i=o?Lo:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=o?e:()=>e(()=>H(()=>Dt(i)));q=i,W=null;try{return Ve(a,!0)}finally{W=n,q=r}}function P(e,t){t=t?Object.assign({},Zt,t):Zt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ro(n,o));return[Io.bind(n),r]}function Do(e,t,n){const r=nn(e,t,!0,Ke);ft(r)}function oe(e,t,n){const r=nn(e,t,!1,Ke);ft(r)}function L(e,t,n){To=ll;const r=nn(e,t,!1,Ke);(!n||!n.render)&&(r.user=!0),Be?Be.push(r):ft(r)}function C(e,t,n){n=n?Object.assign({},Zt,n):Zt;const r=nn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ft(r),Io.bind(r)}function nl(e){return e&&typeof e=="object"&&"then"in e}function rl(e,t,n){let r,o,s;typeof t=="function"?(r=e,o=t,s={}):(r=!0,o=e,s=t||{});let i=null,a=Yn,l=null,c=!1,d="initialValue"in s,u=typeof r=="function"&&C(r);const h=new Set,[p,f]=(s.storage||P)(s.initialValue),[g,m]=P(void 0),[b,v]=P(void 0,{equals:!1}),[w,x]=P(d?"ready":"unresolved");B.context&&(l=B.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:B.load&&B.has(l)&&(a=B.load(l)));function O(_,R,D,I){return i===_&&(i=null,I!==void 0&&(d=!0),(_===a||R===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(I,{value:R})),a=Yn,k(R,D)),R}function k(_,R){Ve(()=>{R===void 0&&f(()=>_),x(R!==void 0?"errored":d?"ready":"unresolved"),m(R);for(const D of h.keys())D.decrement();h.clear()},!1)}function E(){const _=sl,R=p(),D=g();if(D!==void 0&&!i)throw D;return W&&W.user,R}function F(_=!0){if(_!==!1&&c)return;c=!1;const R=u?u():r;if(R==null||R===!1){O(i,H(p));return}const D=a!==Yn?a:H(()=>o(R,{value:p(),refetching:_}));return nl(D)?(i=D,"value"in D?(D.status==="success"?O(i,D.value,void 0,R):O(i,void 0,Qn(D.value),R),D):(c=!0,queueMicrotask(()=>c=!1),Ve(()=>{x(d?"refreshing":"pending"),v()},!1),D.then(I=>O(D,I,void 0,R),I=>O(D,void 0,Qn(I),R)))):(O(i,D,void 0,R),D)}return Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const _=w();return _==="pending"||_==="refreshing"}},latest:{get(){if(!d)return E();const _=g();if(_&&!i)throw _;return p()}}}),u?Do(()=>F(!1)):F(!1),[E,{refetch:F,mutate:f}]}function Ee(e){return Ve(e,!1)}function H(e){if(W===null)return e();const t=W;W=null;try{return e()}finally{W=t}}function et(e,t,n){const r=Array.isArray(e);let o,s=n&&n.defer;return i=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(s)return s=!1,i;const l=H(()=>t(a,o,i));return o=a,l}}function tn(e){L(()=>H(e))}function K(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Jn(){return W}function Mo(){return q}function ol(e,t){const n=q,r=W;q=e,W=null;try{return Ve(t,!0)}catch(o){er(o)}finally{q=n,W=r}}function ce(e,t){const n=Symbol("context");return{id:n,Provider:cl(n),defaultValue:e}}function he(e){let t;return q&&q.context&&(t=q.context[e.id])!==void 0?t:e.defaultValue}function Zn(e){const t=C(e),n=C(()=>tr(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let sl;function Io(){if(this.sources&&this.state)if(this.state===Ke)ft(this);else{const e=ae;ae=null,Ve(()=>on(this),!1),ae=e}if(W){const e=this.observers?this.observers.length:0;W.sources?(W.sources.push(this),W.sourceSlots.push(e)):(W.sources=[this],W.sourceSlots=[e]),this.observers?(this.observers.push(W),this.observerSlots.push(W.sources.length-1)):(this.observers=[W],this.observerSlots=[W.sources.length-1])}return this.value}function Ro(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ve(()=>{for(let o=0;o<e.observers.length;o+=1){const s=e.observers[o],i=Xn&&Xn.running;i&&Xn.disposed.has(s),(i?!s.tState:!s.state)&&(s.pure?ae.push(s):Be.push(s),s.observers&&$o(s)),i||(s.state=Ke)}if(ae.length>1e6)throw ae=[],new Error},!1)),t}function ft(e){if(!e.fn)return;Dt(e);const t=en;il(e,e.value,t)}function il(e,t,n){let r;const o=q,s=W;W=q=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=Ke,e.owned&&e.owned.forEach(Dt),e.owned=null),e.updatedAt=n+1,er(i)}finally{W=s,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ro(e,r):e.value=r,e.updatedAt=n)}function nn(e,t,n,r=Ke,o){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==Lo&&(q.owned?q.owned.push(s):q.owned=[s]),s}function rn(e){if(e.state===0)return;if(e.state===Qt)return on(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<en);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Ke)ft(e);else if(e.state===Qt){const r=ae;ae=null,Ve(()=>on(e,t[0]),!1),ae=r}}function Ve(e,t){if(ae)return e();let n=!1;t||(ae=[]),Be?n=!0:Be=[],en++;try{const r=e();return al(n),r}catch(r){n||(Be=null),ae=null,er(r)}}function al(e){if(ae&&(Fo(ae),ae=null),e)return;const t=Be;Be=null,t.length&&Ve(()=>To(t),!1)}function Fo(e){for(let t=0;t<e.length;t++)rn(e[t])}function ll(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rn(r)}if(B.context){if(B.count){B.effects||(B.effects=[]),B.effects.push(...e.slice(0,n));return}Za()}for(B.effects&&(B.done||!B.count)&&(e=[...B.effects,...e],n+=B.effects.length,delete B.effects),t=0;t<n;t++)rn(e[t])}function on(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Ke?r!==t&&(!r.updatedAt||r.updatedAt<en)&&rn(r):o===Qt&&on(r,t)}}}function $o(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Qt,n.pure?ae.push(n):Be.push(n),n.observers&&$o(n))}}function Dt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const s=o.pop(),i=n.observerSlots.pop();r<o.length&&(s.sourceSlots[i]=r,o[r]=s,n.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dt(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Qn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function er(e,t=q){throw Qn(e)}function tr(e){if(typeof e=="function"&&!e.length)return tr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=tr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function cl(e,t){return function(r){let o;return oe(()=>o=H(()=>(q.context={...q.context,[e]:r.value},Zn(()=>r.children))),void 0),o}}const ul=Symbol("fallback");function No(e){for(let t=0;t<e.length;t++)e[t]()}function dl(e,t,n={}){let r=[],o=[],s=[],i=0,a=t.length>1?[]:null;return K(()=>No(s)),()=>{let l=e()||[],c=l.length,d,u;return l[Gn],H(()=>{let p,f,g,m,b,v,w,x,O;if(c===0)i!==0&&(No(s),s=[],r=[],o=[],i=0,a&&(a=[])),n.fallback&&(r=[ul],o[0]=ze(k=>(s[0]=k,n.fallback())),i=1);else if(i===0){for(o=new Array(c),u=0;u<c;u++)r[u]=l[u],o[u]=ze(h);i=c}else{for(g=new Array(c),m=new Array(c),a&&(b=new Array(c)),v=0,w=Math.min(i,c);v<w&&r[v]===l[v];v++);for(w=i-1,x=c-1;w>=v&&x>=v&&r[w]===l[x];w--,x--)g[x]=o[w],m[x]=s[w],a&&(b[x]=a[w]);for(p=new Map,f=new Array(x+1),u=x;u>=v;u--)O=l[u],d=p.get(O),f[u]=d===void 0?-1:d,p.set(O,u);for(d=v;d<=w;d++)O=r[d],u=p.get(O),u!==void 0&&u!==-1?(g[u]=o[d],m[u]=s[d],a&&(b[u]=a[d]),u=f[u],p.set(O,u)):s[d]();for(u=v;u<c;u++)u in g?(o[u]=g[u],s[u]=m[u],a&&(a[u]=b[u],a[u](u))):o[u]=ze(h);o=o.slice(0,i=c),r=l.slice(0)}return o});function h(p){if(s[u]=p,a){const[f,g]=P(u);return a[u]=g,t(l[u],f)}return t(l[u])}}}function y(e,t){return H(()=>e(t||{}))}function sn(){return!0}const nr={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return t===be?!0:e.has(t)},set:sn,deleteProperty:sn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:sn,deleteProperty:sn}},ownKeys(e){return e.keys()}};function rr(e){return(e=typeof e=="function"?e():e)?e:{}}function fl(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function T(...e){let t=!1;for(let i=0;i<e.length;i++){const a=e[i];t=t||!!a&&be in a,e[i]=typeof a=="function"?(t=!0,C(a)):a}if(Ao&&t)return new Proxy({get(i){for(let a=e.length-1;a>=0;a--){const l=rr(e[a])[i];if(l!==void 0)return l}},has(i){for(let a=e.length-1;a>=0;a--)if(i in rr(e[a]))return!0;return!1},keys(){const i=[];for(let a=0;a<e.length;a++)i.push(...Object.keys(rr(e[a])));return[...new Set(i)]}},nr);const n={},r=Object.create(null);for(let i=e.length-1;i>=0;i--){const a=e[i];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!r[d])r[d]=u.get?{enumerable:!0,configurable:!0,get:fl.bind(n[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const h=n[d];h&&(u.get?h.push(u.get.bind(a)):u.value!==void 0&&h.push(()=>u.value))}}}const o={},s=Object.keys(r);for(let i=s.length-1;i>=0;i--){const a=s[i],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function j(e,...t){if(Ao&&be in e){const o=new Set(t.length>1?t.flat():t[0]),s=t.map(i=>new Proxy({get(a){return i.includes(a)?e[a]:void 0},has(a){return i.includes(a)&&a in e},keys(){return i.filter(a=>a in e)}},nr));return s.push(new Proxy({get(i){return o.has(i)?void 0:e[i]},has(i){return o.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!o.has(i))}},nr)),s}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,o),i=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,i?r[l][o]=s.value:Object.defineProperty(r[l],o,s)),++l;a||(i?n[o]=s.value:Object.defineProperty(n,o,s))}return[...r,n]}let hl=0;function Te(){return B.context?B.getNextContextId():`cl-${hl++}`}const Ko=e=>`Stale read from <${e}>.`;function ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return C(dl(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(o,s)=>!o==!s});return C(()=>{const o=r();if(o){const s=e.children;return typeof s=="function"&&s.length>0?H(()=>s(t?o:()=>{if(!H(r))throw Ko("Show");return n()})):s}return e.fallback},void 0,void 0)}function Bo(e){const t=Zn(()=>e.children),n=C(()=>{const r=t(),o=Array.isArray(r)?r:[r];let s=()=>{};for(let i=0;i<o.length;i++){const a=i,l=o[i],c=s,d=C(()=>c()?void 0:l.when,void 0,void 0),u=l.keyed?d:C(d,void 0,{equals:(h,p)=>!h==!p});s=()=>c()||(u()?[a,d,l]:void 0)}return s});return C(()=>{const r=n()();if(!r)return e.fallback;const[o,s,i]=r,a=i.children;return typeof a=="function"&&a.length>0?H(()=>a(i.keyed?s():()=>{if(H(n)()?.[0]!==o)throw Ko("Match");return s()})):a},void 0,void 0)}function Mt(e){return e}const gl=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],pl=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...gl]),ml=new Set(["innerHTML","textContent","innerText","children"]),yl=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),bl=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function vl(e,t){const n=bl[e];return typeof n=="object"?n[t]?n.$:void 0:n}const wl=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xl=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Sl={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function El(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,l=t[o-1].nextSibling,c=null;for(;i<o||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===i){const d=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],d)}else if(s===a)for(;i<o;)(!c||!c.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],d),t[o]=n[s]}else{if(!c){c=new Map;let u=a;for(;u<s;)c.set(n[u],u++)}const d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let u=i,h=1,p;for(;++u<o&&u<s&&!((p=c.get(t[u]))==null||p!==d+h);)h++;if(h>d-a){const f=t[i];for(;a<d;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const zo="_$DX_DELEGATE";function M(e,t,n,r){let o;const s=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},i=()=>(o||(o=s())).cloneNode(!0);return i.cloneNode=i,i}function kl(e,t=window.document){const n=t[zo]||(t[zo]=new Set);for(let r=0,o=e.length;r<o;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,Dl))}}function ue(e,t,n){nt(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Cl(e,t,n,r){nt(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ol(e,t,n){nt(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function gt(e,t){nt(e)||(t==null?e.removeAttribute("class"):e.className=t)}function _l(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Pl(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let s,i;for(s=0,i=o.length;s<i;s++){const a=o[s];!a||a==="undefined"||t[a]||(Vo(e,a,!1),delete n[a])}for(s=0,i=r.length;s<i;s++){const a=r[s],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Vo(e,a,!0),n[a]=l)}return n}function an(e,t,n){if(!t)return n?ue(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function tt(e,t={},n,r){const o={};return r||oe(()=>o.children=It(e,t.children,o.children)),oe(()=>typeof t.ref=="function"&&or(t.ref,e)),oe(()=>Al(e,t,n,!0,o,!0)),o}function or(e,t,n){return H(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return It(e,t,r,n);oe(o=>It(e,t(),o,n),r)}function Al(e,t,n,r,o={},s=!1){t||(t={});for(const i in o)if(!(i in t)){if(i==="children")continue;o[i]=Uo(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=Uo(e,i,a,o[i],n,s,t)}}function Tl(e){let t,n;return!nt()||!(t=B.registry.get(n=Ml()))?e():(B.completed&&B.completed.add(t),B.registry.delete(n),t)}function nt(e){return!!B.context&&!B.done&&(!e||e.isConnected)}function Ll(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Vo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,s=r.length;o<s;o++)e.classList.toggle(r[o],n)}function Uo(e,t,n,r,o,s,i){let a,l,c,d,u;if(t==="style")return an(e,n,r);if(t==="classList")return Pl(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r,typeof r!="function"&&r),n&&e.addEventListener(h,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),p=wl.has(h);if(!p&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(p||n)&&(_l(e,h,n,p),p&&kl([h]))}else if(t.slice(0,5)==="attr:")ue(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Ol(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(c=ml.has(t))||!o&&((d=vl(t,e.tagName))||(l=pl.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(u)t=t.slice(5),l=!0;else if(nt(e))return n;t==="class"||t==="className"?gt(e,n):a&&!l&&!c?e[Ll(t)]=n:e[d||t]=n}else{const h=o&&t.indexOf(":")>-1&&Sl[t.split(":")[0]];h?Cl(e,h,t,n):ue(e,yl[t]||t,n)}return n}function Dl(e){if(B.registry&&B.events&&B.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),i=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),B.registry&&!B.done&&(B.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!i());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function It(e,t,n,r,o){const s=nt(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const d=n[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(s||i==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=pt(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(s)return n;n=pt(e,n,r)}else{if(i==="function")return oe(()=>{let l=t();for(;typeof l=="function";)l=l();n=It(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(sr(l,t,n,o))return oe(()=>n=It(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let d=l[0];if(d.parentNode!==e)return n;const u=[d];for(;(d=d.nextSibling)!==r;)u.push(d);return n=u}if(l.length===0){if(n=pt(e,n,r),a)return n}else c?n.length===0?jo(e,l,r):El(e,n,l):(n&&pt(e),jo(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=pt(e,n,r,t);pt(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function sr(e,t,n,r){let o=!1;for(let s=0,i=t.length;s<i;s++){let a=t[s],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=sr(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=sr(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function jo(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function pt(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const l=a.parentNode===e;!s&&!i?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function Ml(){return B.getNextContextId()}const Il=!1,Rl="http://www.w3.org/2000/svg";function qo(e,t=!1){return t?document.createElementNS(Rl,e):document.createElement(e)}function Ho(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Mo();let s,i=!!B.context;return L(()=>{i&&(Mo().user=i=!1),s||(s=ol(o,()=>C(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),d=()=>c(!0);ze(u=>A(a,()=>l()?u():s(),null)),K(d)}else{const l=qo(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,s),a.appendChild(l),e.ref&&e.ref(l),K(()=>a.removeChild(l))}},void 0,{render:!i}),n}function Fl(e,t){const n=C(e);return C(()=>{const r=n();switch(typeof r){case"function":return H(()=>r(t));case"string":const o=xl.has(r),s=B.context?Tl():qo(r,o);return tt(s,t,o),s}})}function ln(e){const[,t]=j(e,["component"]);return Fl(()=>e.component,t)}function $l(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,s]=P(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(i){s(()=>i)}})}return n}function Nl(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Kl(e){return(t,n)=>{const{element:r}=n;return ze(o=>{const s=$l(t);r.addPropertyChangedCallback((a,l)=>s[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const i=e(s,n);return A(r.renderRoot,i)},Nl(r))}}function Bl(e,t,n){return arguments.length===2&&(n=t,t={}),Ja(e,t)(Kl(n))}const zl='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-full{width:100%;height:100%}.h-10{height:40px}.h-11{height:44px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-16{min-height:64px}.w-11\\/12{width:91.666667%}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-4{padding-top:16px;padding-bottom:16px}.py-6{padding-top:24px;padding-bottom:24px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-7{padding-bottom:28px}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media (max-width: 640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Wo,ir]=P(!1),Go=[],Vl=e=>Go.push(e),Yo=()=>{Go.forEach(e=>e())},Ul=()=>{const e=!Wo();ir(e),ee("onToggle"),ee(e?"onOpen":"onClose"),Yo()},jl=()=>{ir(!1),ee("onClose")},ql=()=>{ir(!0),ee("onOpen"),Yo()},Xo=()=>({bubble:Wo,show:ql,hide:jl,toggle:Ul,onOpen:Vl}),ar=Symbol("store-raw"),mt=Symbol("store-node"),Ue=Symbol("store-has"),Jo=Symbol("store-self");function Zo(e){let t=e[be];if(!t&&(Object.defineProperty(e,be,{value:t=new Proxy(e,Gl)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,s=n.length;o<s;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function cn(e){let t;return e!=null&&typeof e=="object"&&(e[be]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Rt(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[ar])return n;if(!cn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,a=e.length;i<a;i++)o=e[i],(r=Rt(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=i.length;l<c;l++)s=i[l],!a[s].get&&(o=e[s],(r=Rt(o,t))!==o&&(e[s]=r))}return e}function un(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Ft(e,t,n){if(e[t])return e[t];const[r,o]=P(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Hl(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===be||t===mt||(delete n.value,delete n.writable,n.get=()=>e[be][t]),n}function Qo(e){Jn()&&Ft(un(e,mt),Jo)()}function Wl(e){return Qo(e),Reflect.ownKeys(e)}const Gl={get(e,t,n){if(t===ar)return e;if(t===be)return n;if(t===Gn)return Qo(e),n;const r=un(e,mt),o=r[t];let s=o?o():e[t];if(t===mt||t===Ue||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);Jn()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=Ft(r,t,s)())}return cn(s)?Zo(s):s},has(e,t){return t===ar||t===be||t===Gn||t===mt||t===Ue||t==="__proto__"?!0:(Jn()&&Ft(un(e,Ue),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Wl,getOwnPropertyDescriptor:Hl};function dn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],s=e.length;n===void 0?(delete e[t],e[Ue]&&e[Ue][t]&&o!==void 0&&e[Ue][t].$()):(e[t]=n,e[Ue]&&e[Ue][t]&&o===void 0&&e[Ue][t].$());let i=un(e,mt),a;if((a=Ft(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let l=e.length;l<s;l++)(a=i[l])&&a.$();(a=Ft(i,"length",s))&&a.$(e.length)}(a=i[Jo])&&a.$()}function es(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];dn(e,o,t[o])}}function Yl(e,t){if(typeof t=="function"&&(t=t(e)),t=Rt(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&dn(e,n,o)}dn(e,"length",r)}else es(e,t)}function $t(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)$t(e,[r[l]].concat(t),n);return}else if(a&&i==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&$t(e,[l].concat(t),n);return}else if(a&&i==="object"){const{from:l=0,to:c=e.length-1,by:d=1}=r;for(let u=l;u<=c;u+=d)$t(e,[u].concat(t),n);return}else if(t.length>1){$t(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(o,n),s===o)||r===void 0&&s==null||(s=Rt(s),r===void 0||cn(o)&&cn(s)&&!Array.isArray(s)?es(o,s):dn(e,r,s))}function Xl(...[e,t]){const n=Rt(e||{}),r=Array.isArray(n),o=Zo(n);function s(...i){Ee(()=>{r&&i.length===1?Yl(n,i[0]):$t(n,i)})}return[o,s]}function ts(e,t,n){return ze(()=>{const r=ko(e),[o,s]=Xl(r?JSON.parse(r):t);return L(()=>Eo(e,JSON.stringify(o),n)),[o,s]})}function Jl(e,t,n){return ze(()=>{const r=ko(e),[o,s]=P(r?JSON.parse(r):t);return L(()=>Eo(e,JSON.stringify(o()),n)),[o,s]})}const[hm,gm]=Jl("lang","en");function Zl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function Ql(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const ec=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Jt}/v1/widget/${n}`,{result:s}=await(await fetch(o,{credentials:"include"})).json();if(s.type==="flow")return Zl(s);if(s.type==="entity")return Ql(s);if(s.type==="chat"&&r.includes("showSettings")&&(s.showSettings=!0),(r.includes("right")||r.includes("left"))&&(s.style.position=r.includes("right")?"right":"left"),r.some(i=>i.includes("margin"))){const i=r.find(a=>a.includes("margin"));i&&(s.style.margin=Number(i.split("=")[1]??"5"))}if(r.some(i=>i.includes("mode"))){const i=r.find(a=>a.includes("mode"))?.split("=")[1];(i==="popup"||i==="static"||i==="standard")&&(s.mode=i)}return ne("registerContactData",i=>{i&&Object.keys(i).length&&fetch(`${Jt}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).catch(console.error)}),s._id=n,s},[ns,tc]=P(""),[rt]=ze(()=>rl(ns,ec)),nc=()=>{if(rt()?.type==="chat")return rt()},rc=()=>{if(rt()?.type==="form")return rt()};ze(()=>L(()=>{$a(rt()),rt()&&ee("onLoad")}));const se=()=>({widgetId:ns,setWidgetId:tc,widget:rt,chatWidget:nc,formWidget:rc}),rs=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,os=go,oc=(e,t)=>n=>{var r;if(t?.variants==null)return os(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n?.[c],u=s?.[c];if(d===null)return null;const h=rs(d)||rs(u);return o[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,h]=d;return h===void 0||(c[u]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:h,...p}=d;return Object.entries(p).every(f=>{let[g,m]=f;return Array.isArray(m)?m.includes({...s,...a}[g]):{...s,...a}[g]===m})?[...c,u,h]:c},[]);return os(e,i,l,n?.class,n?.className)};var sc=M("<button>");const ic=oc("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ke=e=>{const[,t]=j(e,["variant","size","class"]);return(()=>{var n=sc();return tt(n,T({get class(){return Ge(ic({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var ac=M('<img alt="widget logo">');const ss=e=>{const[,t]=j(e,["class","src"]);return(()=>{var n=ac();return tt(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return Ge("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var lc=M('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const cc=()=>{const{chatWidget:e}=se(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=lc(),o=r.firstChild,s=o.firstChild,i=s.nextSibling;return A(r,y(ss,{get src(){return e()?.avatar}}),o),A(s,t),A(i,n),r})()};var uc=M("<svg stroke-width=0>");function ve(e,t){const n=T(e.a,t),[r,o]=j(n,["src"]),[s,i]=P(""),a=C(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return L(()=>i(a())),K(()=>{i("")}),(()=>{var l=uc();return tt(l,T({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return s()}}),!0,!0),A(l,()=>Il),l})()}function dc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function fc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function hc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function gc(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}const lr={equals:!1};function is(e){return(...t)=>{for(const n of e)n&&n(...t)}}function pc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const S=e=>typeof e=="function"&&!e.length?e():e,as=e=>Array.isArray(e)?e:e?[e]:[];function mc(e,...t){return typeof e=="function"?e(...t):e}const yc=K;function bc(e,t,n,r){return e.addEventListener(t,n,r),yc(e.removeEventListener.bind(e,t,n,r))}function vc(e,t,n,r){const o=()=>{as(S(e)).forEach(s=>{s&&as(S(t)).forEach(i=>bc(s,i,n,r))})};typeof e=="function"?L(o):oe(o)}function fn(){return!0}const wc={get(e,t,n){return t===be?n:e.get(t)},has(e,t){return e.has(t)},set:fn,deleteProperty:fn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:fn,deleteProperty:fn}},ownKeys(e){return e.keys()}},xc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ls(e){const t={};let n;for(;n=xc.exec(e);)t[n[1]]=n[2];return t}function Sc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ls(e)}else typeof t=="string"&&(t=ls(t));return{...e,...t}}const cr=(e,t,n)=>{let r;for(const o of e){const s=S(o)[t];r?s&&(r=n(r,s)):r=s}return r};function Ec(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?pc:is,o={};for(const i of n){const a=S(i);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],d=l.toLowerCase(),u=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;u?o[d]?o[d].push(u):o[d]=[u]:delete o[d]}}const s=T(...n);return new Proxy({get(i){if(typeof i!="string")return Reflect.get(s,i);if(i==="style")return cr(n,"style",Sc);if(i==="ref"){const a=[];for(const l of n){const c=S(l)[i];typeof c=="function"&&a.push(c)}return r(a)}if(i[0]==="o"&&i[1]==="n"&&i[2]){const a=o[i.toLowerCase()];return a?r(a):Reflect.get(s,i)}return i==="class"||i==="className"?cr(n,i,(a,l)=>`${a} ${l}`):i==="classList"?cr(n,i,(a,l)=>({...a,...l})):Reflect.get(s,i)},has(i){return Reflect.has(s,i)},keys(){return Object.keys(s)}},wc)}function ot(...e){return is(e)}function kc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ur(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Cc(e){return typeof e=="number"}function Oc(e){return Array.isArray(e)}function yt(e){return Object.prototype.toString.call(e)==="[object String]"}function _c(e){return typeof e=="function"}function cs(e){return t=>`${e()}-${t}`}function Le(e,t){return e?e===t||e.contains(t):!1}function Nt(e,t=!1){const{activeElement:n}=je(e);if(!n?.nodeName)return null;if(us(n)&&n.contentDocument)return Nt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function je(e){return e?e.ownerDocument||e:document}function us(e){return e.tagName==="IFRAME"}var ds=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ds||{});function dr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function hn(){return dr(/^Mac/i)}function Pc(){return dr(/^iPhone/i)}function Ac(){return dr(/^iPad/i)||hn()&&navigator.maxTouchPoints>1}function Tc(){return Pc()||Ac()}function Lc(){return hn()||Tc()}function ge(e,t){return t&&(_c(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function we(e){return t=>{for(const n of e)ge(t,n)}}function Dc(e){return hn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function de(e){if(e)if(Mc())e.focus({preventScroll:!0});else{const t=Ic(e);e.focus(),Rc(t)}}var gn=null;function Mc(){if(gn==null){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch{}}return gn}function Ic(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Rc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fs=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Fc=[...fs,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fr=`${fs.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,$c=Fc.join(':not([hidden]):not([tabindex="-1"]),');function hs(e,t){const r=Array.from(e.querySelectorAll(fr)).filter(gs);return t&&gs(e)&&r.unshift(e),r.forEach((o,s)=>{if(us(o)&&o.contentDocument){const i=o.contentDocument.body,a=hs(i,!1);r.splice(s,1,...a)}}),r}function gs(e){return ps(e)&&!Nc(e)}function ps(e){return e.matches(fr)&&hr(e)}function Nc(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function hr(e,t){return e.nodeName!=="#comment"&&Kc(e)&&Bc(e,t)&&(!e.parentElement||hr(e.parentElement,e))}function Kc(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:s,visibility:i}=o(e);r=s!=="none"&&i!=="hidden"&&i!=="collapse"}return r}function Bc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function zc(e,t,n){const r=t?.tabbable?$c:fr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return t?.from?.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&hr(s)&&(!t?.accept||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function ms(e){let t=e;for(;t&&!Vc(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Vc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Uc(){}function jc(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=s,a=0,l=i-1;a<i;l=a++){const[c,d]=t[a],[u,h]=t[l],[,p]=t[l===0?i-1:l-1]||[0,0],f=(d-h)*(n-c)-(c-u)*(r-d);if(h<d){if(r>=h&&r<d){if(f===0)return!0;f>0&&(r===h?r>p&&(o=!o):o=!o)}}else if(d<h){if(r>d&&r<=h){if(f===0)return!0;f<0&&(r===h?r<p&&(o=!o):o=!o)}}else if(r===d&&(n>=u&&n<=c||n>=c&&n<=u))return!0}return o}function De(e,t){return T(e,t)}var Kt=new Map,ys=new Set;function bs(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Kt.get(n.target);r||(r=new Set,Kt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Kt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Kt.delete(n.target)),Kt.size===0)){for(const o of ys)o();ys.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?bs():document.addEventListener("DOMContentLoaded",bs));function gr(e,t){const n=vs(e,t,"left"),r=vs(e,t,"top"),o=t.offsetWidth,s=t.offsetHeight;let i=e.scrollLeft,a=e.scrollTop;const l=i+e.offsetWidth,c=a+e.offsetHeight;n<=i?i=n:n+o>l&&(i+=n+o-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=i,e.scrollTop=a}function vs(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function qc(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=ms(e);for(;e&&o&&e!==n&&o!==n;)gr(o,e),e=o,o=ms(e)}else{const{left:o,top:s}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:i,top:a}=e.getBoundingClientRect();(Math.abs(o-i)>1||Math.abs(s-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Hc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function pr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",d=yt(c)?l[c]:c(l);return d!=null?String(d):""},i=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(yt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return yt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(yt(l)||Cc(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:i(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const d=pr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...d),t+=d.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:s(l),disabled:i(l),level:n,index:t}),t++}return r}/*!
|
|
2
2
|
* Portions of this file are based on code from react-spectrum.
|
|
3
3
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Credits to the Chakra UI team:
|
|
18
18
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/dismissable/src/layer-stack.ts
|
|
19
|
-
*/const pn="data-kb-top-layer";let xs,yr=!1;const qe=[];function Bt(e){return qe.findIndex(t=>t.node===e)}function Jc(e){return qe[Bt(e)]}function Zc(e){return qe[qe.length-1].node===e}function Ss(){return qe.filter(e=>e.isPointerBlocking)}function Qc(){return[...Ss()].slice(-1)[0]}function br(){return Ss().length>0}function Es(e){const t=Bt(Qc()?.node);return Bt(e)<t}function eu(e){qe.push(e)}function tu(e){const t=Bt(e);t<0||qe.splice(t,1)}function nu(){for(const{node:e}of qe)e.style.pointerEvents=Es(e)?"none":"auto"}function ru(e){if(br()&&!yr){const t=je(e);xs=document.body.style.pointerEvents,t.body.style.pointerEvents="none",yr=!0}}function ou(e){if(br())return;const t=je(e);t.body.style.pointerEvents=xs,t.body.style.length===0&&t.body.removeAttribute("style"),yr=!1}const
|
|
19
|
+
*/const pn="data-kb-top-layer";let xs,yr=!1;const qe=[];function Bt(e){return qe.findIndex(t=>t.node===e)}function Jc(e){return qe[Bt(e)]}function Zc(e){return qe[qe.length-1].node===e}function Ss(){return qe.filter(e=>e.isPointerBlocking)}function Qc(){return[...Ss()].slice(-1)[0]}function br(){return Ss().length>0}function Es(e){const t=Bt(Qc()?.node);return Bt(e)<t}function eu(e){qe.push(e)}function tu(e){const t=Bt(e);t<0||qe.splice(t,1)}function nu(){for(const{node:e}of qe)e.style.pointerEvents=Es(e)?"none":"auto"}function ru(e){if(br()&&!yr){const t=je(e);xs=document.body.style.pointerEvents,t.body.style.pointerEvents="none",yr=!0}}function ou(e){if(br())return;const t=je(e);t.body.style.pointerEvents=xs,t.body.style.length===0&&t.body.removeAttribute("style"),yr=!1}const pe={layers:qe,isTopMostLayer:Zc,hasPointerBlockingLayer:br,isBelowPointerBlockingLayer:Es,addLayer:eu,removeLayer:tu,indexOf:Bt,find:Jc,assignPointerEventToLayers:nu,disableBodyPointerEvents:ru,restoreBodyPointerEvents:ou};/*!
|
|
20
20
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
21
21
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
22
22
|
*
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
*
|
|
117
117
|
* Credits to the React Spectrum team:
|
|
118
118
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
|
|
119
|
-
*/function _u(e,t,n){const o=T({selectOnFocus:()=>S(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:i}=Sr();let a={top:0,left:0};vc(()=>S(o.isVirtualized)?void 0:s(),"scroll",()=>{const g=s();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=ku({isDisabled:()=>S(o.disallowTypeAhead),keyboardDelegate:()=>S(o.keyboardDelegate),selectionManager:()=>S(o.selectionManager)}),c=g=>{
|
|
119
|
+
*/function _u(e,t,n){const o=T({selectOnFocus:()=>S(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:i}=Sr();let a={top:0,left:0};vc(()=>S(o.isVirtualized)?void 0:s(),"scroll",()=>{const g=s();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=ku({isDisabled:()=>S(o.disallowTypeAhead),keyboardDelegate:()=>S(o.keyboardDelegate),selectionManager:()=>S(o.selectionManager)}),c=g=>{ge(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const m=t();if(!m?.contains(g.target))return;const b=S(o.selectionManager),v=S(o.selectOnFocus),w=E=>{E!=null&&(b.setFocusedKey(E),g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&!Ms(g)&&b.replaceSelection(E))},x=S(o.keyboardDelegate),O=S(o.shouldFocusWrap),k=b.focusedKey();switch(g.key){case"ArrowDown":{if(x.getKeyBelow){g.preventDefault();let E;k!=null?E=x.getKeyBelow(k):E=x.getFirstKey?.(),E==null&&O&&(E=x.getFirstKey?.(k)),w(E)}break}case"ArrowUp":{if(x.getKeyAbove){g.preventDefault();let E;k!=null?E=x.getKeyAbove(k):E=x.getLastKey?.(),E==null&&O&&(E=x.getLastKey?.(k)),w(E)}break}case"ArrowLeft":{if(x.getKeyLeftOf){g.preventDefault();const E=i()==="rtl";let F;k!=null?F=x.getKeyLeftOf(k):F=E?x.getFirstKey?.():x.getLastKey?.(),w(F)}break}case"ArrowRight":{if(x.getKeyRightOf){g.preventDefault();const E=i()==="rtl";let F;k!=null?F=x.getKeyRightOf(k):F=E?x.getLastKey?.():x.getFirstKey?.(),w(F)}break}case"Home":if(x.getFirstKey){g.preventDefault();const E=x.getFirstKey(k,bt(g));E!=null&&(b.setFocusedKey(E),bt(g)&&g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&b.replaceSelection(E))}break;case"End":if(x.getLastKey){g.preventDefault();const E=x.getLastKey(k,bt(g));E!=null&&(b.setFocusedKey(E),bt(g)&&g.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(E):v&&b.replaceSelection(E))}break;case"PageDown":if(x.getKeyPageBelow&&k!=null){g.preventDefault();const E=x.getKeyPageBelow(k);w(E)}break;case"PageUp":if(x.getKeyPageAbove&&k!=null){g.preventDefault();const E=x.getKeyPageAbove(k);w(E)}break;case"a":bt(g)&&b.selectionMode()==="multiple"&&S(o.disallowSelectAll)!==!0&&(g.preventDefault(),b.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),S(o.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!S(o.allowsTabNavigation)){if(g.shiftKey)m.focus();else{const E=zc(m,{tabbable:!0});let F,_;do _=E.lastChild(),_&&(F=_);while(_);F&&!F.contains(document.activeElement)&&de(F)}break}}},d=g=>{const m=S(o.selectionManager),b=S(o.keyboardDelegate),v=S(o.selectOnFocus);if(m.isFocused()){g.currentTarget.contains(g.target)||m.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(m.setFocused(!0),m.focusedKey()==null){const w=O=>{O!=null&&(m.setFocusedKey(O),v&&m.replaceSelection(O))},x=g.relatedTarget;x&&g.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?w(m.lastSelectedKey()??b.getLastKey?.()):w(m.firstSelectedKey()??b.getFirstKey?.())}else if(!S(o.isVirtualized)){const w=s();if(w){w.scrollTop=a.top,w.scrollLeft=a.left;const x=w.querySelector(`[data-key="${m.focusedKey()}"]`);x&&(de(x),gr(w,x))}}}},u=g=>{const m=S(o.selectionManager);g.currentTarget.contains(g.relatedTarget)||m.setFocused(!1)},h=g=>{s()===g.target&&g.preventDefault()},p=()=>{const g=S(o.autoFocus);if(!g)return;const m=S(o.selectionManager),b=S(o.keyboardDelegate);let v;g==="first"&&(v=b.getFirstKey?.()),g==="last"&&(v=b.getLastKey?.());const w=m.selectedKeys();w.size&&(v=w.values().next().value),m.setFocused(!0),m.setFocusedKey(v);const x=t();x&&v==null&&!S(o.shouldUseVirtualFocus)&&de(x)};return tn(()=>{o.deferAutoFocus?setTimeout(p,0):p()}),L(et([s,()=>S(o.isVirtualized),()=>S(o.selectionManager).focusedKey()],g=>{const[m,b,v]=g;if(b)v&&o.scrollToKey?.(v);else if(v&&m){const w=m.querySelector(`[data-key="${v}"]`);w&&gr(m,w)}})),{tabIndex:C(()=>{if(!S(o.shouldUseVirtualFocus))return S(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:u}}/*!
|
|
120
120
|
* Portions of this file are based on code from react-spectrum.
|
|
121
121
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
122
122
|
*
|
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
|
|
173
173
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
174
174
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
|
|
175
|
-
*/function Vu(e={}){const[t,n]=Yc({value:()=>S(e.items),onChange:s=>e.onItemsChange?.(s)});zu(t,n);const r=s=>(n(i=>{const a=$u(i,s);return kc(i,s,a)}),()=>{n(i=>{const a=i.filter(l=>l.ref()!==s.ref());return i.length===a.length?i:a})});return{DomCollectionProvider:s=>y(Fs.Provider,{value:{registerItem:r},get children(){return s.children}})}}function Uu(e){const t=Fu(),n=De({shouldRegisterItem:!0},e);L(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());K(r)})}var J=e=>typeof e=="function"?e():e,kr=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Cr=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},vn=new Map,ju=e=>{L(()=>{const t=J(e.style)??{},n=J(e.properties)??[],r={};for(const s in t)r[s]=e.element.style[s];const o=vn.get(e.key);o?o.activeCount++:vn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(e.element.style,e.style);for(const s of n)e.element.style.setProperty(s.key,s.value);K(()=>{const s=vn.get(e.key);if(s){if(s.activeCount!==1){s.activeCount--;return}vn.delete(e.key);for(const[i,a]of Object.entries(s.originalStyles))e.element.style[i]=a;for(const i of s.properties)e.element.style.removeProperty(i);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Bs=ju,qu=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Hu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Wu=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,s=0,i=0,a=!1;do{const[l,c,d]=qu(o,t),u=d-l-r*c;(c!==0||u!==0)&&Hu(o,t)&&(s+=u,i+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[s,i]},[zs,Vs]=P([]),Gu=e=>zs().indexOf(e)===zs().length-1,Yu=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Te();let r=[0,0],o=null,s=null;L(()=>{J(t.enabled)&&(Vs(c=>[...c,n]),K(()=>{Vs(c=>c.filter(d=>d!==n))}))}),L(()=>{if(!J(t.enabled)||!J(t.hideScrollbar))return;const{body:c}=document,d=window.innerWidth-c.offsetWidth;if(J(t.preventScrollbarShift)){const u={overflow:"hidden"},h=[];d>0&&(J(t.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${d}px)`,h.push({key:"--scrollbar-width",value:`${d}px`}));const p=window.scrollY,f=window.scrollX;Bs({key:"prevent-scroll",element:c,style:u,properties:h,cleanup:()=>{J(t.restoreScrollPosition)&&d>0&&window.scrollTo(f,p)}})}else Bs({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),L(()=>{!Gu(n)||!J(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",i,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),K(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",i),document.removeEventListener("touchmove",l)}))});const i=c=>{r=Us(c),o=null,s=null},a=c=>{const d=c.target,u=J(t.element),h=Xu(c),p=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=p==="x"?h[0]:h[1],g=js(d,p,f,u);let m;u&&Cr(u,d)?m=!g:m=!0,m&&c.cancelable&&c.preventDefault()},l=c=>{const d=J(t.element),u=c.target;let h;if(c.touches.length===2)h=!J(t.allowPinchZoom);else{if(o==null||s===null){const p=Us(c).map((g,m)=>r[m]-g),f=Math.abs(p[0])>Math.abs(p[1])?"x":"y";o=f,s=f==="x"?p[0]:p[1]}if(u.type==="range")h=!1;else{const p=js(u,o,s,d);d&&Cr(d,u)?h=!p:h=!0}}h&&c.cancelable&&c.preventDefault()}},Xu=e=>[e.deltaX,e.deltaY],Us=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],js=(e,t,n,r)=>{const o=r!==null&&Cr(r,e),[s,i]=Wu(e,t,o?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(i)<1)},Ju=Yu,qs=Ju;const Hs=ce();function Zu(){return he(Hs)}function Qu(e){let t;const n=Zu(),[r,o]=j(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),i=u=>{s.add(u);const h=n?.registerNestedLayer(u);return()=>{s.delete(u),h?.()}};cu({shouldExcludeElement:u=>t?r.excludedElements?.some(h=>Le(h(),u))||[...s].some(h=>Le(h,u)):!1,onPointerDownOutside:u=>{!t||me.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!me.isTopMostLayer(t)||(r.onPointerDownOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.())},onFocusOutside:u=>{r.onFocusOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.()}},()=>t),Xc({ownerDocument:()=>je(t),onEscapeKeyDown:u=>{!t||!me.isTopMostLayer(t)||(r.onEscapeKeyDown?.(u),!u.defaultPrevented&&r.onDismiss&&(u.preventDefault(),r.onDismiss()))}}),tn(()=>{if(!t)return;me.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const u=n?.registerNestedLayer(t);me.assignPointerEventToLayers(),me.disableBodyPointerEvents(t),K(()=>{t&&(me.removeLayer(t),u?.(),me.assignPointerEventToLayers(),me.restoreBodyPointerEvents(t))})}),L(et([()=>t,()=>r.disableOutsidePointerEvents],([u,h])=>{if(!u)return;const p=me.find(u);p&&p.isPointerBlocking!==h&&(p.isPointerBlocking=h,me.assignPointerEventToLayers()),h&&me.disableBodyPointerEvents(u),K(()=>{me.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:i};return y(Hs.Provider,{value:d,get children(){return y(bn,T({as:"div",ref(u){var h=ot(p=>t=p,r.ref);typeof h=="function"&&h(u)}},o))}})}const Ws=ce();function ed(){const e=he(Ws);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function td(e){const t=ed(),[n,r]=j(e,["ref","style"]);return y(bn,T({as:"div",ref(o){var s=ot(t.setPositionerRef,n.ref);typeof s=="function"&&s(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const nd=["top","right","bottom","left"],Ye=Math.min,ye=Math.max,wn=Math.round,xn=Math.floor,Me=e=>({x:e,y:e}),rd={left:"right",right:"left",bottom:"top",top:"bottom"},od={start:"end",end:"start"};function Or(e,t,n){return ye(e,Ye(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function Gs(e){return e==="x"?"y":"x"}function _r(e){return e==="y"?"height":"width"}function it(e){return["top","bottom"].includes(Xe(e))?"y":"x"}function Pr(e){return Gs(it(e))}function sd(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=Pr(e),s=_r(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Sn(i)),[i,Sn(i)]}function id(e){const t=Sn(e);return[Ar(e),t,Ar(t)]}function Ar(e){return e.replace(/start|end/g,t=>od[t])}function ad(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function ld(e,t,n,r){const o=vt(e);let s=ad(Xe(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ar)))),s}function Sn(e){return e.replace(/left|right|bottom|top/g,t=>rd[t])}function cd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ys(e){return typeof e!="number"?cd(e):{top:e,right:e,bottom:e,left:e}}function En(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xs(e,t,n){let{reference:r,floating:o}=e;const s=it(t),i=Pr(t),a=_r(i),l=Xe(t),c=s==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(vt(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}const ud=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Xs(c,r,l),h=r,p={},f=0;for(let g=0;g<a.length;g++){const{name:m,fn:b}=a[g],{x:v,y:w,data:x,reset:O}=await b({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});d=v??d,u=w??u,p={...p,[m]:{...p[m],...x}},O&&f<=50&&(f++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:u}=Xs(c,h,l)),g=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}};async function Ut(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=st(t,e),f=Ys(p),m=a[h?u==="floating"?"reference":"floating":u],b=En(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},O=En(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(b.top-O.top+f.top)/x.y,bottom:(O.bottom-b.bottom+f.bottom)/x.y,left:(b.left-O.left+f.left)/x.x,right:(O.right-b.right+f.right)/x.x}}const dd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=st(e,t)||{};if(c==null)return{};const u=Ys(d),h={x:n,y:r},p=Pr(o),f=_r(p),g=await i.getDimensions(c),m=p==="y",b=m?"top":"left",v=m?"bottom":"right",w=m?"clientHeight":"clientWidth",x=s.reference[f]+s.reference[p]-h[p]-s.floating[f],O=h[p]-s.reference[p],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=k?k[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(k)))&&(E=a.floating[w]||s.floating[f]);const F=x/2-O/2,_=E/2-g[f]/2-1,R=Ye(u[b],_),D=Ye(u[v],_),I=R,re=E-g[f]-D,Y=E/2-g[f]/2+F,fe=Or(I,Y,re),$=!l.arrow&&vt(o)!=null&&Y!==fe&&s.reference[f]/2-(Y<I?R:D)-g[f]/2<0,V=$?Y<I?Y-I:Y-re:0;return{[p]:h[p]+V,data:{[p]:fe,centerOffset:Y-fe-V,...$&&{alignmentOffset:V}},reset:$}}}),fd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=st(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Xe(o),v=it(a),w=Xe(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=h||(w||!g?[Sn(a)]:id(a)),k=f!=="none";!h&&k&&O.push(...ld(a,g,f,x));const E=[a,...O],F=await Ut(t,m),_=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&_.push(F[b]),u){const Y=sd(o,i,x);_.push(F[Y[0]],F[Y[1]])}if(R=[...R,{placement:o,overflows:_}],!_.every(Y=>Y<=0)){var D,I;const Y=(((D=s.flip)==null?void 0:D.index)||0)+1,fe=E[Y];if(fe)return{data:{index:Y,overflows:R},reset:{placement:fe}};let $=(I=R.filter(V=>V.overflows[0]<=0).sort((V,Q)=>V.overflows[1]-Q.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(p){case"bestFit":{var re;const V=(re=R.filter(Q=>{if(k){const ie=it(Q.placement);return ie===v||ie==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(ie=>ie>0).reduce((ie,Pt)=>ie+Pt,0)]).sort((Q,ie)=>Q[1]-ie[1])[0])==null?void 0:re[0];V&&($=V);break}case"initialPlacement":$=a;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function Js(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zs(e){return nd.some(t=>e[t]>=0)}const hd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=st(e,t);switch(r){case"referenceHidden":{const s=await Ut(t,{...o,elementContext:"reference"}),i=Js(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Zs(i)}}}case"escaped":{const s=await Ut(t,{...o,altBoundary:!0}),i=Js(s,n.floating);return{data:{escapedOffsets:i,escaped:Zs(i)}}}default:return{}}}}};async function gd(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Xe(n),a=vt(n),l=it(n)==="y",c=["left","top"].includes(i)?-1:1,d=s&&l?-1:1,u=st(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(p=a==="end"?f*-1:f),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const pd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await gd(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},md=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:m=>{let{x:b,y:v}=m;return{x:b,y:v}}},...l}=st(e,t),c={x:n,y:r},d=await Ut(t,l),u=it(Xe(o)),h=Gs(u);let p=c[h],f=c[u];if(s){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+d[m],w=p-d[b];p=Or(v,p,w)}if(i){const m=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=f+d[m],w=f-d[b];f=Or(v,f,w)}const g=a.fn({...t,[h]:p,[u]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:s,[u]:i}}}}}},yd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=st(e,t),d=await Ut(t,c),u=Xe(o),h=vt(o),p=it(o)==="y",{width:f,height:g}=s.floating;let m,b;u==="top"||u==="bottom"?(m=u,b=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,m=h==="end"?"top":"bottom");const v=g-d.top-d.bottom,w=f-d.left-d.right,x=Ye(g-d[m],v),O=Ye(f-d[b],w),k=!t.middlewareData.shift;let E=x,F=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=v),k&&!h){const R=ye(d.left,0),D=ye(d.right,0),I=ye(d.top,0),re=ye(d.bottom,0);p?F=f-2*(R!==0||D!==0?R+D:ye(d.left,d.right)):E=g-2*(I!==0||re!==0?I+re:ye(d.top,d.bottom))}await l({...t,availableWidth:F,availableHeight:E});const _=await i.getDimensions(a.floating);return f!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function kn(){return typeof window<"u"}function wt(e){return Qs(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Qs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qs(e){return kn()?e instanceof Node||e instanceof be(e).Node:!1}function Oe(e){return kn()?e instanceof Element||e instanceof be(e).Element:!1}function Re(e){return kn()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ei(e){return!kn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}function jt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function bd(e){return["table","td","th"].includes(wt(e))}function Cn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Tr(e){const t=Lr(),n=Oe(e)?_e(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vd(e){let t=Je(e);for(;Re(t)&&!xt(t);){if(Tr(t))return t;if(Cn(t))return null;t=Je(t)}return null}function Lr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xt(e){return["html","body","#document"].includes(wt(e))}function _e(e){return be(e).getComputedStyle(e)}function On(e){return Oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ei(e)&&e.host||Ie(e);return ei(t)?t.host:t}function ti(e){const t=Je(e);return xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&jt(t)?t:ti(t)}function qt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ti(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=be(o);if(s){const a=Dr(i);return t.concat(i,i.visualViewport||[],jt(o)?o:[],a&&n?qt(a):[])}return t.concat(o,qt(o,[],n))}function Dr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ni(e){const t=_e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=wn(n)!==s||wn(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Mr(e){return Oe(e)?e:e.contextElement}function St(e){const t=Mr(e);if(!Re(t))return Me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ni(t);let i=(s?wn(n.width):n.width)/r,a=(s?wn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const wd=Me(0);function ri(e){const t=be(e);return!Lr()||!t.visualViewport?wd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==be(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Mr(e);let i=Me(1);t&&(r?Oe(r)&&(i=St(r)):i=St(e));const a=xd(s,n,r)?ri(s):Me(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const h=be(s),p=r&&Oe(r)?be(r):r;let f=h,g=Dr(f);for(;g&&r&&p!==f;){const m=St(g),b=g.getBoundingClientRect(),v=_e(g),w=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*m.x,x=b.top+(g.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,u*=m.y,l+=w,c+=x,f=be(g),g=Dr(f)}}return En({width:d,height:u,x:l,y:c})}function Ir(e,t){const n=On(e).scrollLeft;return t?t.left+n:at(Ie(e)).left+n}function oi(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ir(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Sd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ie(r),a=t?Cn(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Me(1);const d=Me(0),u=Re(r);if((u||!u&&!s)&&((wt(r)!=="body"||jt(i))&&(l=On(r)),Re(r))){const p=at(r);c=St(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=i&&!u&&!s?oi(i,l,!0):Me(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Ed(e){return Array.from(e.getClientRects())}function kd(e){const t=Ie(e),n=On(e),r=e.ownerDocument.body,o=ye(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ye(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ir(e);const a=-n.scrollTop;return _e(r).direction==="rtl"&&(i+=ye(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Cd(e,t){const n=be(e),r=Ie(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Lr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function Od(e,t){const n=at(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Re(e)?St(e):Me(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function si(e,t,n){let r;if(t==="viewport")r=Cd(e,n);else if(t==="document")r=kd(Ie(e));else if(Oe(t))r=Od(t,n);else{const o=ri(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return En(r)}function ii(e,t){const n=Je(e);return n===t||!Oe(n)||xt(n)?!1:_e(n).position==="fixed"||ii(n,t)}function _d(e,t){const n=t.get(e);if(n)return n;let r=qt(e,[],!1).filter(a=>Oe(a)&&wt(a)!=="body"),o=null;const s=_e(e).position==="fixed";let i=s?Je(e):e;for(;Oe(i)&&!xt(i);){const a=_e(i),l=Tr(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||jt(i)&&!l&&ii(e,i))?r=r.filter(d=>d!==i):o=a,i=Je(i)}return t.set(e,r),r}function Pd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Cn(t)?[]:_d(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,d)=>{const u=si(t,d,o);return c.top=ye(u.top,c.top),c.right=Ye(u.right,c.right),c.bottom=Ye(u.bottom,c.bottom),c.left=ye(u.left,c.left),c},si(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ad(e){const{width:t,height:n}=ni(e);return{width:t,height:n}}function Td(e,t,n){const r=Re(t),o=Ie(t),s=n==="fixed",i=at(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Me(0);if(r||!r&&!s)if((wt(t)!=="body"||jt(o))&&(a=On(t)),r){const h=at(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=Ir(o));const c=o&&!r&&!s?oi(o,a):Me(0),d=i.left+a.scrollLeft-l.x-c.x,u=i.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:i.width,height:i.height}}function Rr(e){return _e(e).position==="static"}function ai(e,t){if(!Re(e)||_e(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function li(e,t){const n=be(e);if(Cn(e))return n;if(!Re(e)){let o=Je(e);for(;o&&!xt(o);){if(Oe(o)&&!Rr(o))return o;o=Je(o)}return n}let r=ai(e,t);for(;r&&bd(r)&&Rr(r);)r=ai(r,t);return r&&xt(r)&&Rr(r)&&!Tr(r)?n:r||vd(e)||n}const Ld=async function(e){const t=this.getOffsetParent||li,n=this.getDimensions,r=await n(e.floating);return{reference:Td(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Dd(e){return _e(e).direction==="rtl"}const ci={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:Ie,getClippingRect:Pd,getOffsetParent:li,getElementRects:Ld,getClientRects:Ed,getDimensions:Ad,getScale:St,isElement:Oe,isRTL:Dd};function ui(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Md(e,t){let n=null,r;const o=Ie(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(a||t(),!h||!p)return;const f=xn(u),g=xn(o.clientWidth-(d+h)),m=xn(o.clientHeight-(u+p)),b=xn(d),w={rootMargin:-f+"px "+-g+"px "+-m+"px "+-b+"px",threshold:ye(0,Ye(1,l))||1};let x=!0;function O(k){const E=k[0].intersectionRatio;if(E!==l){if(!x)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!ui(c,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(O,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(e)}return i(!0),s}function Id(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Mr(e),d=o||s?[...c?qt(c):[],...qt(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const u=c&&a?Md(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let f,g=l?at(e):null;l&&m();function m(){const b=at(e);g&&!ui(g,b)&&n(),g=b,f=requestAnimationFrame(m)}return n(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),u?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Rd=pd,Fd=md,$d=fd,Nd=yd,Kd=hd,Bd=dd,zd=(e,t,n)=>{const r=new Map,o={platform:ci,...n},s={...o.platform,_c:r};return ud(e,t,{...o,platform:s})};function di(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const s={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...s,toJSON:()=>s}}function Vd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?di(r):e?e.getBoundingClientRect():di()}}}function Ud(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const jd={top:"bottom",right:"left",bottom:"top",left:"right"};function qd(e,t){const[n,r]=e.split("-"),o=jd[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function Hd(e){const t=De({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=P(),[o,s]=P(),[i,a]=P(t.placement),l=()=>Vd(t.anchorRef(),t.getAnchorRect),{direction:c}=Sr();async function d(){const h=l(),p=n(),f=o();if(!h||!p)return;const g=(f?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;p.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const b=[Rd(({placement:k})=>{const E=!!k.split("-")[1];return{mainAxis:m,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(Ud))throw new Error("`flip` expects a spaced-delimited list of placements");b.push($d({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&b.push(Fd({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Nd({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:E,rects:F}){const _=Math.round(F.reference.width);k=Math.floor(k),E=Math.floor(E),p.style.setProperty("--kb-popper-anchor-width",`${_}px`),p.style.setProperty("--kb-popper-content-available-width",`${k}px`),p.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(p.style.width=`${_}px`),t.fitViewport&&(p.style.maxWidth=`${k}px`,p.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&b.push(Kd({padding:t.detachedPadding})),f&&b.push(Bd({element:f,padding:t.arrowPadding}));const v=await zd(h,p,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...ci,isRTL:()=>c()==="rtl"}});if(a(v.placement),t.onCurrentPlacementChange?.(v.placement),!p)return;p.style.setProperty("--kb-popper-content-transform-origin",qd(v.placement,c()));const w=Math.round(v.x),x=Math.round(v.y);let O;if(t.hideWhenDetached&&(O=v.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(p.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:O}),f&&v.middlewareData.arrow){const{x:k,y:E}=v.middlewareData.arrow,F=v.placement.split("-")[0];Object.assign(f.style,{left:k!=null?`${k}px`:"",top:E!=null?`${E}px`:"",[F]:"100%"})}}L(()=>{const h=l(),p=n();if(!h||!p)return;const f=Id(h,p,d,{elementResize:typeof ResizeObserver=="function"});K(f)}),L(()=>{const h=n(),p=t.contentRef();!h||!p||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(p).zIndex})});const u={currentPlacement:i,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:s};return y(Ws.Provider,{value:u,get children(){return t.children}})}const fi=ce();function hi(){return he(fi)}function Et(){const e=hi();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const gi=ce();function kt(){const e=he(gi);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
175
|
+
*/function Vu(e={}){const[t,n]=Yc({value:()=>S(e.items),onChange:s=>e.onItemsChange?.(s)});zu(t,n);const r=s=>(n(i=>{const a=$u(i,s);return kc(i,s,a)}),()=>{n(i=>{const a=i.filter(l=>l.ref()!==s.ref());return i.length===a.length?i:a})});return{DomCollectionProvider:s=>y(Fs.Provider,{value:{registerItem:r},get children(){return s.children}})}}function Uu(e){const t=Fu(),n=De({shouldRegisterItem:!0},e);L(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());K(r)})}var J=e=>typeof e=="function"?e():e,kr=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Cr=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},vn=new Map,ju=e=>{L(()=>{const t=J(e.style)??{},n=J(e.properties)??[],r={};for(const s in t)r[s]=e.element.style[s];const o=vn.get(e.key);o?o.activeCount++:vn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(e.element.style,e.style);for(const s of n)e.element.style.setProperty(s.key,s.value);K(()=>{const s=vn.get(e.key);if(s){if(s.activeCount!==1){s.activeCount--;return}vn.delete(e.key);for(const[i,a]of Object.entries(s.originalStyles))e.element.style[i]=a;for(const i of s.properties)e.element.style.removeProperty(i);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Bs=ju,qu=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Hu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Wu=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,s=0,i=0,a=!1;do{const[l,c,d]=qu(o,t),u=d-l-r*c;(c!==0||u!==0)&&Hu(o,t)&&(s+=u,i+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[s,i]},[zs,Vs]=P([]),Gu=e=>zs().indexOf(e)===zs().length-1,Yu=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Te();let r=[0,0],o=null,s=null;L(()=>{J(t.enabled)&&(Vs(c=>[...c,n]),K(()=>{Vs(c=>c.filter(d=>d!==n))}))}),L(()=>{if(!J(t.enabled)||!J(t.hideScrollbar))return;const{body:c}=document,d=window.innerWidth-c.offsetWidth;if(J(t.preventScrollbarShift)){const u={overflow:"hidden"},h=[];d>0&&(J(t.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${d}px)`,h.push({key:"--scrollbar-width",value:`${d}px`}));const p=window.scrollY,f=window.scrollX;Bs({key:"prevent-scroll",element:c,style:u,properties:h,cleanup:()=>{J(t.restoreScrollPosition)&&d>0&&window.scrollTo(f,p)}})}else Bs({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),L(()=>{!Gu(n)||!J(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",i,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),K(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",i),document.removeEventListener("touchmove",l)}))});const i=c=>{r=Us(c),o=null,s=null},a=c=>{const d=c.target,u=J(t.element),h=Xu(c),p=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=p==="x"?h[0]:h[1],g=js(d,p,f,u);let m;u&&Cr(u,d)?m=!g:m=!0,m&&c.cancelable&&c.preventDefault()},l=c=>{const d=J(t.element),u=c.target;let h;if(c.touches.length===2)h=!J(t.allowPinchZoom);else{if(o==null||s===null){const p=Us(c).map((g,m)=>r[m]-g),f=Math.abs(p[0])>Math.abs(p[1])?"x":"y";o=f,s=f==="x"?p[0]:p[1]}if(u.type==="range")h=!1;else{const p=js(u,o,s,d);d&&Cr(d,u)?h=!p:h=!0}}h&&c.cancelable&&c.preventDefault()}},Xu=e=>[e.deltaX,e.deltaY],Us=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],js=(e,t,n,r)=>{const o=r!==null&&Cr(r,e),[s,i]=Wu(e,t,o?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(i)<1)},Ju=Yu,qs=Ju;const Hs=ce();function Zu(){return he(Hs)}function Qu(e){let t;const n=Zu(),[r,o]=j(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),i=u=>{s.add(u);const h=n?.registerNestedLayer(u);return()=>{s.delete(u),h?.()}};cu({shouldExcludeElement:u=>t?r.excludedElements?.some(h=>Le(h(),u))||[...s].some(h=>Le(h,u)):!1,onPointerDownOutside:u=>{!t||pe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!pe.isTopMostLayer(t)||(r.onPointerDownOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.())},onFocusOutside:u=>{r.onFocusOutside?.(u),r.onInteractOutside?.(u),u.defaultPrevented||r.onDismiss?.()}},()=>t),Xc({ownerDocument:()=>je(t),onEscapeKeyDown:u=>{!t||!pe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(u),!u.defaultPrevented&&r.onDismiss&&(u.preventDefault(),r.onDismiss()))}}),tn(()=>{if(!t)return;pe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const u=n?.registerNestedLayer(t);pe.assignPointerEventToLayers(),pe.disableBodyPointerEvents(t),K(()=>{t&&(pe.removeLayer(t),u?.(),pe.assignPointerEventToLayers(),pe.restoreBodyPointerEvents(t))})}),L(et([()=>t,()=>r.disableOutsidePointerEvents],([u,h])=>{if(!u)return;const p=pe.find(u);p&&p.isPointerBlocking!==h&&(p.isPointerBlocking=h,pe.assignPointerEventToLayers()),h&&pe.disableBodyPointerEvents(u),K(()=>{pe.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:i};return y(Hs.Provider,{value:d,get children(){return y(bn,T({as:"div",ref(u){var h=ot(p=>t=p,r.ref);typeof h=="function"&&h(u)}},o))}})}const Ws=ce();function ed(){const e=he(Ws);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function td(e){const t=ed(),[n,r]=j(e,["ref","style"]);return y(bn,T({as:"div",ref(o){var s=ot(t.setPositionerRef,n.ref);typeof s=="function"&&s(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const nd=["top","right","bottom","left"],Ye=Math.min,me=Math.max,wn=Math.round,xn=Math.floor,Me=e=>({x:e,y:e}),rd={left:"right",right:"left",bottom:"top",top:"bottom"},od={start:"end",end:"start"};function Or(e,t,n){return me(e,Ye(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function Gs(e){return e==="x"?"y":"x"}function _r(e){return e==="y"?"height":"width"}function it(e){return["top","bottom"].includes(Xe(e))?"y":"x"}function Pr(e){return Gs(it(e))}function sd(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=Pr(e),s=_r(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Sn(i)),[i,Sn(i)]}function id(e){const t=Sn(e);return[Ar(e),t,Ar(t)]}function Ar(e){return e.replace(/start|end/g,t=>od[t])}function ad(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function ld(e,t,n,r){const o=vt(e);let s=ad(Xe(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ar)))),s}function Sn(e){return e.replace(/left|right|bottom|top/g,t=>rd[t])}function cd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ys(e){return typeof e!="number"?cd(e):{top:e,right:e,bottom:e,left:e}}function En(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xs(e,t,n){let{reference:r,floating:o}=e;const s=it(t),i=Pr(t),a=_r(i),l=Xe(t),c=s==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(vt(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}const ud=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Xs(c,r,l),h=r,p={},f=0;for(let g=0;g<a.length;g++){const{name:m,fn:b}=a[g],{x:v,y:w,data:x,reset:O}=await b({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});d=v??d,u=w??u,p={...p,[m]:{...p[m],...x}},O&&f<=50&&(f++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:u}=Xs(c,h,l)),g=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}};async function Ut(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=st(t,e),f=Ys(p),m=a[h?u==="floating"?"reference":"floating":u],b=En(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},O=En(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(b.top-O.top+f.top)/x.y,bottom:(O.bottom-b.bottom+f.bottom)/x.y,left:(b.left-O.left+f.left)/x.x,right:(O.right-b.right+f.right)/x.x}}const dd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=st(e,t)||{};if(c==null)return{};const u=Ys(d),h={x:n,y:r},p=Pr(o),f=_r(p),g=await i.getDimensions(c),m=p==="y",b=m?"top":"left",v=m?"bottom":"right",w=m?"clientHeight":"clientWidth",x=s.reference[f]+s.reference[p]-h[p]-s.floating[f],O=h[p]-s.reference[p],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=k?k[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(k)))&&(E=a.floating[w]||s.floating[f]);const F=x/2-O/2,_=E/2-g[f]/2-1,R=Ye(u[b],_),D=Ye(u[v],_),I=R,re=E-g[f]-D,Y=E/2-g[f]/2+F,fe=Or(I,Y,re),$=!l.arrow&&vt(o)!=null&&Y!==fe&&s.reference[f]/2-(Y<I?R:D)-g[f]/2<0,V=$?Y<I?Y-I:Y-re:0;return{[p]:h[p]+V,data:{[p]:fe,centerOffset:Y-fe-V,...$&&{alignmentOffset:V}},reset:$}}}),fd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=st(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Xe(o),v=it(a),w=Xe(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=h||(w||!g?[Sn(a)]:id(a)),k=f!=="none";!h&&k&&O.push(...ld(a,g,f,x));const E=[a,...O],F=await Ut(t,m),_=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&_.push(F[b]),u){const Y=sd(o,i,x);_.push(F[Y[0]],F[Y[1]])}if(R=[...R,{placement:o,overflows:_}],!_.every(Y=>Y<=0)){var D,I;const Y=(((D=s.flip)==null?void 0:D.index)||0)+1,fe=E[Y];if(fe)return{data:{index:Y,overflows:R},reset:{placement:fe}};let $=(I=R.filter(V=>V.overflows[0]<=0).sort((V,Q)=>V.overflows[1]-Q.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(p){case"bestFit":{var re;const V=(re=R.filter(Q=>{if(k){const ie=it(Q.placement);return ie===v||ie==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(ie=>ie>0).reduce((ie,Pt)=>ie+Pt,0)]).sort((Q,ie)=>Q[1]-ie[1])[0])==null?void 0:re[0];V&&($=V);break}case"initialPlacement":$=a;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function Js(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zs(e){return nd.some(t=>e[t]>=0)}const hd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=st(e,t);switch(r){case"referenceHidden":{const s=await Ut(t,{...o,elementContext:"reference"}),i=Js(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Zs(i)}}}case"escaped":{const s=await Ut(t,{...o,altBoundary:!0}),i=Js(s,n.floating);return{data:{escapedOffsets:i,escaped:Zs(i)}}}default:return{}}}}};async function gd(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Xe(n),a=vt(n),l=it(n)==="y",c=["left","top"].includes(i)?-1:1,d=s&&l?-1:1,u=st(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(p=a==="end"?f*-1:f),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const pd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await gd(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},md=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:m=>{let{x:b,y:v}=m;return{x:b,y:v}}},...l}=st(e,t),c={x:n,y:r},d=await Ut(t,l),u=it(Xe(o)),h=Gs(u);let p=c[h],f=c[u];if(s){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+d[m],w=p-d[b];p=Or(v,p,w)}if(i){const m=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=f+d[m],w=f-d[b];f=Or(v,f,w)}const g=a.fn({...t,[h]:p,[u]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:s,[u]:i}}}}}},yd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=st(e,t),d=await Ut(t,c),u=Xe(o),h=vt(o),p=it(o)==="y",{width:f,height:g}=s.floating;let m,b;u==="top"||u==="bottom"?(m=u,b=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,m=h==="end"?"top":"bottom");const v=g-d.top-d.bottom,w=f-d.left-d.right,x=Ye(g-d[m],v),O=Ye(f-d[b],w),k=!t.middlewareData.shift;let E=x,F=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=v),k&&!h){const R=me(d.left,0),D=me(d.right,0),I=me(d.top,0),re=me(d.bottom,0);p?F=f-2*(R!==0||D!==0?R+D:me(d.left,d.right)):E=g-2*(I!==0||re!==0?I+re:me(d.top,d.bottom))}await l({...t,availableWidth:F,availableHeight:E});const _=await i.getDimensions(a.floating);return f!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function kn(){return typeof window<"u"}function wt(e){return Qs(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Qs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qs(e){return kn()?e instanceof Node||e instanceof ye(e).Node:!1}function Oe(e){return kn()?e instanceof Element||e instanceof ye(e).Element:!1}function Re(e){return kn()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function ei(e){return!kn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function jt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function bd(e){return["table","td","th"].includes(wt(e))}function Cn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Tr(e){const t=Lr(),n=Oe(e)?_e(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vd(e){let t=Je(e);for(;Re(t)&&!xt(t);){if(Tr(t))return t;if(Cn(t))return null;t=Je(t)}return null}function Lr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xt(e){return["html","body","#document"].includes(wt(e))}function _e(e){return ye(e).getComputedStyle(e)}function On(e){return Oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ei(e)&&e.host||Ie(e);return ei(t)?t.host:t}function ti(e){const t=Je(e);return xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&jt(t)?t:ti(t)}function qt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ti(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ye(o);if(s){const a=Dr(i);return t.concat(i,i.visualViewport||[],jt(o)?o:[],a&&n?qt(a):[])}return t.concat(o,qt(o,[],n))}function Dr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ni(e){const t=_e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=wn(n)!==s||wn(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Mr(e){return Oe(e)?e:e.contextElement}function St(e){const t=Mr(e);if(!Re(t))return Me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ni(t);let i=(s?wn(n.width):n.width)/r,a=(s?wn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const wd=Me(0);function ri(e){const t=ye(e);return!Lr()||!t.visualViewport?wd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ye(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Mr(e);let i=Me(1);t&&(r?Oe(r)&&(i=St(r)):i=St(e));const a=xd(s,n,r)?ri(s):Me(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const h=ye(s),p=r&&Oe(r)?ye(r):r;let f=h,g=Dr(f);for(;g&&r&&p!==f;){const m=St(g),b=g.getBoundingClientRect(),v=_e(g),w=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*m.x,x=b.top+(g.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,u*=m.y,l+=w,c+=x,f=ye(g),g=Dr(f)}}return En({width:d,height:u,x:l,y:c})}function Ir(e,t){const n=On(e).scrollLeft;return t?t.left+n:at(Ie(e)).left+n}function oi(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ir(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Sd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ie(r),a=t?Cn(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Me(1);const d=Me(0),u=Re(r);if((u||!u&&!s)&&((wt(r)!=="body"||jt(i))&&(l=On(r)),Re(r))){const p=at(r);c=St(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=i&&!u&&!s?oi(i,l,!0):Me(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Ed(e){return Array.from(e.getClientRects())}function kd(e){const t=Ie(e),n=On(e),r=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ir(e);const a=-n.scrollTop;return _e(r).direction==="rtl"&&(i+=me(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Cd(e,t){const n=ye(e),r=Ie(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Lr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function Od(e,t){const n=at(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Re(e)?St(e):Me(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function si(e,t,n){let r;if(t==="viewport")r=Cd(e,n);else if(t==="document")r=kd(Ie(e));else if(Oe(t))r=Od(t,n);else{const o=ri(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return En(r)}function ii(e,t){const n=Je(e);return n===t||!Oe(n)||xt(n)?!1:_e(n).position==="fixed"||ii(n,t)}function _d(e,t){const n=t.get(e);if(n)return n;let r=qt(e,[],!1).filter(a=>Oe(a)&&wt(a)!=="body"),o=null;const s=_e(e).position==="fixed";let i=s?Je(e):e;for(;Oe(i)&&!xt(i);){const a=_e(i),l=Tr(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||jt(i)&&!l&&ii(e,i))?r=r.filter(d=>d!==i):o=a,i=Je(i)}return t.set(e,r),r}function Pd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Cn(t)?[]:_d(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,d)=>{const u=si(t,d,o);return c.top=me(u.top,c.top),c.right=Ye(u.right,c.right),c.bottom=Ye(u.bottom,c.bottom),c.left=me(u.left,c.left),c},si(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ad(e){const{width:t,height:n}=ni(e);return{width:t,height:n}}function Td(e,t,n){const r=Re(t),o=Ie(t),s=n==="fixed",i=at(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Me(0);if(r||!r&&!s)if((wt(t)!=="body"||jt(o))&&(a=On(t)),r){const h=at(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=Ir(o));const c=o&&!r&&!s?oi(o,a):Me(0),d=i.left+a.scrollLeft-l.x-c.x,u=i.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:i.width,height:i.height}}function Rr(e){return _e(e).position==="static"}function ai(e,t){if(!Re(e)||_e(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function li(e,t){const n=ye(e);if(Cn(e))return n;if(!Re(e)){let o=Je(e);for(;o&&!xt(o);){if(Oe(o)&&!Rr(o))return o;o=Je(o)}return n}let r=ai(e,t);for(;r&&bd(r)&&Rr(r);)r=ai(r,t);return r&&xt(r)&&Rr(r)&&!Tr(r)?n:r||vd(e)||n}const Ld=async function(e){const t=this.getOffsetParent||li,n=this.getDimensions,r=await n(e.floating);return{reference:Td(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Dd(e){return _e(e).direction==="rtl"}const ci={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:Ie,getClippingRect:Pd,getOffsetParent:li,getElementRects:Ld,getClientRects:Ed,getDimensions:Ad,getScale:St,isElement:Oe,isRTL:Dd};function ui(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Md(e,t){let n=null,r;const o=Ie(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(a||t(),!h||!p)return;const f=xn(u),g=xn(o.clientWidth-(d+h)),m=xn(o.clientHeight-(u+p)),b=xn(d),w={rootMargin:-f+"px "+-g+"px "+-m+"px "+-b+"px",threshold:me(0,Ye(1,l))||1};let x=!0;function O(k){const E=k[0].intersectionRatio;if(E!==l){if(!x)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!ui(c,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(O,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(e)}return i(!0),s}function Id(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Mr(e),d=o||s?[...c?qt(c):[],...qt(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const u=c&&a?Md(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let f,g=l?at(e):null;l&&m();function m(){const b=at(e);g&&!ui(g,b)&&n(),g=b,f=requestAnimationFrame(m)}return n(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),u?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Rd=pd,Fd=md,$d=fd,Nd=yd,Kd=hd,Bd=dd,zd=(e,t,n)=>{const r=new Map,o={platform:ci,...n},s={...o.platform,_c:r};return ud(e,t,{...o,platform:s})};function di(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const s={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...s,toJSON:()=>s}}function Vd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?di(r):e?e.getBoundingClientRect():di()}}}function Ud(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const jd={top:"bottom",right:"left",bottom:"top",left:"right"};function qd(e,t){const[n,r]=e.split("-"),o=jd[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function Hd(e){const t=De({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=P(),[o,s]=P(),[i,a]=P(t.placement),l=()=>Vd(t.anchorRef(),t.getAnchorRect),{direction:c}=Sr();async function d(){const h=l(),p=n(),f=o();if(!h||!p)return;const g=(f?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;p.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const b=[Rd(({placement:k})=>{const E=!!k.split("-")[1];return{mainAxis:m,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(Ud))throw new Error("`flip` expects a spaced-delimited list of placements");b.push($d({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&b.push(Fd({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(Nd({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:E,rects:F}){const _=Math.round(F.reference.width);k=Math.floor(k),E=Math.floor(E),p.style.setProperty("--kb-popper-anchor-width",`${_}px`),p.style.setProperty("--kb-popper-content-available-width",`${k}px`),p.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(p.style.width=`${_}px`),t.fitViewport&&(p.style.maxWidth=`${k}px`,p.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&b.push(Kd({padding:t.detachedPadding})),f&&b.push(Bd({element:f,padding:t.arrowPadding}));const v=await zd(h,p,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...ci,isRTL:()=>c()==="rtl"}});if(a(v.placement),t.onCurrentPlacementChange?.(v.placement),!p)return;p.style.setProperty("--kb-popper-content-transform-origin",qd(v.placement,c()));const w=Math.round(v.x),x=Math.round(v.y);let O;if(t.hideWhenDetached&&(O=v.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(p.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${x}px, 0)`,visibility:O}),f&&v.middlewareData.arrow){const{x:k,y:E}=v.middlewareData.arrow,F=v.placement.split("-")[0];Object.assign(f.style,{left:k!=null?`${k}px`:"",top:E!=null?`${E}px`:"",[F]:"100%"})}}L(()=>{const h=l(),p=n();if(!h||!p)return;const f=Id(h,p,d,{elementResize:typeof ResizeObserver=="function"});K(f)}),L(()=>{const h=n(),p=t.contentRef();!h||!p||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(p).zIndex})});const u={currentPlacement:i,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:s};return y(Ws.Provider,{value:u,get children(){return t.children}})}const fi=ce();function hi(){return he(fi)}function Et(){const e=hi();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const gi=ce();function kt(){const e=he(gi);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
176
176
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
177
177
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
178
178
|
*
|
|
179
179
|
* Credits to the Radix UI team:
|
|
180
180
|
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
|
|
181
|
-
*/function Wd(e,t){return t?jc([e.clientX,e.clientY],t):!1}function Gd(e){const t=kt(),n=$s(),r=hi(),o=De({placement:"bottom-start"},e),[s,i]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=P(),[h,p]=P(),[f,g]=P(),[m,b]=P(),[v,w]=P(!0),[x,O]=P(i.placement),[k,E]=P([]),[F,_]=P([]),{DomCollectionProvider:R}=Vu({items:F,onItemsChange:_}),D=ws({open:()=>s.open,defaultOpen:()=>s.defaultOpen,onOpenChange:U=>s.onOpenChange?.(U)}),I=uu(()=>t.forceMount()||D.isOpen()),re=Tu({selectionMode:"none",dataSource:F}),Y=U=>{w(U),D.open()},fe=(U=!1)=>{D.close(),U&&r&&r.close(!0)},$=U=>{w(U),D.toggle()},V=()=>{const U=m();U&&(de(U),re.selectionManager().setFocused(!0),re.selectionManager().setFocusedKey(void 0))},Q=U=>{E(ho=>[...ho,U]);const Un=r?.registerNestedMenu(U);return()=>{E(ho=>ur(ho,U)),Un?.()}},ie=U=>c===l?.side&&Wd(U,l?.area),Pt=U=>{ie(U)&&U.preventDefault()},Ae=U=>{ie(U)||V()},dm=U=>{ie(U)&&U.preventDefault()};au({isDisabled:()=>!(r==null&&D.isOpen()&&t.isModal()),targets:()=>[m(),...k()].filter(Boolean)}),L(()=>{const U=m();if(!U||!r)return;const Un=r.registerNestedMenu(U);K(()=>{Un()})});const fm={dataset:C(()=>({"data-expanded":D.isOpen()?"":void 0,"data-closed":D.isOpen()?void 0:""})),isOpen:D.isOpen,contentPresence:I,nestedMenus:k,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:v,listState:()=>re,parentMenuContext:()=>r,triggerRef:f,contentRef:m,triggerId:d,contentId:h,setTriggerRef:g,setContentRef:b,open:Y,close:fe,toggle:$,focusContent:V,onItemEnter:Pt,onItemLeave:Ae,onTriggerLeave:dm,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Q,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:yn(u),registerContentId:yn(p)};return y(R,{get children(){return y(fi.Provider,{value:fm,get children(){return y(Hd,T({anchorRef:f,contentRef:m,onCurrentPlacementChange:O},i))}})}})}const Yd=ce();function Xd(e){let t;const n=kt(),r=Et(),o=De({id:n.generateId(`item-${Te()}`)},e),[s,i]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,d]=P(),[u,h]=P(),p=()=>r.listState().selectionManager(),f=()=>i.id,g=()=>p().focusedKey()===f(),m=()=>{s.onSelect?.(),s.closeOnSelect&&r.close(!0)};Uu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:s.textValue??u()?.textContent??t?.textContent??"",disabled:s.disabled??!1})});const b=Pu({key:f,selectionManager:p,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),v=_=>{pe(_,s.onPointerMove),_.pointerType==="mouse"&&(s.disabled?r.onItemLeave(_):(r.onItemEnter(_),_.defaultPrevented||(de(_.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},w=_=>{pe(_,s.onPointerLeave),_.pointerType==="mouse"&&r.onItemLeave(_)},x=_=>{pe(_,s.onPointerUp),!s.disabled&&_.button===0&&m()},O=_=>{if(pe(_,s.onKeyDown),!_.repeat&&!s.disabled)switch(_.key){case"Enter":case" ":m();break}},k=C(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),E=C(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":g()?"":void 0})),F={isChecked:()=>s.checked,dataset:E,setLabelRef:h,generateId:cs(()=>i.id),registerLabel:yn(l),registerDescription:yn(d)};return y(Yd.Provider,{value:F,get children(){return y(bn,T({as:"div",ref(_){var R=ot(D=>t=D,s.ref);typeof R=="function"&&R(_)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return we([s.onPointerDown,b.onPointerDown])},get onPointerUp(){return we([x,b.onPointerUp])},get onClick(){return we([s.onClick,b.onClick])},get onKeyDown(){return we([O,b.onKeyDown])},get onMouseDown(){return we([s.onMouseDown,b.onMouseDown])},get onFocus(){return we([s.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:w},E,i))}})}const Jd=ce();function pi(){return he(Jd)}function Zd(e){let t;const n=kt(),r=Et(),o=pi(),s=De({id:n.generateId(`content-${Te()}`)},e),[i,a]=j(s,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Du({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);su({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&i.onOpenAutoFocus?.(m)},onUnmountAutoFocus:i.onCloseAutoFocus},()=>t);const u=m=>{if(Le(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=m=>{i.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},p=m=>{i.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},f=m=>{pe(m,i.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=m=>{if(pe(m,i.onPointerMove),m.pointerType!=="mouse")return;const b=m.target,v=l!==m.clientX;Le(m.currentTarget,b)&&v&&(r.setPointerDir(m.clientX>l?"right":"left"),l=m.clientX)};return L(()=>K(r.registerContentId(i.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y(td,{get children(){return y(Qu,T({ref(m){var b=ot(v=>{r.setContentRef(v),r.contentPresence.setRef(v),t=v},i.ref);typeof b=="function"&&b(m)},role:"menu",get id(){return i.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return C(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...i.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:p,get onDismiss(){return r.close},get onKeyDown(){return we([i.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return we([i.onMouseDown,d.onMouseDown])},get onFocusIn(){return we([i.onFocusIn,d.onFocusIn])},get onFocusOut(){return we([i.onFocusOut,d.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Qd(e){let t;const n=kt(),r=Et(),[o,s]=j(e,["ref"]);return qs({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Zd,T({ref(i){var a=ot(l=>{t=l},o.ref);typeof a=="function"&&a(i)}},s))}function ef(e){return y(Xd,T({role:"menuitem",closeOnSelect:!0},e))}function tf(e){const t=Et();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(Ho,e)}})}function nf(e){const t=`menu-${Te()}`,n=De({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),s=ws({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),i={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??i.isModal(),forceMount:()=>r.forceMount??!1,generateId:cs(()=>r.id),value:()=>r.value};return y(gi.Provider,{value:i,get children(){return y(Gd,T({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},o))}})}function rf(e){const t=kt(),n=Et(),r=pi(),o=De({id:t.generateId("trigger")},e),[s,i]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??s.id,L(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),L(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),L(()=>{n.isOpen()&&r.setValue(a)}),K(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{pe(f,s.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!s.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},d=f=>{pe(f,s.onClick),s.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},u=f=>{if(pe(f,s.onKeyDown),!s.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),qc(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{pe(f,s.onMouseOver),!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},p=f=>{pe(f,s.onFocus),r!==void 0&&r.setValue(a)};return L(()=>K(n.registerTriggerId(s.id))),y(Ru,T({ref(f){var g=ot(n.setTriggerRef,s.ref);typeof g=="function"&&g(f)},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return C(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:h,onClick:d,onKeyDown:u,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),i))}function of(e){const t=kt(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return y(Qd,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),s||de(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},o))}function sf(e){const t=`dropdownmenu-${Te()}`,n=De({id:t},e);return y(nf,n)}function af(e){return ge({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function lf(e){return ge({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function cf(e){return ge({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const uf=e=>y(sf,T({gutter:4},e)),df=rf,ff=e=>{const[,t]=j(e,["class"]);return y(tf,{get mount(){return Xt()},get children(){return y(of,T({get class(){return Ge("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},hf=e=>{const[,t]=j(e,["class"]);return y(ef,T({get class(){return Ge("relative flex cursor-default select-none items-center rounded-sm 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",e.class)}},t))};function gf(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function pf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function mf(e,t,n){const r=`${Jt}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function yf(e,t,n){if(!e||!t||!n)return;const r=`${Jt}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const Fe=Object.create(null);Fe.open="0",Fe.close="1",Fe.ping="2",Fe.pong="3",Fe.message="4",Fe.upgrade="5",Fe.noop="6";const _n=Object.create(null);Object.keys(Fe).forEach(e=>{_n[Fe[e]]=e});const Fr={type:"error",data:"parser error"},mi=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",yi=typeof ArrayBuffer=="function",bi=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,$r=({type:e,data:t},n,r)=>mi&&t instanceof Blob?n?r(t):vi(t,r):yi&&(t instanceof ArrayBuffer||bi(t))?n?r(t):vi(new Blob([t]),r):r(Fe[e]+(t||"")),vi=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function wi(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Nr;function bf(e,t){if(mi&&e.data instanceof Blob)return e.data.arrayBuffer().then(wi).then(t);if(yi&&(e.data instanceof ArrayBuffer||bi(e.data)))return t(wi(e.data));$r(e,!1,n=>{Nr||(Nr=new TextEncoder),t(Nr.encode(n))})}const xi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ht=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<xi.length;e++)Ht[xi.charCodeAt(e)]=e;const vf=e=>{let t=e.length*.75,n=e.length,r,o=0,s,i,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=Ht[e.charCodeAt(r)],i=Ht[e.charCodeAt(r+1)],a=Ht[e.charCodeAt(r+2)],l=Ht[e.charCodeAt(r+3)],d[o++]=s<<2|i>>4,d[o++]=(i&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},wf=typeof ArrayBuffer=="function",Kr=(e,t)=>{if(typeof e!="string")return{type:"message",data:Si(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xf(e.substring(1),t)}:_n[n]?e.length>1?{type:_n[n],data:e.substring(1)}:{type:_n[n]}:Fr},xf=(e,t)=>{if(wf){const n=vf(e);return Si(n,t)}else return{base64:!0,data:e}},Si=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Ei="",Sf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((s,i)=>{$r(s,!1,a=>{r[i]=a,++o===n&&t(r.join(Ei))})})},Ef=(e,t)=>{const n=e.split(Ei),r=[];for(let o=0;o<n.length;o++){const s=Kr(n[o],t);if(r.push(s),s.type==="error")break}return r};function kf(){return new TransformStream({transform(e,t){bf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const s=new DataView(o.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{o=new Uint8Array(9);const s=new DataView(o.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Br;function Pn(e){return e.reduce((t,n)=>t+n.length,0)}function An(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Cf(e,t){Br||(Br=new TextDecoder);const n=[];let r=0,o=-1,s=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(r===0){if(Pn(n)<1)break;const l=An(n,1);s=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Pn(n)<2)break;const l=An(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pn(n)<8)break;const l=An(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Fr);break}o=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pn(n)<o)break;const l=An(n,o);a.enqueue(Kr(s?l:Br.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Fr);break}}}})}const ki=4;function te(e){if(e)return Of(e)}function Of(e){for(var t in te.prototype)e[t]=te.prototype[t];return e}te.prototype.on=te.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},te.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this},te.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},te.prototype.emitReserved=te.prototype.emit,te.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},te.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Se=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_f="arraybuffer";function mm(){}function Ci(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Pf=Se.setTimeout,Af=Se.clearTimeout;function Ln(e,t){t.useNativeTimers?(e.setTimeoutFn=Pf.bind(Se),e.clearTimeoutFn=Af.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Tf=1.33;function Lf(e){return typeof e=="string"?Df(e):Math.ceil((e.byteLength||e.size)*Tf)}function Df(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Oi(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Mf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function If(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class Rf extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class zr extends te{constructor(t){super(),this.writable=!1,Ln(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Rf(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Kr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Mf(t);return n.length?"?"+n:""}}class Ff extends zr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Ef(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Sf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Oi()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _i=!1;try{_i=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const $f=_i;function Nf(){}class Kf extends Ff{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,s)=>{this.onError("xhr post error",o,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class $e extends te{constructor(t,n,r){super(),this.createRequest=t,Ln(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Ci(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=$e.requestsCount++,$e.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Nf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $e.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if($e.requestsCount=0,$e.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pi);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,Pi,!1)}}function Pi(){for(let e in $e.requests)$e.requests.hasOwnProperty(e)&&$e.requests[e].abort()}const Bf=function(){const e=Ai({xdomain:!1});return e&&e.responseType!==null}();class zf extends Kf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Bf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new $e(Ai,this.uri(),t)}}function Ai(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||$f))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ti=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vf extends zr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ti?{}:Ci(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;$r(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Oi()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Vr=Se.WebSocket||Se.MozWebSocket;class Uf extends Vf{createSocket(t,n,r){return Ti?new Vr(t,n,r):n?new Vr(t,n):new Vr(t)}doWrite(t,n){this.ws.send(n)}}class jf extends zr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Cf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=kf();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const qf={websocket:Uf,webtransport:jf,polling:zf},Hf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ur(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=Hf.exec(e||""),s={},i=14;for(;i--;)s[Wf[i]]=o[i]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Gf(s,s.path),s.queryKey=Yf(s,s.query),s}function Gf(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Yf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,s){o&&(n[o]=s)}),n}const jr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Dn=[];jr&&addEventListener("offline",()=>{Dn.forEach(e=>e())},!1);class Ze extends te{constructor(t,n){if(super(),this.binaryType=_f,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ur(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ur(n.host).host);Ln(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=If(this.opts.query)),jr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Dn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ki,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=Lf(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ze.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Dn.indexOf(this._offlineEventListener);r!==-1&&Dn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=ki;class Xf extends Ze{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const i=u=>{const h=new Error("probe error: "+u);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function a(){i("transport closed")}function l(){i("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",o),n.removeListener("error",i),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",i),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Jf=class extends Xf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>qf[o]).filter(o=>!!o)),super(t,r)}};function Zf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ur(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Qf=typeof ArrayBuffer=="function",eh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Li=Object.prototype.toString,th=typeof Blob=="function"||typeof Blob<"u"&&Li.call(Blob)==="[object BlobConstructor]",nh=typeof File=="function"||typeof File<"u"&&Li.call(File)==="[object FileConstructor]";function qr(e){return Qf&&(e instanceof ArrayBuffer||eh(e))||th&&e instanceof Blob||nh&&e instanceof File}function Mn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Mn(e[n]))return!0;return!1}if(qr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mn(e[n]))return!0;return!1}function rh(e){const t=[],n=e.data,r=e;return r.data=Hr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Hr(e,t){if(!e)return e;if(qr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Hr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Hr(e[r],t));return n}return e}function oh(e,t){return e.data=Wr(e.data,t),delete e.attachments,e}function Wr(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Wr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Wr(e[n],t));return e}const sh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ih=5;var z;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(z||(z={}));class ah{constructor(t){this.replacer=t}encode(t){return(t.type===z.EVENT||t.type===z.ACK)&&Mn(t)?this.encodeAsBinary({type:t.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===z.BINARY_EVENT||t.type===z.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=rh(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Di(e){return Object.prototype.toString.call(e)==="[object Object]"}class Gr extends te{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===z.BINARY_EVENT;r||n.type===z.BINARY_ACK?(n.type=r?z.EVENT:z.ACK,this.reconstructor=new lh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(qr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const i=t.substring(s,n);if(i!=Number(i)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(i)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const s=n+1;for(;++n;){const i=t.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(Gr.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case z.CONNECT:return Di(n);case z.DISCONNECT:return n===void 0;case z.CONNECT_ERROR:return typeof n=="string"||Di(n);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&sh.indexOf(n[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class lh{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=oh(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ch=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Gr,Encoder:ah,get PacketType(){return z},protocol:ih},Symbol.toStringTag,{value:"Module"}));function Pe(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const uh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Mi extends te{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Pe(t,"open",this.onopen.bind(this)),Pe(t,"packet",this.onpacket.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,s;if(uh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:z.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),i.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),i=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...n){return new Promise((r,o)=>{const s=(i,a)=>i?o(i):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...s)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:z.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case z.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case z.EVENT:case z.BINARY_EVENT:this.onevent(t);break;case z.ACK:case z.BINARY_ACK:this.onack(t);break;case z.DISCONNECT:this.ondisconnect();break;case z.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:z.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:z.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ct(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ct.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Ct.prototype.reset=function(){this.attempts=0},Ct.prototype.setMin=function(e){this.ms=e},Ct.prototype.setMax=function(e){this.max=e},Ct.prototype.setJitter=function(e){this.jitter=e};class Yr extends te{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ln(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ct({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||ch;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Jf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Pe(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},i=Pe(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Pe(t,"ping",this.onping.bind(this)),Pe(t,"data",this.ondata.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this)),Pe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tn(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Mi(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Wt={};function In(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Zf(e,t.path||"/socket.io"),r=n.source,o=n.id,s=n.path,i=Wt[o]&&s in Wt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let l;return a?l=new Yr(r,t):(Wt[o]||(Wt[o]=new Yr(r,t)),l=Wt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(In,{Manager:Yr,Socket:Mi,io:In,connect:In});class lt{static instance;constructor(){}static init(t){return lt.instance||(lt.instance=In(za,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t}}),lt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),lt.instance}static on(t,n,r){lt.instance||this.init(n).on(t,r)}}const Ii=1e3*60*60*24,[Rn,Ri]=ts("smarttalks-widget-messages",{},Ii),Fi=()=>{const{widgetId:e}=se();return Rn[e()]??[]},dh=e=>{const{widgetId:t}=se();Ri({...Rn,[t()]:[...Rn[t()]??[],e]})},fh=()=>{const{widgetId:e}=se();Ri({...Rn,[e()]:[]})},[$i,hh]=ts("smarttalks-widget-conversationinfo",{},Ii),Ni=()=>{const{widgetId:e}=se();return $i[e()]??{}},Ki=e=>{const{widgetId:t}=se();hh({...$i,[t()]:e})},[gh,Xr]=P(!1),[ph,Bi]=P(!1),zi=[],Vi=()=>{zi.forEach(e=>e())},mh=e=>zi.push(e),Jr=e=>{const t=gf(e);if(dh(t),t.type==="media"){setTimeout(Vi,200);return}Vi()},yh=(e,t)=>{const{chatWidget:n,widgetId:r}=se(),o=Ni();e.trim()&&(Jr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ee("onInput",e),lt.on("message",r(),s=>{(s.contactId!==o.contactId||s.interactionId!==o.interactionId)&&Ki({contactId:s.contactId,interactionId:s.interactionId});for(const i of s.messages)Jr(i),ee("onAnswer",i);Xr(!1),pf(s.debug)}),Xr(!0),mf(e,t,n()?._id).catch(s=>{console.error(s),Xr(!1)}))},bh=()=>{const{chatWidget:e}=se(),t=Ni();Bi(!0),fh(),yf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ki({}),Bi(!1),vh()}),ee("onReset")},vh=()=>{const{chatWidget:e}=se();if(Fi().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Jr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qe=()=>({getMessages:Fi,pushMessage:yh,clearMessages:bh,onMessage:mh,typing:gh,loading:ph});var wh=M("<span>");const xh=()=>{const{clearMessages:e}=Qe();P(!1);const[t,n]=P(!1);return y(uf,{get open(){return t()},onOpenChange:n,get children(){return[y(df,{get children(){return y(ke,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(fc,{size:20})}})}}),y(ff,{get children(){return y(hf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(dc,{size:14}),(()=>{var r=wh();return A(r,()=>dt("restart")),r})()]}})}})]}})};function Sh(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Eh(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function kh(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function Ch(e){return ge({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var Oh=M('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const Zr=()=>{const{chatWidget:e}=se(),[t,n]=P(!1);let r=null;const o=h=>{const p=h;return!!(p.requestFullscreen||p.webkitRequestFullscreen||p.msRequestFullscreen)},s=async h=>{const p=h;try{if(p.requestFullscreen)return await p.requestFullscreen(),!0;if(p.webkitRequestFullscreen)return p.webkitRequestFullscreen(),!0;if(p.msRequestFullscreen)return p.msRequestFullscreen(),!0}catch{}return!1},i=async()=>{const h=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(h.webkitExitFullscreen)return h.webkitExitFullscreen(),!0;if(h.msExitFullscreen)return h.msExitFullscreen(),!0}catch{}return!1},a=h=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",h.classList.add("st-fullscreen"),n(!0)},l=h=>{h.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},c=async()=>{try{const h=Xt();if(!h)return;if(!t())o(h)&&await s(h)||a(h);else{const p=document;(document.fullscreenElement||p.webkitFullscreenElement||p.msFullscreenElement)&&await i()||l(h)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},d=()=>{const h=document,p=!!(document.fullscreenElement||h.webkitFullscreenElement||h.msFullscreenElement);if(n(p),!p)try{const f=Xt();f.classList.contains("st-fullscreen")&&l(f)}catch{}};document.addEventListener("fullscreenchange",d),document.addEventListener("webkitfullscreenchange",d);const u=()=>{e()?.mode==="popup"&&ee("close")};return ne("toggleFullscreen",()=>{c()}),(()=>{var h=Oh(),p=h.firstChild;return A(h,y(cc,{}),p),A(p,y(ke,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:c,get children(){return y(Z,{get when(){return t()},get fallback(){return y(Eh,{size:16})},get children(){return y(Sh,{size:16})}})}}),null),A(p,y(Z,{get when(){return e()?.showSettings},get children(){return y(xh,{})}}),null),A(p,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(ke,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:u,get children(){return y(Ch,{size:16})}})}}),null),h})()};var _h=M("<span>");const Ui=({createdAt:e,anchor:t="end"})=>(()=>{var n=_h();return gt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var Ph=M('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const Ah=({children:e,createdAt:t})=>(()=>{var n=Ph(),r=n.firstChild;return A(r,e),A(n,y(Ui,{createdAt:t,anchor:"start"}),null),n})();var Th=M("<span>");const Ot=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Na(Ka(n))),(()=>{var r=Th();return r.innerHTML=n,tt(r,T({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Lh=M('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Dh=({options:e,text:t})=>{let n;const{pushMessage:r}=Qe(),[o,s]=P(!1),i=(a,l)=>{s(!0),r(a,l)};return(()=>{var a=Lh(),l=a.firstChild,c=l.firstChild;A(a,y(Ot,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?or(d,c):n=c,A(c,y(ht,{each:e,children:u=>y(ke,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>i(u.label,u.value),get children(){return u.label?.trim()}})})),oe(()=>gt(l,`flex items-center justify-center max-w-80 mx-[-1rem] ${o()&&"opacity-50"}`)),a})()};var Mh=M('<div class="flex flex-col"><span>'),Ih=M("<a target=_blank><img><span></span><span>");const Rh=({options:e,text:t})=>(()=>{var n=Mh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(ht,{each:e,children:o=>(()=>{var s=Ih(),i=s.firstChild,a=i.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),oe(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(s,"href",c.e=d),u!==c.t&&ue(i,"src",c.t=u),c},{e:void 0,t:void 0}),s})()}),null),n})();var Fh=M("<a target=_blank>");const $h=({url:e,text:t})=>(()=>{var n=Fh();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,ji=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Nh=e=>{const t=T({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[C(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},qi=Nh,Gt=e=>typeof e=="function",Kh=["button","color","file","image","reset","submit"],Bh=(e,t)=>e==="button"?!0:e==="input"&&t?Kh.indexOf(t)!==-1:!1;function zh(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,i=>H(()=>{let a;return Gt(i)?a=i(o()):a=i,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Qr=zh,Fn=new Map,$n=(e,t)=>{if(Fn.has(e))return Fn.get(e);const n=ce(t);return Fn.set(e,n),n},eo=e=>{const t=Fn.get(e);if(t)return he(t)},Nn=new Map,Vh=e=>{L(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const s in t)r[s]=e.element.style[s];const o=Nn.get(e.key);o?o.activeCount++:Nn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(e.element.style,e.style);for(const s of n)e.element.style.setProperty(s.key,s.value);K(()=>{const s=Nn.get(e.key);if(s){if(s.activeCount!==1){s.activeCount--;return}Nn.delete(e.key);for(const[i,a]of Object.entries(s.originalStyles))e.element.style[i]=a;for(const i of s.properties)e.element.style.removeProperty(i);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Uh=Vh,jh=e=>{const t=T({enabled:!0},e);L(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},qh=jh,Hh=e=>{const t=T({enabled:!0},e);L(()=>{const{body:n}=document;G(t.enabled)&&Uh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Wh=Hh,Gh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);L(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),s=G(t.ignore);o&&!o.contains(r.target)&&!(s&&s.contains(r.target))&&t.onPointer(r)}},Yh=Gh,Xh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);qh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Yh({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),Wh({enabled:t.noOutsidePointerEvents})},Jh=Xh,to=ce(),Zh=e=>C(()=>{if(he(to))return y(Hi,e);const r=Te(),[o,s]=P([r]),i=l=>{s(c=>[...c,l])},a=l=>{s(c=>c.filter(d=>d!==l))};return y(to.Provider,{value:{layers:o,onLayerShow:i,onLayerDismiss:a},get children(){return y(Hi,e)}})}),Hi=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(to),s=Te();L(()=>{n.enabled?o.onLayerShow(s):o.onLayerDismiss(s)});const i=()=>o.layers()[o.layers().length-1]===s;Jh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&i()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&i()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=C(()=>n.children),l=()=>{const c=a();return Gt(c)?c({get isLastLayer(){return i()}}):c};return H(()=>l())},Qh=Zh,eg=()=>{const[e,t]=P(!1);return L(()=>t(!0)),e},tg=eg,ng=(e,t)=>(e&&(Gt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),no=(...e)=>e.some(t=>!!t()),rg=e=>(...t)=>{for(const n of e)n&&n(...t)},Kn=(...e)=>rg(e),le=e=>e?"":void 0,og="div",sg=e=>{const[t,n]=j(e,["as"]),r=C(()=>t.as??og);return C(()=>{const s=r();switch(typeof s){case"function":return H(()=>s(n));case"string":return y(ln,T({component:s},n))}})},ro=sg,ig=e=>{let t,n=!1;return()=>n?t:(n=!0,t=C(e))},Wi=ig,ag=e=>C(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),lg=ag,Gi="button",cg=e=>{const[t,n]=P(null),[r,o]=j(e,["as","ref","type"]),s=lg({element:t,fallback:Gi}),i=C(()=>Bh(s(),r.type));return y(ro,T({get as(){return r.as??Gi},ref(a){var l=Kn(n,r.ref);typeof l=="function"&&l(a)},get type(){return i()?"button":void 0},get role(){return i()?void 0:"button"}},o))},ug=cg,dg='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',oo="focusTrap.initialFocus",so="focusTrap.finalFocus",Yi={bubbles:!1,cancelable:!0},fg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=C(()=>{const f=n();return f?f[0]??null:null}),s=C(()=>{const f=n();return f?f[f.length-1]??null:null});let i=null;const a=()=>{kr(()=>{l(J(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(J(t.element))})};L(()=>{const f=J(t.element);if(f&&J(t.enabled)){i=document.activeElement,H(()=>{l(f),c(f)});const g=new MutationObserver(a);J(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&g.disconnect(),r(null),p(f)})}}),L(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),K(()=>{document.removeEventListener("keydown",h)}))}),L(()=>{const f=o();f&&(f.addEventListener("keydown",d),K(()=>{f.removeEventListener("keydown",d)}))}),L(()=>{const f=s();f&&(f.addEventListener("keydown",u),K(()=>{f.removeEventListener("keydown",u)}))});const l=f=>{const g=Array.from(f.querySelectorAll(dg)).map((m,b)=>({element:m,domIndex:b,tabIndex:m.tabIndex})).sort((m,b)=>m.tabIndex===b.tabIndex?m.domIndex-b.domIndex:m.tabIndex-b.tabIndex);r(g.map(({element:m})=>m))},c=f=>{kr(()=>{const g=J(t.initialFocusElement)??o()??f,m=t.onInitialFocus;let b;m&&(b=new CustomEvent(oo,Yi),f.addEventListener(oo,m),f.dispatchEvent(b),f.removeEventListener(oo,m)),b?.defaultPrevented!==!0&&g.focus()})},d=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),s().focus())},u=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},p=f=>{kr(()=>{if(!J(t.restoreFocus))return;const m=J(t.finalFocusElement)??i;if(!m)return;let b;const v=t.onFinalFocus;v&&(b=new CustomEvent(so,Yi),f.addEventListener(so,v),f.dispatchEvent(b),f.removeEventListener(so,v)),b?.defaultPrevented!==!0&&m.focus()})}},hg=fg,gg=hg,pg=e=>{const t=C(()=>{const i=J(e.element);if(i)return getComputedStyle(i)}),n=()=>t()?.animationName??"none",[r,o]=P(J(e.show)?"present":"hidden");let s="none";return L(i=>{const a=J(e.show);return H(()=>{if(i===a)return a;const l=s,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(i===!0&&l!==c?"hiding":"hidden")}),a}),L(()=>{const i=J(e.element);if(!i)return;const a=c=>{c.target===i&&(s=n())},l=c=>{const u=n().includes(c.animationName);c.target===i&&u&&r()==="hiding"&&o("hidden")};i.addEventListener("animationstart",a),i.addEventListener("animationcancel",l),i.addEventListener("animationend",l),K(()=>{i.removeEventListener("animationstart",a),i.removeEventListener("animationcancel",l),i.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},mg=pg,Xi=mg,yg=ce(),bg=e=>e?$n(`dialog-${e}`):yg,Ji=ce(),vg=e=>e?$n(`dialog-internal-${e}`):Ji,_t=e=>{if(!e){const n=he(Ji);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=eo(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},wg="div",xg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().contentPresent),s=C(i=>i||o(),!1);return y(Z,{get when(){return s()},get children(){return y(Qh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:i=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(ro,T({ref(l){var c=Kn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??wg},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return le(r().open())},get"data-closed"(){return le(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":i.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},Sg=xg,Eg="div",kg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().overlayPresent),s=C(i=>i||o(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const i=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(ro,T({get as(){return t.as??Eg},ref(a){var l=Kn(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return le(r().open())},get"data-closed"(){return le(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return i()}}))}})})()}})},Cg=kg,Og=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),s=tg(),i=C(a=>a||o()&&s(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(Ho,T(n,{get children(){return a()}}))}})})()}})},_g=Og,io=!0,Pg=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??io),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??io),preventScroll:()=>!!(e.modal??io),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Te()},e),[n,r]=Qr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,s,i]=qi({value:()=>t.labelId??Te()}),[a,l,c]=qi({value:()=>t.descriptionId??Te()}),[d,u]=P(null),[h,p]=P(null),[f,g]=P(null),{present:m}=Xi({show:n,element:h}),{present:b}=Xi({show:n,element:f});gg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),qs({element:h,enabled:()=>m()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const v={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return m()},get contentRef(){return h()},get overlayPresent(){return b()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Wi(()=>t.children),x=()=>{const k=w()();return Gt(k)?k(v):k};return C(()=>{const k=bg(t.contextId),E=vg(t.contextId);return y(k.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(E.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:s,unregisterLabelId:i,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:p,setOverlayRef:g,triggerRef:d,setTriggerRef:u}},get children(){return H(()=>x())}})}})})},Ag=Pg,Tg="button",Lg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=C(()=>_t(t.contextId));return y(ug,T({ref(s){var i=Kn(r().setTriggerRef,t.ref);typeof i=="function"&&i(s)},get as(){return t.as??Tg},onClick:s=>{!ng(t.onClick,s)&&r().setOpen(i=>!i)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return le(r().open())},get"data-closed"(){return le(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},Dg=Lg,Bn=e=>typeof e=="function"?e():e,Zi=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Mg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,s]=P(null);let i=null;L(()=>{const c=Bn(t.element),d=Bn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],h=Bn(t.dimension);h==="both"?i?i[0]!==u[0]&&i[1]!==u[1]&&(Ee(()=>{s(i),r(!0)}),Zi(()=>{s(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):i=u:i?zn(h,i)!==zn(h,u)&&(Ee(()=>{s(zn(h,i)),r(!0)}),Zi(()=>{s(zn(h,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):i=u},l=()=>{if(!n())return;const c=Bn(t.element);c?i=[c.offsetWidth,c.offsetHeight]:i=null,Ee(()=>{r(!1),s(null)})};return{transitioning:n,transitionSize:o}}var zn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Ig=Mg,Rg=Ig;const Fg=(e,t)=>e.length>0?()=>e(H(t)):e;function $g(e,t){let n=0;const r=e.map((o,s)=>C(()=>(n=s,o()),void 0,lr));return C(()=>r.map(o=>o())[n],void 0,t)}function Qi(e,t,n){let r=()=>t;const[o,s]=P(t,lr),i=C(Fg(e,()=>r()),t,lr);return[r=$g([o,i],n),a=>s(()=>typeof a=="function"?a(H(r)):a)]}var Ng=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Kg=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Bg=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,s=0,i=0,a=!1;do{const[l,c,d]=Ng(o,t),u=d-l-r*c;(c!==0||u!==0)&&Kg(o,t)&&(s+=u,i+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[s,i]},zg=e=>y(Dg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),ea=ce(),Vg=e=>e?$n(`drawer-${e}`):ea,Ug=e=>{if(!e){const n=he(ea);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=eo(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ta=ce(),jg=e=>e?$n(`drawer-internal-${e}`):ta,na=e=>{if(!e){const n=he(ta);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=eo(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ra=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vn(e,t)};const o=r[n-1]?Vn(r[n-1],t):void 0,s=r[n]?Vn(r[n],t):void 0;return{value:e,offset:Vn(e,t),lowerBreakPoint:s,upperBreakPoint:o}},Vn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},qg=(e,t,n,r)=>{const o=oa("upper",e,r?n:t),s=oa("lower",e,r?n:t);return o?s?s.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(s.offset-n)<Math.abs(o.offset-n)?s:o:n<o.lowerBreakPoint?s:o:o:s},oa=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Hg=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},Wg=void 0,Gg=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[Wg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,V)=>{const Q=$/V;return Q<1&&Q>-1?1:Q},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,s]=Qr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[i,a]=Qr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:d,transitionSize:u}=Rg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,p]=P(!1),[f,g]=Qi(()=>d()?"resizing":null),m=C(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[b,v]=P(!1);L(()=>{const $=o();H(()=>{b()!==$&&($?(v(!0),ji(()=>{Ee(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&g(null)})):(Ee(()=>{g("closing"),a(0)}),ji(()=>{parseFloat(m().transitionDuration)===0&&w()})))})});const w=()=>{Ee(()=>{v(!1),g(null)})},[x,O]=P(0);L(()=>{const $=l()?.contentRef();if(!$)return;E($);const V=new ResizeObserver(k);V.observe($),K(()=>{V.disconnect()})});const k=$=>{for(const V of $)V.target===l()?.contentRef()&&E(V.target)},E=$=>{const V=H(()=>x());switch(n.side){case"top":case"bottom":if(V===$.offsetHeight)return;O($.offsetHeight);break;case"left":case"right":if(V===$.offsetWidth)return;O($.offsetWidth);break}},F=C(()=>ra(i(),x())),[_,R]=Qi(()=>F().offset),D=C(()=>x()?(x()-_())/x():0),I={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return i()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return D()},get translate(){return _()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},re=Wi(()=>n.children),Y=$=>{c(_t(n.contextId));const V=re()();if(Gt(V)){const Q=T($,I);return V(Q)}return V};return C(()=>{const $=Vg(n.contextId),V=jg(n.contextId);return H(()=>y($.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:i,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:D,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:i,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:D,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:p,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:F,drawerStyles:m,setTransitionState:g,transitionSize:u,closeDrawer:w}},get children(){return y(Ag,T({get open(){return b()},onOpenChange:s,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:Q=>Y(Q)}))}})}}))})},Yg=Gg,Xg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,s=[0,0],i,a=0;const l=C(()=>na(t.contextId)),c=C(()=>_t(t.contextId)),d=C(()=>l().snapPoints().map((w,x)=>ra(w,l().drawerSize(),x,l().breakPoints()))),u=C(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),h=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),p=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});L(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",m),document.addEventListener("pointerup",v),document.addEventListener("touchend",v),K(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",v),document.removeEventListener("touchend",v)}))});const f=w=>{Hg(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(s=[w.clientX,w.clientY]))},g=w=>{b(w.target,w.clientX,w.clientY)},m=w=>{w.touches[0]&&b(w.target,w.touches[0].clientX,w.touches[0].clientY)},b=(w,x,O)=>{if(!r)return;if(!l().isDragging()||o===null){const F=window.getSelection();if(F&&F.toString().length>0){v();return}if(l().handleScrollableElements()){const _=[x,O].map((fe,$)=>s[$]-fe),R=Math.abs(_[0])>Math.abs(_[1])?"x":"y",D=R==="x"?_[0]:_[1];if(Math.abs(D)<.3)return;const I=c().contentRef(),[re,Y]=Bg(w,R,I);if(D>0&&Math.abs(re)>1||D<0&&Math.abs(Y)>0){v();return}}switch(l().side()){case"top":case"bottom":o=O;break;case"right":case"left":o=x}i=new Date,a=l().translate(),Ee(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let k;switch(l().side()){case"top":k=-(o-O);break;case"bottom":k=o-O;break;case"right":k=o-x;break;case"left":k=-(o-x);break}k-=l().resolvedActiveSnapPoint().offset,k>0&&(k=l().dampFunction(k));const E=new Date;E.getTime()-i.getTime()>l().velocityCacheReset()&&(i=E,a=l().translate()),l().setTranslate(-k)},v=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-i.getTime()||1),O=l().translate()*x,k=qg(d(),l().translate(),O,l().allowSkippingSnapPoints());Ee(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Ee(()=>{l().setActiveSnapPoint(k.value),k.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(k.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(Sg,T({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:p(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ee(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return le(l().isTransitioning())},get"data-opening"(){return le(l().transitionState()==="opening")},get"data-closing"(){return le(l().transitionState()==="closing")},get"data-snapping"(){return le(l().transitionState()==="snapping")},get"data-resizing"(){return le(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Jg=Xg,Zg=e=>{const[t,n]=j(e,["contextId"]),r=C(()=>na(t.contextId));return y(Cg,T({get contextId(){return t.contextId},get"data-transitioning"(){return le(r().isTransitioning())},get"data-opening"(){return le(r().transitionState()==="opening")},get"data-closing"(){return le(r().transitionState()==="closing")},get"data-snapping"(){return le(r().transitionState()==="snapping")},get"data-resizing"(){return le(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Qg=Zg,ep=M('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const tp=Yg,np=zg,rp=_g,op=e=>{const[,t]=j(e,["class"]),n=Ug();return y(Qg,T({get class(){return Ge("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},sp=e=>{const[,t]=j(e,["class","children"]);return y(rp,{get mount(){return Xt()},get children(){return[y(op,{}),y(Jg,T({id:"smarttalks-list-content",get class(){return Ge("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[ep(),C(()=>e.children)]}}))]}})};var ip=M('<span class="font-semibold mt-2">'),ap=M('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),lp=M('<div class="flex flex-col space-y-2"><div>'),cp=M('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),up=M('<div class="flex flex-col items-start"><span class=text-slate-500>');const dp=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qe(),[o,s]=P(!1),[i,a]=P(!1),[l,c]=P(),d=(h,p)=>{a(!1),s(!0),r(h,p)},u=h=>{const p=h.composedPath();for(const f of p)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=lp(),p=h.firstChild;return A(h,y(Ot,{get children(){return t?.trim()}}),p),A(p,y(tp,{get open(){return i()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(np,{as:ke,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??dt("selectOption")}}),y(sp,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=ip();return A(f,()=>n?.trim()??dt("selectOption")),f})(),(()=>{var f=ap();return A(f,y(ht,{each:e,children:g=>(()=>{var m=cp(),b=m.firstChild;return A(b,()=>g.label?.trim()??""),A(m,y(ht,{get each(){return g.items},children:v=>y(ke,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===v?"bg-slate-200":""}`},onClick:()=>c(v),get children(){return[(()=>{var w=up(),x=w.firstChild;return A(w,()=>v.label?.trim(),x),A(x,()=>v.description?.trim()),w})(),y(Z,{get when(){return l()===v},get fallback(){return y(lf,{class:"size-4 text-slate-500"})},get children(){return y(af,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),f})(),y(ke,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return dt("send")}})]}})]}})),oe(()=>gt(p,o()?"opacity-50":"")),h})()};var fp=M("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const hp=e=>(()=>{var t=fp(),n=t.firstChild,r=n.nextSibling;return oe(o=>{var s=e.link,i=e.link;return s!==o.e&&ue(n,"src",o.e=s),i!==o.t&&ue(r,"src",o.t=i),o},{e:void 0,t:void 0}),t})();var gp=M('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const pp=e=>(()=>{var t=gp(),n=t.firstChild,r=n.firstChild;return A(n,y(cf,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(Ot,{get children(){return e.text?.trim()}}),null),oe(()=>ue(n,"href",e.link)),t})();var mp=M('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const yp=e=>(()=>{var t=mp(),n=t.firstChild,r=n.firstChild;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),oe(o=>{var s=e.link,i=e.link,a=e.text?.trim();return s!==o.e&&ue(n,"href",o.e=s),i!==o.t&&ue(r,"src",o.t=i),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var bp=M('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const vp=e=>(()=>{var t=bp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),oe(s=>{var i=e.link,a=e.link;return i!==s.e&&ue(r,"src",s.e=i),a!==s.t&&ue(o,"src",s.t=a),s},{e:void 0,t:void 0}),t})();var wp=M("<div>Media type not supported");const sa=e=>e.type==="image"?y(yp,e):e.type==="audio"?y(hp,e):e.type==="document"?y(pp,e):e.type==="video"?y(vp,e):wp(),ao=({text:e})=>y(Ot,{get children(){return e?.trim()}});var xp=M("<div>Unknown bot message type");const Sp=e=>y(Ah,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ao,{get text(){return e.text}}):e.type==="buttons"?y(Dh,T(()=>e.buttons)):e.type==="list"?y(dp,T(()=>e.list)):e.type==="media"?y(sa,T(()=>e.media)):e.type==="link"?y($h,T(()=>e.link)):e.type==="cards"?y(Rh,T(()=>e.cards)):e.type==="date"?y(ao,{get text(){return e.text}}):xp()}});var Ep=M('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const kp=e=>(()=>{var t=Ep(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var Cp=M('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const Op=({children:e,createdAt:t})=>(()=>{var n=Cp(),r=n.firstChild;return A(r,e),A(n,y(Ui,{createdAt:t,anchor:"end"}),null),n})();var _p=M("<div>Unknown user message type");const Pp=e=>y(Op,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ao,{get text(){return e.text}}):e.type==="media"?y(sa,T(()=>e.media)):_p()}});var Ap=M("<div>Unknown message origin");const Tp=e=>e.origin==="bot"?y(Sp,e):e.origin==="user"?y(Pp,e):e.origin==="service"?y(kp,e):Ap();function Lp(e){return ge({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function lo(e){return ge({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Dp=M('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0">'),Mp=M("<div>");const co=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r}=Qe(),{onOpen:o}=Xo(),s=(i=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},i)};return ne("reset",()=>{r()}),tn(()=>{s(200)}),n(s),o(()=>s(200)),(()=>{var i=Dp(),a=e;return typeof a=="function"?or(a,i):e=i,A(i,y(ht,{get each(){return t()},get fallback(){return(()=>{var l=Mp();return A(l,()=>dt("emptyMessages")),l})()},children:l=>y(Tp,l)})),i})()};var Ip=M("<textarea>");const Rp=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Ip();return tt(n,T({get class(){return Ge("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md:text-sm ring-offset-background 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",e.class)}},t),!1,!1),n})()};var Fp=M('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const $p=e=>(()=>{var t=Fp();return tt(t,e,!0,!0),t})();var Np=M('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Kp=()=>(()=>{var e=Np(),t=e.firstChild;return A(e,y($p,{height:15}),t),e})();var Bp=M('<footer class="relative flex-none p-4 bg-white min-h-16 flex space-x-1 pb-6">');const uo=()=>{const{pushMessage:e}=Qe(),[t,n]=P(""),r=()=>{e(t()),n("")},o=s=>{s.key==="Enter"&&!s.shiftKey&&r()};return ne("setInput",s=>{s&&n(s)}),(()=>{var s=Bp();return A(s,y(Rp,{get placeholder(){return dt("inputPlaceholder")},get value(){return t()},onInput:i=>n(i.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),A(s,y(ke,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return y(gc,{size:24})}}),null),A(s,y(Kp,{}),null),s})()};var zp=M('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Vp=M("<span class=sr-only>Close"),Up=M('<div><div class="flex justify-center gap-3">'),jp=M("<span class=sr-only>Open"),qp=M('<span class="animate-pulse delay-150 font-bold">'),Hp=M("<span>"),Wp=M('<div class="animate-pulse flex p-1">');const Gp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:s}=Xo(),{chatWidget:i}=se(),[a,l]=P(!0),[c,d]=P("");setTimeout(()=>l(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},(i()?.openDelay||0)*1e3);const u=()=>(i()?.style.margin??5)/4,h=()=>i()?.style.position==="left"?{left:`${u()}rem`}:{right:`${u()}rem`};return ne("open",()=>{o()}),ne("close",()=>{s()}),ne("toggle",()=>{r()}),ne("onAnswer",p=>{p.text&&d(p.text),o()}),(()=>{var p=Up(),f=p.firstChild;return A(p,y(Z,{get when(){return n()},get children(){var g=zp();return A(g,e),g}}),f),A(f,y(Z,{get when(){return i()?.whatsappBtn},get children(){return y(ke,{onclick:()=>window.open(i()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full py-6 px-3 shadow-md hover:bg-green-400",type:"button",get children(){return y(kh,{size:25,color:"white"})}})}}),null),A(f,y(Z,{get when(){return n()},get fallback(){return y(ke,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,jp(),y(Z,{get when(){return i()?.balloonMessage},get children(){var g=Hp();return A(g,y(Z,{get when(){return c()},get fallback(){return y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=Wp();return A(m,y(lo,{class:"size-2 animate-bounce"}),null),A(m,y(lo,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(lo,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return i()?.balloonMessage}})},get children(){var m=qp();return A(m,(()=>{var b=C(()=>c().length>20);return()=>b()?c().substring(0,17)+"...":c()})()),m}})),oe(()=>gt(g,"absolute -top-6 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(i()?.style.position==="left"?" left-9":" right-9"))),g}})]}})},get children(){return y(ke,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[y(Lp,{size:30}),Vp()]}})}}),null),oe(g=>{var m="max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(i()?.style.position==="left"?" items-start":" items-end"),b=h();return m!==g.e&>(p,g.e=m),g.t=an(p,b,g.t),g},{e:void 0,t:void 0}),p})()};var Yp=M('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Xp=({children:e})=>{const{chatWidget:t}=se(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Yp();return an(r,n),A(r,e),r})()};var Jp=M('<div id=smarttalks-widget class="h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col">');const Zp=({children:e})=>{const{chatWidget:t}=se(),[n,r]=P(!1),o=()=>(t()?.style.margin??5)/4,s=()=>{const i={};return t()?.fullscreen?(i.height="100%",i["max-height"]="100%",i.width="100%",i["max-width"]="100%",i.bottom=0,i.left=0):t()?.style.position&&(i[t()?.style.position||"right"]=`${o()}rem`),i};return ne("open",()=>{r(!0),ee("onOpen")}),ne("close",()=>{r(!1),ee("onClose")}),ne("toggle",()=>{r(!n()),ee("onToggle")}),ne("onAnswer",()=>{r(!0),ee("onOpen")}),setTimeout(()=>{r(!0),ee("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var i=Jp();return A(i,e),oe(a=>an(i,s(),a)),i}})};var Qp=M('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const fo=()=>(()=>{var e=Qp();return A(e,y(hc,{size:45,class:"animate-spin"})),e})(),em=()=>{const{chatWidget:e}=se(),{loading:t}=Qe();return y(Gp,{get openIcon(){return y(ss,{get src(){return e()?.avatar}})},get children(){return[y(Z,{get when(){return t()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},tm=()=>{const{loading:e}=Qe();return y(Zp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},nm=()=>{const{loading:e}=Qe();return y(Xp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},rm=()=>{const{chatWidget:e}=se();return y(Bo,{get children(){return[y(Mt,{get when(){return e()?.mode==="standard"},get children(){return y(em,{})}}),y(Mt,{get when(){return e()?.mode==="popup"},get children(){return y(tm,{})}}),y(Mt,{get when(){return e()?.mode==="static"},get children(){return y(nm,{})}})]}})};var om=M("<div><div>Form");const sm=()=>{const{formWidget:e}=se();return(()=>{var t=om();return t.firstChild,A(t,()=>e()?._id,null),t})()};function im(){const{widget:e}=se();return y(Bo,{get children(){return[y(Mt,{get when(){return e()?.type==="chat"},get children(){return y(rm,{})}}),y(Mt,{get when(){return e()?.type==="form"},get children(){return y(sm,{})}})]}})}var am=M("<style>"),lm=M("<div>");const cm=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:s}=se(),i=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return s(i),[(()=>{var a=am();return A(a,zl),a})(),(()=>{var a=lm();return A(a,y(im,{})),a})()]},um={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Bl("smarttalks-widget",um,cm)})(),Va()});
|
|
181
|
+
*/function Wd(e,t){return t?jc([e.clientX,e.clientY],t):!1}function Gd(e){const t=kt(),n=$s(),r=hi(),o=De({placement:"bottom-start"},e),[s,i]=j(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[d,u]=P(),[h,p]=P(),[f,g]=P(),[m,b]=P(),[v,w]=P(!0),[x,O]=P(i.placement),[k,E]=P([]),[F,_]=P([]),{DomCollectionProvider:R}=Vu({items:F,onItemsChange:_}),D=ws({open:()=>s.open,defaultOpen:()=>s.defaultOpen,onOpenChange:U=>s.onOpenChange?.(U)}),I=uu(()=>t.forceMount()||D.isOpen()),re=Tu({selectionMode:"none",dataSource:F}),Y=U=>{w(U),D.open()},fe=(U=!1)=>{D.close(),U&&r&&r.close(!0)},$=U=>{w(U),D.toggle()},V=()=>{const U=m();U&&(de(U),re.selectionManager().setFocused(!0),re.selectionManager().setFocusedKey(void 0))},Q=U=>{E(ho=>[...ho,U]);const Un=r?.registerNestedMenu(U);return()=>{E(ho=>ur(ho,U)),Un?.()}},ie=U=>c===l?.side&&Wd(U,l?.area),Pt=U=>{ie(U)&&U.preventDefault()},Ae=U=>{ie(U)||V()},um=U=>{ie(U)&&U.preventDefault()};au({isDisabled:()=>!(r==null&&D.isOpen()&&t.isModal()),targets:()=>[m(),...k()].filter(Boolean)}),L(()=>{const U=m();if(!U||!r)return;const Un=r.registerNestedMenu(U);K(()=>{Un()})});const dm={dataset:C(()=>({"data-expanded":D.isOpen()?"":void 0,"data-closed":D.isOpen()?void 0:""})),isOpen:D.isOpen,contentPresence:I,nestedMenus:k,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:v,listState:()=>re,parentMenuContext:()=>r,triggerRef:f,contentRef:m,triggerId:d,contentId:h,setTriggerRef:g,setContentRef:b,open:Y,close:fe,toggle:$,focusContent:V,onItemEnter:Pt,onItemLeave:Ae,onTriggerLeave:um,setPointerDir:U=>c=U,setPointerGraceTimeoutId:U=>a=U,setPointerGraceIntent:U=>l=U,registerNestedMenu:Q,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:yn(u),registerContentId:yn(p)};return y(R,{get children(){return y(fi.Provider,{value:dm,get children(){return y(Hd,T({anchorRef:f,contentRef:m,onCurrentPlacementChange:O},i))}})}})}const Yd=ce();function Xd(e){let t;const n=kt(),r=Et(),o=De({id:n.generateId(`item-${Te()}`)},e),[s,i]=j(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,d]=P(),[u,h]=P(),p=()=>r.listState().selectionManager(),f=()=>i.id,g=()=>p().focusedKey()===f(),m=()=>{s.onSelect?.(),s.closeOnSelect&&r.close(!0)};Uu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:s.textValue??u()?.textContent??t?.textContent??"",disabled:s.disabled??!1})});const b=Pu({key:f,selectionManager:p,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),v=_=>{ge(_,s.onPointerMove),_.pointerType==="mouse"&&(s.disabled?r.onItemLeave(_):(r.onItemEnter(_),_.defaultPrevented||(de(_.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},w=_=>{ge(_,s.onPointerLeave),_.pointerType==="mouse"&&r.onItemLeave(_)},x=_=>{ge(_,s.onPointerUp),!s.disabled&&_.button===0&&m()},O=_=>{if(ge(_,s.onKeyDown),!_.repeat&&!s.disabled)switch(_.key){case"Enter":case" ":m();break}},k=C(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),E=C(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":g()?"":void 0})),F={isChecked:()=>s.checked,dataset:E,setLabelRef:h,generateId:cs(()=>i.id),registerLabel:yn(l),registerDescription:yn(d)};return y(Yd.Provider,{value:F,get children(){return y(bn,T({as:"div",ref(_){var R=ot(D=>t=D,s.ref);typeof R=="function"&&R(_)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return we([s.onPointerDown,b.onPointerDown])},get onPointerUp(){return we([x,b.onPointerUp])},get onClick(){return we([s.onClick,b.onClick])},get onKeyDown(){return we([O,b.onKeyDown])},get onMouseDown(){return we([s.onMouseDown,b.onMouseDown])},get onFocus(){return we([s.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:w},E,i))}})}const Jd=ce();function pi(){return he(Jd)}function Zd(e){let t;const n=kt(),r=Et(),o=pi(),s=De({id:n.generateId(`content-${Te()}`)},e),[i,a]=j(s,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=Du({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);su({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&i.onOpenAutoFocus?.(m)},onUnmountAutoFocus:i.onCloseAutoFocus},()=>t);const u=m=>{if(Le(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=m=>{i.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},p=m=>{i.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},f=m=>{ge(m,i.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=m=>{if(ge(m,i.onPointerMove),m.pointerType!=="mouse")return;const b=m.target,v=l!==m.clientX;Le(m.currentTarget,b)&&v&&(r.setPointerDir(m.clientX>l?"right":"left"),l=m.clientX)};return L(()=>K(r.registerContentId(i.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y(td,{get children(){return y(Qu,T({ref(m){var b=ot(v=>{r.setContentRef(v),r.contentPresence.setRef(v),t=v},i.ref);typeof b=="function"&&b(m)},role:"menu",get id(){return i.id},get tabIndex(){return d.tabIndex()},get disableOutsidePointerEvents(){return C(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...i.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:p,get onDismiss(){return r.close},get onKeyDown(){return we([i.onKeyDown,d.onKeyDown,u])},get onMouseDown(){return we([i.onMouseDown,d.onMouseDown])},get onFocusIn(){return we([i.onFocusIn,d.onFocusIn])},get onFocusOut(){return we([i.onFocusOut,d.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Qd(e){let t;const n=kt(),r=Et(),[o,s]=j(e,["ref"]);return qs({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Zd,T({ref(i){var a=ot(l=>{t=l},o.ref);typeof a=="function"&&a(i)}},s))}function ef(e){return y(Xd,T({role:"menuitem",closeOnSelect:!0},e))}function tf(e){const t=Et();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(Ho,e)}})}function nf(e){const t=`menu-${Te()}`,n=De({id:t,modal:!0},e),[r,o]=j(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),s=ws({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),i={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??i.isModal(),forceMount:()=>r.forceMount??!1,generateId:cs(()=>r.id),value:()=>r.value};return y(gi.Provider,{value:i,get children(){return y(Gd,T({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},o))}})}function rf(e){const t=kt(),n=Et(),r=pi(),o=De({id:t.generateId("trigger")},e),[s,i]=j(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??s.id,L(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),L(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),L(()=>{n.isOpen()&&r.setValue(a)}),K(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{ge(f,s.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!s.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},d=f=>{ge(f,s.onClick),s.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},u=f=>{if(ge(f,s.onKeyDown),!s.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),qc(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{ge(f,s.onMouseOver),!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},p=f=>{ge(f,s.onFocus),r!==void 0&&r.setValue(a)};return L(()=>K(n.registerTriggerId(s.id))),y(Ru,T({ref(f){var g=ot(n.setTriggerRef,s.ref);typeof g=="function"&&g(f)},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return C(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:h,onClick:d,onKeyDown:u,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),i))}function of(e){const t=kt(),n=Et(),[r,o]=j(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return y(Qd,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),s||de(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},o))}function sf(e){const t=`dropdownmenu-${Te()}`,n=De({id:t},e);return y(nf,n)}function af(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function lf(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function cf(e){return ve({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const uf=e=>y(sf,T({gutter:4},e)),df=rf,ff=e=>{const[,t]=j(e,["class"]);return y(tf,{get mount(){return Xt()},get children(){return y(of,T({get class(){return Ge("z-50 min-w-[128px] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},hf=e=>{const[,t]=j(e,["class"]);return y(ef,T({get class(){return Ge("relative flex cursor-default select-none items-center rounded-sm 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",e.class)}},t))};function gf(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function pf(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function mf(e,t,n){const r=`${Jt}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function yf(e,t,n){if(!e||!t||!n)return;const r=`${Jt}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const Fe=Object.create(null);Fe.open="0",Fe.close="1",Fe.ping="2",Fe.pong="3",Fe.message="4",Fe.upgrade="5",Fe.noop="6";const _n=Object.create(null);Object.keys(Fe).forEach(e=>{_n[Fe[e]]=e});const Fr={type:"error",data:"parser error"},mi=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",yi=typeof ArrayBuffer=="function",bi=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,$r=({type:e,data:t},n,r)=>mi&&t instanceof Blob?n?r(t):vi(t,r):yi&&(t instanceof ArrayBuffer||bi(t))?n?r(t):vi(new Blob([t]),r):r(Fe[e]+(t||"")),vi=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function wi(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Nr;function bf(e,t){if(mi&&e.data instanceof Blob)return e.data.arrayBuffer().then(wi).then(t);if(yi&&(e.data instanceof ArrayBuffer||bi(e.data)))return t(wi(e.data));$r(e,!1,n=>{Nr||(Nr=new TextEncoder),t(Nr.encode(n))})}const xi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ht=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<xi.length;e++)Ht[xi.charCodeAt(e)]=e;const vf=e=>{let t=e.length*.75,n=e.length,r,o=0,s,i,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=Ht[e.charCodeAt(r)],i=Ht[e.charCodeAt(r+1)],a=Ht[e.charCodeAt(r+2)],l=Ht[e.charCodeAt(r+3)],d[o++]=s<<2|i>>4,d[o++]=(i&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},wf=typeof ArrayBuffer=="function",Kr=(e,t)=>{if(typeof e!="string")return{type:"message",data:Si(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:xf(e.substring(1),t)}:_n[n]?e.length>1?{type:_n[n],data:e.substring(1)}:{type:_n[n]}:Fr},xf=(e,t)=>{if(wf){const n=vf(e);return Si(n,t)}else return{base64:!0,data:e}},Si=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Ei="",Sf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((s,i)=>{$r(s,!1,a=>{r[i]=a,++o===n&&t(r.join(Ei))})})},Ef=(e,t)=>{const n=e.split(Ei),r=[];for(let o=0;o<n.length;o++){const s=Kr(n[o],t);if(r.push(s),s.type==="error")break}return r};function kf(){return new TransformStream({transform(e,t){bf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const s=new DataView(o.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{o=new Uint8Array(9);const s=new DataView(o.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Br;function Pn(e){return e.reduce((t,n)=>t+n.length,0)}function An(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Cf(e,t){Br||(Br=new TextDecoder);const n=[];let r=0,o=-1,s=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(r===0){if(Pn(n)<1)break;const l=An(n,1);s=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Pn(n)<2)break;const l=An(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pn(n)<8)break;const l=An(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Fr);break}o=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pn(n)<o)break;const l=An(n,o);a.enqueue(Kr(s?l:Br.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Fr);break}}}})}const ki=4;function te(e){if(e)return Of(e)}function Of(e){for(var t in te.prototype)e[t]=te.prototype[t];return e}te.prototype.on=te.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},te.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this},te.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},te.prototype.emitReserved=te.prototype.emit,te.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},te.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Se=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_f="arraybuffer";function pm(){}function Ci(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Pf=Se.setTimeout,Af=Se.clearTimeout;function Ln(e,t){t.useNativeTimers?(e.setTimeoutFn=Pf.bind(Se),e.clearTimeoutFn=Af.bind(Se)):(e.setTimeoutFn=Se.setTimeout.bind(Se),e.clearTimeoutFn=Se.clearTimeout.bind(Se))}const Tf=1.33;function Lf(e){return typeof e=="string"?Df(e):Math.ceil((e.byteLength||e.size)*Tf)}function Df(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Oi(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Mf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function If(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class Rf extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class zr extends te{constructor(t){super(),this.writable=!1,Ln(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Rf(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Kr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Mf(t);return n.length?"?"+n:""}}class Ff extends zr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Ef(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Sf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Oi()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _i=!1;try{_i=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const $f=_i;function Nf(){}class Kf extends Ff{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,s)=>{this.onError("xhr post error",o,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class $e extends te{constructor(t,n,r){super(),this.createRequest=t,Ln(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Ci(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=$e.requestsCount++,$e.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Nf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $e.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if($e.requestsCount=0,$e.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pi);else if(typeof addEventListener=="function"){const e="onpagehide"in Se?"pagehide":"unload";addEventListener(e,Pi,!1)}}function Pi(){for(let e in $e.requests)$e.requests.hasOwnProperty(e)&&$e.requests[e].abort()}const Bf=function(){const e=Ai({xdomain:!1});return e&&e.responseType!==null}();class zf extends Kf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Bf&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new $e(Ai,this.uri(),t)}}function Ai(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||$f))return new XMLHttpRequest}catch{}if(!t)try{return new Se[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ti=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vf extends zr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ti?{}:Ci(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;$r(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Oi()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Vr=Se.WebSocket||Se.MozWebSocket;class Uf extends Vf{createSocket(t,n,r){return Ti?new Vr(t,n,r):n?new Vr(t,n):new Vr(t)}doWrite(t,n){this.ws.send(n)}}class jf extends zr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Cf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=kf();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&Tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const qf={websocket:Uf,webtransport:jf,polling:zf},Hf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ur(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=Hf.exec(e||""),s={},i=14;for(;i--;)s[Wf[i]]=o[i]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Gf(s,s.path),s.queryKey=Yf(s,s.query),s}function Gf(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Yf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,s){o&&(n[o]=s)}),n}const jr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Dn=[];jr&&addEventListener("offline",()=>{Dn.forEach(e=>e())},!1);class Ze extends te{constructor(t,n){if(super(),this.binaryType=_f,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ur(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ur(n.host).host);Ln(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=If(this.opts.query)),jr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Dn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ki,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=Lf(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ze.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Dn.indexOf(this._offlineEventListener);r!==-1&&Dn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ze.protocol=ki;class Xf extends Ze{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ze.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ze.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const i=u=>{const h=new Error("probe error: "+u);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function a(){i("transport closed")}function l(){i("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",o),n.removeListener("error",i),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",i),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Jf=class extends Xf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>qf[o]).filter(o=>!!o)),super(t,r)}};function Zf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ur(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Qf=typeof ArrayBuffer=="function",eh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Li=Object.prototype.toString,th=typeof Blob=="function"||typeof Blob<"u"&&Li.call(Blob)==="[object BlobConstructor]",nh=typeof File=="function"||typeof File<"u"&&Li.call(File)==="[object FileConstructor]";function qr(e){return Qf&&(e instanceof ArrayBuffer||eh(e))||th&&e instanceof Blob||nh&&e instanceof File}function Mn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Mn(e[n]))return!0;return!1}if(qr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mn(e[n]))return!0;return!1}function rh(e){const t=[],n=e.data,r=e;return r.data=Hr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Hr(e,t){if(!e)return e;if(qr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Hr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Hr(e[r],t));return n}return e}function oh(e,t){return e.data=Wr(e.data,t),delete e.attachments,e}function Wr(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Wr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Wr(e[n],t));return e}const sh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ih=5;var z;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(z||(z={}));class ah{constructor(t){this.replacer=t}encode(t){return(t.type===z.EVENT||t.type===z.ACK)&&Mn(t)?this.encodeAsBinary({type:t.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===z.BINARY_EVENT||t.type===z.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=rh(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Di(e){return Object.prototype.toString.call(e)==="[object Object]"}class Gr extends te{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===z.BINARY_EVENT;r||n.type===z.BINARY_ACK?(n.type=r?z.EVENT:z.ACK,this.reconstructor=new lh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(qr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const i=t.substring(s,n);if(i!=Number(i)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(i)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const s=n+1;for(;++n;){const i=t.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(Gr.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case z.CONNECT:return Di(n);case z.DISCONNECT:return n===void 0;case z.CONNECT_ERROR:return typeof n=="string"||Di(n);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&sh.indexOf(n[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class lh{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=oh(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ch=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Gr,Encoder:ah,get PacketType(){return z},protocol:ih},Symbol.toStringTag,{value:"Module"}));function Pe(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const uh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Mi extends te{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Pe(t,"open",this.onopen.bind(this)),Pe(t,"packet",this.onpacket.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,s;if(uh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:z.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),i.id=d}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),i=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...n){return new Promise((r,o)=>{const s=(i,a)=>i?o(i):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...s)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:z.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case z.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case z.EVENT:case z.BINARY_EVENT:this.onevent(t);break;case z.ACK:case z.BINARY_ACK:this.onack(t);break;case z.DISCONNECT:this.ondisconnect();break;case z.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:z.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:z.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ct(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ct.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Ct.prototype.reset=function(){this.attempts=0},Ct.prototype.setMin=function(e){this.ms=e},Ct.prototype.setMax=function(e){this.max=e},Ct.prototype.setJitter=function(e){this.jitter=e};class Yr extends te{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ln(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ct({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||ch;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Jf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Pe(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},i=Pe(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Pe(t,"ping",this.onping.bind(this)),Pe(t,"data",this.ondata.bind(this)),Pe(t,"error",this.onerror.bind(this)),Pe(t,"close",this.onclose.bind(this)),Pe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tn(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Mi(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Wt={};function In(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Zf(e,t.path||"/socket.io"),r=n.source,o=n.id,s=n.path,i=Wt[o]&&s in Wt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let l;return a?l=new Yr(r,t):(Wt[o]||(Wt[o]=new Yr(r,t)),l=Wt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(In,{Manager:Yr,Socket:Mi,io:In,connect:In});class lt{static instance;constructor(){}static init(t){return lt.instance||(lt.instance=In(za,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t}}),lt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),lt.instance}static on(t,n,r){lt.instance||this.init(n).on(t,r)}}const Ii=1e3*60*60*24,[Rn,Ri]=ts("smarttalks-widget-messages",{},Ii),Fi=()=>{const{widgetId:e}=se();return Rn[e()]??[]},dh=e=>{const{widgetId:t}=se();Ri({...Rn,[t()]:[...Rn[t()]??[],e]})},fh=()=>{const{widgetId:e}=se();Ri({...Rn,[e()]:[]})},[$i,hh]=ts("smarttalks-widget-conversationinfo",{},Ii),Ni=()=>{const{widgetId:e}=se();return $i[e()]??{}},Ki=e=>{const{widgetId:t}=se();hh({...$i,[t()]:e})},[gh,Xr]=P(!1),[ph,Bi]=P(!1),zi=[],Vi=()=>{zi.forEach(e=>e())},mh=e=>zi.push(e),Jr=e=>{const t=gf(e);if(dh(t),t.type==="media"){setTimeout(Vi,200);return}Vi()},yh=(e,t)=>{const{chatWidget:n,widgetId:r}=se(),o=Ni();e.trim()&&(Jr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ee("onInput",e),lt.on("message",r(),s=>{(s.contactId!==o.contactId||s.interactionId!==o.interactionId)&&Ki({contactId:s.contactId,interactionId:s.interactionId});for(const i of s.messages)Jr(i),ee("onAnswer",i);Xr(!1),pf(s.debug)}),Xr(!0),mf(e,t,n()?._id).catch(s=>{console.error(s),Xr(!1)}))},bh=()=>{const{chatWidget:e}=se(),t=Ni();Bi(!0),fh(),yf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ki({}),Bi(!1),vh()}),ee("onReset")},vh=()=>{const{chatWidget:e}=se();if(Fi().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Jr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qe=()=>({getMessages:Fi,pushMessage:yh,clearMessages:bh,onMessage:mh,typing:gh,loading:ph});var wh=M("<span>");const xh=()=>{const{clearMessages:e}=Qe();P(!1);const[t,n]=P(!1);return y(uf,{get open(){return t()},onOpenChange:n,get children(){return[y(df,{get children(){return y(ke,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(fc,{size:20})}})}}),y(ff,{get children(){return y(hf,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(dc,{size:14}),(()=>{var r=wh();return A(r,()=>dt("restart")),r})()]}})}})]}})};function Sh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function Eh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function kh(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function Ch(e){return ve({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var Oh=M('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const Zr=()=>{const{chatWidget:e}=se(),[t,n]=P(!1);let r=null;const o=h=>{const p=h;return!!(p.requestFullscreen||p.webkitRequestFullscreen||p.msRequestFullscreen)},s=async h=>{const p=h;try{if(p.requestFullscreen)return await p.requestFullscreen(),!0;if(p.webkitRequestFullscreen)return p.webkitRequestFullscreen(),!0;if(p.msRequestFullscreen)return p.msRequestFullscreen(),!0}catch{}return!1},i=async()=>{const h=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(h.webkitExitFullscreen)return h.webkitExitFullscreen(),!0;if(h.msExitFullscreen)return h.msExitFullscreen(),!0}catch{}return!1},a=h=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",h.classList.add("st-fullscreen"),n(!0)},l=h=>{h.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},c=async()=>{try{const h=Xt();if(!h)return;if(!t())o(h)&&await s(h)||a(h);else{const p=document;(document.fullscreenElement||p.webkitFullscreenElement||p.msFullscreenElement)&&await i()||l(h)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},d=()=>{const h=document,p=!!(document.fullscreenElement||h.webkitFullscreenElement||h.msFullscreenElement);if(n(p),!p)try{const f=Xt();f.classList.contains("st-fullscreen")&&l(f)}catch{}};document.addEventListener("fullscreenchange",d),document.addEventListener("webkitfullscreenchange",d);const u=()=>{e()?.mode==="popup"&&ee("close")};return ne("toggleFullscreen",()=>{c()}),(()=>{var h=Oh(),p=h.firstChild;return A(h,y(cc,{}),p),A(p,y(ke,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:c,get children(){return y(Z,{get when(){return t()},get fallback(){return y(Eh,{size:16})},get children(){return y(Sh,{size:16})}})}}),null),A(p,y(Z,{get when(){return e()?.showSettings},get children(){return y(xh,{})}}),null),A(p,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(ke,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:u,get children(){return y(Ch,{size:16})}})}}),null),h})()};var _h=M("<span>");const Ui=({createdAt:e,anchor:t="end"})=>(()=>{var n=_h();return gt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var Ph=M('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const Ah=({children:e,createdAt:t})=>(()=>{var n=Ph(),r=n.firstChild;return A(r,e),A(n,y(Ui,{createdAt:t,anchor:"start"}),null),n})();var Th=M("<span>");const Ot=e=>{const[,t]=j(e,["class","children"]);let n=e.children?.toString();return n&&(n=Na(Ka(n))),(()=>{var r=Th();return r.innerHTML=n,tt(r,T({get class(){return Ge("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Lh=M('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Dh=({options:e,text:t})=>{let n;const{pushMessage:r}=Qe(),[o,s]=P(!1),i=(a,l)=>{s(!0),r(a,l)};return(()=>{var a=Lh(),l=a.firstChild,c=l.firstChild;A(a,y(Ot,{get children(){return t?.trim()}}),l);var d=n;return typeof d=="function"?or(d,c):n=c,A(c,y(ht,{each:e,children:u=>y(ke,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>i(u.label,u.value),get children(){return u.label?.trim()}})})),oe(()=>gt(l,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Mh=M('<div class="flex flex-col"><span>'),Ih=M("<a target=_blank><img><span></span><span>");const Rh=({options:e,text:t})=>(()=>{var n=Mh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,y(ht,{each:e,children:o=>(()=>{var s=Ih(),i=s.firstChild,a=i.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),oe(c=>{var d=o.url,u=o.image;return d!==c.e&&ue(s,"href",c.e=d),u!==c.t&&ue(i,"src",c.t=u),c},{e:void 0,t:void 0}),s})()}),null),n})();var Fh=M("<a target=_blank>");const $h=({url:e,text:t})=>(()=>{var n=Fh();return ue(n,"href",e),A(n,()=>t?.trim()),n})();var G=e=>typeof e=="function"?e():e,ji=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Nh=e=>{const t=T({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[C(()=>{if(n())return G(t.value)}),()=>{r(!0)},()=>{r(!1)}]},qi=Nh,Gt=e=>typeof e=="function",Kh=["button","color","file","image","reset","submit"],Bh=(e,t)=>e==="button"?!0:e==="input"&&t?Kh.indexOf(t)!==-1:!1;function zh(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,i=>H(()=>{let a;return Gt(i)?a=i(o()):a=i,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Qr=zh,Fn=new Map,$n=(e,t)=>{if(Fn.has(e))return Fn.get(e);const n=ce(t);return Fn.set(e,n),n},eo=e=>{const t=Fn.get(e);if(t)return he(t)},Nn=new Map,Vh=e=>{L(()=>{const t=G(e.style)??{},n=G(e.properties)??[],r={};for(const s in t)r[s]=e.element.style[s];const o=Nn.get(e.key);o?o.activeCount++:Nn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(e.element.style,e.style);for(const s of n)e.element.style.setProperty(s.key,s.value);K(()=>{const s=Nn.get(e.key);if(s){if(s.activeCount!==1){s.activeCount--;return}Nn.delete(e.key);for(const[i,a]of Object.entries(s.originalStyles))e.element.style[i]=a;for(const i of s.properties)e.element.style.removeProperty(i);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Uh=Vh,jh=e=>{const t=T({enabled:!0},e);L(()=>{G(t.enabled)&&(document.addEventListener("keydown",n),K(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},qh=jh,Hh=e=>{const t=T({enabled:!0},e);L(()=>{const{body:n}=document;G(t.enabled)&&Uh({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Wh=Hh,Gh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);L(()=>{if(!G(t.enabled))return;const r=G(t.strategy);document.addEventListener(r,n),K(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=G(t.element),s=G(t.ignore);o&&!o.contains(r.target)&&!(s&&s.contains(r.target))&&t.onPointer(r)}},Yh=Gh,Xh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);qh({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Yh({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),Wh({enabled:t.noOutsidePointerEvents})},Jh=Xh,to=ce(),Zh=e=>C(()=>{if(he(to))return y(Hi,e);const r=Te(),[o,s]=P([r]),i=l=>{s(c=>[...c,l])},a=l=>{s(c=>c.filter(d=>d!==l))};return y(to.Provider,{value:{layers:o,onLayerShow:i,onLayerDismiss:a},get children(){return y(Hi,e)}})}),Hi=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=j(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=he(to),s=Te();L(()=>{n.enabled?o.onLayerShow(s):o.onLayerDismiss(s)});const i=()=>o.layers()[o.layers().length-1]===s;Jh({dismissOnEscapeKeyDown:()=>G(n.dismissOnEscapeKeyDown)&&i()&&n.enabled,dismissOnOutsidePointer:()=>G(n.dismissOnOutsidePointer)&&i()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>G(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=C(()=>n.children),l=()=>{const c=a();return Gt(c)?c({get isLastLayer(){return i()}}):c};return H(()=>l())},Qh=Zh,eg=()=>{const[e,t]=P(!1);return L(()=>t(!0)),e},tg=eg,ng=(e,t)=>(e&&(Gt(e)?e(t):e[0](e[1],t)),t.defaultPrevented),no=(...e)=>e.some(t=>!!t()),rg=e=>(...t)=>{for(const n of e)n&&n(...t)},Kn=(...e)=>rg(e),le=e=>e?"":void 0,og="div",sg=e=>{const[t,n]=j(e,["as"]),r=C(()=>t.as??og);return C(()=>{const s=r();switch(typeof s){case"function":return H(()=>s(n));case"string":return y(ln,T({component:s},n))}})},ro=sg,ig=e=>{let t,n=!1;return()=>n?t:(n=!0,t=C(e))},Wi=ig,ag=e=>C(()=>G(e.element)?.tagName.toLowerCase()||e.fallback),lg=ag,Gi="button",cg=e=>{const[t,n]=P(null),[r,o]=j(e,["as","ref","type"]),s=lg({element:t,fallback:Gi}),i=C(()=>Bh(s(),r.type));return y(ro,T({get as(){return r.as??Gi},ref(a){var l=Kn(n,r.ref);typeof l=="function"&&l(a)},get type(){return i()?"button":void 0},get role(){return i()?void 0:"button"}},o))},ug=cg,dg='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',oo="focusTrap.initialFocus",so="focusTrap.finalFocus",Yi={bubbles:!1,cancelable:!0},fg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=C(()=>{const f=n();return f?f[0]??null:null}),s=C(()=>{const f=n();return f?f[f.length-1]??null:null});let i=null;const a=()=>{kr(()=>{l(J(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(J(t.element))})};L(()=>{const f=J(t.element);if(f&&J(t.enabled)){i=document.activeElement,H(()=>{l(f),c(f)});const g=new MutationObserver(a);J(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),K(()=>{J(t.observeChanges)&&g.disconnect(),r(null),p(f)})}}),L(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),K(()=>{document.removeEventListener("keydown",h)}))}),L(()=>{const f=o();f&&(f.addEventListener("keydown",d),K(()=>{f.removeEventListener("keydown",d)}))}),L(()=>{const f=s();f&&(f.addEventListener("keydown",u),K(()=>{f.removeEventListener("keydown",u)}))});const l=f=>{const g=Array.from(f.querySelectorAll(dg)).map((m,b)=>({element:m,domIndex:b,tabIndex:m.tabIndex})).sort((m,b)=>m.tabIndex===b.tabIndex?m.domIndex-b.domIndex:m.tabIndex-b.tabIndex);r(g.map(({element:m})=>m))},c=f=>{kr(()=>{const g=J(t.initialFocusElement)??o()??f,m=t.onInitialFocus;let b;m&&(b=new CustomEvent(oo,Yi),f.addEventListener(oo,m),f.dispatchEvent(b),f.removeEventListener(oo,m)),b?.defaultPrevented!==!0&&g.focus()})},d=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),s().focus())},u=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},p=f=>{kr(()=>{if(!J(t.restoreFocus))return;const m=J(t.finalFocusElement)??i;if(!m)return;let b;const v=t.onFinalFocus;v&&(b=new CustomEvent(so,Yi),f.addEventListener(so,v),f.dispatchEvent(b),f.removeEventListener(so,v)),b?.defaultPrevented!==!0&&m.focus()})}},hg=fg,gg=hg,pg=e=>{const t=C(()=>{const i=J(e.element);if(i)return getComputedStyle(i)}),n=()=>t()?.animationName??"none",[r,o]=P(J(e.show)?"present":"hidden");let s="none";return L(i=>{const a=J(e.show);return H(()=>{if(i===a)return a;const l=s,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(i===!0&&l!==c?"hiding":"hidden")}),a}),L(()=>{const i=J(e.element);if(!i)return;const a=c=>{c.target===i&&(s=n())},l=c=>{const u=n().includes(c.animationName);c.target===i&&u&&r()==="hiding"&&o("hidden")};i.addEventListener("animationstart",a),i.addEventListener("animationcancel",l),i.addEventListener("animationend",l),K(()=>{i.removeEventListener("animationstart",a),i.removeEventListener("animationcancel",l),i.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},mg=pg,Xi=mg,yg=ce(),bg=e=>e?$n(`dialog-${e}`):yg,Ji=ce(),vg=e=>e?$n(`dialog-internal-${e}`):Ji,_t=e=>{if(!e){const n=he(Ji);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=eo(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},wg="div",xg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().contentPresent),s=C(i=>i||o(),!1);return y(Z,{get when(){return s()},get children(){return y(Qh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:i=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(ro,T({ref(l){var c=Kn(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??wg},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return le(r().open())},get"data-closed"(){return le(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":i.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},Sg=xg,Eg="div",kg=e=>{const[t,n]=j(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().overlayPresent),s=C(i=>i||o(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const i=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(ro,T({get as(){return t.as??Eg},ref(a){var l=Kn(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return le(r().open())},get"data-closed"(){return le(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return i()}}))}})})()}})},Cg=kg,Og=e=>{const[t,n]=j(e,["forceMount","contextId","children"]),r=C(()=>_t(t.contextId)),o=()=>no(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),s=tg(),i=C(a=>a||o()&&s(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const a=C(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(Ho,T(n,{get children(){return a()}}))}})})()}})},_g=Og,io=!0,Pg=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??io),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??io),preventScroll:()=>!!(e.modal??io),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Te()},e),[n,r]=Qr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,s,i]=qi({value:()=>t.labelId??Te()}),[a,l,c]=qi({value:()=>t.descriptionId??Te()}),[d,u]=P(null),[h,p]=P(null),[f,g]=P(null),{present:m}=Xi({show:n,element:h}),{present:b}=Xi({show:n,element:f});gg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),qs({element:h,enabled:()=>m()&&G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const v={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return G(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return G(t.noOutsidePointerEvents)},get preventScroll(){return G(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return G(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return m()},get contentRef(){return h()},get overlayPresent(){return b()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},w=Wi(()=>t.children),x=()=>{const k=w()();return Gt(k)?k(v):k};return C(()=>{const k=bg(t.contextId),E=vg(t.contextId);return y(k.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(E.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>G(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>G(t.noOutsidePointerEvents),preventScroll:()=>G(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>G(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:h,overlayPresent:b,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:s,unregisterLabelId:i,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:p,setOverlayRef:g,triggerRef:d,setTriggerRef:u}},get children(){return H(()=>x())}})}})})},Ag=Pg,Tg="button",Lg=e=>{const[t,n]=j(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=C(()=>_t(t.contextId));return y(ug,T({ref(s){var i=Kn(r().setTriggerRef,t.ref);typeof i=="function"&&i(s)},get as(){return t.as??Tg},onClick:s=>{!ng(t.onClick,s)&&r().setOpen(i=>!i)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return le(r().open())},get"data-closed"(){return le(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},Dg=Lg,Bn=e=>typeof e=="function"?e():e,Zi=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Mg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,s]=P(null);let i=null;L(()=>{const c=Bn(t.element),d=Bn(t.enabled);if(!c||!d)return;const u=new ResizeObserver(a);u.observe(c),c.addEventListener("transitionend",l),K(()=>{u.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const d=c.target,u=[d.offsetWidth,d.offsetHeight],h=Bn(t.dimension);h==="both"?i?i[0]!==u[0]&&i[1]!==u[1]&&(Ee(()=>{s(i),r(!0)}),Zi(()=>{s(u),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):i=u:i?zn(h,i)!==zn(h,u)&&(Ee(()=>{s(zn(h,i)),r(!0)}),Zi(()=>{s(zn(h,u)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):i=u},l=()=>{if(!n())return;const c=Bn(t.element);c?i=[c.offsetWidth,c.offsetHeight]:i=null,Ee(()=>{r(!1),s(null)})};return{transitioning:n,transitionSize:o}}var zn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Ig=Mg,Rg=Ig;const Fg=(e,t)=>e.length>0?()=>e(H(t)):e;function $g(e,t){let n=0;const r=e.map((o,s)=>C(()=>(n=s,o()),void 0,lr));return C(()=>r.map(o=>o())[n],void 0,t)}function Qi(e,t,n){let r=()=>t;const[o,s]=P(t,lr),i=C(Fg(e,()=>r()),t,lr);return[r=$g([o,i],n),a=>s(()=>typeof a=="function"?a(H(r)):a)]}var Ng=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Kg=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Bg=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,s=0,i=0,a=!1;do{const[l,c,d]=Ng(o,t),u=d-l-r*c;(c!==0||u!==0)&&Kg(o,t)&&(s+=u,i+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[s,i]},zg=e=>y(Dg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),ea=ce(),Vg=e=>e?$n(`drawer-${e}`):ea,Ug=e=>{if(!e){const n=he(ea);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=eo(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ta=ce(),jg=e=>e?$n(`drawer-internal-${e}`):ta,na=e=>{if(!e){const n=he(ta);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=eo(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},ra=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Vn(e,t)};const o=r[n-1]?Vn(r[n-1],t):void 0,s=r[n]?Vn(r[n],t):void 0;return{value:e,offset:Vn(e,t),lowerBreakPoint:s,upperBreakPoint:o}},Vn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},qg=(e,t,n,r)=>{const o=oa("upper",e,r?n:t),s=oa("lower",e,r?n:t);return o?s?s.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(s.offset-n)<Math.abs(o.offset-n)?s:o:n<o.lowerBreakPoint?s:o:o:s},oa=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Hg=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},Wg=void 0,Gg=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[Wg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,V)=>{const Q=$/V;return Q<1&&Q>-1?1:Q},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=j(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,s]=Qr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[i,a]=Qr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:d,transitionSize:u}=Rg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,p]=P(!1),[f,g]=Qi(()=>d()?"resizing":null),m=C(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[b,v]=P(!1);L(()=>{const $=o();H(()=>{b()!==$&&($?(v(!0),ji(()=>{Ee(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&g(null)})):(Ee(()=>{g("closing"),a(0)}),ji(()=>{parseFloat(m().transitionDuration)===0&&w()})))})});const w=()=>{Ee(()=>{v(!1),g(null)})},[x,O]=P(0);L(()=>{const $=l()?.contentRef();if(!$)return;E($);const V=new ResizeObserver(k);V.observe($),K(()=>{V.disconnect()})});const k=$=>{for(const V of $)V.target===l()?.contentRef()&&E(V.target)},E=$=>{const V=H(()=>x());switch(n.side){case"top":case"bottom":if(V===$.offsetHeight)return;O($.offsetHeight);break;case"left":case"right":if(V===$.offsetWidth)return;O($.offsetWidth);break}},F=C(()=>ra(i(),x())),[_,R]=Qi(()=>F().offset),D=C(()=>x()?(x()-_())/x():0),I={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return i()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return D()},get translate(){return _()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},re=Wi(()=>n.children),Y=$=>{c(_t(n.contextId));const V=re()();if(Gt(V)){const Q=T($,I);return V(Q)}return V};return C(()=>{const $=Vg(n.contextId),V=jg(n.contextId);return H(()=>y($.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:i,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:D,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(V.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:i,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:D,translate:_,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:p,setTranslate:R,drawerSize:x,resolvedActiveSnapPoint:F,drawerStyles:m,setTransitionState:g,transitionSize:u,closeDrawer:w}},get children(){return y(Ag,T({get open(){return b()},onOpenChange:s,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:Q=>Y(Q)}))}})}}))})},Yg=Gg,Xg=e=>{const[t,n]=j(e,["contextId","style"]);let r=!1,o=null,s=[0,0],i,a=0;const l=C(()=>na(t.contextId)),c=C(()=>_t(t.contextId)),d=C(()=>l().snapPoints().map((w,x)=>ra(w,l().drawerSize(),x,l().breakPoints()))),u=C(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),h=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"top":case"bottom":return`${w}px`}}),p=C(()=>{const w=l().transitionSize();if(w)switch(l().side()){case"left":case"right":return`${w}px`}});L(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",m),document.addEventListener("pointerup",v),document.addEventListener("touchend",v),K(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",v),document.removeEventListener("touchend",v)}))});const f=w=>{Hg(w.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(s=[w.clientX,w.clientY]))},g=w=>{b(w.target,w.clientX,w.clientY)},m=w=>{w.touches[0]&&b(w.target,w.touches[0].clientX,w.touches[0].clientY)},b=(w,x,O)=>{if(!r)return;if(!l().isDragging()||o===null){const F=window.getSelection();if(F&&F.toString().length>0){v();return}if(l().handleScrollableElements()){const _=[x,O].map((fe,$)=>s[$]-fe),R=Math.abs(_[0])>Math.abs(_[1])?"x":"y",D=R==="x"?_[0]:_[1];if(Math.abs(D)<.3)return;const I=c().contentRef(),[re,Y]=Bg(w,R,I);if(D>0&&Math.abs(re)>1||D<0&&Math.abs(Y)>0){v();return}}switch(l().side()){case"top":case"bottom":o=O;break;case"right":case"left":o=x}i=new Date,a=l().translate(),Ee(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let k;switch(l().side()){case"top":k=-(o-O);break;case"bottom":k=o-O;break;case"right":k=o-x;break;case"left":k=-(o-x);break}k-=l().resolvedActiveSnapPoint().offset,k>0&&(k=l().dampFunction(k));const E=new Date;E.getTime()-i.getTime()>l().velocityCacheReset()&&(i=E,a=l().translate()),l().setTranslate(-k)},v=()=>{if(r=!1,!l().isDragging())return;const w=new Date,x=l().velocityFunction(-(a-l().translate()),w.getTime()-i.getTime()||1),O=l().translate()*x,k=qg(d(),l().translate(),O,l().allowSkippingSnapPoints());Ee(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Ee(()=>{l().setActiveSnapPoint(k.value),k.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(k.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(Sg,T({get contextId(){return t.contextId},get style(){return{transform:u(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:p(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ee(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return le(l().isTransitioning())},get"data-opening"(){return le(l().transitionState()==="opening")},get"data-closing"(){return le(l().transitionState()==="closing")},get"data-snapping"(){return le(l().transitionState()==="snapping")},get"data-resizing"(){return le(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Jg=Xg,Zg=e=>{const[t,n]=j(e,["contextId"]),r=C(()=>na(t.contextId));return y(Cg,T({get contextId(){return t.contextId},get"data-transitioning"(){return le(r().isTransitioning())},get"data-opening"(){return le(r().transitionState()==="opening")},get"data-closing"(){return le(r().transitionState()==="closing")},get"data-snapping"(){return le(r().transitionState()==="snapping")},get"data-resizing"(){return le(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Qg=Zg,ep=M('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const tp=Yg,np=zg,rp=_g,op=e=>{const[,t]=j(e,["class"]),n=Ug();return y(Qg,T({get class(){return Ge("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},sp=e=>{const[,t]=j(e,["class","children"]);return y(rp,{get mount(){return Xt()},get children(){return[y(op,{}),y(Jg,T({id:"smarttalks-list-content",get class(){return Ge("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[ep(),C(()=>e.children)]}}))]}})};var ip=M('<span class="font-semibold mt-2">'),ap=M('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),lp=M('<div class="flex flex-col space-y-2"><div>'),cp=M('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),up=M('<div class="flex flex-col items-start"><span class=text-slate-500>');const dp=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qe(),[o,s]=P(!1),[i,a]=P(!1),[l,c]=P(),d=(h,p)=>{a(!1),s(!0),r(h,p)},u=h=>{const p=h.composedPath();for(const f of p)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=lp(),p=h.firstChild;return A(h,y(Ot,{get children(){return t?.trim()}}),p),A(p,y(tp,{get open(){return i()},onOpenChange:a,onOutsidePointer:u,get children(){return[y(np,{as:ke,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??dt("selectOption")}}),y(sp,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=ip();return A(f,()=>n?.trim()??dt("selectOption")),f})(),(()=>{var f=ap();return A(f,y(ht,{each:e,children:g=>(()=>{var m=cp(),b=m.firstChild;return A(b,()=>g.label?.trim()??""),A(m,y(ht,{get each(){return g.items},children:v=>y(ke,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===v?"bg-slate-200":""}`},onClick:()=>c(v),get children(){return[(()=>{var w=up(),x=w.firstChild;return A(w,()=>v.label?.trim(),x),A(x,()=>v.description?.trim()),w})(),y(Z,{get when(){return l()===v},get fallback(){return y(lf,{class:"size-4 text-slate-500"})},get children(){return y(af,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),f})(),y(ke,{get disabled(){return o()||!l()},onClick:()=>d(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return dt("send")}})]}})]}})),oe(()=>gt(p,o()?"opacity-50":"")),h})()};var fp=M("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const hp=e=>(()=>{var t=fp(),n=t.firstChild,r=n.nextSibling;return oe(o=>{var s=e.link,i=e.link;return s!==o.e&&ue(n,"src",o.e=s),i!==o.t&&ue(r,"src",o.t=i),o},{e:void 0,t:void 0}),t})();var gp=M('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const pp=e=>(()=>{var t=gp(),n=t.firstChild,r=n.firstChild;return A(n,y(cf,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,y(Ot,{get children(){return e.text?.trim()}}),null),oe(()=>ue(n,"href",e.link)),t})();var mp=M('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const yp=e=>(()=>{var t=mp(),n=t.firstChild,r=n.firstChild;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),oe(o=>{var s=e.link,i=e.link,a=e.text?.trim();return s!==o.e&&ue(n,"href",o.e=s),i!==o.t&&ue(r,"src",o.t=i),a!==o.a&&ue(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var bp=M('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const vp=e=>(()=>{var t=bp(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,y(Ot,{get children(){return e.text?.trim()}}),null),oe(s=>{var i=e.link,a=e.link;return i!==s.e&&ue(r,"src",s.e=i),a!==s.t&&ue(o,"src",s.t=a),s},{e:void 0,t:void 0}),t})();var wp=M("<div>Media type not supported");const sa=e=>e.type==="image"?y(yp,e):e.type==="audio"?y(hp,e):e.type==="document"?y(pp,e):e.type==="video"?y(vp,e):wp(),ao=({text:e})=>y(Ot,{get children(){return e?.trim()}});var xp=M("<div>Unknown bot message type");const Sp=e=>y(Ah,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ao,{get text(){return e.text}}):e.type==="buttons"?y(Dh,T(()=>e.buttons)):e.type==="list"?y(dp,T(()=>e.list)):e.type==="media"?y(sa,T(()=>e.media)):e.type==="link"?y($h,T(()=>e.link)):e.type==="cards"?y(Rh,T(()=>e.cards)):e.type==="date"?y(ao,{get text(){return e.text}}):xp()}});var Ep=M('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const kp=e=>(()=>{var t=Ep(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var Cp=M('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const Op=({children:e,createdAt:t})=>(()=>{var n=Cp(),r=n.firstChild;return A(r,e),A(n,y(Ui,{createdAt:t,anchor:"end"}),null),n})();var _p=M("<div>Unknown user message type");const Pp=e=>y(Op,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ao,{get text(){return e.text}}):e.type==="media"?y(sa,T(()=>e.media)):_p()}});var Ap=M("<div>Unknown message origin");const Tp=e=>e.origin==="bot"?y(Sp,e):e.origin==="user"?y(Pp,e):e.origin==="service"?y(kp,e):Ap();function lo(e){return ve({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var Lp=M('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0">'),Dp=M("<div>");const co=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r}=Qe(),{onOpen:o}=Xo(),s=(i=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},i)};return ne("reset",()=>{r()}),tn(()=>{s(200)}),n(s),o(()=>s(200)),(()=>{var i=Lp(),a=e;return typeof a=="function"?or(a,i):e=i,A(i,y(ht,{get each(){return t()},get fallback(){return(()=>{var l=Dp();return A(l,()=>dt("emptyMessages")),l})()},children:l=>y(Tp,l)})),i})()};var Mp=M("<textarea>");const Ip=e=>{const[,t]=j(e,["class"]);return(()=>{var n=Mp();return tt(n,T({get class(){return Ge("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md:text-sm ring-offset-background 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",e.class)}},t),!1,!1),n})()};var Rp=M('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const Fp=e=>(()=>{var t=Rp();return tt(t,e,!0,!0),t})();var $p=M('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Np=()=>(()=>{var e=$p(),t=e.firstChild;return A(e,y(Fp,{height:15}),t),e})();var Kp=M('<footer class="relative flex-none p-4 bg-white min-h-16 flex space-x-1 pb-7">');const uo=()=>{const{pushMessage:e}=Qe(),[t,n]=P(""),r=()=>{e(t()),n("")},o=s=>{s.key==="Enter"&&!s.shiftKey&&r()};return ne("setInput",s=>{s&&n(s)}),(()=>{var s=Kp();return A(s,y(Ip,{get placeholder(){return dt("inputPlaceholder")},get value(){return t()},onInput:i=>n(i.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),A(s,y(ke,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return y(gc,{size:24})}}),null),A(s,y(Np,{}),null),s})()};var Bp=M('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),zp=M("<span class=sr-only>Close"),Vp=M('<div><div class="flex justify-center gap-3 items-center">'),Up=M("<span class=sr-only>Open"),jp=M("<span class=font-bold>"),qp=M("<span>"),Hp=M('<div class="animate-pulse flex p-1">');const Wp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:s}=Xo(),{chatWidget:i}=se(),[a,l]=P(!0),[c,d]=P("");setTimeout(()=>l(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},(i()?.openDelay||0)*1e3);const u=()=>(i()?.style.margin??5)/4,h=()=>i()?.style.position==="left"?{left:`${u()}rem`}:{right:`${u()}rem`};return ne("open",()=>{o()}),ne("close",()=>{s()}),ne("toggle",()=>{r()}),ne("onAnswer",p=>{p.text&&d(p.text),o()}),(()=>{var p=Vp(),f=p.firstChild;return A(p,y(Z,{get when(){return n()},get children(){var g=Bp();return A(g,e),g}}),f),A(f,y(Z,{get when(){return i()?.whatsappBtn},get children(){return y(ke,{onclick:()=>window.open(i()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return y(kh,{class:"size-9",color:"white"})}})}}),null),A(f,y(Z,{get when(){return n()},get fallback(){return y(ke,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,Up(),y(Z,{get when(){return i()?.balloonMessage},get children(){var g=qp();return A(g,y(Z,{get when(){return c()},get fallback(){return y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=Hp();return A(m,y(lo,{class:"size-2 animate-bounce"}),null),A(m,y(lo,{class:"size-2 animate-bounce delay-150"}),null),A(m,y(lo,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return i()?.balloonMessage}})},get children(){var m=jp();return A(m,(()=>{var b=C(()=>c().length>20);return()=>b()?c().substring(0,17)+"...":c()})()),m}})),oe(()=>gt(g,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate"+(i()?.style.position==="left"?" left-0":" right-0"))),g}})]}})},get children(){return y(ke,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,zp()]}})}}),null),oe(g=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(i()?.style.position==="left"?" items-start":" items-end"),b=h();return m!==g.e&>(p,g.e=m),g.t=an(p,b,g.t),g},{e:void 0,t:void 0}),p})()};var Gp=M('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Yp=({children:e})=>{const{chatWidget:t}=se(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=Gp();return an(r,n),A(r,e),r})()};var Xp=M('<div id=smarttalks-widget class="h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col">');const Jp=({children:e})=>{const{chatWidget:t}=se(),[n,r]=P(!1),o=()=>(t()?.style.margin??5)/4,s=()=>{const i={};return t()?.fullscreen?(i.height="100%",i["max-height"]="100%",i.width="100%",i["max-width"]="100%",i.bottom=0,i.left=0):t()?.style.position&&(i[t()?.style.position||"right"]=`${o()}rem`),i};return ne("open",()=>{r(!0),ee("onOpen")}),ne("close",()=>{r(!1),ee("onClose")}),ne("toggle",()=>{r(!n()),ee("onToggle")}),ne("onAnswer",()=>{r(!0),ee("onOpen")}),setTimeout(()=>{r(!0),ee("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var i=Xp();return A(i,e),oe(a=>an(i,s(),a)),i}})};var Zp=M('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const fo=()=>(()=>{var e=Zp();return A(e,y(hc,{size:45,class:"animate-spin"})),e})(),Qp=()=>{const{chatWidget:e}=se(),{loading:t}=Qe();return y(Wp,{get openIcon(){return y(ss,{get src(){return e()?.avatar}})},get children(){return[y(Z,{get when(){return t()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},em=()=>{const{loading:e}=Qe();return y(Jp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},tm=()=>{const{loading:e}=Qe();return y(Yp,{get children(){return[y(Z,{get when(){return e()},get children(){return y(fo,{})}}),y(Zr,{}),y(co,{}),y(uo,{})]}})},nm=()=>{const{chatWidget:e}=se();return y(Bo,{get children(){return[y(Mt,{get when(){return e()?.mode==="standard"},get children(){return y(Qp,{})}}),y(Mt,{get when(){return e()?.mode==="popup"},get children(){return y(em,{})}}),y(Mt,{get when(){return e()?.mode==="static"},get children(){return y(tm,{})}})]}})};var rm=M("<div><div>Form");const om=()=>{const{formWidget:e}=se();return(()=>{var t=rm();return t.firstChild,A(t,()=>e()?._id,null),t})()};function sm(){const{widget:e}=se();return y(Bo,{get children(){return[y(Mt,{get when(){return e()?.type==="chat"},get children(){return y(nm,{})}}),y(Mt,{get when(){return e()?.type==="form"},get children(){return y(om,{})}})]}})}var im=M("<style>"),am=M("<div>");const lm=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:s}=se(),i=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return s(i),[(()=>{var a=im();return A(a,zl),a})(),(()=>{var a=am();return A(a,y(sm,{})),a})()]},cm={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Bl("smarttalks-widget",cm,lm)})(),Va()});
|