@smarttalks.ai/widget 0.18.0 → 0.19.0
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 +3111 -3072
- package/lib/index.umd.cjs +27 -27
- package/package.json +1 -1
package/lib/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(ir){typeof define=="function"&&define.amd?define(ir):ir()})((function(){"use strict";function ir(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=ir(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ir(e))&&(r&&(r+=" "),r+=t);return r}const Ti="-",bh=e=>{const t=xh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Ti);return a[0]===""&&a.length!==1&&a.shift(),rc(a,t)||wh(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&r[s]?[...c,...r[s]]:c}}},rc=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?rc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Ti);return t.validators.find(({validator:s})=>s(i))?.classGroupId},oc=/^\[(.+)\]$/,wh=e=>{if(oc.test(e)){const t=oc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},xh=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Eh(Object.entries(e.classGroups),n).forEach(([i,s])=>{Ai(s,r,i,t)}),r},Ai=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ic(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Sh(o)){Ai(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Ai(s,ic(t,i),n,r)})})},ic=(e,t)=>{let n=e;return t.split(Ti).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sh=e=>e.isThemeGetter,Eh=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,Ph=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},sc="!",Ch=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const c=[];let l=0,u=0,d;for(let m=0;m<a.length;m++){let y=a[m];if(l===0){if(y===o&&(r||a.slice(m,m+i)===t)){c.push(a.slice(u,m)),u=m+i;continue}if(y==="/"){d=m;continue}}y==="["?l++:y==="]"&&l--}const h=c.length===0?a:a.substring(u),g=h.startsWith(sc),f=g?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},kh=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},Oh=e=>({cache:Ph(e.cacheSize),parseClassName:Ch(e),...bh(e)}),Th=/\s+/,Ah=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Th);let a="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:g}=n(l);let f=!!g,p=r(f?h.substring(0,g):h);if(!p){if(!f){a=l+(a.length>0?" "+a:a);continue}if(p=r(h),!p){a=l+(a.length>0?" "+a:a);continue}f=!1}const m=kh(u).join(":"),y=d?m+sc:m,b=y+p;if(i.includes(b))continue;i.push(b);const x=o(p,f);for(let w=0;w<x.length;++w){const C=x[w];i.push(y+C)}a=l+(a.length>0?" "+a:a)}return a};function $h(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ac(t))&&(r&&(r+=" "),r+=n);return r}const ac=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ac(e[r]))&&(n&&(n+=" "),n+=t);return n};function Dh(e,...t){let n,r,o,i=s;function s(c){const l=t.reduce((u,d)=>d(u),e());return n=Oh(l),r=n.cache.get,o=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=Ah(c,n);return o(c,u),u}return function(){return i($h.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},cc=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rh=/^\d+\/\d+$/,Mh=new Set(["px","full","screen"]),Ih=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_h=/\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$/,Lh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wt=e=>Pn(e)||Mh.has(e)||Rh.test(e),Bt=e=>Cn(e,"length",Hh),Pn=e=>!!e&&!Number.isNaN(Number(e)),$i=e=>Cn(e,"number",Pn),sr=e=>!!e&&Number.isInteger(Number(e)),Vh=e=>e.endsWith("%")&&Pn(e.slice(0,-1)),H=e=>cc.test(e),Kt=e=>Ih.test(e),Bh=new Set(["length","size","percentage"]),Kh=e=>Cn(e,Bh,lc),zh=e=>Cn(e,"position",lc),Uh=new Set(["image","url"]),jh=e=>Cn(e,Uh,qh),Wh=e=>Cn(e,"",Yh),ar=()=>!0,Cn=(e,t,n)=>{const r=cc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Hh=e=>_h.test(e)&&!Lh.test(e),lc=()=>!1,Yh=e=>Nh.test(e),qh=e=>Fh.test(e),Gh=Dh(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),a=ue("borderWidth"),c=ue("contrast"),l=ue("grayscale"),u=ue("hueRotate"),d=ue("invert"),h=ue("gap"),g=ue("gradientColorStops"),f=ue("gradientColorStopPositions"),p=ue("inset"),m=ue("margin"),y=ue("opacity"),b=ue("padding"),x=ue("saturate"),w=ue("scale"),C=ue("sepia"),S=ue("skew"),O=ue("space"),D=ue("translate"),P=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",H,t],$=()=>[H,t],K=()=>["",wt,Bt],U=()=>["auto",Pn,H],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",H],qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$e=()=>[Pn,H];return{cacheSize:500,separator:":",theme:{colors:[ar],spacing:[wt,Bt],blur:["none","",Kt,H],brightness:$e(),borderColor:[e],borderRadius:["none","","full",Kt,H],borderSpacing:$(),borderWidth:K(),contrast:$e(),grayscale:q(),hueRotate:$e(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Vh,Bt],inset:I(),margin:I(),opacity:$e(),padding:$(),saturate:$e(),scale:$e(),sepia:q(),skew:$e(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",H]}],container:["container"],columns:[{columns:[Kt]}],"break-after":[{"break-after":qe()}],"break-before":[{"break-before":qe()}],"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:[...Q(),H]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sr,H]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",H]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",sr,H]}],"grid-cols":[{"grid-cols":[ar]}],"col-start-end":[{col:["auto",{span:["full",sr,H]},H]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ar]}],"row-start-end":[{row:["auto",{span:[sr,H]},H]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",H]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",H]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",H,t]}],"min-w":[{"min-w":[H,t,"min","max","fit"]}],"max-w":[{"max-w":[H,t,"none","full","min","max","fit","prose",{screen:[Kt]},Kt]}],h:[{h:[H,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[H,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[H,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Kt,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$i]}],"font-family":[{font:[ar]}],"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",H]}],"line-clamp":[{"line-clamp":["none",Pn,$i]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",wt,H]}],"list-image":[{"list-image":["none",H]}],"list-style-type":[{list:["none","disc","decimal",H]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",wt,Bt]}],"underline-offset":[{"underline-offset":["auto",wt,H]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",H]}],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",H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),zh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[y]}],"border-style":[{border:[...F(),"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":[y]}],"divide-style":[{divide:F()}],"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:["",...F()]}],"outline-offset":[{"outline-offset":[wt,H]}],"outline-w":[{outline:[wt,Bt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[wt,Bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Kt,Wh]}],"shadow-color":[{shadow:[ar]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...j(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Kt,H]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",H]}],duration:[{duration:$e()}],ease:[{ease:["linear","in","out","in-out",H]}],delay:[{delay:$e()}],animate:[{animate:["none","spin","ping","pulse","bounce",H]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[sr,H]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",H]}],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",H]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",H]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[wt,Bt,$i]}],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 zt(...e){return Gh(nc(e))}function Xh(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",Wr(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Wr(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Wr(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Wr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Wr(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),i=Math.max(t,n,r),s=i-o,a=0,c=0,l=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),l=(i+o)/2,c=s==0?0:s/(1-Math.abs(2*l-1)),c=+(c*100).toFixed(1),l=+(l*100).toFixed(1),a+","+c+"%,"+l+"%"}function Zh(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 Jh(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 Hr(){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 Qh={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 kn(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"),Qh[n][e]}const On="https://heimdall.smarttalks.ai/api",eg="wss://heimdall.smarttalks.ai",uc="smarttalkswidget";function he(e,...t){window.postMessage({from:uc,command:e,args:t})}function pe(e,t){window.addEventListener("message",n=>{n.origin===window.location.origin&&n.data?.from===uc&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function tg(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{he("registerContactData",e)},registerMetadata:e=>{he("registerMetadata",e)},open:e=>{he("open"),e&&he("setInput",e)},close:()=>{he("close")},toggle:()=>{he("toggle")},toggleFullscreen:()=>{he("toggleFullscreen")},reset:()=>{he("reset")},onOpen:e=>{pe("onOpen",e)},onClose:e=>{pe("onClose",e)},onToggle:e=>{pe("onToggle",e)},onReset:e=>{pe("onReset",e)},onInput:e=>{pe("onInput",e)},onAnswer:e=>{pe("onAnswer",e)},onLoad:e=>{pe("onLoad",e)}})}function dc(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function fc(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 ng(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),pc(o.value)&&!ag(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 rg(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=pc(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=sg(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function og(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function ig(e,t){const n=ng(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?hc(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&gc(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){const l=i.value;i.value=c,i.reflect&&gc(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,c,l)},enumerable:!0,configurable:!0})}),n}function hc(e){if(e)try{return JSON.parse(e)}catch{return e}}function gc(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 sg(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function pc(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function ag(e){return Object.prototype.toString.call(e)==="[object Function]"}function cg(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Di;function lg(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=ig(this,t);const o=og(this.props),i=this.Component,s=Di;try{Di=this,this.__initialized=!0,cg(i)?new i(o,{element:this}):i(o,{element:this})}finally{Di=s}}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,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?hc(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function ug(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=lg(r,rg(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const dg=!1,fg=(e,t)=>e===t,Ve=Symbol("solid-proxy"),mc=typeof Proxy=="function",Yr=Symbol("solid-track"),qr={equals:fg};let yc=Ec;const xt=1,Gr=2,vc={owned:null,cleanups:null,context:null,owner:null},Ri={};var te=null;let Mi=null,hg=null,se=null,be=null,St=null,Xr=0;function Xe(e,t){const n=se,r=te,o=e.length===0,i=t===void 0?r:t,s=o?vc:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ne(()=>cr(s)));te=s,se=null;try{return Et(a,!0)}finally{se=n,te=r}}function L(e,t){t=t?Object.assign({},qr,t):qr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Sc(n,o));return[xc.bind(n),r]}function bc(e,t,n){const r=Zr(e,t,!0,xt);Tn(r)}function ye(e,t,n){const r=Zr(e,t,!1,xt);Tn(r)}function V(e,t,n){yc=wg;const r=Zr(e,t,!1,xt);(!n||!n.render)&&(r.user=!0),St?St.push(r):Tn(r)}function _(e,t,n){n=n?Object.assign({},qr,n):qr;const r=Zr(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Tn(r),xc.bind(r)}function gg(e){return e&&typeof e=="object"&&"then"in e}function pg(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Ri,c=!1,l="initialValue"in i,u=typeof r=="function"&&_(r);const d=new Set,[h,g]=(i.storage||L)(i.initialValue),[f,p]=L(void 0),[m,y]=L(void 0,{equals:!1}),[b,x]=L(l?"ready":"unresolved");function w(P,T,I,$){return s===P&&(s=null,$!==void 0&&(l=!0),(P===a||T===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated($,{value:T})),a=Ri,C(T,I)),T}function C(P,T){Et(()=>{T===void 0&&g(()=>P),x(T!==void 0?"errored":l?"ready":"unresolved"),p(T);for(const I of d.keys())I.decrement();d.clear()},!1)}function S(){const P=yg,T=h(),I=f();if(I!==void 0&&!s)throw I;return se&&se.user,T}function O(P=!0){if(P!==!1&&c)return;c=!1;const T=u?u():r;if(T==null||T===!1){w(s,ne(h));return}let I;const $=a!==Ri?a:ne(()=>{try{return o(T,{value:h(),refetching:P})}catch(K){I=K}});if(I!==void 0){w(s,void 0,eo(I),T);return}else if(!gg($))return w(s,$,void 0,T),$;return s=$,"v"in $?($.s===1?w(s,$.v,void 0,T):w(s,void 0,eo($.v),T),$):(c=!0,queueMicrotask(()=>c=!1),Et(()=>{x(l?"refreshing":"pending"),y()},!1),$.then(K=>w($,K,void 0,T),K=>w($,void 0,eo(K),T)))}Object.defineProperties(S,{state:{get:()=>b()},error:{get:()=>f()},loading:{get(){const P=b();return P==="pending"||P==="refreshing"}},latest:{get(){if(!l)return S();const P=f();if(P&&!s)throw P;return h()}}});let D=te;return u?bc(()=>(D=te,O(!1))):O(!1),[S,{refetch:P=>wc(D,()=>O(P)),mutate:g}]}function Ze(e){return Et(e,!1)}function ne(e){if(se===null)return e();const t=se;se=null;try{return e()}finally{se=t}}function sn(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(i)return i=!1,s;const c=ne(()=>t(a,o,s));return o=a,c}}function an(e){V(()=>ne(e))}function Y(e){return te===null||(te.cleanups===null?te.cleanups=[e]:te.cleanups.push(e)),e}function Ii(){return se}function mg(){return te}function wc(e,t){const n=te,r=se;te=e,se=null;try{return Et(t,!0)}catch(o){Li(o)}finally{te=n,se=r}}function xe(e,t){const n=Symbol("context");return{id:n,Provider:xg(n),defaultValue:e}}function Ce(e){let t;return te&&te.context&&(t=te.context[e.id])!==void 0?t:e.defaultValue}function _i(e){const t=_(e),n=_(()=>Ni(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let yg;function xc(){if(this.sources&&this.state)if(this.state===xt)Tn(this);else{const e=be;be=null,Et(()=>Qr(this),!1),be=e}if(se){const e=this.observers;if(!e||e[e.length-1]!==se){const t=e?e.length:0;se.sources?(se.sources.push(this),se.sourceSlots.push(t)):(se.sources=[this],se.sourceSlots=[t]),e?(e.push(se),this.observerSlots.push(se.sources.length-1)):(this.observers=[se],this.observerSlots=[se.sources.length-1])}}return this.value}function Sc(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Et(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Mi&&Mi.running;s&&Mi.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?be.push(i):St.push(i),i.observers&&Pc(i)),s||(i.state=xt)}if(be.length>1e6)throw be=[],new Error},!1)),t}function Tn(e){if(!e.fn)return;cr(e);const t=Xr;vg(e,e.value,t)}function vg(e,t,n){let r;const o=te,i=se;se=te=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=xt,e.owned&&e.owned.forEach(cr),e.owned=null),e.updatedAt=n+1,Li(s)}finally{se=i,te=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Sc(e,r):e.value=r,e.updatedAt=n)}function Zr(e,t,n,r=xt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:te,context:te?te.context:null,pure:n};return te===null||te!==vc&&(te.owned?te.owned.push(i):te.owned=[i]),i}function Jr(e){if(e.state===0)return;if(e.state===Gr)return Qr(e);if(e.suspense&&ne(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Xr);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===xt)Tn(e);else if(e.state===Gr){const r=be;be=null,Et(()=>Qr(e,t[0]),!1),be=r}}function Et(e,t){if(be)return e();let n=!1;t||(be=[]),St?n=!0:St=[],Xr++;try{const r=e();return bg(n),r}catch(r){n||(St=null),be=null,Li(r)}}function bg(e){if(be&&(Ec(be),be=null),e)return;const t=St;St=null,t.length&&Et(()=>yc(t),!1)}function Ec(e){for(let t=0;t<e.length;t++)Jr(e[t])}function wg(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jr(r)}for(t=0;t<n;t++)Jr(e[t])}function Qr(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===xt?r!==t&&(!r.updatedAt||r.updatedAt<Xr)&&Jr(r):o===Gr&&Qr(r,t)}}}function Pc(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Gr,n.pure?be.push(n):St.push(n),n.observers&&Pc(n))}}function cr(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 i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)cr(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)cr(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 eo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Li(e,t=te){throw eo(e)}function Ni(e){if(typeof e=="function"&&!e.length)return Ni(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Ni(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function xg(e,t){return function(r){let o;return ye(()=>o=ne(()=>(te.context={...te.context,[e]:r.value},_i(()=>r.children))),void 0),o}}const Fi=Symbol("fallback");function to(e){for(let t=0;t<e.length;t++)e[t]()}function Sg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Y(()=>to(i)),()=>{let c=e()||[],l=c.length,u,d;return c[Yr],ne(()=>{let g,f,p,m,y,b,x,w,C;if(l===0)s!==0&&(to(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Fi],o[0]=Xe(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(l),d=0;d<l;d++)r[d]=c[d],o[d]=Xe(h);s=l}else{for(p=new Array(l),m=new Array(l),a&&(y=new Array(l)),b=0,x=Math.min(s,l);b<x&&r[b]===c[b];b++);for(x=s-1,w=l-1;x>=b&&w>=b&&r[x]===c[w];x--,w--)p[w]=o[x],m[w]=i[x],a&&(y[w]=a[x]);for(g=new Map,f=new Array(w+1),d=w;d>=b;d--)C=c[d],u=g.get(C),f[d]=u===void 0?-1:u,g.set(C,d);for(u=b;u<=x;u++)C=r[u],d=g.get(C),d!==void 0&&d!==-1?(p[d]=o[u],m[d]=i[u],a&&(y[d]=a[u]),d=f[d],g.set(C,d)):i[u]();for(d=b;d<l;d++)d in p?(o[d]=p[d],i[d]=m[d],a&&(a[d]=y[d],a[d](d))):o[d]=Xe(h);o=o.slice(0,s=l),r=c.slice(0)}return o});function h(g){if(i[d]=g,a){const[f,p]=L(d);return a[d]=p,t(c[d],f)}return t(c[d])}}}function Eg(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,c;return Y(()=>to(i)),()=>{const l=e()||[],u=l.length;return l[Yr],ne(()=>{if(u===0)return a!==0&&(to(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Fi],o[0]=Xe(h=>(i[0]=h,n.fallback())),a=1),o;for(r[0]===Fi&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?s[c](()=>l[c]):c>=r.length&&(o[c]=Xe(d));for(;c<r.length;c++)i[c]();return a=s.length=i.length=u,r=l.slice(0),o=o.slice(0,a)});function d(h){i[c]=h;const[g,f]=L(l[c]);return s[c]=f,t(g,c)}}}function v(e,t){return ne(()=>e(t||{}))}function no(){return!0}const Vi={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return t===Ve?!0:e.has(t)},set:no,deleteProperty:no,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:no,deleteProperty:no}},ownKeys(e){return e.keys()}};function Bi(e){return(e=typeof e=="function"?e():e)?e:{}}function Pg(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function N(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ve in a,e[s]=typeof a=="function"?(t=!0,_(a)):a}if(mc&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const c=Bi(e[a])[s];if(c!==void 0)return c}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Bi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Bi(e[a])));return[...new Set(s)]}},Vi);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let l=c.length-1;l>=0;l--){const u=c[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:Pg.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const h=n[u];h&&(d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function J(e,...t){const n=t.length;if(mc&&Ve in e){const o=n>1?t.flat():t[0],i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Vi));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Vi)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let c=0;c<t.length;c++)if(t[c].includes(o)){i=c;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let Cg=0;function Be(){return`cl-${Cg++}`}const Cc=e=>`Stale read from <${e}>.`;function cn(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Sg(()=>e.each,e.children,t||void 0))}function kc(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Eg(()=>e.each,e.children,t||void 0))}function ie(e){const t=e.keyed,n=_(()=>e.when,void 0,void 0),r=t?n:_(n,void 0,{equals:(o,i)=>!o==!i});return _(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?ne(()=>i(t?o:()=>{if(!ne(r))throw Cc("Show");return n()})):i}return e.fallback},void 0,void 0)}function Oc(e){const t=_i(()=>e.children),n=_(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],l=i,u=_(()=>l()?void 0:c.when,void 0,void 0),d=c.keyed?u:_(u,void 0,{equals:(h,g)=>!h==!g});i=()=>l()||(d()?[a,u,c]:void 0)}return i});return _(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?ne(()=>a(s.keyed?i():()=>{if(ne(n)()?.[0]!==o)throw Cc("Match");return i()})):a},void 0,void 0)}function lr(e){return e}const kg=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Og=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...kg]),Tg=new Set(["innerHTML","textContent","innerText","children"]),Ag=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),$g=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Dg(e,t){const n=$g[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Rg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Mg=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"]),Ig={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Ut=e=>_(()=>e());function _g(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,c=t[o-1].nextSibling,l=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:c;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!l){l=new Map;let d=a;for(;d<i;)l.set(n[d],d++)}const u=l.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,g;for(;++d<o&&d<i&&!((g=l.get(t[d]))==null||g!==u+h);)h++;if(h>u-a){const f=t[s];for(;a<u;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Tc="_$DX_DELEGATE";function W(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function Lg(e,t=window.document){const n=t[Tc]||(t[Tc]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Ug))}}function ke(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Ng(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function Fg(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function ln(e,t){t==null?e.removeAttribute("class"):e.className=t}function Vg(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]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Bg(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Ac(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(Ac(e,a,!0),n[a]=c)}return n}function ro(e,t,n){if(!t)return n?ke(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,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function un(e,t={},n,r){const o={};return r||ye(()=>o.children=ur(e,t.children,o.children)),ye(()=>typeof t.ref=="function"&&Ki(t.ref,e)),ye(()=>Kg(e,t,n,!0,o,!0)),o}function Ki(e,t,n){return ne(()=>e(t,n))}function B(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ur(e,t,r,n);ye(o=>ur(e,t(),o,n),r)}function Kg(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=$c(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=$c(e,s,a,o[s],n,i,t)}}function zg(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ac(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function $c(e,t,n,r,o,i,s){let a,c,l,u,d;if(t==="style")return ro(e,n,r);if(t==="classList")return Bg(e,n,r);if(n===r)return r;if(t==="ref")i||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(),g=Rg.has(h);if(!g&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(g||n)&&(Vg(e,h,n,g),g&&Lg([h]))}else if(t.slice(0,5)==="attr:")ke(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Fg(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=Tg.has(t))||!o&&((u=Dg(t,e.tagName))||(c=Og.has(t)))||(a=e.nodeName.includes("-")||"is"in s))d&&(t=t.slice(5),c=!0),t==="class"||t==="className"?ln(e,n):a&&!c&&!l?e[zg(t)]=n:e[u||t]=n;else{const h=o&&t.indexOf(":")>-1&&Ig[t.split(":")[0]];h?Ng(e,h,t,n):ke(e,Ag[t]||t,n)}return n}function Ug(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),s=()=>{const c=t[n];if(c&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function ur(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(t=t.toString(),t===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=An(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=An(e,n,r);else{if(i==="function")return ye(()=>{let a=t();for(;typeof a=="function";)a=a();n=ur(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(zi(a,t,n,o))return ye(()=>n=ur(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=An(e,n,r),s)return n}else c?n.length===0?Dc(e,a,r):_g(e,n,a):(n&&An(e),Dc(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=An(e,n,r,t);An(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function zi(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],c=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=zi(e,a,c)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=zi(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const u=String(a);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function Dc(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function An(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const c=a.parentNode===e;!i&&!s?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const jg=!1,Wg="http://www.w3.org/2000/svg";function Rc(e,t=!1,n=void 0){return t?document.createElementNS(Wg,e):document.createElement(e,{is:n})}function Mc(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=mg();let i;return V(()=>{i||(i=wc(o,()=>_(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[a,c]=L(!1),l=()=>c(!0);Xe(u=>B(s,()=>a()?u():i(),null)),Y(l)}else{const a=Rc(e.isSVG?"g":"div",e.isSVG),c=t&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),B(c,i),s.appendChild(a),e.ref&&e.ref(a),Y(()=>s.removeChild(a))}},void 0,{render:!0}),n}function Hg(e,t){const n=_(e);return _(()=>{const r=n();switch(typeof r){case"function":return ne(()=>r(t));case"string":const o=Mg.has(r),i=Rc(r,o,ne(()=>t.is));return un(i,t,o),i}})}function dr(e){const[,t]=J(e,["component"]);return Hg(()=>e.component,t)}function Yg(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function qg(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 Gg(e){return(t,n)=>{const{element:r}=n;return Xe(o=>{const i=Yg(t);r.addPropertyChangedCallback((a,c)=>i[a]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return B(r.renderRoot,s)},qg(r))}}function Xg(e,t,n){return arguments.length===2&&(n=t,t={}),ug(e,t)(Gg(n))}const Zg='*,: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}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.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}.box-border{box-sizing:border-box}.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-\\[44px\\]{height:44px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[44px\\]{min-height:44px}.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-\\[400px\\]{width:400px}.w-\\[44px\\]{width:44px}.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}.shrink-0{flex-shrink:0}.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))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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-none{resize: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}.overscroll-contain{overscroll-behavior:contain}.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-none{border-radius:0}.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-t{border-top-width:1px}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.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-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-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-6{padding-top:24px;padding-bottom:24px}.pb-2{padding-bottom:8px}.pb-\\[\\.\\.\\.\\]{padding-bottom:...}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.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}.leading-tight{line-height:1.25}.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}.opacity-70{opacity:.7}.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))}.filter{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)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@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}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--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\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.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\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.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))}',[Ic,Ui]=L(!1),_c=[],Jg=e=>_c.push(e),Lc=()=>{_c.forEach(e=>e())},Qg=()=>{const e=!Ic();Ui(e),he("onToggle"),he(e?"onOpen":"onClose"),Lc()},ep=()=>{Ui(!1),he("onClose")},tp=()=>{Ui(!0),he("onOpen"),Lc()},Nc=()=>({bubble:Ic,show:tp,hide:ep,toggle:Qg,onOpen:Jg}),ji=Symbol("store-raw"),$n=Symbol("store-node"),Pt=Symbol("store-has"),Fc=Symbol("store-self");function Vc(e){let t=e[Ve];if(!t&&(Object.defineProperty(e,Ve,{value:t=new Proxy(e,op)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const c=n[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(e,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(t)})}}return t}function oo(e){let t;return e!=null&&typeof e=="object"&&(e[Ve]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function fr(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ji])return n;if(!oo(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=fr(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,l=s.length;c<l;c++)i=s[c],!a[i].get&&(o=e[i],(r=fr(o,t))!==o&&(e[i]=r))}return e}function io(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function hr(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function np(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Ve||t===$n||(delete n.value,delete n.writable,n.get=()=>e[Ve][t]),n}function Bc(e){Ii()&&hr(io(e,$n),Fc)()}function rp(e){return Bc(e),Reflect.ownKeys(e)}const op={get(e,t,n){if(t===ji)return e;if(t===Ve)return n;if(t===Yr)return Bc(e),n;const r=io(e,$n),o=r[t];let i=o?o():e[t];if(t===$n||t===Pt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Ii()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=hr(r,t,i)())}return oo(i)?Vc(i):i},has(e,t){return t===ji||t===Ve||t===Yr||t===$n||t===Pt||t==="__proto__"?!0:(Ii()&&hr(io(e,Pt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:rp,getOwnPropertyDescriptor:np};function so(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Pt]&&e[Pt][t]&&o!==void 0&&e[Pt][t].$()):(e[t]=n,e[Pt]&&e[Pt][t]&&o===void 0&&e[Pt][t].$());let s=io(e,$n),a;if((a=hr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(a=s[c])&&a.$();(a=hr(s,"length",i))&&a.$(e.length)}(a=s[Fc])&&a.$()}function Kc(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];zc(o)||so(e,o,t[o])}}function zc(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function ip(e,t){if(typeof t=="function"&&(t=t(e)),t=fr(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&&so(e,n,o)}so(e,"length",r)}else Kc(e,t)}function gr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&zc(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)gr(e,[r[c]].concat(t),n);return}else if(a&&s==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&gr(e,[c].concat(t),n);return}else if(a&&s==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=r;for(let d=c;d<=l;d+=u)gr(e,[d].concat(t),n);return}else if(t.length>1){gr(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=fr(i),r===void 0||oo(o)&&oo(i)&&!Array.isArray(i)?Kc(o,i):so(e,r,i))}function sp(...[e,t]){const n=fr(e||{}),r=Array.isArray(n),o=Vc(n);function i(...s){Ze(()=>{r&&s.length===1?ip(n,s[0]):gr(n,s)})}return[o,i]}function Wi(e,t,n){return Xe(()=>{const r=fc(e),[o,i]=sp(r?JSON.parse(r):t);return V(()=>dc(e,JSON.stringify(o),n)),[o,i]})}function ap(e,t,n){return Xe(()=>{const r=fc(e),[o,i]=L(r?JSON.parse(r):t);return V(()=>dc(e,JSON.stringify(o()),n)),[o,i]})}const[ck,lk]=ap("smarttalks-widget-lang","en");function cp(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 lp(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 ao={};function up(e){for(const[t,n]of Object.entries(e))n===null?ao[t]=null:ao[t]=n;return{...ao}}function dp(){const e=Object.entries(ao).filter(([,t])=>t!==void 0);if(e.length)return Object.fromEntries(e)}function fp(e){const t=new URLSearchParams(e),n={},r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];for(const o of r){const i=t.get(o);if(i){const s=o.replace(/_([a-z])/g,(a,c)=>c.toUpperCase());n[s]=i}}return n}function Uc(){if(typeof window>"u")return{};const e={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,...fp(window.location.search)};try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}e.isMobile=String(/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)),e.viewportW=String(window.innerWidth),e.viewportH=String(window.innerHeight);const t=dp();t&&(e.custom=t);for(const n of Object.keys(e))(e[n]===void 0||e[n]==="")&&delete e[n];return e}const hp=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${On}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return cp(i);if(i.type==="entity")return lp(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return pe("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${On}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),pe("registerMetadata",s=>{!s||!Object.keys(s).length||(up(s),fetch(`${On}/v1/widget-metadata/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:s})}).catch(console.error))}),i._id=n,i},[jc,gp]=L(""),[dn]=Xe(()=>pg(jc,hp)),pp=()=>{if(dn()?.type==="chat")return dn()},mp=()=>{if(dn()?.type==="form")return dn()},co=()=>{const e=dn();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Xe(()=>V(()=>{const e=dn();Xh(e),e&&(he("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const ge=()=>({widgetId:jc,setWidgetId:gp,widget:dn,chatWidget:pp,formWidget:mp,getSessionId:co}),Wc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hc=nc,yp=(e,t)=>n=>{var r;if(t?.variants==null)return Hc(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(l=>{const u=n?.[l],d=i?.[l];if(u===null)return null;const h=Wc(u)||Wc(d);return o[l][h]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,h]=u;return h===void 0||(l[d]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:h,...g}=u;return Object.entries(g).every(f=>{let[p,m]=f;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...l,d,h]:l},[]);return Hc(e,s,c,n?.class,n?.className)};var vp=W("<button>");const bp=yp("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"}}),Je=e=>{const[,t]=J(e,["variant","size","class"]);return(()=>{var n=vp();return un(n,N({get class(){return zt(bp({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var wp=W('<img alt="widget logo">');const Yc=e=>{const[,t]=J(e,["class","src"]);return(()=>{var n=wp();return un(n,N({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return zt("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var xp=W('<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 Sp=()=>{const{chatWidget:e}=ge(),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=xp(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return B(r,v(Yc,{get src(){return e()?.avatar}}),o),B(i,t),B(s,n),r})()};var Ep=W("<svg stroke-width=0>");function Ke(e,t){const n=N(e.a,t),[r,o]=J(n,["src"]),[i,s]=L(""),a=_(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return V(()=>s(a())),Y(()=>{s("")}),(()=>{var c=Ep();return un(c,N({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 i()}}),!0,!0),B(c,()=>jg),c})()}function Pp(e){return Ke({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 Cp(e){return Ke({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 kp(e){return Ke({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 Op(e){return Ke({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 Hi={equals:!1};function qc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Tp(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const M=e=>typeof e=="function"&&!e.length?e():e,Gc=e=>Array.isArray(e)?e:e?[e]:[];function Ap(e,...t){return typeof e=="function"?e(...t):e}const $p=Y;function Dp(e,t,n,r){return e.addEventListener(t,n,r),$p(e.removeEventListener.bind(e,t,n,r))}function Rp(e,t,n,r){const o=()=>{Gc(M(e)).forEach(i=>{i&&Gc(M(t)).forEach(s=>Dp(i,s,n,r))})};typeof e=="function"?V(o):ye(o)}function lo(){return!0}const Mp={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return e.has(t)},set:lo,deleteProperty:lo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:lo,deleteProperty:lo}},ownKeys(e){return e.keys()}},Ip=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Xc(e){const t={};let n;for(;n=Ip.exec(e);)t[n[1]]=n[2];return t}function _p(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Xc(e)}else typeof t=="string"&&(t=Xc(t));return{...e,...t}}const Yi=(e,t,n)=>{let r;for(const o of e){const i=M(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Lp(...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?Tp:qc,o={};for(const s of n){const a=M(s);for(const c in a)if(c[0]==="o"&&c[1]==="n"&&c[2]){const l=a[c],u=c.toLowerCase(),d=typeof l=="function"?l:Array.isArray(l)?l.length===1?l[0]:l[0].bind(void 0,l[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=N(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return Yi(n,"style",_p);if(s==="ref"){const a=[];for(const c of n){const l=M(c)[s];typeof l=="function"&&a.push(l)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?Yi(n,s,(a,c)=>`${a} ${c}`):s==="classList"?Yi(n,s,(a,c)=>({...a,...c})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},Mp)}function fn(...e){return qc(e)}function Np(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function qi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fp(e){return typeof e=="number"}function Vp(e){return Array.isArray(e)}function Dn(e){return Object.prototype.toString.call(e)==="[object String]"}function Bp(e){return typeof e=="function"}function Zc(e){return t=>`${e()}-${t}`}function at(e,t){return e?e===t||e.contains(t):!1}function pr(e,t=!1){const{activeElement:n}=Ct(e);if(!n?.nodeName)return null;if(Jc(n)&&n.contentDocument)return pr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ct(n).getElementById(r);if(o)return o}}return n}function Ct(e){return e?e.ownerDocument||e:document}function Jc(e){return e.tagName==="IFRAME"}var Qc=(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))(Qc||{});function Gi(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function uo(){return Gi(/^Mac/i)}function Kp(){return Gi(/^iPhone/i)}function zp(){return Gi(/^iPad/i)||uo()&&navigator.maxTouchPoints>1}function Up(){return Kp()||zp()}function jp(){return uo()||Up()}function De(e,t){return t&&(Bp(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ze(e){return t=>{for(const n of e)De(t,n)}}function Wp(e){return uo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Oe(e){if(e)if(Hp())e.focus({preventScroll:!0});else{const t=Yp(e);e.focus(),qp(t)}}var fo=null;function Hp(){if(fo==null){fo=!1;try{document.createElement("div").focus({get preventScroll(){return fo=!0,!0}})}catch{}}return fo}function Yp(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 qp(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var el=["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'])"],Gp=[...el,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Xi=`${el.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Xp=Gp.join(':not([hidden]):not([tabindex="-1"]),');function tl(e,t){const r=Array.from(e.querySelectorAll(Xi)).filter(nl);return t&&nl(e)&&r.unshift(e),r.forEach((o,i)=>{if(Jc(o)&&o.contentDocument){const s=o.contentDocument.body,a=tl(s,!1);r.splice(i,1,...a)}}),r}function nl(e){return rl(e)&&!Zp(e)}function rl(e){return e.matches(Xi)&&Zi(e)}function Zp(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Zi(e,t){return e.nodeName!=="#comment"&&Jp(e)&&Qp(e,t)&&(!e.parentElement||Zi(e.parentElement,e))}function Jp(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:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Qp(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function em(e,t,n){const r=t?.tabbable?Xp:Xi,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Zi(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function ol(e){let t=e;for(;t&&!tm(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function tm(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function nm(){}function rm(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,c=s-1;a<s;c=a++){const[l,u]=t[a],[d,h]=t[c],[,g]=t[c===0?s-1:c-1]||[0,0],f=(u-h)*(n-l)-(l-d)*(r-u);if(h<u){if(r>=h&&r<u){if(f===0)return!0;f>0&&(r===h?r>g&&(o=!o):o=!o)}}else if(u<h){if(r>u&&r<=h){if(f===0)return!0;f<0&&(r===h?r<g&&(o=!o):o=!o)}}else if(r===u&&(n>=d&&n<=l||n>=l&&n<=d))return!0}return o}function ct(e,t){return N(e,t)}var mr=new Map,il=new Set;function sl(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=mr.get(n.target);r||(r=new Set,mr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=mr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),mr.delete(n.target)),mr.size===0)){for(const o of il)o();il.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?sl():document.addEventListener("DOMContentLoaded",sl));function Ji(e,t){const n=al(e,t,"left"),r=al(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const c=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+o>c&&(s+=n+o-c),r<=a?a=r:r+i>l&&(a+=r+i-l),e.scrollLeft=s,e.scrollTop=a}function al(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 om(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=ol(e);for(;e&&o&&e!==n&&o!==n;)Ji(o,e),e=o,o=ol(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var im={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 Qi(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=c=>{if(c==null)return"";const l=e.getKey??"key",u=Dn(l)?c[l]:l(c);return u!=null?String(u):""},i=c=>{if(c==null)return"";const l=e.getTextValue??"textValue",u=Dn(l)?c[l]:l(c);return u!=null?String(u):""},s=c=>{if(c==null)return!1;const l=e.getDisabled??"disabled";return(Dn(l)?c[l]:l(c))??!1},a=c=>{if(c!=null)return Dn(e.getSectionChildren)?c[e.getSectionChildren]:e.getSectionChildren?.(c)};for(const c of e.dataSource){if(Dn(c)||Fp(c)){r.push({type:"item",rawValue:c,key:String(c),textValue:String(c),disabled:s(c),level:n,index:t}),t++;continue}if(a(c)!=null){r.push({type:"section",rawValue:c,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(c)??[];if(l.length>0){const u=Qi({dataSource:l,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:c,key:o(c),textValue:i(c),disabled:s(c),level:n,index:t}),t++}return r}/*!
|
|
1
|
+
(function(ir){typeof define=="function"&&define.amd?define(ir):ir()})((function(){"use strict";function ir(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=ir(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ir(e))&&(r&&(r+=" "),r+=t);return r}const $i="-",bh=e=>{const t=Sh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split($i);return a[0]===""&&a.length!==1&&a.shift(),oc(a,t)||xh(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&r[s]?[...c,...r[s]]:c}}},oc=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?oc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join($i);return t.validators.find(({validator:s})=>s(i))?.classGroupId},ic=/^\[(.+)\]$/,xh=e=>{if(ic.test(e)){const t=ic.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Sh=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ph(Object.entries(e.classGroups),n).forEach(([i,s])=>{Di(s,r,i,t)}),r},Di=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:sc(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Eh(o)){Di(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Di(s,sc(t,i),n,r)})})},sc=(e,t)=>{let n=e;return t.split($i).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Eh=e=>e.isThemeGetter,Ph=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,Ch=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},ac="!",kh=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const c=[];let l=0,u=0,d;for(let m=0;m<a.length;m++){let y=a[m];if(l===0){if(y===o&&(r||a.slice(m,m+i)===t)){c.push(a.slice(u,m)),u=m+i;continue}if(y==="/"){d=m;continue}}y==="["?l++:y==="]"&&l--}const h=c.length===0?a:a.substring(u),g=h.startsWith(ac),f=g?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},Oh=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},Th=e=>({cache:Ch(e.cacheSize),parseClassName:kh(e),...bh(e)}),Ah=/\s+/,$h=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Ah);let a="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:g}=n(l);let f=!!g,p=r(f?h.substring(0,g):h);if(!p){if(!f){a=l+(a.length>0?" "+a:a);continue}if(p=r(h),!p){a=l+(a.length>0?" "+a:a);continue}f=!1}const m=Oh(u).join(":"),y=d?m+ac:m,w=y+p;if(i.includes(w))continue;i.push(w);const x=o(p,f);for(let b=0;b<x.length;++b){const C=x[b];i.push(y+C)}a=l+(a.length>0?" "+a:a)}return a};function Dh(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=cc(t))&&(r&&(r+=" "),r+=n);return r}const cc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=cc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Rh(e,...t){let n,r,o,i=s;function s(c){const l=t.reduce((u,d)=>d(u),e());return n=Th(l),r=n.cache.get,o=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=$h(c,n);return o(c,u),u}return function(){return i(Dh.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},lc=/^\[(?:([a-z-]+):)?(.+)\]$/i,Mh=/^\d+\/\d+$/,Ih=new Set(["px","full","screen"]),_h=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lh=/\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$/,Nh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Fh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bt=e=>Pn(e)||Ih.has(e)||Mh.test(e),Bt=e=>Cn(e,"length",Yh),Pn=e=>!!e&&!Number.isNaN(Number(e)),Ri=e=>Cn(e,"number",Pn),sr=e=>!!e&&Number.isInteger(Number(e)),Bh=e=>e.endsWith("%")&&Pn(e.slice(0,-1)),Y=e=>lc.test(e),Kt=e=>_h.test(e),Kh=new Set(["length","size","percentage"]),zh=e=>Cn(e,Kh,uc),Uh=e=>Cn(e,"position",uc),Wh=new Set(["image","url"]),jh=e=>Cn(e,Wh,Gh),Hh=e=>Cn(e,"",qh),ar=()=>!0,Cn=(e,t,n)=>{const r=lc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Yh=e=>Lh.test(e)&&!Nh.test(e),uc=()=>!1,qh=e=>Fh.test(e),Gh=e=>Vh.test(e),Xh=Rh(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),a=ue("borderWidth"),c=ue("contrast"),l=ue("grayscale"),u=ue("hueRotate"),d=ue("invert"),h=ue("gap"),g=ue("gradientColorStops"),f=ue("gradientColorStopPositions"),p=ue("inset"),m=ue("margin"),y=ue("opacity"),w=ue("padding"),x=ue("saturate"),b=ue("scale"),C=ue("sepia"),S=ue("skew"),O=ue("space"),D=ue("translate"),P=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Y,t],$=()=>[Y,t],K=()=>["",bt,Bt],U=()=>["auto",Pn,Y],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Y],qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$e=()=>[Pn,Y];return{cacheSize:500,separator:":",theme:{colors:[ar],spacing:[bt,Bt],blur:["none","",Kt,Y],brightness:$e(),borderColor:[e],borderRadius:["none","","full",Kt,Y],borderSpacing:$(),borderWidth:K(),contrast:$e(),grayscale:q(),hueRotate:$e(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Bh,Bt],inset:I(),margin:I(),opacity:$e(),padding:$(),saturate:$e(),scale:$e(),sepia:q(),skew:$e(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[Kt]}],"break-after":[{"break-after":qe()}],"break-before":[{"break-before":qe()}],"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:[...Q(),Y]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sr,Y]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",sr,Y]}],"grid-cols":[{"grid-cols":[ar]}],"col-start-end":[{col:["auto",{span:["full",sr,Y]},Y]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ar]}],"row-start-end":[{row:["auto",{span:[sr,Y]},Y]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],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":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[Kt]},Kt]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Kt,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ri]}],"font-family":[{font:[ar]}],"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",Y]}],"line-clamp":[{"line-clamp":["none",Pn,Ri]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bt,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bt,Bt]}],"underline-offset":[{"underline-offset":["auto",bt,Y]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],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",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),Uh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[y]}],"border-style":[{border:[...V(),"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":[y]}],"divide-style":[{divide:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[bt,Y]}],"outline-w":[{outline:[bt,Bt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[bt,Bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Kt,Hh]}],"shadow-color":[{shadow:[ar]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...j(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Kt,Y]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:$e()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:$e()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[sr,Y]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],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",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[bt,Bt,Ri]}],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 zt(...e){return Xh(rc(e))}function Zh(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",jr(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",jr(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",jr(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",jr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function jr(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),i=Math.max(t,n,r),s=i-o,a=0,c=0,l=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),l=(i+o)/2,c=s==0?0:s/(1-Math.abs(2*l-1)),c=+(c*100).toFixed(1),l=+(l*100).toFixed(1),a+","+c+"%,"+l+"%"}function Jh(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 Qh(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 Hr(){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 eg={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 kn(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"),eg[n][e]}const On="https://heimdall.smarttalks.ai/api",tg="wss://heimdall.smarttalks.ai",dc="smarttalkswidget";function he(e,...t){window.postMessage({from:dc,command:e,args:t})}function pe(e,t){window.addEventListener("message",n=>{n.origin===window.location.origin&&n.data?.from===dc&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function ng(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{he("registerContactData",e)},registerMetadata:e=>{he("registerMetadata",e)},open:e=>{he("open"),e&&he("setInput",e)},close:()=>{he("close")},toggle:()=>{he("toggle")},toggleFullscreen:()=>{he("toggleFullscreen")},reset:()=>{he("reset")},onOpen:e=>{pe("onOpen",e)},onClose:e=>{pe("onClose",e)},onToggle:e=>{pe("onToggle",e)},onReset:e=>{pe("onReset",e)},onInput:e=>{pe("onInput",e)},onAnswer:e=>{pe("onAnswer",e)},onLoad:e=>{pe("onLoad",e)}})}function fc(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function hc(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 rg(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),mc(o.value)&&!cg(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 og(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=mc(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=ag(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function ig(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function sg(e,t){const n=rg(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?gc(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&pc(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){const l=i.value;i.value=c,i.reflect&&pc(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,c,l)},enumerable:!0,configurable:!0})}),n}function gc(e){if(e)try{return JSON.parse(e)}catch{return e}}function pc(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 ag(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function mc(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function cg(e){return Object.prototype.toString.call(e)==="[object Function]"}function lg(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Mi;function ug(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=sg(this,t);const o=ig(this.props),i=this.Component,s=Mi;try{Mi=this,this.__initialized=!0,lg(i)?new i(o,{element:this}):i(o,{element:this})}finally{Mi=s}}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,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?gc(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function dg(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=ug(r,og(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const fg=!1,hg=(e,t)=>e===t,Ve=Symbol("solid-proxy"),yc=typeof Proxy=="function",Yr=Symbol("solid-track"),qr={equals:hg};let vc=Pc;const xt=1,Gr=2,wc={owned:null,cleanups:null,context:null,owner:null},Ii={};var te=null;let _i=null,gg=null,se=null,we=null,St=null,Xr=0;function Xe(e,t){const n=se,r=te,o=e.length===0,i=t===void 0?r:t,s=o?wc:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ne(()=>cr(s)));te=s,se=null;try{return Et(a,!0)}finally{se=n,te=r}}function L(e,t){t=t?Object.assign({},qr,t):qr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ec(n,o));return[Sc.bind(n),r]}function bc(e,t,n){const r=Zr(e,t,!0,xt);Tn(r)}function ye(e,t,n){const r=Zr(e,t,!1,xt);Tn(r)}function B(e,t,n){vc=xg;const r=Zr(e,t,!1,xt);(!n||!n.render)&&(r.user=!0),St?St.push(r):Tn(r)}function _(e,t,n){n=n?Object.assign({},qr,n):qr;const r=Zr(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Tn(r),Sc.bind(r)}function pg(e){return e&&typeof e=="object"&&"then"in e}function mg(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Ii,c=!1,l="initialValue"in i,u=typeof r=="function"&&_(r);const d=new Set,[h,g]=(i.storage||L)(i.initialValue),[f,p]=L(void 0),[m,y]=L(void 0,{equals:!1}),[w,x]=L(l?"ready":"unresolved");function b(P,T,I,$){return s===P&&(s=null,$!==void 0&&(l=!0),(P===a||T===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated($,{value:T})),a=Ii,C(T,I)),T}function C(P,T){Et(()=>{T===void 0&&g(()=>P),x(T!==void 0?"errored":l?"ready":"unresolved"),p(T);for(const I of d.keys())I.decrement();d.clear()},!1)}function S(){const P=vg,T=h(),I=f();if(I!==void 0&&!s)throw I;return se&&se.user,T}function O(P=!0){if(P!==!1&&c)return;c=!1;const T=u?u():r;if(T==null||T===!1){b(s,ne(h));return}let I;const $=a!==Ii?a:ne(()=>{try{return o(T,{value:h(),refetching:P})}catch(K){I=K}});if(I!==void 0){b(s,void 0,eo(I),T);return}else if(!pg($))return b(s,$,void 0,T),$;return s=$,"v"in $?($.s===1?b(s,$.v,void 0,T):b(s,void 0,eo($.v),T),$):(c=!0,queueMicrotask(()=>c=!1),Et(()=>{x(l?"refreshing":"pending"),y()},!1),$.then(K=>b($,K,void 0,T),K=>b($,void 0,eo(K),T)))}Object.defineProperties(S,{state:{get:()=>w()},error:{get:()=>f()},loading:{get(){const P=w();return P==="pending"||P==="refreshing"}},latest:{get(){if(!l)return S();const P=f();if(P&&!s)throw P;return h()}}});let D=te;return u?bc(()=>(D=te,O(!1))):O(!1),[S,{refetch:P=>xc(D,()=>O(P)),mutate:g}]}function Ze(e){return Et(e,!1)}function ne(e){if(se===null)return e();const t=se;se=null;try{return e()}finally{se=t}}function an(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(i)return i=!1,s;const c=ne(()=>t(a,o,s));return o=a,c}}function cn(e){B(()=>ne(e))}function H(e){return te===null||(te.cleanups===null?te.cleanups=[e]:te.cleanups.push(e)),e}function Li(){return se}function yg(){return te}function xc(e,t){const n=te,r=se;te=e,se=null;try{return Et(t,!0)}catch(o){Fi(o)}finally{te=n,se=r}}function xe(e,t){const n=Symbol("context");return{id:n,Provider:Sg(n),defaultValue:e}}function ke(e){let t;return te&&te.context&&(t=te.context[e.id])!==void 0?t:e.defaultValue}function Ni(e){const t=_(e),n=_(()=>Vi(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let vg;function Sc(){if(this.sources&&this.state)if(this.state===xt)Tn(this);else{const e=we;we=null,Et(()=>Qr(this),!1),we=e}if(se){const e=this.observers;if(!e||e[e.length-1]!==se){const t=e?e.length:0;se.sources?(se.sources.push(this),se.sourceSlots.push(t)):(se.sources=[this],se.sourceSlots=[t]),e?(e.push(se),this.observerSlots.push(se.sources.length-1)):(this.observers=[se],this.observerSlots=[se.sources.length-1])}}return this.value}function Ec(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Et(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=_i&&_i.running;s&&_i.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?we.push(i):St.push(i),i.observers&&Cc(i)),s||(i.state=xt)}if(we.length>1e6)throw we=[],new Error},!1)),t}function Tn(e){if(!e.fn)return;cr(e);const t=Xr;wg(e,e.value,t)}function wg(e,t,n){let r;const o=te,i=se;se=te=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=xt,e.owned&&e.owned.forEach(cr),e.owned=null),e.updatedAt=n+1,Fi(s)}finally{se=i,te=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ec(e,r):e.value=r,e.updatedAt=n)}function Zr(e,t,n,r=xt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:te,context:te?te.context:null,pure:n};return te===null||te!==wc&&(te.owned?te.owned.push(i):te.owned=[i]),i}function Jr(e){if(e.state===0)return;if(e.state===Gr)return Qr(e);if(e.suspense&&ne(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Xr);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===xt)Tn(e);else if(e.state===Gr){const r=we;we=null,Et(()=>Qr(e,t[0]),!1),we=r}}function Et(e,t){if(we)return e();let n=!1;t||(we=[]),St?n=!0:St=[],Xr++;try{const r=e();return bg(n),r}catch(r){n||(St=null),we=null,Fi(r)}}function bg(e){if(we&&(Pc(we),we=null),e)return;const t=St;St=null,t.length&&Et(()=>vc(t),!1)}function Pc(e){for(let t=0;t<e.length;t++)Jr(e[t])}function xg(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jr(r)}for(t=0;t<n;t++)Jr(e[t])}function Qr(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===xt?r!==t&&(!r.updatedAt||r.updatedAt<Xr)&&Jr(r):o===Gr&&Qr(r,t)}}}function Cc(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Gr,n.pure?we.push(n):St.push(n),n.observers&&Cc(n))}}function cr(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 i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)cr(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)cr(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 eo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Fi(e,t=te){throw eo(e)}function Vi(e){if(typeof e=="function"&&!e.length)return Vi(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Vi(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function Sg(e,t){return function(r){let o;return ye(()=>o=ne(()=>(te.context={...te.context,[e]:r.value},Ni(()=>r.children))),void 0),o}}const Bi=Symbol("fallback");function to(e){for(let t=0;t<e.length;t++)e[t]()}function Eg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return H(()=>to(i)),()=>{let c=e()||[],l=c.length,u,d;return c[Yr],ne(()=>{let g,f,p,m,y,w,x,b,C;if(l===0)s!==0&&(to(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Bi],o[0]=Xe(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(l),d=0;d<l;d++)r[d]=c[d],o[d]=Xe(h);s=l}else{for(p=new Array(l),m=new Array(l),a&&(y=new Array(l)),w=0,x=Math.min(s,l);w<x&&r[w]===c[w];w++);for(x=s-1,b=l-1;x>=w&&b>=w&&r[x]===c[b];x--,b--)p[b]=o[x],m[b]=i[x],a&&(y[b]=a[x]);for(g=new Map,f=new Array(b+1),d=b;d>=w;d--)C=c[d],u=g.get(C),f[d]=u===void 0?-1:u,g.set(C,d);for(u=w;u<=x;u++)C=r[u],d=g.get(C),d!==void 0&&d!==-1?(p[d]=o[u],m[d]=i[u],a&&(y[d]=a[u]),d=f[d],g.set(C,d)):i[u]();for(d=w;d<l;d++)d in p?(o[d]=p[d],i[d]=m[d],a&&(a[d]=y[d],a[d](d))):o[d]=Xe(h);o=o.slice(0,s=l),r=c.slice(0)}return o});function h(g){if(i[d]=g,a){const[f,p]=L(d);return a[d]=p,t(c[d],f)}return t(c[d])}}}function Pg(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,c;return H(()=>to(i)),()=>{const l=e()||[],u=l.length;return l[Yr],ne(()=>{if(u===0)return a!==0&&(to(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Bi],o[0]=Xe(h=>(i[0]=h,n.fallback())),a=1),o;for(r[0]===Bi&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?s[c](()=>l[c]):c>=r.length&&(o[c]=Xe(d));for(;c<r.length;c++)i[c]();return a=s.length=i.length=u,r=l.slice(0),o=o.slice(0,a)});function d(h){i[c]=h;const[g,f]=L(l[c]);return s[c]=f,t(g,c)}}}function v(e,t){return ne(()=>e(t||{}))}function no(){return!0}const Ki={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return t===Ve?!0:e.has(t)},set:no,deleteProperty:no,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:no,deleteProperty:no}},ownKeys(e){return e.keys()}};function zi(e){return(e=typeof e=="function"?e():e)?e:{}}function Cg(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function N(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&Ve in a,e[s]=typeof a=="function"?(t=!0,_(a)):a}if(yc&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const c=zi(e[a])[s];if(c!==void 0)return c}},has(s){for(let a=e.length-1;a>=0;a--)if(s in zi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(zi(e[a])));return[...new Set(s)]}},Ki);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let l=c.length-1;l>=0;l--){const u=c[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:Cg.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const h=n[u];h&&(d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function J(e,...t){const n=t.length;if(yc&&Ve in e){const o=n>1?t.flat():t[0],i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Ki));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Ki)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let c=0;c<t.length;c++)if(t[c].includes(o)){i=c;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let kg=0;function Be(){return`cl-${kg++}`}const kc=e=>`Stale read from <${e}>.`;function ln(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Eg(()=>e.each,e.children,t||void 0))}function Oc(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Pg(()=>e.each,e.children,t||void 0))}function ie(e){const t=e.keyed,n=_(()=>e.when,void 0,void 0),r=t?n:_(n,void 0,{equals:(o,i)=>!o==!i});return _(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?ne(()=>i(t?o:()=>{if(!ne(r))throw kc("Show");return n()})):i}return e.fallback},void 0,void 0)}function Tc(e){const t=Ni(()=>e.children),n=_(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],l=i,u=_(()=>l()?void 0:c.when,void 0,void 0),d=c.keyed?u:_(u,void 0,{equals:(h,g)=>!h==!g});i=()=>l()||(d()?[a,u,c]:void 0)}return i});return _(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?ne(()=>a(s.keyed?i():()=>{if(ne(n)()?.[0]!==o)throw kc("Match");return i()})):a},void 0,void 0)}function lr(e){return e}const Og=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Tg=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Og]),Ag=new Set(["innerHTML","textContent","innerText","children"]),$g=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Dg=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Rg(e,t){const n=Dg[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Mg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Ig=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"]),_g={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Ut=e=>_(()=>e());function Lg(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,c=t[o-1].nextSibling,l=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:c;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!l){l=new Map;let d=a;for(;d<i;)l.set(n[d],d++)}const u=l.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,g;for(;++d<o&&d<i&&!((g=l.get(t[d]))==null||g!==u+h);)h++;if(h>u-a){const f=t[s];for(;a<u;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Ac="_$DX_DELEGATE";function W(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function Ng(e,t=window.document){const n=t[Ac]||(t[Ac]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Wg))}}function Se(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Fg(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function Vg(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function Wt(e,t){t==null?e.removeAttribute("class"):e.className=t}function Bg(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]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Kg(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||($c(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||($c(e,a,!0),n[a]=c)}return n}function ro(e,t,n){if(!t)return n?Se(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,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function un(e,t={},n,r){const o={};return r||ye(()=>o.children=ur(e,t.children,o.children)),ye(()=>typeof t.ref=="function"&&oo(t.ref,e)),ye(()=>zg(e,t,n,!0,o,!0)),o}function oo(e,t,n){return ne(()=>e(t,n))}function F(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ur(e,t,r,n);ye(o=>ur(e,t(),o,n),r)}function zg(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Dc(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Dc(e,s,a,o[s],n,i,t)}}function Ug(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function $c(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Dc(e,t,n,r,o,i,s){let a,c,l,u,d;if(t==="style")return ro(e,n,r);if(t==="classList")return Kg(e,n,r);if(n===r)return r;if(t==="ref")i||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(),g=Mg.has(h);if(!g&&r){const f=Array.isArray(r)?r[0]:r;e.removeEventListener(h,f)}(g||n)&&(Bg(e,h,n,g),g&&Ng([h]))}else if(t.slice(0,5)==="attr:")Se(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Vg(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=Ag.has(t))||!o&&((u=Rg(t,e.tagName))||(c=Tg.has(t)))||(a=e.nodeName.includes("-")||"is"in s))d&&(t=t.slice(5),c=!0),t==="class"||t==="className"?Wt(e,n):a&&!c&&!l?e[Ug(t)]=n:e[u||t]=n;else{const h=o&&t.indexOf(":")>-1&&_g[t.split(":")[0]];h?Fg(e,h,t,n):Se(e,$g[t]||t,n)}return n}function Wg(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),s=()=>{const c=t[n];if(c&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function ur(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(t=t.toString(),t===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=An(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=An(e,n,r);else{if(i==="function")return ye(()=>{let a=t();for(;typeof a=="function";)a=a();n=ur(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(Ui(a,t,n,o))return ye(()=>n=ur(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=An(e,n,r),s)return n}else c?n.length===0?Rc(e,a,r):Lg(e,n,a):(n&&An(e),Rc(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=An(e,n,r,t);An(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Ui(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],c=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Ui(e,a,c)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=Ui(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const u=String(a);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function Rc(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function An(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const c=a.parentNode===e;!i&&!s?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const jg=!1,Hg="http://www.w3.org/2000/svg";function Mc(e,t=!1,n=void 0){return t?document.createElementNS(Hg,e):document.createElement(e,{is:n})}function Ic(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=yg();let i;return B(()=>{i||(i=xc(o,()=>_(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[a,c]=L(!1),l=()=>c(!0);Xe(u=>F(s,()=>a()?u():i(),null)),H(l)}else{const a=Mc(e.isSVG?"g":"div",e.isSVG),c=t&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),F(c,i),s.appendChild(a),e.ref&&e.ref(a),H(()=>s.removeChild(a))}},void 0,{render:!0}),n}function Yg(e,t){const n=_(e);return _(()=>{const r=n();switch(typeof r){case"function":return ne(()=>r(t));case"string":const o=Ig.has(r),i=Mc(r,o,ne(()=>t.is));return un(i,t,o),i}})}function dr(e){const[,t]=J(e,["component"]);return Yg(()=>e.component,t)}function qg(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function Gg(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 Xg(e){return(t,n)=>{const{element:r}=n;return Xe(o=>{const i=qg(t);r.addPropertyChangedCallback((a,c)=>i[a]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return F(r.renderRoot,s)},Gg(r))}}function Zg(e,t,n){return arguments.length===2&&(n=t,t={}),dg(e,t)(Xg(n))}const Jg='*,: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}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.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}.box-border{box-sizing:border-box}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.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-\\[44px\\]{height:44px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[120px\\]{max-height:120px}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-\\[44px\\]{min-height:44px}.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-\\[400px\\]{width:400px}.w-\\[44px\\]{width:44px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-0{min-width:0}.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}.shrink-0{flex-shrink:0}.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))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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-none{resize: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}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.break-words{overflow-wrap:break-word}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.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-t{border-top-width:1px}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.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-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-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.pb-2{padding-bottom:8px}.pb-\\[\\.\\.\\.\\]{padding-bottom:...}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.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-left{text-align:left}.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}.leading-tight{line-height:1.25}.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}.opacity-70{opacity:.7}.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))}.filter{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)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@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}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--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\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.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\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.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))}',[_c,Wi]=L(!1),Lc=[],Qg=e=>Lc.push(e),Nc=()=>{Lc.forEach(e=>e())},ep=()=>{const e=!_c();Wi(e),he("onToggle"),he(e?"onOpen":"onClose"),Nc()},tp=()=>{Wi(!1),he("onClose")},np=()=>{Wi(!0),he("onOpen"),Nc()},Fc=()=>({bubble:_c,show:np,hide:tp,toggle:ep,onOpen:Qg}),ji=Symbol("store-raw"),$n=Symbol("store-node"),Pt=Symbol("store-has"),Vc=Symbol("store-self");function Bc(e){let t=e[Ve];if(!t&&(Object.defineProperty(e,Ve,{value:t=new Proxy(e,ip)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const c=n[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(e,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(t)})}}return t}function io(e){let t;return e!=null&&typeof e=="object"&&(e[Ve]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function fr(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ji])return n;if(!io(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=fr(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,l=s.length;c<l;c++)i=s[c],!a[i].get&&(o=e[i],(r=fr(o,t))!==o&&(e[i]=r))}return e}function so(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function hr(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function rp(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Ve||t===$n||(delete n.value,delete n.writable,n.get=()=>e[Ve][t]),n}function Kc(e){Li()&&hr(so(e,$n),Vc)()}function op(e){return Kc(e),Reflect.ownKeys(e)}const ip={get(e,t,n){if(t===ji)return e;if(t===Ve)return n;if(t===Yr)return Kc(e),n;const r=so(e,$n),o=r[t];let i=o?o():e[t];if(t===$n||t===Pt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Li()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=hr(r,t,i)())}return io(i)?Bc(i):i},has(e,t){return t===ji||t===Ve||t===Yr||t===$n||t===Pt||t==="__proto__"?!0:(Li()&&hr(so(e,Pt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:op,getOwnPropertyDescriptor:rp};function ao(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Pt]&&e[Pt][t]&&o!==void 0&&e[Pt][t].$()):(e[t]=n,e[Pt]&&e[Pt][t]&&o===void 0&&e[Pt][t].$());let s=so(e,$n),a;if((a=hr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(a=s[c])&&a.$();(a=hr(s,"length",i))&&a.$(e.length)}(a=s[Vc])&&a.$()}function zc(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Uc(o)||ao(e,o,t[o])}}function Uc(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function sp(e,t){if(typeof t=="function"&&(t=t(e)),t=fr(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&&ao(e,n,o)}ao(e,"length",r)}else zc(e,t)}function gr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&Uc(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)gr(e,[r[c]].concat(t),n);return}else if(a&&s==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&gr(e,[c].concat(t),n);return}else if(a&&s==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=r;for(let d=c;d<=l;d+=u)gr(e,[d].concat(t),n);return}else if(t.length>1){gr(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=fr(i),r===void 0||io(o)&&io(i)&&!Array.isArray(i)?zc(o,i):ao(e,r,i))}function ap(...[e,t]){const n=fr(e||{}),r=Array.isArray(n),o=Bc(n);function i(...s){Ze(()=>{r&&s.length===1?sp(n,s[0]):gr(n,s)})}return[o,i]}function Hi(e,t,n){return Xe(()=>{const r=hc(e),[o,i]=ap(r?JSON.parse(r):t);return B(()=>fc(e,JSON.stringify(o),n)),[o,i]})}function cp(e,t,n){return Xe(()=>{const r=hc(e),[o,i]=L(r?JSON.parse(r):t);return B(()=>fc(e,JSON.stringify(o()),n)),[o,i]})}const[uk,dk]=cp("smarttalks-widget-lang","en");function lp(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 up(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 co={};function dp(e){for(const[t,n]of Object.entries(e))n===null?co[t]=null:co[t]=n;return{...co}}function fp(){const e=Object.entries(co).filter(([,t])=>t!==void 0);if(e.length)return Object.fromEntries(e)}function hp(e){const t=new URLSearchParams(e),n={},r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];for(const o of r){const i=t.get(o);if(i){const s=o.replace(/_([a-z])/g,(a,c)=>c.toUpperCase());n[s]=i}}return n}function Wc(){if(typeof window>"u")return{};const e={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,...hp(window.location.search)};try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}e.isMobile=String(/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)),e.viewportW=String(window.innerWidth),e.viewportH=String(window.innerHeight);const t=fp();t&&(e.custom=t);for(const n of Object.keys(e))(e[n]===void 0||e[n]==="")&&delete e[n];return e}const gp=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${On}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return lp(i);if(i.type==="entity")return up(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return pe("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${On}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),pe("registerMetadata",s=>{!s||!Object.keys(s).length||(dp(s),fetch(`${On}/v1/widget-metadata/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:s})}).catch(console.error))}),i._id=n,i},[jc,pp]=L(""),[dn]=Xe(()=>mg(jc,gp)),mp=()=>{if(dn()?.type==="chat")return dn()},yp=()=>{if(dn()?.type==="form")return dn()},lo=()=>{const e=dn();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Xe(()=>B(()=>{const e=dn();Zh(e),e&&(he("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const ge=()=>({widgetId:jc,setWidgetId:pp,widget:dn,chatWidget:mp,formWidget:yp,getSessionId:lo}),Hc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yc=rc,vp=(e,t)=>n=>{var r;if(t?.variants==null)return Yc(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(l=>{const u=n?.[l],d=i?.[l];if(u===null)return null;const h=Hc(u)||Hc(d);return o[l][h]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,h]=u;return h===void 0||(l[d]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:h,...g}=u;return Object.entries(g).every(f=>{let[p,m]=f;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...l,d,h]:l},[]);return Yc(e,s,c,n?.class,n?.className)};var wp=W("<button>");const bp=vp("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"}}),Je=e=>{const[,t]=J(e,["variant","size","class"]);return(()=>{var n=wp();return un(n,N({get class(){return zt(bp({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var xp=W('<img alt="widget logo">');const qc=e=>{const[,t]=J(e,["class","src"]);return(()=>{var n=xp();return un(n,N({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return zt("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Sp=W('<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 Ep=()=>{const{chatWidget:e}=ge(),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=Sp(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return F(r,v(qc,{get src(){return e()?.avatar}}),o),F(i,t),F(s,n),r})()};var Pp=W("<svg stroke-width=0>");function Ke(e,t){const n=N(e.a,t),[r,o]=J(n,["src"]),[i,s]=L(""),a=_(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return B(()=>s(a())),H(()=>{s("")}),(()=>{var c=Pp();return un(c,N({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 i()}}),!0,!0),F(c,()=>jg),c})()}function Cp(e){return Ke({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 kp(e){return Ke({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 Op(e){return Ke({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 Tp(e){return Ke({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 Yi={equals:!1};function Gc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Ap(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const M=e=>typeof e=="function"&&!e.length?e():e,Xc=e=>Array.isArray(e)?e:e?[e]:[];function $p(e,...t){return typeof e=="function"?e(...t):e}const Dp=H;function Rp(e,t,n,r){return e.addEventListener(t,n,r),Dp(e.removeEventListener.bind(e,t,n,r))}function Mp(e,t,n,r){const o=()=>{Xc(M(e)).forEach(i=>{i&&Xc(M(t)).forEach(s=>Rp(i,s,n,r))})};typeof e=="function"?B(o):ye(o)}function uo(){return!0}const Ip={get(e,t,n){return t===Ve?n:e.get(t)},has(e,t){return e.has(t)},set:uo,deleteProperty:uo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:uo,deleteProperty:uo}},ownKeys(e){return e.keys()}},_p=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Zc(e){const t={};let n;for(;n=_p.exec(e);)t[n[1]]=n[2];return t}function Lp(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Zc(e)}else typeof t=="string"&&(t=Zc(t));return{...e,...t}}const qi=(e,t,n)=>{let r;for(const o of e){const i=M(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Np(...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?Ap:Gc,o={};for(const s of n){const a=M(s);for(const c in a)if(c[0]==="o"&&c[1]==="n"&&c[2]){const l=a[c],u=c.toLowerCase(),d=typeof l=="function"?l:Array.isArray(l)?l.length===1?l[0]:l[0].bind(void 0,l[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=N(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return qi(n,"style",Lp);if(s==="ref"){const a=[];for(const c of n){const l=M(c)[s];typeof l=="function"&&a.push(l)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?qi(n,s,(a,c)=>`${a} ${c}`):s==="classList"?qi(n,s,(a,c)=>({...a,...c})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},Ip)}function fn(...e){return Gc(e)}function Fp(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Gi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Vp(e){return typeof e=="number"}function Bp(e){return Array.isArray(e)}function Dn(e){return Object.prototype.toString.call(e)==="[object String]"}function Kp(e){return typeof e=="function"}function Jc(e){return t=>`${e()}-${t}`}function at(e,t){return e?e===t||e.contains(t):!1}function pr(e,t=!1){const{activeElement:n}=Ct(e);if(!n?.nodeName)return null;if(Qc(n)&&n.contentDocument)return pr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ct(n).getElementById(r);if(o)return o}}return n}function Ct(e){return e?e.ownerDocument||e:document}function Qc(e){return e.tagName==="IFRAME"}var el=(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))(el||{});function Xi(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function fo(){return Xi(/^Mac/i)}function zp(){return Xi(/^iPhone/i)}function Up(){return Xi(/^iPad/i)||fo()&&navigator.maxTouchPoints>1}function Wp(){return zp()||Up()}function jp(){return fo()||Wp()}function De(e,t){return t&&(Kp(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function ze(e){return t=>{for(const n of e)De(t,n)}}function Hp(e){return fo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Oe(e){if(e)if(Yp())e.focus({preventScroll:!0});else{const t=qp(e);e.focus(),Gp(t)}}var ho=null;function Yp(){if(ho==null){ho=!1;try{document.createElement("div").focus({get preventScroll(){return ho=!0,!0}})}catch{}}return ho}function qp(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 Gp(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var tl=["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'])"],Xp=[...tl,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Zi=`${tl.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Zp=Xp.join(':not([hidden]):not([tabindex="-1"]),');function nl(e,t){const r=Array.from(e.querySelectorAll(Zi)).filter(rl);return t&&rl(e)&&r.unshift(e),r.forEach((o,i)=>{if(Qc(o)&&o.contentDocument){const s=o.contentDocument.body,a=nl(s,!1);r.splice(i,1,...a)}}),r}function rl(e){return ol(e)&&!Jp(e)}function ol(e){return e.matches(Zi)&&Ji(e)}function Jp(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Ji(e,t){return e.nodeName!=="#comment"&&Qp(e)&&em(e,t)&&(!e.parentElement||Ji(e.parentElement,e))}function Qp(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:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function em(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function tm(e,t,n){const r=t?.tabbable?Zp:Zi,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&Ji(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function il(e){let t=e;for(;t&&!nm(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function nm(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function rm(){}function om(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,c=s-1;a<s;c=a++){const[l,u]=t[a],[d,h]=t[c],[,g]=t[c===0?s-1:c-1]||[0,0],f=(u-h)*(n-l)-(l-d)*(r-u);if(h<u){if(r>=h&&r<u){if(f===0)return!0;f>0&&(r===h?r>g&&(o=!o):o=!o)}}else if(u<h){if(r>u&&r<=h){if(f===0)return!0;f<0&&(r===h?r<g&&(o=!o):o=!o)}}else if(r===u&&(n>=d&&n<=l||n>=l&&n<=d))return!0}return o}function ct(e,t){return N(e,t)}var mr=new Map,sl=new Set;function al(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=mr.get(n.target);r||(r=new Set,mr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=mr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),mr.delete(n.target)),mr.size===0)){for(const o of sl)o();sl.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?al():document.addEventListener("DOMContentLoaded",al));function Qi(e,t){const n=cl(e,t,"left"),r=cl(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const c=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+o>c&&(s+=n+o-c),r<=a?a=r:r+i>l&&(a+=r+i-l),e.scrollLeft=s,e.scrollTop=a}function cl(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 im(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=il(e);for(;e&&o&&e!==n&&o!==n;)Qi(o,e),e=o,o=il(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var sm={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 es(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=c=>{if(c==null)return"";const l=e.getKey??"key",u=Dn(l)?c[l]:l(c);return u!=null?String(u):""},i=c=>{if(c==null)return"";const l=e.getTextValue??"textValue",u=Dn(l)?c[l]:l(c);return u!=null?String(u):""},s=c=>{if(c==null)return!1;const l=e.getDisabled??"disabled";return(Dn(l)?c[l]:l(c))??!1},a=c=>{if(c!=null)return Dn(e.getSectionChildren)?c[e.getSectionChildren]:e.getSectionChildren?.(c)};for(const c of e.dataSource){if(Dn(c)||Vp(c)){r.push({type:"item",rawValue:c,key:String(c),textValue:String(c),disabled:s(c),level:n,index:t}),t++;continue}if(a(c)!=null){r.push({type:"section",rawValue:c,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(c)??[];if(l.length>0){const u=es({dataSource:l,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:c,key:o(c),textValue:i(c),disabled:s(c),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
|
*
|
|
5
5
|
* Credits to the React Spectrum team:
|
|
6
6
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/collections/src/useCollection.ts
|
|
7
|
-
*/function
|
|
7
|
+
*/function am(e,t=[]){const n=es({dataSource:M(e.dataSource),getKey:M(e.getKey),getTextValue:M(e.getTextValue),getDisabled:M(e.getDisabled),getSectionChildren:M(e.getSectionChildren)}),[r,o]=L(e.factory(n));return B(an([()=>M(e.dataSource),()=>M(e.getKey),()=>M(e.getTextValue),()=>M(e.getDisabled),()=>M(e.getSectionChildren),()=>e.factory,...t],([i,s,a,c,l,u])=>{const d=es({dataSource:i,getKey:s,getTextValue:a,getDisabled:c,getSectionChildren:l});o(()=>u(d))},{defer:!0})),r}function ts(e){const[t,n]=L(e.defaultValue?.()),r=_(()=>e.value?.()!==void 0),o=_(()=>r()?e.value?.():t());return[o,s=>{ne(()=>{const a=$p(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function cm(e){const[t,n]=ts(e);return[()=>t()??!1,n]}function lm(e){const[t,n]=ts(e);return[()=>t()??[],n]}function ll(e={}){const[t,n]=cm({value:()=>M(e.open),defaultValue:()=>!!M(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function um(e){const t=n=>{n.key===el.Escape&&e.onEscapeKeyDown?.(n)};B(()=>{if(M(e.isDisabled))return;const n=e.ownerDocument?.()??Ct();n.addEventListener("keydown",t),H(()=>{n.removeEventListener("keydown",t)})})}/*!
|
|
8
8
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
9
9
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
10
10
|
*
|
|
@@ -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
|
|
19
|
+
*/const go="data-kb-top-layer";let ul,ns=!1;const kt=[];function yr(e){return kt.findIndex(t=>t.node===e)}function dm(e){return kt[yr(e)]}function fm(e){return kt[kt.length-1].node===e}function dl(){return kt.filter(e=>e.isPointerBlocking)}function hm(){return[...dl()].slice(-1)[0]}function rs(){return dl().length>0}function fl(e){const t=yr(hm()?.node);return yr(e)<t}function gm(e){kt.push(e)}function pm(e){const t=yr(e);t<0||kt.splice(t,1)}function mm(){for(const{node:e}of kt)e.style.pointerEvents=fl(e)?"none":"auto"}function ym(e){if(rs()&&!ns){const t=Ct(e);ul=document.body.style.pointerEvents,t.body.style.pointerEvents="none",ns=!0}}function vm(e){if(rs())return;const t=Ct(e);t.body.style.pointerEvents=ul,t.body.style.length===0&&t.body.removeAttribute("style"),ns=!1}const Re={layers:kt,isTopMostLayer:fm,hasPointerBlockingLayer:rs,isBelowPointerBlockingLayer:fl,addLayer:gm,removeLayer:pm,indexOf:yr,find:dm,assignPointerEventToLayers:mm,disableBodyPointerEvents:ym,restoreBodyPointerEvents:vm};/*!
|
|
20
20
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
21
21
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
22
22
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* Credits to the Chakra UI team:
|
|
30
30
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-on-child-unmount.ts
|
|
31
31
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-containment.ts
|
|
32
|
-
*/const
|
|
32
|
+
*/const os="focusScope.autoFocusOnMount",is="focusScope.autoFocusOnUnmount",hl={bubbles:!1,cancelable:!0},gl={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=Gi(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=Gi(this.stack,e),this.active()?.resume()}};function wm(e,t){const[n,r]=L(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=f=>e.onMountAutoFocus?.(f),a=f=>e.onUnmountAutoFocus?.(f),c=()=>Ct(t()),l=()=>{const f=c().createElement("span");return f.setAttribute("data-focus-trap",""),f.tabIndex=0,Object.assign(f.style,sm),f},u=()=>{const f=t();return f?nl(f,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const f=u();return f.length>0?f[0]:null},h=()=>{const f=u();return f.length>0?f[f.length-1]:null},g=()=>{const f=t();if(!f)return!1;const p=pr(f);return!p||at(f,p)?!1:ol(p)};B(()=>{const f=t();if(!f)return;gl.add(o);const p=pr(f);if(!at(f,p)){const y=new CustomEvent(os,hl);f.addEventListener(os,s),f.dispatchEvent(y),y.defaultPrevented||setTimeout(()=>{Oe(d()),pr(f)===p&&Oe(f)},0)}H(()=>{f.removeEventListener(os,s),setTimeout(()=>{const y=new CustomEvent(is,hl);g()&&y.preventDefault(),f.addEventListener(is,a),f.dispatchEvent(y),y.defaultPrevented||Oe(p??c().body),f.removeEventListener(is,a),gl.remove(o)},0)})}),B(()=>{const f=t();if(!f||!M(e.trapFocus)||n())return;const p=y=>{const w=y.target;w?.closest(`[${go}]`)||(at(f,w)?i=w:Oe(i))},m=y=>{const x=y.relatedTarget??pr(f);x?.closest(`[${go}]`)||at(f,x)||Oe(i)};c().addEventListener("focusin",p),c().addEventListener("focusout",m),H(()=>{c().removeEventListener("focusin",p),c().removeEventListener("focusout",m)})}),B(()=>{const f=t();if(!f||!M(e.trapFocus)||n())return;const p=l();f.insertAdjacentElement("afterbegin",p);const m=l();f.insertAdjacentElement("beforeend",m);function y(x){const b=d(),C=h();x.relatedTarget===b?Oe(C):Oe(b)}p.addEventListener("focusin",y),m.addEventListener("focusin",y);const w=new MutationObserver(x=>{for(const b of x)b.previousSibling===m&&(m.remove(),f.insertAdjacentElement("beforeend",m)),b.nextSibling===p&&(p.remove(),f.insertAdjacentElement("afterbegin",p))});w.observe(f,{childList:!0,subtree:!1}),H(()=>{p.removeEventListener("focusin",y),m.removeEventListener("focusin",y),p.remove(),m.remove(),w.disconnect()})})}/*!
|
|
33
33
|
* Portions of this file are based on code from react-spectrum.
|
|
34
34
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
35
35
|
*
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
*
|
|
42
42
|
* Credits to the React Spectrum team:
|
|
43
43
|
* https://github.com/adobe/react-spectrum/blob/810579b671791f1593108f62cdc1893de3a220e3/packages/@react-aria/overlays/src/ariaHideOutside.ts
|
|
44
|
-
*/function
|
|
44
|
+
*/function xm(e){B(()=>{M(e.isDisabled)||H(Sm(M(e.targets),M(e.root)))})}const vr=new WeakMap,Ue=[];function Sm(e,t=document.body){const n=new Set(e),r=new Set,o=c=>{for(const h of c.querySelectorAll(`[${bm}], [${go}]`))n.add(h);const l=h=>{if(n.has(h)||h.parentElement&&r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(h.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT,{acceptNode:l}),d=l(c);if(d===NodeFilter.FILTER_ACCEPT&&i(c),d!==NodeFilter.FILTER_REJECT){let h=u.nextNode();for(;h!=null;)i(h),h=u.nextNode()}},i=c=>{const l=vr.get(c)??0;c.getAttribute("aria-hidden")==="true"&&l===0||(l===0&&c.setAttribute("aria-hidden","true"),r.add(c),vr.set(c,l+1))};Ue.length&&Ue[Ue.length-1].disconnect(),o(t);const s=new MutationObserver(c=>{for(const l of c)if(!(l.type!=="childList"||l.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(l.target))){for(const u of l.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of l.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return Ue.push(a),()=>{s.disconnect();for(const c of r){const l=vr.get(c);if(l==null)return;l===1?(c.removeAttribute("aria-hidden"),vr.delete(c)):vr.set(c,l-1)}a===Ue[Ue.length-1]?(Ue.pop(),Ue.length&&Ue[Ue.length-1].observe()):Ue.splice(Ue.indexOf(a),1)}}/*!
|
|
45
45
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
46
46
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
47
47
|
*
|
|
@@ -53,38 +53,38 @@
|
|
|
53
53
|
*
|
|
54
54
|
* Credits to the Chakra UI team:
|
|
55
55
|
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/interact-outside/src/index.ts
|
|
56
|
-
*/const
|
|
56
|
+
*/const pl="interactOutside.pointerDownOutside",ml="interactOutside.focusOutside";function Em(e,t){let n,r=rm;const o=()=>Ct(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),c=d=>{const h=d.target;return!(h instanceof HTMLElement)||h.closest(`[${go}]`)||!at(o(),h)||at(t(),h)?!1:!e.shouldExcludeElement?.(h)},l=d=>{function h(){const g=t(),f=d.target;if(!g||!f||!c(d))return;const p=ze([i,a]);f.addEventListener(pl,p,{once:!0});const m=new CustomEvent(pl,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||Hp(d)&&d.button===0}});f.dispatchEvent(m)}d.pointerType==="touch"?(o().removeEventListener("click",h),r=h,o().addEventListener("click",h,{once:!0})):h()},u=d=>{const h=t(),g=d.target;if(!h||!g||!c(d))return;const f=ze([s,a]);g.addEventListener(ml,f,{once:!0});const p=new CustomEvent(ml,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});g.dispatchEvent(p)};B(()=>{M(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",l,!0)},0),o().addEventListener("focusin",u,!0),H(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",l,!0),o().removeEventListener("focusin",u,!0)}))})}/*!
|
|
57
57
|
* Portions of this file are based on code from radix-ui-primitives.
|
|
58
58
|
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
59
59
|
*
|
|
60
60
|
* Credits to the Radix UI team:
|
|
61
61
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
|
|
62
62
|
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
|
|
63
|
-
*/function
|
|
63
|
+
*/function Pm(e){const[t,n]=L();let r={},o=e(),i="none";const[s,a]=Cm(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return B(an(s,c=>{const l=po(r);i=c==="mounted"?l:"none"})),B(an(e,c=>{if(o===c)return;const l=po(r);c?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==l?"ANIMATION_OUT":"UNMOUNT"),o=c})),B(an(t,c=>{if(c){const l=d=>{const g=po(r).includes(d.animationName);d.target===c&&g&&a("ANIMATION_END")},u=d=>{d.target===c&&(i=po(r))};c.addEventListener("animationstart",u),c.addEventListener("animationcancel",l),c.addEventListener("animationend",l),H(()=>{c.removeEventListener("animationstart",u),c.removeEventListener("animationcancel",l),c.removeEventListener("animationend",l)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:c=>{c&&(r=getComputedStyle(c)),n(c)}}}function po(e){return e?.animationName||"none"}function Cm(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=L(e);return[r,s=>{o(a=>n(a,s))}]}function mo(e){return t=>(e(t),()=>e(void 0))}/*!
|
|
64
64
|
* Portions of this file are based on code from ariakit.
|
|
65
65
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
66
66
|
*
|
|
67
67
|
* Credits to the ariakit team:
|
|
68
68
|
* https://github.com/ariakit/ariakit/blob/8a13899ff807bbf39f3d89d2d5964042ba4d5287/packages/ariakit-react-utils/src/hooks.ts
|
|
69
|
-
*/function
|
|
69
|
+
*/function km(e,t){const[n,r]=L(yl(t?.()));return B(()=>{r(e()?.tagName.toLowerCase()||yl(t?.()))}),n}function yl(e){return Dn(e)?e:void 0}function yo(e){const[t,n]=J(e,["asChild","as","children"]);if(!t.asChild)return v(dr,N({get component(){return t.as}},n,{get children(){return t.children}}));const r=Ni(()=>t.children);if(vl(r())){const o=wl(n,r()?.props??{});return v(dr,o)}if(Bp(r())){const o=r().find(vl);if(o){const i=()=>v(ln,{get each(){return r()},children:a=>v(ie,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=wl(n,o?.props??{});return v(dr,N(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const Om=Symbol("$$KobalteAsComponent");function vl(e){return e?.[Om]===!0}function wl(e,t){return Np([e,t],{reverseEventHandlers:!0})}/*!
|
|
70
70
|
* Portions of this file are based on code from react-spectrum.
|
|
71
71
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
72
72
|
*
|
|
73
73
|
* Credits to the React Spectrum team:
|
|
74
74
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
|
|
75
|
-
*/const
|
|
75
|
+
*/const Tm=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Am=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function $m(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Tm.has(n)}const t=e.split("-")[0];return Am.has(t)}function Dm(e){return $m(e)?"rtl":"ltr"}/*!
|
|
76
76
|
* Portions of this file are based on code from react-spectrum.
|
|
77
77
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
78
78
|
*
|
|
79
79
|
* Credits to the React Spectrum team:
|
|
80
80
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
|
|
81
|
-
*/function bl(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction
|
|
81
|
+
*/function bl(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Dm(e)}}let ss=bl();const wr=new Set;function xl(){ss=bl();for(const e of wr)e(ss)}function Rm(){const[e,t]=L(ss),n=_(()=>e());return cn(()=>{wr.size===0&&window.addEventListener("languagechange",xl),wr.add(t),H(()=>{wr.delete(t),wr.size===0&&window.removeEventListener("languagechange",xl)})}),{locale:()=>n().locale,direction:()=>n().direction}}const Mm=xe();function as(){const e=Rm();return ke(Mm)||e}/*!
|
|
82
82
|
* Portions of this file are based on code from react-spectrum.
|
|
83
83
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
84
84
|
*
|
|
85
85
|
* Credits to the React Spectrum team:
|
|
86
86
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
|
|
87
|
-
*/const
|
|
87
|
+
*/const cs=new Map;function Im(e){const{locale:t}=as(),n=_(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return _(()=>{const r=n();let o;return cs.has(r)&&(o=cs.get(r)),o||(o=new Intl.Collator(t(),e),cs.set(r,o)),o})}function _m(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ls(e,t,n){_m(e,t),t.set(e,n)}/*!
|
|
88
88
|
* Portions of this file are based on code from react-spectrum.
|
|
89
89
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
90
90
|
*
|
|
@@ -92,79 +92,79 @@
|
|
|
92
92
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
|
|
93
93
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
|
|
94
94
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
|
|
95
|
-
*/class Qe extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Qe?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function
|
|
95
|
+
*/class Qe extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Qe?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function Lm(e){const[t,n]=ts(e);return[()=>t()??new Qe,n]}/*!
|
|
96
96
|
* Portions of this file are based on code from react-spectrum.
|
|
97
97
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
98
98
|
*
|
|
99
99
|
* Credits to the React Spectrum team:
|
|
100
100
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
|
|
101
|
-
*/function
|
|
101
|
+
*/function Sl(e){return jp()?e.altKey:e.ctrlKey}function Rn(e){return fo()?e.metaKey:e.ctrlKey}function El(e){return new Qe(e)}function Nm(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
|
|
102
102
|
* Portions of this file are based on code from react-spectrum.
|
|
103
103
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
104
104
|
*
|
|
105
105
|
* Credits to the React Spectrum team:
|
|
106
106
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
|
|
107
|
-
*/function
|
|
107
|
+
*/function Fm(e){const t=ct({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=L(!1),[o,i]=L(),s=_(()=>{const p=M(t.selectedKeys);return p!=null?El(p):p}),a=_(()=>{const p=M(t.defaultSelectedKeys);return p!=null?El(p):new Qe}),[c,l]=Lm({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[u,d]=L(M(t.selectionBehavior)),h=()=>M(t.selectionMode),g=()=>M(t.disallowEmptySelection)??!1,f=p=>{(M(t.allowDuplicateSelectionEvents)||!Nm(p,c()))&&l(p)};return B(()=>{const p=c();M(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),B(()=>{d(M(t.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:g,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:c,setSelectedKeys:f}}/*!
|
|
108
108
|
* Portions of this file are based on code from react-spectrum.
|
|
109
109
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
110
110
|
*
|
|
111
111
|
* Credits to the React Spectrum team:
|
|
112
112
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
|
|
113
|
-
*/function
|
|
113
|
+
*/function Vm(e){const[t,n]=L(""),[r,o]=L(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(M(e.isDisabled))return;const a=M(e.keyboardDelegate),c=M(e.selectionManager);if(!a.getKeyForSearch)return;const l=Bm(s.key);if(!l||s.ctrlKey||s.metaKey)return;l===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(h=>h+l),d=a.getKeyForSearch(u,c.focusedKey())??a.getKeyForSearch(u);d==null&&Km(u)&&(u=u[0],d=a.getKeyForSearch(u,c.focusedKey())??a.getKeyForSearch(u)),d!=null&&(c.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function Bm(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Km(e){return e.split("").every(t=>t===e[0])}/*!
|
|
114
114
|
* Portions of this file are based on code from react-spectrum.
|
|
115
115
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
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
|
|
119
|
+
*/function zm(e,t,n){const o=N({selectOnFocus:()=>M(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=as();let a={top:0,left:0};Mp(()=>M(o.isVirtualized)?void 0:i(),"scroll",()=>{const p=i();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:c}=Vm({isDisabled:()=>M(o.disallowTypeAhead),keyboardDelegate:()=>M(o.keyboardDelegate),selectionManager:()=>M(o.selectionManager)}),l=p=>{De(p,c.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const m=t();if(!m?.contains(p.target))return;const y=M(o.selectionManager),w=M(o.selectOnFocus),x=O=>{O!=null&&(y.setFocusedKey(O),p.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(O):w&&!Sl(p)&&y.replaceSelection(O))},b=M(o.keyboardDelegate),C=M(o.shouldFocusWrap),S=y.focusedKey();switch(p.key){case"ArrowDown":{if(b.getKeyBelow){p.preventDefault();let O;S!=null?O=b.getKeyBelow(S):O=b.getFirstKey?.(),O==null&&C&&(O=b.getFirstKey?.(S)),x(O)}break}case"ArrowUp":{if(b.getKeyAbove){p.preventDefault();let O;S!=null?O=b.getKeyAbove(S):O=b.getLastKey?.(),O==null&&C&&(O=b.getLastKey?.(S)),x(O)}break}case"ArrowLeft":{if(b.getKeyLeftOf){p.preventDefault();const O=s()==="rtl";let D;S!=null?D=b.getKeyLeftOf(S):D=O?b.getFirstKey?.():b.getLastKey?.(),x(D)}break}case"ArrowRight":{if(b.getKeyRightOf){p.preventDefault();const O=s()==="rtl";let D;S!=null?D=b.getKeyRightOf(S):D=O?b.getLastKey?.():b.getFirstKey?.(),x(D)}break}case"Home":if(b.getFirstKey){p.preventDefault();const O=b.getFirstKey(S,Rn(p));O!=null&&(y.setFocusedKey(O),Rn(p)&&p.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(O):w&&y.replaceSelection(O))}break;case"End":if(b.getLastKey){p.preventDefault();const O=b.getLastKey(S,Rn(p));O!=null&&(y.setFocusedKey(O),Rn(p)&&p.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(O):w&&y.replaceSelection(O))}break;case"PageDown":if(b.getKeyPageBelow&&S!=null){p.preventDefault();const O=b.getKeyPageBelow(S);x(O)}break;case"PageUp":if(b.getKeyPageAbove&&S!=null){p.preventDefault();const O=b.getKeyPageAbove(S);x(O)}break;case"a":Rn(p)&&y.selectionMode()==="multiple"&&M(o.disallowSelectAll)!==!0&&(p.preventDefault(),y.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),M(o.disallowEmptySelection)||y.clearSelection());break;case"Tab":if(!M(o.allowsTabNavigation)){if(p.shiftKey)m.focus();else{const O=tm(m,{tabbable:!0});let D,P;do P=O.lastChild(),P&&(D=P);while(P);D&&!D.contains(document.activeElement)&&Oe(D)}break}}},u=p=>{const m=M(o.selectionManager),y=M(o.keyboardDelegate),w=M(o.selectOnFocus);if(m.isFocused()){p.currentTarget.contains(p.target)||m.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(m.setFocused(!0),m.focusedKey()==null){const x=C=>{C!=null&&(m.setFocusedKey(C),w&&m.replaceSelection(C))},b=p.relatedTarget;b&&p.currentTarget.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?x(m.lastSelectedKey()??y.getLastKey?.()):x(m.firstSelectedKey()??y.getFirstKey?.())}else if(!M(o.isVirtualized)){const x=i();if(x){x.scrollTop=a.top,x.scrollLeft=a.left;const b=x.querySelector(`[data-key="${m.focusedKey()}"]`);b&&(Oe(b),Qi(x,b))}}}},d=p=>{const m=M(o.selectionManager);p.currentTarget.contains(p.relatedTarget)||m.setFocused(!1)},h=p=>{i()===p.target&&p.preventDefault()},g=()=>{const p=M(o.autoFocus);if(!p)return;const m=M(o.selectionManager),y=M(o.keyboardDelegate);let w;p==="first"&&(w=y.getFirstKey?.()),p==="last"&&(w=y.getLastKey?.());const x=m.selectedKeys();x.size&&(w=x.values().next().value),m.setFocused(!0),m.setFocusedKey(w);const b=t();b&&w==null&&!M(o.shouldUseVirtualFocus)&&Oe(b)};return cn(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),B(an([i,()=>M(o.isVirtualized),()=>M(o.selectionManager).focusedKey()],p=>{const[m,y,w]=p;if(y)w&&o.scrollToKey?.(w);else if(w&&m){const x=m.querySelector(`[data-key="${w}"]`);x&&Qi(m,x)}})),{tabIndex:_(()=>{if(!M(o.shouldUseVirtualFocus))return M(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:l,onMouseDown:h,onFocusIn:u,onFocusOut:d}}/*!
|
|
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
|
*
|
|
123
123
|
* Credits to the React Spectrum team:
|
|
124
124
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
|
|
125
|
-
*/function
|
|
125
|
+
*/function Um(e,t){const n=()=>M(e.selectionManager),r=()=>M(e.key),o=()=>M(e.shouldUseVirtualFocus),i=w=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):w?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Rn(w)||"pointerType"in w&&w.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>M(e.disabled)||n().isDisabled(r()),c=()=>!a()&&n().canSelectItem(r());let l=null;const u=w=>{c()&&(l=w.pointerType,w.pointerType==="mouse"&&w.button===0&&!M(e.shouldSelectOnPressUp)&&i(w))},d=w=>{c()&&w.pointerType==="mouse"&&w.button===0&&M(e.shouldSelectOnPressUp)&&M(e.allowsDifferentPressOrigin)&&i(w)},h=w=>{c()&&(M(e.shouldSelectOnPressUp)&&!M(e.allowsDifferentPressOrigin)||l!=="mouse")&&i(w)},g=w=>{!c()||!["Enter"," "].includes(w.key)||(Sl(w)?n().toggleSelection(r()):i(w))},f=w=>{a()&&w.preventDefault()},p=w=>{const x=t();o()||a()||!x||w.target===x&&n().setFocusedKey(r())},m=_(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),y=_(()=>M(e.virtualized)?void 0:r());return B(an([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([w,x,b,C,S])=>{w&&x===C&&S&&!b&&document.activeElement!==w&&(e.focus?e.focus():Oe(w))})),{isSelected:s,isDisabled:a,allowsSelection:c,tabIndex:m,dataKey:y,onPointerDown:u,onPointerUp:d,onClick:h,onKeyDown:g,onMouseDown:f,onFocus:p}}/*!
|
|
126
126
|
* Portions of this file are based on code from react-spectrum.
|
|
127
127
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
128
128
|
*
|
|
129
129
|
* Credits to the React Spectrum team:
|
|
130
130
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
|
|
131
|
-
*/class
|
|
131
|
+
*/class Wm{collection;state;constructor(t,n){this.collection=t,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}isFocused(){return this.state.isFocused()}setFocused(t){this.state.setFocused(t)}focusedKey(){return this.state.focusedKey()}setFocusedKey(t){(t==null||this.collection().getItem(t))&&this.state.setFocusedKey(t)}selectedKeys(){return this.state.selectedKeys()}isSelected(t){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(t);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const t=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>t.has(n))}firstSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index<t.index;(!t||o)&&(t=r)}return t?.key}lastSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index>t.index;(!t||o)&&(t=r)}return t?.key}extendSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=this.state.selectedKeys(),o=r.anchorKey||n,i=new Qe(r,o,n);for(const s of this.getKeyRange(o,r.currentKey||n))i.delete(s);for(const s of this.getKeyRange(n,o))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(t,n){const r=this.collection().getItem(t),o=this.collection().getItem(n);return r&&o?r.index!=null&&o.index!=null&&r.index<=o.index?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){const r=[];let o=t;for(;o!=null;){const i=this.collection().getItem(o);if(i&&i.type==="item"&&r.push(o),o===n)return r;o=this.collection().getKeyAfter(o)}return[]}getKey(t){const n=this.collection().getItem(t);return n?!n||n.type!=="item"?null:n.key:t}toggleSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=new Qe(this.state.selectedKeys());r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection()&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode()==="none")return;const n=this.getKey(t);if(n==null)return;const r=this.canSelectItem(n)?new Qe([n],n,n):new Qe;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new Qe;for(const r of t){const o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const t=this.state.selectedKeys();!this.disallowEmptySelection()&&t.size>0&&this.state.setSelectedKeys(new Qe)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
|
|
132
132
|
* Portions of this file are based on code from react-spectrum.
|
|
133
133
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
134
134
|
*
|
|
135
135
|
* Credits to the React Spectrum team:
|
|
136
136
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
|
|
137
|
-
*/class
|
|
137
|
+
*/class Pl{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
|
|
138
138
|
* Portions of this file are based on code from react-spectrum.
|
|
139
139
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
140
140
|
*
|
|
141
141
|
* Credits to the React Spectrum team:
|
|
142
142
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
|
|
143
|
-
*/function jm(e){const t=
|
|
143
|
+
*/function jm(e){const t=Fm(e),r=am({dataSource:()=>M(e.dataSource),getKey:()=>M(e.getKey),getTextValue:()=>M(e.getTextValue),getDisabled:()=>M(e.getDisabled),getSectionChildren:()=>M(e.getSectionChildren),factory:i=>e.filter?new Pl(e.filter(i)):new Pl(i)},[()=>e.filter]),o=new Wm(r,t);return bc(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
|
|
144
144
|
* Portions of this file are based on code from react-spectrum.
|
|
145
145
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
146
146
|
*
|
|
147
147
|
* Credits to the React Spectrum team:
|
|
148
148
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
|
|
149
|
-
*/class
|
|
149
|
+
*/class Hm{collection;ref;collator;constructor(t,n,r){this.collection=t,this.ref=n,this.collator=r}getKeyBelow(t){let n=this.collection().getKeyAfter(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(t){let n=this.collection().getKeyBefore(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let t=this.collection().getFirstKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getLastKey(){let t=this.collection().getLastKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getItem(t){return this.ref?.()?.querySelector(`[data-key="${t}"]`)??null}getKeyPageAbove(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=i!=null?this.getItem(i):null;return i}getKeyPageBelow(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=i!=null?this.getItem(i):null;return i}getKeyForSearch(t,n){const r=this.collator?.();if(!r)return;let o=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;o!=null;){const i=this.collection().getItem(o);if(i){const s=i.textValue.slice(0,t.length);if(i.textValue&&r.compare(s,t)===0)return o}o=this.getKeyBelow(o)}}}/*!
|
|
150
150
|
* Portions of this file are based on code from react-spectrum.
|
|
151
151
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
152
152
|
*
|
|
153
153
|
* Credits to the React Spectrum team:
|
|
154
154
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
|
|
155
|
-
*/function
|
|
155
|
+
*/function Ym(e,t,n){const r=Im({usage:"search",sensitivity:"base"}),o=_(()=>{const i=M(e.keyboardDelegate);return i||new Hm(e.collection,t,r)});return zm({selectionManager:()=>M(e.selectionManager),keyboardDelegate:o,autoFocus:()=>M(e.autoFocus),deferAutoFocus:()=>M(e.deferAutoFocus),shouldFocusWrap:()=>M(e.shouldFocusWrap),disallowEmptySelection:()=>M(e.disallowEmptySelection),selectOnFocus:()=>M(e.selectOnFocus),disallowTypeAhead:()=>M(e.disallowTypeAhead),shouldUseVirtualFocus:()=>M(e.shouldUseVirtualFocus),allowsTabNavigation:()=>M(e.allowsTabNavigation),isVirtualized:()=>M(e.isVirtualized),scrollToKey:i=>M(e.scrollToKey)?.(i)},t)}/*!
|
|
156
156
|
* Portions of this file are based on code from ariakit
|
|
157
157
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
158
158
|
*
|
|
159
159
|
* Credits to the ariakit team:
|
|
160
160
|
* https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
|
|
161
|
-
*/const
|
|
161
|
+
*/const qm=["button","color","file","image","reset","submit"];function Gm(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?qm.indexOf(e.type)!==-1:!1}function Xm(e){let t;const n=ct({type:"button"},e),[r,o]=J(n,["ref","type","disabled"]),i=km(()=>t,()=>"button"),s=_(()=>{const l=i();return l==null?!1:Gm({tagName:l,type:r.type})}),a=_(()=>i()==="input"),c=_(()=>i()==="a"&&t?.getAttribute("href")!=null);return v(yo,N({as:"button",ref(l){var u=fn(d=>t=d,r.ref);typeof u=="function"&&u(l)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!c()?"button":void 0},get tabIndex(){return!s()&&!c()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const Cl=xe();function kl(){return ke(Cl)}function Zm(){const e=kl();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
|
|
162
162
|
* Portions of this file are based on code from ariakit.
|
|
163
163
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
164
164
|
*
|
|
165
165
|
* Credits to the Ariakit team:
|
|
166
166
|
* https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
|
|
167
|
-
*/function
|
|
167
|
+
*/function Ol(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Jm(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&Ol(o,n))return r+1}return 0}function Qm(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),c=s.ref();return a===c||!a||!c?0:Ol(a,c)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Tl(e,t){const n=Qm(e);e!==n&&t(n)}function ey(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Ct(r).body}function ty(e,t){B(()=>{const n=setTimeout(()=>{Tl(e(),t)});H(()=>clearTimeout(n))})}function ny(e,t){if(typeof IntersectionObserver!="function"){ty(e,t);return}let n=[];B(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Tl(e(),t)},o=ey(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}H(()=>i.disconnect())})}/*!
|
|
168
168
|
* Portions of this file are based on code from ariakit.
|
|
169
169
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
170
170
|
*
|
|
@@ -172,14 +172,14 @@
|
|
|
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 ny(e={}){const[t,n]=cm({value:()=>M(e.items),onChange:i=>e.onItemsChange?.(i)});ty(t,n);const r=i=>(n(s=>{const a=Zm(s,i);return Np(s,i,a)}),()=>{n(s=>{const a=s.filter(c=>c.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>v(Pl.Provider,{value:{registerItem:r},get children(){return i.children}})}}function ry(e){const t=Xm(),n=ct({shouldRegisterItem:!0},e);V(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Y(r)})}var de=e=>typeof e=="function"?e():e,ls=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),us=(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},yo=new Map,oy=e=>{V(()=>{const t=de(e.style)??{},n=de(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=yo.get(e.key);o?o.activeCount++:yo.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);Y(()=>{const i=yo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}yo.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Tl=oy,iy=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},sy=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},ay=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=iy(o,t),d=u-c-r*l;(l!==0||d!==0)&&sy(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Al,$l]=L([]),cy=e=>Al().indexOf(e)===Al().length-1,ly=e=>{const t=N({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Be();let r=[0,0],o=null,i=null;V(()=>{de(t.enabled)&&($l(l=>[...l,n]),Y(()=>{$l(l=>l.filter(u=>u!==n))}))}),V(()=>{if(!de(t.enabled)||!de(t.hideScrollbar))return;const{body:l}=document,u=window.innerWidth-l.offsetWidth;if(de(t.preventScrollbarShift)){const d={overflow:"hidden"},h=[];u>0&&(de(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${u}px)`,h.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,f=window.scrollX;Tl({key:"prevent-scroll",element:l,style:d,properties:h,cleanup:()=>{de(t.restoreScrollPosition)&&u>0&&window.scrollTo(f,g)}})}else Tl({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),V(()=>{!cy(n)||!de(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",c,{passive:!1}),Y(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",c)}))});const s=l=>{r=Dl(l),o=null,i=null},a=l=>{const u=l.target,d=de(t.element),h=uy(l),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=g==="x"?h[0]:h[1],p=Rl(u,g,f,d);let m;d&&us(d,u)?m=!p:m=!0,m&&l.cancelable&&l.preventDefault()},c=l=>{const u=de(t.element),d=l.target;let h;if(l.touches.length===2)h=!de(t.allowPinchZoom);else{if(o==null||i===null){const g=Dl(l).map((p,m)=>r[m]-p),f=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=f,i=f==="x"?g[0]:g[1]}if(d.type==="range")h=!1;else{const g=Rl(d,o,i,u);u&&us(u,d)?h=!g:h=!0}}h&&l.cancelable&&l.preventDefault()}},uy=e=>[e.deltaX,e.deltaY],Dl=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Rl=(e,t,n,r)=>{const o=r!==null&&us(r,e),[i,s]=ay(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},dy=ly,Ml=dy;const Il=xe();function fy(){return Ce(Il)}function hy(e){let t;const n=fy(),[r,o]=J(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const h=n?.registerNestedLayer(d);return()=>{i.delete(d),h?.()}};Sm({shouldExcludeElement:d=>t?r.excludedElements?.some(h=>at(h(),d))||[...i].some(h=>at(h,d)):!1,onPointerDownOutside:d=>{!t||Re.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Re.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),lm({ownerDocument:()=>Ct(t),onEscapeKeyDown:d=>{!t||!Re.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),an(()=>{if(!t)return;Re.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);Re.assignPointerEventToLayers(),Re.disableBodyPointerEvents(t),Y(()=>{t&&(Re.removeLayer(t),d?.(),Re.assignPointerEventToLayers(),Re.restoreBodyPointerEvents(t))})}),V(sn([()=>t,()=>r.disableOutsidePointerEvents],([d,h])=>{if(!d)return;const g=Re.find(d);g&&g.isPointerBlocking!==h&&(g.isPointerBlocking=h,Re.assignPointerEventToLayers()),h&&Re.disableBodyPointerEvents(d),Y(()=>{Re.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return v(Il.Provider,{value:u,get children(){return v(mo,N({as:"div",ref(d){var h=fn(g=>t=g,r.ref);typeof h=="function"&&h(d)}},o))}})}const _l=xe();function gy(){const e=Ce(_l);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function py(e){const t=gy(),[n,r]=J(e,["ref","style"]);return v(mo,N({as:"div",ref(o){var i=fn(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const my=["top","right","bottom","left"],jt=Math.min,Me=Math.max,vo=Math.round,bo=Math.floor,lt=e=>({x:e,y:e}),yy={left:"right",right:"left",bottom:"top",top:"bottom"},vy={start:"end",end:"start"};function ds(e,t,n){return Me(e,jt(t,n))}function hn(e,t){return typeof e=="function"?e(t):e}function Wt(e){return e.split("-")[0]}function Mn(e){return e.split("-")[1]}function Ll(e){return e==="x"?"y":"x"}function fs(e){return e==="y"?"height":"width"}function gn(e){return["top","bottom"].includes(Wt(e))?"y":"x"}function hs(e){return Ll(gn(e))}function by(e,t,n){n===void 0&&(n=!1);const r=Mn(e),o=hs(e),i=fs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wo(s)),[s,wo(s)]}function wy(e){const t=wo(e);return[gs(e),t,gs(t)]}function gs(e){return e.replace(/start|end/g,t=>vy[t])}function xy(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Sy(e,t,n,r){const o=Mn(e);let i=xy(Wt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(gs)))),i}function wo(e){return e.replace(/left|right|bottom|top/g,t=>yy[t])}function Ey(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nl(e){return typeof e!="number"?Ey(e):{top:e,right:e,bottom:e,left:e}}function xo(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 Fl(e,t,n){let{reference:r,floating:o}=e;const i=gn(t),s=hs(t),a=fs(s),c=Wt(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Mn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}const Py=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fl(l,r,c),h=r,g={},f=0;for(let p=0;p<a.length;p++){const{name:m,fn:y}=a[p],{x:b,y:x,data:w,reset:C}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:l,platform:s,elements:{reference:e,floating:t}});u=b??u,d=x??d,g={...g,[m]:{...g[m],...w}},C&&f<=50&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=Fl(l,h,c)),p=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:g}};async function wr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=hn(t,e),f=Nl(g),m=a[h?d==="floating"?"reference":"floating":d],y=xo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=xo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-C.top+f.top)/w.y,bottom:(C.bottom-y.bottom+f.bottom)/w.y,left:(y.left-C.left+f.left)/w.x,right:(C.right-y.right+f.right)/w.x}}const Cy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=hn(e,t)||{};if(l==null)return{};const d=Nl(u),h={x:n,y:r},g=hs(o),f=fs(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",b=m?"bottom":"right",x=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=w/2-C/2,P=O/2-p[f]/2-1,T=jt(d[y],P),I=jt(d[b],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=ds($,U,K),F=!c.arrow&&Mn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,j=F?U<$?U-$:U-K:0;return{[g]:h[g]+j,data:{[g]:Q,centerOffset:U-Q-j,...F&&{alignmentOffset:j}},reset:F}}}),ky=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=hn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Wt(o),b=gn(a),x=Wt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[wo(a)]:wy(a)),S=f!=="none";!h&&S&&C.push(...Sy(a,p,f,w));const O=[a,...C],D=await wr(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&P.push(D[y]),d){const U=by(o,s,w);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q)return{data:{index:U,overflows:T},reset:{placement:Q}};let F=($=T.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(g){case"bestFit":{var K;const j=(K=T.filter(G=>{if(S){const q=gn(G.placement);return q===b||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];j&&(F=j);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Vl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bl(e){return my.some(t=>e[t]>=0)}const Oy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=hn(e,t);switch(r){case"referenceHidden":{const i=await wr(t,{...o,elementContext:"reference"}),s=Vl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Bl(s)}}}case"escaped":{const i=await wr(t,{...o,altBoundary:!0}),s=Vl(i,n.floating);return{data:{escapedOffsets:s,escaped:Bl(s)}}}default:return{}}}}};async function Ty(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Wt(n),a=Mn(n),c=gn(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,d=hn(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*u,y:h*l}:{x:h*l,y:g*u}}const Ay=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await Ty(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},$y=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:y,y:b}=m;return{x:y,y:b}}},...c}=hn(e,t),l={x:n,y:r},u=await wr(t,c),d=gn(Wt(o)),h=Ll(d);let g=l[h],f=l[d];if(i){const m=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=g+u[m],x=g-u[y];g=ds(b,g,x)}if(s){const m=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=f+u[m],x=f-u[y];f=ds(b,f,x)}const p=a.fn({...t,[h]:g,[d]:f});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:i,[d]:s}}}}}},Dy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=hn(e,t),u=await wr(t,l),d=Wt(o),h=Mn(o),g=gn(o)==="y",{width:f,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=h==="end"?"top":"bottom");const b=p-u.top-u.bottom,x=f-u.left-u.right,w=jt(p-u[m],b),C=jt(f-u[y],x),S=!t.middlewareData.shift;let O=w,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=b),S&&!h){const T=Me(u.left,0),I=Me(u.right,0),$=Me(u.top,0),K=Me(u.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Me(u.left,u.right)):O=p-2*($!==0||K!==0?$+K:Me(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function So(){return typeof window<"u"}function In(e){return Kl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ut(e){var t;return(t=(Kl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kl(e){return So()?e instanceof Node||e instanceof Ie(e).Node:!1}function et(e){return So()?e instanceof Element||e instanceof Ie(e).Element:!1}function dt(e){return So()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function zl(e){return!So()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}function xr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ry(e){return["table","td","th"].includes(In(e))}function Eo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ps(e){const t=ms(),n=et(e)?tt(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 My(e){let t=Ht(e);for(;dt(t)&&!_n(t);){if(ps(t))return t;if(Eo(t))return null;t=Ht(t)}return null}function ms(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _n(e){return["html","body","#document"].includes(In(e))}function tt(e){return Ie(e).getComputedStyle(e)}function Po(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ht(e){if(In(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zl(e)&&e.host||ut(e);return zl(t)?t.host:t}function Ul(e){const t=Ht(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&xr(t)?t:Ul(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ul(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ie(o);if(i){const a=ys(s);return t.concat(s,s.visualViewport||[],xr(o)?o:[],a&&n?Sr(a):[])}return t.concat(o,Sr(o,[],n))}function ys(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jl(e){const t=tt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=dt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=vo(n)!==i||vo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function vs(e){return et(e)?e:e.contextElement}function Ln(e){const t=vs(e);if(!dt(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=jl(t);let s=(i?vo(n.width):n.width)/r,a=(i?vo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Iy=lt(0);function Wl(e){const t=Ie(e);return!ms()||!t.visualViewport?Iy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _y(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ie(e)?!1:t}function pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=vs(e);let s=lt(1);t&&(r?et(r)&&(s=Ln(r)):s=Ln(e));const a=_y(i,n,r)?Wl(i):lt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=Ie(i),g=r&&et(r)?Ie(r):r;let f=h,p=ys(f);for(;p&&r&&g!==f;){const m=Ln(p),y=p.getBoundingClientRect(),b=tt(p),x=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,w=y.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=w,f=Ie(p),p=ys(f)}}return xo({width:u,height:d,x:c,y:l})}function bs(e,t){const n=Po(e).scrollLeft;return t?t.left+n:pn(ut(e)).left+n}function Hl(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:bs(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Ly(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ut(r),a=t?Eo(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const u=lt(0),d=dt(r);if((d||!d&&!i)&&((In(r)!=="body"||xr(s))&&(c=Po(r)),dt(r))){const g=pn(r);l=Ln(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!i?Hl(s,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function Ny(e){return Array.from(e.getClientRects())}function Fy(e){const t=ut(e),n=Po(e),r=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+bs(e);const a=-n.scrollTop;return tt(r).direction==="rtl"&&(s+=Me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Vy(e,t){const n=Ie(e),r=ut(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=ms();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function By(e,t){const n=pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=dt(e)?Ln(e):lt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Yl(e,t,n){let r;if(t==="viewport")r=Vy(e,n);else if(t==="document")r=Fy(ut(e));else if(et(t))r=By(t,n);else{const o=Wl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return xo(r)}function ql(e,t){const n=Ht(e);return n===t||!et(n)||_n(n)?!1:tt(n).position==="fixed"||ql(n,t)}function Ky(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>et(a)&&In(a)!=="body"),o=null;const i=tt(e).position==="fixed";let s=i?Ht(e):e;for(;et(s)&&!_n(s);){const a=tt(s),c=ps(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xr(s)&&!c&&ql(e,s))?r=r.filter(u=>u!==s):o=a,s=Ht(s)}return t.set(e,r),r}function zy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Eo(t)?[]:Ky(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const d=Yl(t,u,o);return l.top=Me(d.top,l.top),l.right=jt(d.right,l.right),l.bottom=jt(d.bottom,l.bottom),l.left=Me(d.left,l.left),l},Yl(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uy(e){const{width:t,height:n}=jl(e);return{width:t,height:n}}function jy(e,t,n){const r=dt(t),o=ut(t),i=n==="fixed",s=pn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!i)if((In(t)!=="body"||xr(o))&&(a=Po(t)),r){const h=pn(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=bs(o));const l=o&&!r&&!i?Hl(o,a):lt(0),u=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:s.width,height:s.height}}function ws(e){return tt(e).position==="static"}function Gl(e,t){if(!dt(e)||tt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ut(e)===n&&(n=n.ownerDocument.body),n}function Xl(e,t){const n=Ie(e);if(Eo(e))return n;if(!dt(e)){let o=Ht(e);for(;o&&!_n(o);){if(et(o)&&!ws(o))return o;o=Ht(o)}return n}let r=Gl(e,t);for(;r&&Ry(r)&&ws(r);)r=Gl(r,t);return r&&_n(r)&&ws(r)&&!ps(r)?n:r||My(e)||n}const Wy=async function(e){const t=this.getOffsetParent||Xl,n=this.getDimensions,r=await n(e.floating);return{reference:jy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hy(e){return tt(e).direction==="rtl"}const Zl={convertOffsetParentRelativeRectToViewportRelativeRect:Ly,getDocumentElement:ut,getClippingRect:zy,getOffsetParent:Xl,getElementRects:Wy,getClientRects:Ny,getDimensions:Uy,getScale:Ln,isElement:et,isRTL:Hy};function Jl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yy(e,t){let n=null,r;const o=ut(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=bo(d),p=bo(o.clientWidth-(u+h)),m=bo(o.clientHeight-(d+g)),y=bo(u),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Me(0,jt(1,c))||1};let w=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Jl(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function qy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=vs(e),u=o||i?[...l?Sr(l):[],...Sr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?Yy(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let f,p=c?pn(e):null;c&&m();function m(){const y=pn(e);p&&!Jl(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const Gy=Ay,Xy=$y,Zy=ky,Jy=Dy,Qy=Oy,ev=Cy,tv=(e,t,n)=>{const r=new Map,o={platform:Zl,...n},i={...o.platform,_c:r};return Py(e,t,{...o,platform:i})};function Ql(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 i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function nv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Ql(r):e?e.getBoundingClientRect():Ql()}}}function rv(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const ov={top:"bottom",right:"left",bottom:"top",left:"right"};function iv(e,t){const[n,r]=e.split("-"),o=ov[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 sv(e){const t=ct({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]=L(),[o,i]=L(),[s,a]=L(t.placement),c=()=>nv(t.anchorRef(),t.getAnchorRect),{direction:l}=ss();async function u(){const h=c(),g=n(),f=o();if(!h||!g)return;const p=(f?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const y=[Gy(({placement:S})=>{const O=!!S.split("-")[1];return{mainAxis:m,crossAxis:O?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const S=typeof t.flip=="string"?t.flip.split(" "):void 0;if(S!==void 0&&!S.every(rv))throw new Error("`flip` expects a spaced-delimited list of placements");y.push(Zy({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&y.push(Xy({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),y.push(Jy({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:O,rects:D}){const P=Math.round(D.reference.width);S=Math.floor(S),O=Math.floor(O),g.style.setProperty("--kb-popper-anchor-width",`${P}px`),g.style.setProperty("--kb-popper-content-available-width",`${S}px`),g.style.setProperty("--kb-popper-content-available-height",`${O}px`),t.sameWidth&&(g.style.width=`${P}px`),t.fitViewport&&(g.style.maxWidth=`${S}px`,g.style.maxHeight=`${O}px`)}})),t.hideWhenDetached&&y.push(Qy({padding:t.detachedPadding})),f&&y.push(ev({element:f,padding:t.arrowPadding}));const b=await tv(h,g,{placement:t.placement,strategy:"absolute",middleware:y,platform:{...Zl,isRTL:()=>l()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",iv(b.placement,l()));const x=Math.round(b.x),w=Math.round(b.y);let C;if(t.hideWhenDetached&&(C=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${w}px, 0)`,visibility:C}),f&&b.middlewareData.arrow){const{x:S,y:O}=b.middlewareData.arrow,D=b.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:O!=null?`${O}px`:"",[D]:"100%"})}}V(()=>{const h=c(),g=n();if(!h||!g)return;const f=qy(h,g,u,{elementResize:typeof ResizeObserver=="function"});Y(f)}),V(()=>{const h=n(),g=t.contentRef();!h||!g||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(g).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return v(_l.Provider,{value:d,get children(){return t.children}})}const eu=xe();function tu(){return Ce(eu)}function Nn(){const e=tu();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const nu=xe();function Fn(){const e=Ce(nu);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
175
|
+
*/function ry(e={}){const[t,n]=lm({value:()=>M(e.items),onChange:i=>e.onItemsChange?.(i)});ny(t,n);const r=i=>(n(s=>{const a=Jm(s,i);return Fp(s,i,a)}),()=>{n(s=>{const a=s.filter(c=>c.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>v(Cl.Provider,{value:{registerItem:r},get children(){return i.children}})}}function oy(e){const t=Zm(),n=ct({shouldRegisterItem:!0},e);B(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());H(r)})}var de=e=>typeof e=="function"?e():e,us=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),ds=(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},vo=new Map,iy=e=>{B(()=>{const t=de(e.style)??{},n=de(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=vo.get(e.key);o?o.activeCount++:vo.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);H(()=>{const i=vo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}vo.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},Al=iy,sy=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},ay=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},cy=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=sy(o,t),d=u-c-r*l;(l!==0||d!==0)&&ay(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[$l,Dl]=L([]),ly=e=>$l().indexOf(e)===$l().length-1,uy=e=>{const t=N({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Be();let r=[0,0],o=null,i=null;B(()=>{de(t.enabled)&&(Dl(l=>[...l,n]),H(()=>{Dl(l=>l.filter(u=>u!==n))}))}),B(()=>{if(!de(t.enabled)||!de(t.hideScrollbar))return;const{body:l}=document,u=window.innerWidth-l.offsetWidth;if(de(t.preventScrollbarShift)){const d={overflow:"hidden"},h=[];u>0&&(de(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${u}px)`,h.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,f=window.scrollX;Al({key:"prevent-scroll",element:l,style:d,properties:h,cleanup:()=>{de(t.restoreScrollPosition)&&u>0&&window.scrollTo(f,g)}})}else Al({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),B(()=>{!ly(n)||!de(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",c,{passive:!1}),H(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",c)}))});const s=l=>{r=Rl(l),o=null,i=null},a=l=>{const u=l.target,d=de(t.element),h=dy(l),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=g==="x"?h[0]:h[1],p=Ml(u,g,f,d);let m;d&&ds(d,u)?m=!p:m=!0,m&&l.cancelable&&l.preventDefault()},c=l=>{const u=de(t.element),d=l.target;let h;if(l.touches.length===2)h=!de(t.allowPinchZoom);else{if(o==null||i===null){const g=Rl(l).map((p,m)=>r[m]-p),f=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=f,i=f==="x"?g[0]:g[1]}if(d.type==="range")h=!1;else{const g=Ml(d,o,i,u);u&&ds(u,d)?h=!g:h=!0}}h&&l.cancelable&&l.preventDefault()}},dy=e=>[e.deltaX,e.deltaY],Rl=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Ml=(e,t,n,r)=>{const o=r!==null&&ds(r,e),[i,s]=cy(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},fy=uy,Il=fy;const _l=xe();function hy(){return ke(_l)}function gy(e){let t;const n=hy(),[r,o]=J(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const h=n?.registerNestedLayer(d);return()=>{i.delete(d),h?.()}};Em({shouldExcludeElement:d=>t?r.excludedElements?.some(h=>at(h(),d))||[...i].some(h=>at(h,d)):!1,onPointerDownOutside:d=>{!t||Re.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Re.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),um({ownerDocument:()=>Ct(t),onEscapeKeyDown:d=>{!t||!Re.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),cn(()=>{if(!t)return;Re.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);Re.assignPointerEventToLayers(),Re.disableBodyPointerEvents(t),H(()=>{t&&(Re.removeLayer(t),d?.(),Re.assignPointerEventToLayers(),Re.restoreBodyPointerEvents(t))})}),B(an([()=>t,()=>r.disableOutsidePointerEvents],([d,h])=>{if(!d)return;const g=Re.find(d);g&&g.isPointerBlocking!==h&&(g.isPointerBlocking=h,Re.assignPointerEventToLayers()),h&&Re.disableBodyPointerEvents(d),H(()=>{Re.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return v(_l.Provider,{value:u,get children(){return v(yo,N({as:"div",ref(d){var h=fn(g=>t=g,r.ref);typeof h=="function"&&h(d)}},o))}})}const Ll=xe();function py(){const e=ke(Ll);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function my(e){const t=py(),[n,r]=J(e,["ref","style"]);return v(yo,N({as:"div",ref(o){var i=fn(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const yy=["top","right","bottom","left"],jt=Math.min,Me=Math.max,wo=Math.round,bo=Math.floor,lt=e=>({x:e,y:e}),vy={left:"right",right:"left",bottom:"top",top:"bottom"},wy={start:"end",end:"start"};function fs(e,t,n){return Me(e,jt(t,n))}function hn(e,t){return typeof e=="function"?e(t):e}function Ht(e){return e.split("-")[0]}function Mn(e){return e.split("-")[1]}function Nl(e){return e==="x"?"y":"x"}function hs(e){return e==="y"?"height":"width"}function gn(e){return["top","bottom"].includes(Ht(e))?"y":"x"}function gs(e){return Nl(gn(e))}function by(e,t,n){n===void 0&&(n=!1);const r=Mn(e),o=gs(e),i=hs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=xo(s)),[s,xo(s)]}function xy(e){const t=xo(e);return[ps(e),t,ps(t)]}function ps(e){return e.replace(/start|end/g,t=>wy[t])}function Sy(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Ey(e,t,n,r){const o=Mn(e);let i=Sy(Ht(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ps)))),i}function xo(e){return e.replace(/left|right|bottom|top/g,t=>vy[t])}function Py(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fl(e){return typeof e!="number"?Py(e):{top:e,right:e,bottom:e,left:e}}function So(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 Vl(e,t,n){let{reference:r,floating:o}=e;const i=gn(t),s=gs(t),a=hs(s),c=Ht(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Mn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}const Cy=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Vl(l,r,c),h=r,g={},f=0;for(let p=0;p<a.length;p++){const{name:m,fn:y}=a[p],{x:w,y:x,data:b,reset:C}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:l,platform:s,elements:{reference:e,floating:t}});u=w??u,d=x??d,g={...g,[m]:{...g[m],...b}},C&&f<=50&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=Vl(l,h,c)),p=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:g}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=hn(t,e),f=Fl(g),m=a[h?d==="floating"?"reference":"floating":d],y=So(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=So(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-C.top+f.top)/b.y,bottom:(C.bottom-y.bottom+f.bottom)/b.y,left:(y.left-C.left+f.left)/b.x,right:(C.right-y.right+f.right)/b.x}}const ky=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=hn(e,t)||{};if(l==null)return{};const d=Fl(u),h={x:n,y:r},g=gs(o),f=hs(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=b/2-C/2,P=O/2-p[f]/2-1,T=jt(d[y],P),I=jt(d[w],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=fs($,U,K),V=!c.arrow&&Mn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,j=V?U<$?U-$:U-K:0;return{[g]:h[g]+j,data:{[g]:Q,centerOffset:U-Q-j,...V&&{alignmentOffset:j}},reset:V}}}),Oy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=hn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Ht(o),w=gn(a),x=Ht(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[xo(a)]:xy(a)),S=f!=="none";!h&&S&&C.push(...Ey(a,p,f,b));const O=[a,...C],D=await br(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&P.push(D[y]),d){const U=by(o,s,b);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q)return{data:{index:U,overflows:T},reset:{placement:Q}};let V=($=T.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(g){case"bestFit":{var K;const j=(K=T.filter(G=>{if(S){const q=gn(G.placement);return q===w||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];j&&(V=j);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function Bl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kl(e){return yy.some(t=>e[t]>=0)}const Ty=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=hn(e,t);switch(r){case"referenceHidden":{const i=await br(t,{...o,elementContext:"reference"}),s=Bl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Kl(s)}}}case"escaped":{const i=await br(t,{...o,altBoundary:!0}),s=Bl(i,n.floating);return{data:{escapedOffsets:s,escaped:Kl(s)}}}default:return{}}}}};async function Ay(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ht(n),a=Mn(n),c=gn(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,d=hn(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*u,y:h*l}:{x:h*l,y:g*u}}const $y=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await Ay(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...c}=hn(e,t),l={x:n,y:r},u=await br(t,c),d=gn(Ht(o)),h=Nl(d);let g=l[h],f=l[d];if(i){const m=h==="y"?"top":"left",y=h==="y"?"bottom":"right",w=g+u[m],x=g-u[y];g=fs(w,g,x)}if(s){const m=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=f+u[m],x=f-u[y];f=fs(w,f,x)}const p=a.fn({...t,[h]:g,[d]:f});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:i,[d]:s}}}}}},Ry=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=hn(e,t),u=await br(t,l),d=Ht(o),h=Mn(o),g=gn(o)==="y",{width:f,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=h==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=f-u.left-u.right,b=jt(p-u[m],w),C=jt(f-u[y],x),S=!t.middlewareData.shift;let O=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=w),S&&!h){const T=Me(u.left,0),I=Me(u.right,0),$=Me(u.top,0),K=Me(u.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Me(u.left,u.right)):O=p-2*($!==0||K!==0?$+K:Me(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function Eo(){return typeof window<"u"}function In(e){return zl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ut(e){var t;return(t=(zl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zl(e){return Eo()?e instanceof Node||e instanceof Ie(e).Node:!1}function et(e){return Eo()?e instanceof Element||e instanceof Ie(e).Element:!1}function dt(e){return Eo()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function Ul(e){return!Eo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}function xr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function My(e){return["table","td","th"].includes(In(e))}function Po(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ms(e){const t=ys(),n=et(e)?tt(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 Iy(e){let t=Yt(e);for(;dt(t)&&!_n(t);){if(ms(t))return t;if(Po(t))return null;t=Yt(t)}return null}function ys(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _n(e){return["html","body","#document"].includes(In(e))}function tt(e){return Ie(e).getComputedStyle(e)}function Co(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yt(e){if(In(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ul(e)&&e.host||ut(e);return Ul(t)?t.host:t}function Wl(e){const t=Yt(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&xr(t)?t:Wl(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wl(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ie(o);if(i){const a=vs(s);return t.concat(s,s.visualViewport||[],xr(o)?o:[],a&&n?Sr(a):[])}return t.concat(o,Sr(o,[],n))}function vs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jl(e){const t=tt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=dt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=wo(n)!==i||wo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ws(e){return et(e)?e:e.contextElement}function Ln(e){const t=ws(e);if(!dt(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=jl(t);let s=(i?wo(n.width):n.width)/r,a=(i?wo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _y=lt(0);function Hl(e){const t=Ie(e);return!ys()||!t.visualViewport?_y:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ly(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ie(e)?!1:t}function pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ws(e);let s=lt(1);t&&(r?et(r)&&(s=Ln(r)):s=Ln(e));const a=Ly(i,n,r)?Hl(i):lt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=Ie(i),g=r&&et(r)?Ie(r):r;let f=h,p=vs(f);for(;p&&r&&g!==f;){const m=Ln(p),y=p.getBoundingClientRect(),w=tt(p),x=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=y.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=b,f=Ie(p),p=vs(f)}}return So({width:u,height:d,x:c,y:l})}function bs(e,t){const n=Co(e).scrollLeft;return t?t.left+n:pn(ut(e)).left+n}function Yl(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:bs(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Ny(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ut(r),a=t?Po(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const u=lt(0),d=dt(r);if((d||!d&&!i)&&((In(r)!=="body"||xr(s))&&(c=Co(r)),dt(r))){const g=pn(r);l=Ln(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!i?Yl(s,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function Fy(e){return Array.from(e.getClientRects())}function Vy(e){const t=ut(e),n=Co(e),r=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+bs(e);const a=-n.scrollTop;return tt(r).direction==="rtl"&&(s+=Me(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function By(e,t){const n=Ie(e),r=ut(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=ys();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function Ky(e,t){const n=pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=dt(e)?Ln(e):lt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function ql(e,t,n){let r;if(t==="viewport")r=By(e,n);else if(t==="document")r=Vy(ut(e));else if(et(t))r=Ky(t,n);else{const o=Hl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return So(r)}function Gl(e,t){const n=Yt(e);return n===t||!et(n)||_n(n)?!1:tt(n).position==="fixed"||Gl(n,t)}function zy(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>et(a)&&In(a)!=="body"),o=null;const i=tt(e).position==="fixed";let s=i?Yt(e):e;for(;et(s)&&!_n(s);){const a=tt(s),c=ms(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xr(s)&&!c&&Gl(e,s))?r=r.filter(u=>u!==s):o=a,s=Yt(s)}return t.set(e,r),r}function Uy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Po(t)?[]:zy(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const d=ql(t,u,o);return l.top=Me(d.top,l.top),l.right=jt(d.right,l.right),l.bottom=jt(d.bottom,l.bottom),l.left=Me(d.left,l.left),l},ql(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Wy(e){const{width:t,height:n}=jl(e);return{width:t,height:n}}function jy(e,t,n){const r=dt(t),o=ut(t),i=n==="fixed",s=pn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!i)if((In(t)!=="body"||xr(o))&&(a=Co(t)),r){const h=pn(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=bs(o));const l=o&&!r&&!i?Yl(o,a):lt(0),u=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:s.width,height:s.height}}function xs(e){return tt(e).position==="static"}function Xl(e,t){if(!dt(e)||tt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ut(e)===n&&(n=n.ownerDocument.body),n}function Zl(e,t){const n=Ie(e);if(Po(e))return n;if(!dt(e)){let o=Yt(e);for(;o&&!_n(o);){if(et(o)&&!xs(o))return o;o=Yt(o)}return n}let r=Xl(e,t);for(;r&&My(r)&&xs(r);)r=Xl(r,t);return r&&_n(r)&&xs(r)&&!ms(r)?n:r||Iy(e)||n}const Hy=async function(e){const t=this.getOffsetParent||Zl,n=this.getDimensions,r=await n(e.floating);return{reference:jy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Yy(e){return tt(e).direction==="rtl"}const Jl={convertOffsetParentRelativeRectToViewportRelativeRect:Ny,getDocumentElement:ut,getClippingRect:Uy,getOffsetParent:Zl,getElementRects:Hy,getClientRects:Fy,getDimensions:Wy,getScale:Ln,isElement:et,isRTL:Yy};function Ql(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qy(e,t){let n=null,r;const o=ut(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=bo(d),p=bo(o.clientWidth-(u+h)),m=bo(o.clientHeight-(d+g)),y=bo(u),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Me(0,jt(1,c))||1};let b=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!b)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Ql(l,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function Gy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=ws(e),u=o||i?[...l?Sr(l):[],...Sr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?qy(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let f,p=c?pn(e):null;c&&m();function m(){const y=pn(e);p&&!Ql(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const Xy=$y,Zy=Dy,Jy=Oy,Qy=Ry,ev=Ty,tv=ky,nv=(e,t,n)=>{const r=new Map,o={platform:Jl,...n},i={...o.platform,_c:r};return Cy(e,t,{...o,platform:i})};function eu(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 i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function rv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?eu(r):e?e.getBoundingClientRect():eu()}}}function ov(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const iv={top:"bottom",right:"left",bottom:"top",left:"right"};function sv(e,t){const[n,r]=e.split("-"),o=iv[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 av(e){const t=ct({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]=L(),[o,i]=L(),[s,a]=L(t.placement),c=()=>rv(t.anchorRef(),t.getAnchorRect),{direction:l}=as();async function u(){const h=c(),g=n(),f=o();if(!h||!g)return;const p=(f?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const y=[Xy(({placement:S})=>{const O=!!S.split("-")[1];return{mainAxis:m,crossAxis:O?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const S=typeof t.flip=="string"?t.flip.split(" "):void 0;if(S!==void 0&&!S.every(ov))throw new Error("`flip` expects a spaced-delimited list of placements");y.push(Jy({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&y.push(Zy({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),y.push(Qy({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:O,rects:D}){const P=Math.round(D.reference.width);S=Math.floor(S),O=Math.floor(O),g.style.setProperty("--kb-popper-anchor-width",`${P}px`),g.style.setProperty("--kb-popper-content-available-width",`${S}px`),g.style.setProperty("--kb-popper-content-available-height",`${O}px`),t.sameWidth&&(g.style.width=`${P}px`),t.fitViewport&&(g.style.maxWidth=`${S}px`,g.style.maxHeight=`${O}px`)}})),t.hideWhenDetached&&y.push(ev({padding:t.detachedPadding})),f&&y.push(tv({element:f,padding:t.arrowPadding}));const w=await nv(h,g,{placement:t.placement,strategy:"absolute",middleware:y,platform:{...Jl,isRTL:()=>l()==="rtl"}});if(a(w.placement),t.onCurrentPlacementChange?.(w.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",sv(w.placement,l()));const x=Math.round(w.x),b=Math.round(w.y);let C;if(t.hideWhenDetached&&(C=w.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${b}px, 0)`,visibility:C}),f&&w.middlewareData.arrow){const{x:S,y:O}=w.middlewareData.arrow,D=w.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:O!=null?`${O}px`:"",[D]:"100%"})}}B(()=>{const h=c(),g=n();if(!h||!g)return;const f=Gy(h,g,u,{elementResize:typeof ResizeObserver=="function"});H(f)}),B(()=>{const h=n(),g=t.contentRef();!h||!g||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(g).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return v(Ll.Provider,{value:d,get children(){return t.children}})}const tu=xe();function nu(){return ke(tu)}function Nn(){const e=nu();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const ru=xe();function Fn(){const e=ke(ru);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 av(e,t){return t?rm([e.clientX,e.clientY],t):!1}function cv(e){const t=Fn(),n=Cl(),r=tu(),o=ct({placement:"bottom-start"},e),[i,s]=J(o,["open","defaultOpen","onOpenChange"]);let a=0,c=null,l="right";const[u,d]=L(),[h,g]=L(),[f,p]=L(),[m,y]=L(),[b,x]=L(!0),[w,C]=L(s.placement),[S,O]=L([]),[D,P]=L([]),{DomCollectionProvider:T}=ny({items:D,onItemsChange:P}),I=cl({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:X=>i.onOpenChange?.(X)}),$=Em(()=>t.forceMount()||I.isOpen()),K=jm({selectionMode:"none",dataSource:D}),U=X=>{x(X),I.open()},Q=(X=!1)=>{I.close(),X&&r&&r.close(!0)},F=X=>{x(X),I.toggle()},j=()=>{const X=m();X&&(Oe(X),K.selectionManager().setFocused(!0),K.selectionManager().setFocusedKey(void 0))},G=X=>{O(tn=>[...tn,X]);const Vt=r?.registerNestedMenu(X);return()=>{O(tn=>qi(tn,X)),Vt?.()}},q=X=>l===c?.side&&av(X,c?.area),qe=X=>{q(X)&&X.preventDefault()},$e=X=>{q(X)||j()},ec=X=>{q(X)&&X.preventDefault()};wm({isDisabled:()=>!(r==null&&I.isOpen()&&t.isModal()),targets:()=>[m(),...S()].filter(Boolean)}),V(()=>{const X=m();if(!X||!r)return;const Vt=r.registerNestedMenu(X);Y(()=>{Vt()})});const Pi={dataset:_(()=>({"data-expanded":I.isOpen()?"":void 0,"data-closed":I.isOpen()?void 0:""})),isOpen:I.isOpen,contentPresence:$,nestedMenus:S,currentPlacement:w,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>K,parentMenuContext:()=>r,triggerRef:f,contentRef:m,triggerId:u,contentId:h,setTriggerRef:p,setContentRef:y,open:U,close:Q,toggle:F,focusContent:j,onItemEnter:qe,onItemLeave:$e,onTriggerLeave:ec,setPointerDir:X=>l=X,setPointerGraceTimeoutId:X=>a=X,setPointerGraceIntent:X=>c=X,registerNestedMenu:G,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:po(d),registerContentId:po(g)};return v(T,{get children(){return v(eu.Provider,{value:Pi,get children(){return v(sv,N({anchorRef:f,contentRef:m,onCurrentPlacementChange:C},s))}})}})}const lv=xe();function uv(e){let t;const n=Fn(),r=Nn(),o=ct({id:n.generateId(`item-${Be()}`)},e),[i,s]=J(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,c]=L(),[l,u]=L(),[d,h]=L(),g=()=>r.listState().selectionManager(),f=()=>s.id,p=()=>g().focusedKey()===f(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};ry({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const y=zm({key:f,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=P=>{De(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(Oe(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},x=P=>{De(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},w=P=>{De(P,i.onPointerUp),!i.disabled&&P.button===0&&m()},C=P=>{if(De(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":m();break}},S=_(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),O=_(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),D={isChecked:()=>i.checked,dataset:O,setLabelRef:h,generateId:Zc(()=>s.id),registerLabel:po(c),registerDescription:po(u)};return v(lv.Provider,{value:D,get children(){return v(mo,N({as:"div",ref(P){var T=fn(I=>t=I,i.ref);typeof T=="function"&&T(P)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return y.dataKey()},get onPointerDown(){return ze([i.onPointerDown,y.onPointerDown])},get onPointerUp(){return ze([w,y.onPointerUp])},get onClick(){return ze([i.onClick,y.onClick])},get onKeyDown(){return ze([C,y.onKeyDown])},get onMouseDown(){return ze([i.onMouseDown,y.onMouseDown])},get onFocus(){return ze([i.onFocus,y.onFocus])},onPointerMove:b,onPointerLeave:x},O,s))}})}const dv=xe();function ru(){return Ce(dv)}function fv(e){let t;const n=Fn(),r=Nn(),o=ru(),i=ct({id:n.generateId(`content-${Be()}`)},e),[s,a]=J(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const l=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=Hm({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);vm({trapFocus:()=>l()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=m=>{if(at(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=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},f=m=>{De(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(De(m,s.onPointerMove),m.pointerType!=="mouse")return;const y=m.target,b=c!==m.clientX;at(m.currentTarget,y)&&b&&(r.setPointerDir(m.clientX>c?"right":"left"),c=m.clientX)};return V(()=>Y(r.registerContentId(s.id))),v(ie,{get when(){return r.contentPresence.isPresent()},get children(){return v(py,{get children(){return v(hy,N({ref(m){var y=fn(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof y=="function"&&y(m)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return Ut(()=>!!l())()&&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",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return ze([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return ze([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return ze([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return ze([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:p},()=>r.dataset(),a))}})}})}function hv(e){let t;const n=Fn(),r=Nn(),[o,i]=J(e,["ref"]);return Ml({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),v(fv,N({ref(s){var a=fn(c=>{t=c},o.ref);typeof a=="function"&&a(s)}},i))}function gv(e){return v(uv,N({role:"menuitem",closeOnSelect:!0},e))}function pv(e){const t=Nn();return v(ie,{get when(){return t.contentPresence.isPresent()},get children(){return v(Mc,e)}})}function mv(e){const t=`menu-${Be()}`,n=ct({id:t,modal:!0},e),[r,o]=J(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=cl({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:Zc(()=>r.id),value:()=>r.value};return v(nu.Provider,{value:s,get children(){return v(cv,N({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function yv(e){const t=Fn(),n=Nn(),r=ru(),o=ct({id:t.generateId("trigger")},e),[i,s]=J(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,V(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),V(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),V(()=>{n.isOpen()&&r.setValue(a)}),Y(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const c=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},l=f=>{De(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&c()},u=f=>{De(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&c()},d=f=>{if(De(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),om(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=>{De(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=f=>{De(f,i.onFocus),r!==void 0&&r.setValue(a)};return V(()=>Y(n.registerTriggerId(i.id))),v(Gm,N({ref(f){var p=fn(n.setTriggerRef,i.ref);typeof p=="function"&&p(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Ut(()=>!!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:l,onMouseOver:h,onClick:u,onKeyDown:d,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function vv(e){const t=Fn(),n=Nn(),[r,o]=J(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return v(hv,N({onCloseAutoFocus:c=>{r.onCloseAutoFocus?.(c),i||Oe(n.triggerRef()),i=!1,c.preventDefault()},onInteractOutside:c=>{r.onInteractOutside?.(c),(!t.isModal()||c.detail.isContextMenu)&&(i=!0)}},o))}function bv(e){const t=`dropdownmenu-${Be()}`,n=ct({id:t},e);return v(mv,n)}function wv(e){return Ke({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 xv(e){return Ke({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 Sv(e){return Ke({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 Ev=e=>v(bv,N({gutter:4},e)),Pv=yv,Cv=e=>{const[,t]=J(e,["class"]);return v(pv,{get mount(){return Hr()},get children(){return v(vv,N({get class(){return zt("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))}})},kv=e=>{const[,t]=J(e,["class"]);return v(gv,N({get class(){return zt("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 Ov(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 Tv(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function Av(e,t,n){const r=`${On}/v1/messages`,o=co(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:Uc()})};await fetch(r,s)}async function $v(e){const t=`${On}/v1/messages`,n=co(),r={"Content-Type":"application/json"};n&&(r["x-session-id"]=n);const o={credentials:"include",method:"POST",headers:r,body:JSON.stringify({channelId:e,type:"open",metadata:Uc()})},i=await fetch(t,o);if(!i.ok)throw new Error(`open event rejected: ${i.status}`)}async function Dv(e,t,n){if(!e||!t||!n)return;const r=`${On}/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 ft=Object.create(null);ft.open="0",ft.close="1",ft.ping="2",ft.pong="3",ft.message="4",ft.upgrade="5",ft.noop="6";const Co=Object.create(null);Object.keys(ft).forEach(e=>{Co[ft[e]]=e});const xs={type:"error",data:"parser error"},ou=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",iu=typeof ArrayBuffer=="function",su=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ss=({type:e,data:t},n,r)=>ou&&t instanceof Blob?n?r(t):au(t,r):iu&&(t instanceof ArrayBuffer||su(t))?n?r(t):au(new Blob([t]),r):r(ft[e]+(t||"")),au=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function cu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Es;function Rv(e,t){if(ou&&e.data instanceof Blob)return e.data.arrayBuffer().then(cu).then(t);if(iu&&(e.data instanceof ArrayBuffer||su(e.data)))return t(cu(e.data));Ss(e,!1,n=>{Es||(Es=new TextEncoder),t(Es.encode(n))})}const lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Er=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<lu.length;e++)Er[lu.charCodeAt(e)]=e;const Mv=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)i=Er[e.charCodeAt(r)],s=Er[e.charCodeAt(r+1)],a=Er[e.charCodeAt(r+2)],c=Er[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|c&63;return l},Iv=typeof ArrayBuffer=="function",Ps=(e,t)=>{if(typeof e!="string")return{type:"message",data:uu(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:_v(e.substring(1),t)}:Co[n]?e.length>1?{type:Co[n],data:e.substring(1)}:{type:Co[n]}:xs},_v=(e,t)=>{if(Iv){const n=Mv(e);return uu(n,t)}else return{base64:!0,data:e}},uu=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},du="",Lv=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Ss(i,!1,a=>{r[s]=a,++o===n&&t(r.join(du))})})},Nv=(e,t)=>{const n=e.split(du),r=[];for(let o=0;o<n.length;o++){const i=Ps(n[o],t);if(r.push(i),i.type==="error")break}return r};function Fv(){return new TransformStream({transform(e,t){Rv(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 i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Cs;function ko(e){return e.reduce((t,n)=>t+n.length,0)}function Oo(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 Vv(e,t){Cs||(Cs=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(ko(n)<1)break;const c=Oo(n,1);i=(c[0]&128)===128,o=c[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(ko(n)<2)break;const c=Oo(n,2);o=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(ko(n)<8)break;const c=Oo(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(xs);break}o=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(ko(n)<o)break;const c=Oo(n,o);a.enqueue(Ps(i?c:Cs.decode(c),t)),r=0}if(o===0||o>e){a.enqueue(xs);break}}}})}const fu=4;function me(e){if(e)return Bv(e)}function Bv(e){for(var t in me.prototype)e[t]=me.prototype[t];return e}me.prototype.on=me.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},me.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},me.prototype.off=me.prototype.removeListener=me.prototype.removeAllListeners=me.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},me.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},me.prototype.emitReserved=me.prototype.emit,me.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},me.prototype.hasListeners=function(e){return!!this.listeners(e).length};const To=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),je=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Kv="arraybuffer";function uk(){}function hu(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const zv=je.setTimeout,Uv=je.clearTimeout;function Ao(e,t){t.useNativeTimers?(e.setTimeoutFn=zv.bind(je),e.clearTimeoutFn=Uv.bind(je)):(e.setTimeoutFn=je.setTimeout.bind(je),e.clearTimeoutFn=je.clearTimeout.bind(je))}const jv=1.33;function Wv(e){return typeof e=="string"?Hv(e):Math.ceil((e.byteLength||e.size)*jv)}function Hv(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 gu(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Yv(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function qv(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Gv extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class ks extends me{constructor(t){super(),this.writable=!1,Ao(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 Gv(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=Ps(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=Yv(t);return n.length?"?"+n:""}}class Xv extends ks{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)};Nv(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,Lv(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]=gu()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let pu=!1;try{pu=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Zv=pu;function Jv(){}class Qv extends Xv{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,i)=>{this.onError("xhr post error",o,i)})}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 ht extends me{constructor(t,n,r){super(),this.createRequest=t,Ao(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=hu(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=ht.requestsCount++,ht.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=Jv,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ht.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(ht.requestsCount=0,ht.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",mu);else if(typeof addEventListener=="function"){const e="onpagehide"in je?"pagehide":"unload";addEventListener(e,mu,!1)}}function mu(){for(let e in ht.requests)ht.requests.hasOwnProperty(e)&&ht.requests[e].abort()}const eb=(function(){const e=yu({xdomain:!1});return e&&e.responseType!==null})();class tb extends Qv{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=eb&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ht(yu,this.uri(),t)}}function yu(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Zv))return new XMLHttpRequest}catch{}if(!t)try{return new je[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const vu=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class nb extends ks{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=vu?{}:hu(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;Ss(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&To(()=>{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]=gu()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Os=je.WebSocket||je.MozWebSocket;class rb extends nb{createSocket(t,n,r){return vu?new Os(t,n,r):n?new Os(t,n):new Os(t)}doWrite(t,n){this.ws.send(n)}}class ob extends ks{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=Vv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Fv();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).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&&To(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const ib={websocket:rb,webtransport:ob,polling:tb},sb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ab=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ts(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=sb.exec(e||""),i={},s=14;for(;s--;)i[ab[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=cb(i,i.path),i.queryKey=lb(i,i.query),i}function cb(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 lb(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const As=typeof addEventListener=="function"&&typeof removeEventListener=="function",$o=[];As&&addEventListener("offline",()=>{$o.forEach(e=>e())},!1);class Yt extends me{constructor(t,n){if(super(),this.binaryType=Kv,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=Ts(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=Ts(n.host).host);Ao(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=qv(this.opts.query)),As&&(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"})},$o.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=fu,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&&Yt.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",Yt.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+=Wv(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,To(()=>{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 i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),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(Yt.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(),As&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=$o.indexOf(this._offlineEventListener);r!==-1&&$o.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Yt.protocol=fu;class ub extends Yt{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;Yt.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Yt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),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 i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function c(){s("socket closed")}function l(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),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 db=class extends ub{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=>ib[o]).filter(o=>!!o)),super(t,r)}};function fb(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=Ts(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 i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const hb=typeof ArrayBuffer=="function",gb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,bu=Object.prototype.toString,pb=typeof Blob=="function"||typeof Blob<"u"&&bu.call(Blob)==="[object BlobConstructor]",mb=typeof File=="function"||typeof File<"u"&&bu.call(File)==="[object FileConstructor]";function $s(e){return hb&&(e instanceof ArrayBuffer||gb(e))||pb&&e instanceof Blob||mb&&e instanceof File}function Do(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Do(e[n]))return!0;return!1}if($s(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Do(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Do(e[n]))return!0;return!1}function yb(e){const t=[],n=e.data,r=e;return r.data=Ds(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ds(e,t){if(!e)return e;if($s(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]=Ds(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]=Ds(e[r],t));return n}return e}function vb(e,t){return e.data=Rs(e.data,t),delete e.attachments,e}function Rs(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]=Rs(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Rs(e[n],t));return e}const bb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];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 wb{constructor(t){this.replacer=t}encode(t){return(t.type===Z.EVENT||t.type===Z.ACK)&&Do(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=yb(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class Ms extends me{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}: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 xb(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if($s(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 i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(s);if(!Sb(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Ms.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Z.CONNECT:return wu(n);case Z.DISCONNECT:return n===void 0;case Z.CONNECT_ERROR:return typeof n=="string"||wu(n);case Z.EVENT:case Z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&bb.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 xb{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=vb(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Sb=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function wu(e){return Object.prototype.toString.call(e)==="[object Object]"}const Eb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ms,Encoder:wb,get PacketType(){return Z}},Symbol.toStringTag,{value:"Module"}));function nt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Pb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class xu extends me{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=[nt(t,"open",this.onopen.bind(this)),nt(t,"packet",this.onpacket.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(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,i;if(Pb.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 s={type:Z.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,c=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),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 i=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),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),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,...i)=>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,...i)),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 Vn(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}Vn.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)==0?e-n:e+n}return Math.min(e,this.max)|0},Vn.prototype.reset=function(){this.attempts=0},Vn.prototype.setMin=function(e){this.ms=e},Vn.prototype.setMax=function(e){this.max=e},Vn.prototype.setJitter=function(e){this.jitter=e};class Is extends me{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,Ao(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 Vn({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||Eb;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 db(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=nt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=nt(n,"error",i);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(nt(t,"ping",this.onping.bind(this)),nt(t,"data",this.ondata.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(t,"close",this.onclose.bind(this)),nt(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){To(()=>{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 xu(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 Pr={};function Ro(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=fb(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Pr[o]&&i in Pr[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new Is(r,t):(Pr[o]||(Pr[o]=new Is(r,t)),c=Pr[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Ro,{Manager:Is,Socket:xu,io:Ro,connect:Ro});class gt{static instance;constructor(){}static init(t){if(!gt.instance){const n=co();gt.instance=Ro(eg,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),gt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",gt.instance.id)})}return gt.instance}static on(t,n,r){const o=gt.instance||this.init(n);o.off(t),o.on(t,r)}static waitForConnection(t){const n=gt.instance||this.init(t);return n.connected?Promise.resolve():new Promise(r=>{n.once("connect",()=>r())})}}const _s=1e3*60*60*24,[Mo,Su]=Wi("smarttalks-widget-messages",{},_s),Eu=()=>{const{widgetId:e}=ge();return Mo[e()]??[]},Cb=e=>{const{widgetId:t}=ge();Su({...Mo,[t()]:[...Mo[t()]??[],e]})},kb=()=>{const{widgetId:e}=ge();Su({...Mo,[e()]:[]})},[Pu,Ob]=Wi("smarttalks-widget-conversationinfo",{},_s),Ls=()=>{const{widgetId:e}=ge();return Pu[e()]??{}},Cu=e=>{const{widgetId:t}=ge();Ob({...Pu,[t()]:e})},[ku,Tb]=Wi("smarttalks-widget-autostarted",{},_s),Ab=()=>{const{widgetId:e}=ge();return ku[e()]??!1},Ou=e=>{const{widgetId:t}=ge();Tb({...ku,[t()]:e})},[$b,Ns]=L(!1),[Db,Tu]=L(!1),Au=[],$u=()=>{Au.forEach(e=>e())},Rb=e=>Au.push(e),Fs=e=>{const t=Ov(e);if(Cb(t),t.type==="media"){setTimeout($u,200);return}$u()},Du=()=>{const{widgetId:e}=ge(),t=Ls();gt.on("message",e(),n=>{(n.contactId!==t.contactId||n.interactionId!==t.interactionId)&&Cu({contactId:n.contactId,interactionId:n.interactionId});for(const r of n.messages)Fs(r),he("onAnswer",r);Ns(!1),Tv(n.debug)})},Mb=(e,t)=>{const{chatWidget:n}=ge();e.trim()&&(Fs({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),he("onInput",e),Du(),Ns(!0),Av(e,t,n()?._id).catch(r=>{console.error(r),Ns(!1)}))};let Vs=!1;const Ib=()=>{const{chatWidget:e,widgetId:t}=ge();Du(),Vs=!0,gt.waitForConnection(t()).then(()=>$v(e()?._id)).then(()=>Ou(!0)).catch(n=>console.error(n)).finally(()=>{Vs=!1})},Ru=()=>{Ls().interactionId||Ab()||Vs||Ib()},_b=()=>{const{chatWidget:e}=ge(),t=Ls();Tu(!0),kb(),Dv(e()?._id,t.contactId,t.interactionId).finally(()=>{Cu({}),Tu(!1),Mu(),Ou(!1),Ru()}),he("onReset")},Mu=()=>{const{chatWidget:e}=ge();if(Eu().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Fs({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},qt=()=>({getMessages:Eu,pushMessage:Mb,maybeAutostart:Ru,clearMessages:_b,addBalloonMessage:Mu,onMessage:Rb,typing:$b,loading:Db});var Lb=W("<span>");const Nb=()=>{const{clearMessages:e}=qt();L(!1);const[t,n]=L(!1);return v(Ev,{get open(){return t()},onOpenChange:n,get children(){return[v(Pv,{get children(){return v(Je,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return v(Cp,{size:20})}})}}),v(Cv,{get children(){return v(kv,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[v(Pp,{size:14}),(()=>{var r=Lb();return B(r,()=>kn("restart")),r})()]}})}})]}})};function Fb(e){return Ke({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 Vb(e){return Ke({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 Bb(e){return Ke({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 Kb(e){return Ke({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 zb=W('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Bs=()=>{const{chatWidget:e}=ge(),[t,n]=L(!1);let r=null;an(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&l()});const o=h=>{const g=h;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async h=>{const g=h;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=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)},c=h=>{h.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},l=async()=>{try{const h=Hr();if(!h)return;if(!t())o(h)&&await i(h)||a(h);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||c(h)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},u=()=>{const h=document,g=!!(document.fullscreenElement||h.webkitFullscreenElement||h.msFullscreenElement);if(n(g),!g)try{const f=Hr();f.classList.contains("st-fullscreen")&&c(f)}catch{}};document.addEventListener("fullscreenchange",u),document.addEventListener("webkitfullscreenchange",u);const d=()=>{e()?.mode==="popup"&&he("close")};return pe("toggleFullscreen",()=>{l()}),(()=>{var h=zb(),g=h.firstChild;return B(h,v(Sp,{}),g),B(g,v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:l,get children(){return v(ie,{get when(){return t()},get fallback(){return v(Vb,{size:16})},get children(){return v(Fb,{size:16})}})}}),null),B(g,v(ie,{get when(){return e()?.showSettings},get children(){return v(Nb,{})}}),null),B(g,v(ie,{get when(){return e()?.mode==="popup"},get children(){return v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:d,get children(){return v(Kb,{size:16})}})}}),null),h})()};var Ub=W("<span>");const Iu=({createdAt:e,anchor:t="end"})=>(()=>{var n=Ub();return ln(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),B(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var jb=W('<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 Wb=({children:e,createdAt:t})=>(()=>{var n=jb(),r=n.firstChild;return B(r,e),B(n,v(Iu,{createdAt:t,anchor:"start"}),null),n})();var Hb=W("<span>");const Bn=e=>{const[,t]=J(e,["class","children"]);let n=e.children?.toString();return n&&(n=Zh(Jh(n))),(()=>{var r=Hb();return r.innerHTML=n,un(r,N({get class(){return zt("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Yb=W('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const qb=({options:e,text:t})=>{let n;const{pushMessage:r}=qt(),[o,i]=L(!1),s=(a,c)=>{i(!0),r(a,c)};return(()=>{var a=Yb(),c=a.firstChild,l=c.firstChild;B(a,v(Bn,{get children(){return t?.trim()}}),c);var u=n;return typeof u=="function"?Ki(u,l):n=l,B(l,v(cn,{each:e,children:d=>v(Je,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 text-nowrap",onClick:()=>s(d.label,d.value),get children(){return d.label?.trim()}})})),ye(()=>ln(c,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Gb=W('<div class="flex flex-col"><span>'),Xb=W("<a target=_blank><img><span></span><span>");const Zb=({options:e,text:t})=>(()=>{var n=Gb(),r=n.firstChild;return B(r,()=>t?.trim()),B(n,v(cn,{each:e,children:o=>(()=>{var i=Xb(),s=i.firstChild,a=s.nextSibling,c=a.nextSibling;return B(a,()=>o.title?.trim()),B(c,()=>o.description?.trim()),ye(l=>{var u=o.url,d=o.image;return u!==l.e&&ke(i,"href",l.e=u),d!==l.t&&ke(s,"src",l.t=d),l},{e:void 0,t:void 0}),i})()}),null),n})();var Jb=W("<a target=_blank>");const Qb=({url:e,text:t})=>(()=>{var n=Jb();return ke(n,"href",e),B(n,()=>t?.trim()),n})();var ce=e=>typeof e=="function"?e():e,_u=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),ew=e=>{const t=N({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[_(()=>{if(n())return ce(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Lu=ew,Cr=e=>typeof e=="function",tw=["button","color","file","image","reset","submit"],nw=(e,t)=>e==="button"?!0:e==="input"&&t?tw.indexOf(t)!==-1:!1;function rw(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>ne(()=>{let a;return Cr(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Ks=rw,Io=new Map,_o=(e,t)=>{if(Io.has(e))return Io.get(e);const n=xe(t);return Io.set(e,n),n},zs=e=>{const t=Io.get(e);if(t)return Ce(t)},Lo=new Map,ow=e=>{V(()=>{const t=ce(e.style)??{},n=ce(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Lo.get(e.key);o?o.activeCount++:Lo.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);Y(()=>{const i=Lo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Lo.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},iw=ow,sw=e=>{const t=N({enabled:!0},e);V(()=>{ce(t.enabled)&&(document.addEventListener("keydown",n),Y(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},aw=sw,cw=e=>{const t=N({enabled:!0},e);V(()=>{const{body:n}=document;ce(t.enabled)&&iw({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},lw=cw,uw=e=>{const t=N({enabled:!0,strategy:"pointerup"},e);V(()=>{if(!ce(t.enabled))return;const r=ce(t.strategy);document.addEventListener(r,n),Y(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=ce(t.element),i=ce(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},dw=uw,fw=e=>{const t=N({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);aw({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),dw({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}),lw({enabled:t.noOutsidePointerEvents})},hw=fw,Us=xe(),gw=e=>_(()=>{if(Ce(Us))return v(Nu,e);const r=Be(),[o,i]=L([r]),s=c=>{i(l=>[...l,c])},a=c=>{i(l=>l.filter(u=>u!==c))};return v(Us.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return v(Nu,e)}})}),Nu=e=>{const t=N({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=J(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=Ce(Us),i=Be();V(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;hw({dismissOnEscapeKeyDown:()=>ce(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>ce(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>ce(n.noOutsidePointerEvents)&&n.enabled,onDismiss:l=>{n.onDismiss(l)},...r});const a=_(()=>n.children),c=()=>{const l=a();return Cr(l)?l({get isLastLayer(){return s()}}):l};return ne(()=>c())},pw=gw,mw=()=>{const[e,t]=L(!1);return V(()=>t(!0)),e},yw=mw,vw=(e,t)=>(e&&(Cr(e)?e(t):e[0](e[1],t)),t.defaultPrevented),js=(...e)=>e.some(t=>!!t()),bw=e=>(...t)=>{for(const n of e)n&&n(...t)},No=(...e)=>bw(e),we=e=>e?"":void 0,ww="div",xw=e=>{const[t,n]=J(e,["as"]),r=_(()=>t.as??ww);return _(()=>{const i=r();switch(typeof i){case"function":return ne(()=>i(n));case"string":return v(dr,N({component:i},n))}})},Ws=xw,Sw=e=>{let t,n=!1;return()=>n?t:(n=!0,t=_(e))},Fu=Sw,Ew=e=>_(()=>ce(e.element)?.tagName.toLowerCase()||e.fallback),Pw=Ew,Vu="button",Cw=e=>{const[t,n]=L(null),[r,o]=J(e,["as","ref","type"]),i=Pw({element:t,fallback:Vu}),s=_(()=>nw(i(),r.type));return v(Ws,N({get as(){return r.as??Vu},ref(a){var c=No(n,r.ref);typeof c=="function"&&c(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},kw=Cw,Ow='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"])',Hs="focusTrap.initialFocus",Ys="focusTrap.finalFocus",Bu={bubbles:!1,cancelable:!0},Tw=e=>{const t=N({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=_(()=>{const f=n();return f?f[0]??null:null}),i=_(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{ls(()=>{c(de(t.element)),(document.activeElement===null||document.activeElement===document.body)&&l(de(t.element))})};V(()=>{const f=de(t.element);if(f&&de(t.enabled)){s=document.activeElement,ne(()=>{c(f),l(f)});const p=new MutationObserver(a);de(t.observeChanges)&&p.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),Y(()=>{de(t.observeChanges)&&p.disconnect(),r(null),g(f)})}}),V(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),Y(()=>{document.removeEventListener("keydown",h)}))}),V(()=>{const f=o();f&&(f.addEventListener("keydown",u),Y(()=>{f.removeEventListener("keydown",u)}))}),V(()=>{const f=i();f&&(f.addEventListener("keydown",d),Y(()=>{f.removeEventListener("keydown",d)}))});const c=f=>{const p=Array.from(f.querySelectorAll(Ow)).map((m,y)=>({element:m,domIndex:y,tabIndex:m.tabIndex})).sort((m,y)=>m.tabIndex===y.tabIndex?m.domIndex-y.domIndex:m.tabIndex-y.tabIndex);r(p.map(({element:m})=>m))},l=f=>{ls(()=>{const p=de(t.initialFocusElement)??o()??f,m=t.onInitialFocus;let y;m&&(y=new CustomEvent(Hs,Bu),f.addEventListener(Hs,m),f.dispatchEvent(y),f.removeEventListener(Hs,m)),y?.defaultPrevented!==!0&&p.focus()})},u=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},d=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},g=f=>{ls(()=>{if(!de(t.restoreFocus))return;const m=de(t.finalFocusElement)??s;if(!m)return;let y;const b=t.onFinalFocus;b&&(y=new CustomEvent(Ys,Bu),f.addEventListener(Ys,b),f.dispatchEvent(y),f.removeEventListener(Ys,b)),y?.defaultPrevented!==!0&&m.focus()})}},Aw=Tw,$w=Aw,Dw=e=>{const t=_(()=>{const s=de(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(de(e.show)?"present":"hidden");let i="none";return V(s=>{const a=de(e.show);return ne(()=>{if(s===a)return a;const c=i,l=n();a?o("present"):l==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&c!==l?"hiding":"hidden")}),a}),V(()=>{const s=de(e.element);if(!s)return;const a=l=>{l.target===s&&(i=n())},c=l=>{const d=n().includes(l.animationName);l.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c),Y(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",c),s.removeEventListener("animationend",c)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},Rw=Dw,Ku=Rw,Mw=xe(),Iw=e=>e?_o(`dialog-${e}`):Mw,zu=xe(),_w=e=>e?_o(`dialog-internal-${e}`):zu,Kn=e=>{if(!e){const n=Ce(zu);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=zs(`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},Lw="div",Nw=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().contentPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return v(pw,{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:s=>{const a=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ws,N({ref(c){var l=No(r().setContentRef,t.ref);typeof l=="function"&&l(c)},get as(){return t.as??Lw},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 we(r().open())},get"data-closed"(){return we(!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":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},Fw=Nw,Vw="div",Bw=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().overlayPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return(()=>{const s=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ws,N({get as(){return t.as??Vw},ref(a){var c=No(r().setOverlayRef,t.ref);typeof c=="function"&&c(a)},"aria-hidden":"true",get"data-open"(){return we(r().open())},get"data-closed"(){return we(!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 s()}}))}})})()}})},Kw=Bw,zw=e=>{const[t,n]=J(e,["forceMount","contextId","children"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=yw(),s=_(a=>a||o()&&i(),!1);return v(ie,{get when(){return s()},get children(){return(()=>{const a=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Mc,N(n,{get children(){return a()}}))}})})()}})},Uw=zw,qs=!0,jw=e=>{const t=N({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??qs),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??qs),preventScroll:()=>!!(e.modal??qs),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Be()},e),[n,r]=Ks({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Lu({value:()=>t.labelId??Be()}),[a,c,l]=Lu({value:()=>t.descriptionId??Be()}),[u,d]=L(null),[h,g]=L(null),[f,p]=L(null),{present:m}=Ku({show:n,element:h}),{present:y}=Ku({show:n,element:f});$w({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ml({element:h,enabled:()=>m()&&ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return ce(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return ce(t.noOutsidePointerEvents)},get preventScroll(){return ce(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return ce(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 y()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},x=Fu(()=>t.children),w=()=>{const S=x()();return Cr(S)?S(b):S};return _(()=>{const S=Iw(t.contextId),O=_w(t.contextId);return v(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(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:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return v(O.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(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:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:c,unregisterDescriptionId:l,setContentRef:g,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return ne(()=>w())}})}})})},Ww=jw,Hw="button",Yw=e=>{const[t,n]=J(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=_(()=>Kn(t.contextId));return v(kw,N({ref(i){var s=No(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??Hw},onClick:i=>{!vw(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return we(r().open())},get"data-closed"(){return we(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},qw=Yw,Fo=e=>typeof e=="function"?e():e,Uu=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Gw(e){const t=N({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;V(()=>{const l=Fo(t.element),u=Fo(t.enabled);if(!l||!u)return;const d=new ResizeObserver(a);d.observe(l),l.addEventListener("transitionend",c),Y(()=>{d.disconnect(),l.removeEventListener("transitionend",c),c()})});const a=([l])=>{if(n())return;const u=l.target,d=[u.offsetWidth,u.offsetHeight],h=Fo(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Ze(()=>{i(s),r(!0)}),Uu(()=>{i(d),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d:s?Vo(h,s)!==Vo(h,d)&&(Ze(()=>{i(Vo(h,s)),r(!0)}),Uu(()=>{i(Vo(h,d)),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d},c=()=>{if(!n())return;const l=Fo(t.element);l?s=[l.offsetWidth,l.offsetHeight]:s=null,Ze(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Vo=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Xw=Gw,Zw=Xw;const Jw=(e,t)=>e.length>0?()=>e(ne(t)):e;function Qw(e,t){let n=0;const r=e.map((o,i)=>_(()=>(n=i,o()),void 0,Hi));return _(()=>r.map(o=>o())[n],void 0,t)}function ju(e,t,n){let r=()=>t;const[o,i]=L(t,Hi),s=_(Jw(e,()=>r()),t,Hi);return[r=Qw([o,s],n),(a=>i(()=>typeof a=="function"?a(ne(r)):a))]}var e0=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},t0=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},n0=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=e0(o,t),d=u-c-r*l;(l!==0||d!==0)&&t0(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},r0=e=>v(qw,N({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Wu=xe(),o0=e=>e?_o(`drawer-${e}`):Wu,i0=e=>{if(!e){const n=Ce(Wu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=zs(`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},Hu=xe(),s0=e=>e?_o(`drawer-internal-${e}`):Hu,Yu=e=>{if(!e){const n=Ce(Hu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=zs(`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},qu=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Bo(e,t)};const o=r[n-1]?Bo(r[n-1],t):void 0,i=r[n]?Bo(r[n],t):void 0;return{value:e,offset:Bo(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Bo=(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)},a0=(e,t,n,r)=>{const o=Gu("upper",e,r?n:t),i=Gu("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Gu=(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),c0=(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},l0=void 0,u0=e=>{const t=N({initialOpen:!1,snapPoints:[0,1],breakPoints:[l0],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,j)=>{const G=F/j;return G<1&&G>-1?1:G},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,i]=Ks({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Ks({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[c,l]=L(),{transitioning:u,transitionSize:d}=Zw({element:()=>c()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,g]=L(!1),[f,p]=ju(()=>u()?"resizing":null),m=_(()=>{const F=c()?.contentRef();if(F)return getComputedStyle(F)}),[y,b]=L(!1);V(()=>{const F=o();ne(()=>{y()!==F&&(F?(b(!0),_u(()=>{Ze(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(Ze(()=>{p("closing"),a(0)}),_u(()=>{parseFloat(m().transitionDuration)===0&&x()})))})});const x=()=>{Ze(()=>{b(!1),p(null)})},[w,C]=L(0);V(()=>{const F=c()?.contentRef();if(!F)return;O(F);const j=new ResizeObserver(S);j.observe(F),Y(()=>{j.disconnect()})});const S=F=>{for(const j of F)j.target===c()?.contentRef()&&O(j.target)},O=F=>{const j=ne(()=>w());switch(n.side){case"top":case"bottom":if(j===F.offsetHeight)return;C(F.offsetHeight);break;case"left":case"right":if(j===F.offsetWidth)return;C(F.offsetWidth);break}},D=_(()=>qu(s(),w())),[P,T]=ju(()=>D().offset),I=_(()=>w()?(w()-P())/w():0),$={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return I()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},K=Fu(()=>n.children),U=F=>{l(Kn(n.contextId));const j=K()();if(Cr(j)){const G=N(F,$);return j(G)}return j};return _(()=>{const F=o0(n.contextId),j=s0(n.contextId);return ne(()=>v(F.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return v(j.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:T,drawerSize:w,resolvedActiveSnapPoint:D,drawerStyles:m,setTransitionState:p,transitionSize:d,closeDrawer:x}},get children(){return v(Ww,N({get open(){return y()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:G=>U(G)}))}})}}))})},d0=u0,f0=e=>{const[t,n]=J(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const c=_(()=>Yu(t.contextId)),l=_(()=>Kn(t.contextId)),u=_(()=>c().snapPoints().map((x,w)=>qu(x,c().drawerSize(),w,c().breakPoints()))),d=_(()=>{switch(c().side()){case"top":return`translate3d(0, ${-c().translate()}px, 0)`;case"bottom":return`translate3d(0, ${c().translate()}px, 0)`;case"right":return`translate3d(${c().translate()}px, 0, 0)`;case"left":return`translate3d(${-c().translate()}px, 0, 0)`}}),h=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"top":case"bottom":return`${x}px`}}),g=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"left":case"right":return`${x}px`}});V(()=>{l().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),Y(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=x=>{c0(x.target,l().contentRef())&&c().transitionState()!=="closing"&&(r=!0,c().handleScrollableElements()&&(i=[x.clientX,x.clientY]))},p=x=>{y(x.target,x.clientX,x.clientY)},m=x=>{x.touches[0]&&y(x.target,x.touches[0].clientX,x.touches[0].clientY)},y=(x,w,C)=>{if(!r)return;if(!c().isDragging()||o===null){const D=window.getSelection();if(D&&D.toString().length>0){b();return}if(c().handleScrollableElements()){const P=[w,C].map((Q,F)=>i[F]-Q),T=Math.abs(P[0])>Math.abs(P[1])?"x":"y",I=T==="x"?P[0]:P[1];if(Math.abs(I)<.3)return;const $=l().contentRef(),[K,U]=n0(x,T,$);if(I>0&&Math.abs(K)>1||I<0&&Math.abs(U)>0){b();return}}switch(c().side()){case"top":case"bottom":o=C;break;case"right":case"left":o=w}s=new Date,a=c().translate(),Ze(()=>{c().setIsDragging(!0),c().setTransitionState(null)})}let S;switch(c().side()){case"top":S=-(o-C);break;case"bottom":S=o-C;break;case"right":S=o-w;break;case"left":S=-(o-w);break}S-=c().resolvedActiveSnapPoint().offset,S>0&&(S=c().dampFunction(S));const O=new Date;O.getTime()-s.getTime()>c().velocityCacheReset()&&(s=O,a=c().translate()),c().setTranslate(-S)},b=()=>{if(r=!1,!c().isDragging())return;const x=new Date,w=c().velocityFunction(-(a-c().translate()),x.getTime()-s.getTime()||1),C=c().translate()*w,S=a0(u(),c().translate(),C,c().allowSkippingSnapPoints());Ze(()=>{c().setTransitionState("snapping"),c().setIsDragging(!1)}),Ze(()=>{c().setActiveSnapPoint(S.value),S.offset===c().drawerSize()?l().setOpen(!1):(c().setTranslate(S.offset),parseFloat(c().drawerStyles().transitionDuration)===0&&c().setTransitionState(null))})};return v(Fw,N({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":c().isDragging()?"0ms":void 0,height:h(),width:g(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ze(()=>{c().transitionState()==="closing"&&c().closeDrawer(),c().transitionState()!=="resizing"&&c().setTransitionState(null)})},get"data-transitioning"(){return we(c().isTransitioning())},get"data-opening"(){return we(c().transitionState()==="opening")},get"data-closing"(){return we(c().transitionState()==="closing")},get"data-snapping"(){return we(c().transitionState()==="snapping")},get"data-resizing"(){return we(c().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},h0=f0,g0=e=>{const[t,n]=J(e,["contextId"]),r=_(()=>Yu(t.contextId));return v(Kw,N({get contextId(){return t.contextId},get"data-transitioning"(){return we(r().isTransitioning())},get"data-opening"(){return we(r().transitionState()==="opening")},get"data-closing"(){return we(r().transitionState()==="closing")},get"data-snapping"(){return we(r().transitionState()==="snapping")},get"data-resizing"(){return we(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},p0=g0,m0=W('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const y0=d0,v0=r0,b0=Uw,w0=e=>{const[,t]=J(e,["class"]),n=i0();return v(p0,N({get class(){return zt("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))},x0=e=>{const[,t]=J(e,["class","children"]);return v(b0,{get mount(){return Hr()},get children(){return[v(w0,{}),v(h0,N({id:"smarttalks-list-content",get class(){return zt("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[m0(),Ut(()=>e.children)]}}))]}})};var S0=W('<span class="font-semibold mt-2">'),E0=W('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),P0=W('<div class="flex flex-col space-y-2"><div>'),C0=W('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),k0=W('<div class="flex flex-col items-start"><span class=text-slate-500>');const O0=({options:e,text:t,title:n})=>{const{pushMessage:r}=qt(),[o,i]=L(!1),[s,a]=L(!1),[c,l]=L(),u=(h,g)=>{a(!1),i(!0),r(h,g)},d=h=>{const g=h.composedPath();for(const f of g)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=P0(),g=h.firstChild;return B(h,v(Bn,{get children(){return t?.trim()}}),g),B(g,v(y0,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[v(v0,{as:Je,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??kn("selectOption")}}),v(x0,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=S0();return B(f,()=>n?.trim()??kn("selectOption")),f})(),(()=>{var f=E0();return B(f,v(cn,{each:e,children:p=>(()=>{var m=C0(),y=m.firstChild;return B(y,()=>p.label?.trim()??""),B(m,v(cn,{get each(){return p.items},children:b=>v(Je,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${c()===b?"bg-slate-200":""}`},onClick:()=>l(b),get children(){return[(()=>{var x=k0(),w=x.firstChild;return B(x,()=>b.label?.trim(),w),B(w,()=>b.description?.trim()),x})(),v(ie,{get when(){return c()===b},get fallback(){return v(xv,{class:"size-4 text-slate-500"})},get children(){return v(wv,{class:"size-4 text-slate-500"})}})]}})}),null),m})()})),f})(),v(Je,{get disabled(){return o()||!c()},onClick:()=>u(c().label,c().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return kn("send")}})]}})]}})),ye(()=>ln(g,o()?"opacity-50":"")),h})()};var T0=W("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const A0=e=>(()=>{var t=T0(),n=t.firstChild,r=n.nextSibling;return ye(o=>{var i=e.link,s=e.link;return i!==o.e&&ke(n,"src",o.e=i),s!==o.t&&ke(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var $0=W('<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 D0=e=>(()=>{var t=$0(),n=t.firstChild,r=n.firstChild;return B(n,v(Sv,{class:"size-10"}),r),B(r,()=>e.filename?.trim()),B(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(()=>ke(n,"href",e.link)),t})();var R0=W('<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 M0=e=>(()=>{var t=R0(),n=t.firstChild,r=n.firstChild;return B(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ke(n,"href",o.e=i),s!==o.t&&ke(r,"src",o.t=s),a!==o.a&&ke(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var I0=W('<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 _0=e=>(()=>{var t=I0(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return B(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(i=>{var s=e.link,a=e.link;return s!==i.e&&ke(r,"src",i.e=s),a!==i.t&&ke(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var L0=W("<div>Media type not supported");const Xu=e=>e.type==="image"?v(M0,e):e.type==="audio"?v(A0,e):e.type==="document"?v(D0,e):e.type==="video"?v(_0,e):L0(),Gs=({text:e})=>v(Bn,{get children(){return e?.trim()}});var pt=()=>(e,t)=>J(e,t);function N0(e){return e==null?[]:Array.isArray(e)?e:[e]}var F0=e=>e[e.length-1],V0=e=>Array.from(new Set(e));function Zu(e,t){return e.reduce((n,r,o)=>(o%t===0?n.push([r]):F0(n)?.push(r),n),[])}var Ju=e=>e?.constructor.name==="Array",B0=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ko(e[n],t[n]))return!1;return!0},Ko=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Ju(e)&&Ju(t))return B0(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Ko(e[i],t[i]))return!1}return!0},K0=e=>Array.isArray(e),Qu=e=>e!=null&&typeof e=="object",z0=e=>Qu(e)&&!K0(e),U0=e=>typeof e=="number"&&!Number.isNaN(e),zn=e=>typeof e=="string",rt=e=>typeof e=="function",j0=e=>e==null,ed=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),W0=e=>Object.prototype.toString.call(e),td=Function.prototype.toString,H0=td.call(Object),Y0=e=>{if(!Qu(e)||W0(e)!="[object Object]"||X0(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=ed(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&td.call(n)==H0},q0=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,G0=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,X0=e=>q0(e)||G0(e),nd=()=>{},kr=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function Or(e,t,...n){if(e in t){const o=t[e];return rt(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,Or),r}var{min:Z0,max:J0}=Math,Q0=e=>Number.isNaN(e),rd=e=>Q0(e)?0:e,Xs=(e,t,n)=>{const r=rd(e),o=t==null||r>=t,i=n==null||r<=n;return o&&i},ex=(e,t,n)=>Z0(J0(rd(e),t),n);function Zs(e){if(!Y0(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Zs(o))}return n}function zo(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function od(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function Js(e,t){if(e==null)throw new Error(t())}function tx(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Gt(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=xe(i);function a(){const c=Ce(s);if(!c&&t){const l=new Error(o??tx(n,r));throw l.name="ContextError",ed(Error,"captureStackTrace")&&rt(Error.captureStackTrace)&&Error.captureStackTrace(l,a),l}return c}return[s.Provider,a,s]}Gt({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});var nx=e=>pt()(e,["lazyMount","unmountOnExit"]),rx=e=>typeof e=="function",id=(e,...t)=>rx(e)?e(...t):e;function ox(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var ix=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),sx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,sd=e=>{const t={};let n;for(;n=sx.exec(e);)t[n[1]]=n[2];return t},ax=(e,t)=>{if(zn(e)){if(zn(t))return`${e};${t}`;e=sd(e)}else zn(t)&&(t=sd(t));return Object.assign({},e??{},t??{})};function cx(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=kr(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=ix(t[o],n[o]);continue}if(o==="style"){t[o]=ax(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function lx(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((c,l)=>!Ko(r[l],c)))&&(r=s,o=t(s,i)),o}}var Xt=".",ad="#",cd=new WeakMap,ld=new WeakMap;function Qs(e){return e.join(Xt)}function ux(e){return e.includes(Xt)}function ud(e){return e.startsWith(ad)}function dx(e){return e.startsWith(Xt)}function fx(e){return ud(e)?e.slice(ad.length):e}function ea(e,t){return e?`${e}${Xt}${t}`:t}function hx(e){const t=new Map,n=new Map,r=(o,i)=>{t.set(o,i);const s=i.id;s&&(n.has(s)&&od(`[zag-js] Duplicate state id: "${s}"`),n.set(s,o));const a=i.states;if(a){Js(i.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),i.initial in a||od(`[zag-js] Compound state "${o}" has initial "${String(i.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const u=ea(o,c);r(u,l)}}};for(const[o,i]of Object.entries(e.states))i&&r(o,i);return{index:t,idIndex:n}}function Tr(e){const t=cd.get(e);if(t)return t;const{index:n,idIndex:r}=hx(e);return cd.set(e,n),ld.set(e,r),n}function gx(e,t){return Tr(e),ld.get(e)?.get(t)}function ta(e){return e?String(e).split(Xt).filter(Boolean):[]}function Uo(e,t){if(!t)return[];const n=Tr(e),r=ta(t),o=[],i=[];for(const s of r){i.push(s);const a=Qs(i),c=n.get(a);if(!c)break;o.push({path:a,state:c})}return o}function Ar(e,t){const n=Tr(e),r=ta(t);if(!r.length)return t;const o=[];for(const a of r){o.push(a);const c=Qs(o);if(!n.has(c))return t}let i=Qs(o),s=n.get(i);for(;s?.initial;){const a=`${i}${Xt}${s.initial}`,c=n.get(a);if(!c)break;i=a,s=c}return i}function dd(e,t){return Tr(e).has(t)}function fd(e,t,n){const r=String(t);if(ud(r)){const o=fx(r),i=gx(e,o);return Js(i,()=>`[zag-js] Unknown state id: "${o}"`),Ar(e,i)}if(dx(r)&&n){const o=ea(n,r.slice(1));return Ar(e,o)}if(!ux(r)&&n){const o=ta(n);for(let i=o.length-1;i>=1;i--){const s=o.slice(0,i).join(Xt),a=ea(s,r);if(dd(e,a))return Ar(e,a)}if(dd(e,r))return Ar(e,r)}return Ar(e,r)}function px(e,t,n){const r=Uo(e,t);for(let i=r.length-1;i>=0;i--){const a=r[i]?.state.on?.[n];if(a)return{transitions:a,source:r[i]?.path}}return{transitions:e.on?.[n],source:void 0}}function mx(e,t,n,r){const o=t?Uo(e,t):[],i=Uo(e,n);let s=0;for(;s<o.length&&s<i.length&&o[s]?.path===i[s]?.path;)s+=1;let a=o.slice(s).reverse(),c=i.slice(s);const l=o.at(-1)?.path===i.at(-1)?.path;return r&&l&&(a=o.slice().reverse(),c=i),{exiting:a,entering:c}}function yx(e,t){return e?e===t||e.startsWith(`${t}${Xt}`):!1}function vx(e,t,n){return Uo(e,t).some(r=>r.state.tags?.includes(n))}function bx(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function hd(e){return Tr(e),e}var Un=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Un||{}),jo="__init__",wx=Object.defineProperty,xx=(e,t,n)=>t in e?wx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,na=(e,t,n)=>xx(e,typeof t!="symbol"?t+"":t,n),gd=()=>{},Wo=e=>typeof e=="object"&&e!==null,z=e=>e?"":void 0,Se=e=>e?"true":void 0,Sx=1,Ex=9,Px=11,_e=e=>Wo(e)&&e.nodeType===Sx&&typeof e.nodeName=="string",ra=e=>Wo(e)&&e.nodeType===Ex,Cx=e=>Wo(e)&&e===e.window,pd=e=>_e(e)?e.localName||"":"#document";function kx(e){return["html","body","#document"].includes(pd(e))}var md=e=>Wo(e)&&e.nodeType!==void 0,jn=e=>md(e)&&e.nodeType===Px&&"host"in e,Ox=e=>_e(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Tx(e){if(!e)return!1;const t=e.getRootNode();return yd(t)===e}function Ho(e,t){if(!e||!t||!_e(e)||!md(t))return!1;if(_e(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&jn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function mn(e){return ra(e)?e:Cx(e)?e.document:e?.ownerDocument??document}function Ax(e){return mn(e).documentElement}function Ot(e){return jn(e)?Ot(e.host):ra(e)?e.defaultView??window:_e(e)?e.ownerDocument?.defaultView??window:window}function yd(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function $x(e){if(pd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jn(e)&&e.host||Ax(e);return jn(t)?t.host:t}function Dx(e){let t;try{if(t=e.getRootNode({composed:!0}),ra(t)||jn(t))return t}catch{}return e.ownerDocument??document}var oa=new WeakMap;function ia(e){return oa.has(e)||oa.set(e,Ot(e).getComputedStyle(e)),oa.get(e)}var Rx=new Set(["menu","listbox","dialog","grid","tree","region","application"]),Mx=e=>Rx.has(e),Ix=e=>e.getAttribute("aria-controls")?.split(" ")||[];function _x(e,t){const n=new Set,r=Dx(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const c=Ix(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const u=r.getElementById(l);if(u){const d=u.getAttribute("role"),h=u.getAttribute("aria-modal")==="true";if(d&&Mx(d)&&!h&&(u===t||u.contains(t)||o(u)))return!0}}}return!1};return o(e)}var vd=()=>typeof document<"u";function Lx(){return navigator.userAgentData?.platform??navigator.platform}var sa=e=>vd()&&e.test(Lx()),bd=()=>vd()&&!!navigator.maxTouchPoints,Nx=()=>sa(/^iPhone/i),Fx=()=>sa(/^iPad/i)||xd()&&navigator.maxTouchPoints>1,wd=()=>Nx()||Fx(),xd=()=>sa(/^Mac/i);function Vx(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Wn(e){return Vx(e)?.[0]??e.target}function Bx(e){return Ed(e).isComposing||e.keyCode===229}var Kx=e=>e.button===2||xd()&&e.ctrlKey&&e.button===0,zx={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Sd={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Ux(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=zx[o]??o,n==="rtl"&&r==="horizontal"&&o in Sd&&(o=Sd[o]),o}function Ed(e){return e.nativeEvent??e}var Yo=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function jx(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=Ot(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function Wx(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function qo(e,t,n="value"){if(!e)return;const r=Wx(e);r&&jx(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}var Hx="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Pd(e){return!_e(e)||e.closest("[inert]")?!1:e.matches(Hx)&&Ox(e)}var Yx=class vh{constructor(){na(this,"id",null),na(this,"fn_cleanup"),na(this,"cleanup",()=>{this.cancel()})}static create(){return new vh}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function Te(e){const t=Yx.create();return t.request(e),t.cleanup}function aa(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function ca(e){const t=$x(e);return kx(t)?mn(t).body:_e(t)&&Xx(t)?t:ca(t)}var qx=/auto|scroll|overlay|hidden|clip/,Gx=new Set(["inline","contents"]);function Xx(e){const t=Ot(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return qx.test(n+o+r)&&!Gx.has(i)}var Hn="default",la="",Go=new WeakMap;function Zx(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return wd()?(Hn==="default"&&(la=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Hn="disabled"):t&&(Go.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Cd({target:t,doc:r})}function Cd(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(wd()){if(Hn!=="disabled")return;Hn="restoring",setTimeout(()=>{aa(()=>{Hn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=la||""),la="",Hn="default")})},300)}else if(t&&Go.has(t)){const i=Go.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Go.delete(t)}}function Jx(e={}){const{defer:t,target:n,...r}=e,o=t?Te:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(Zx({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function Qx(e,t){return Array.from(e?.querySelectorAll(t)??[])}function e1(e,t){return e?.querySelector(t)??null}function kd(e,t){if(!e)return gd;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return t1(n,t)?gd:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function t1(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function n1(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{r.aborted||(clearTimeout(c),s(l))}).catch(l=>{r.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function r1(e,t){const{timeout:n,rootNode:r}=t,o=Ot(r),i=mn(r),s=new o.AbortController;return n1(new Promise(a=>{const c=e();if(c){a(c);return}const l=new o.MutationObserver(()=>{const u=e();u&&u.isConnected&&(l.disconnect(),a(u))});l.observe(i.body,{childList:!0,subtree:!0})}),s,n)}function o1(e){const t=()=>e.getRootNode?.()??document,n=()=>mn(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>yd(t()),isActiveElement:Tx,getById:s=>t().getElementById(s)}}var i1=hd({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e("onExitComplete")?.();const n=t.get("node");if(!n)return;const r=Ot(n),o=new r.CustomEvent("exitcomplete",{bubbles:!1});n.dispatchEvent(o)},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",ia(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Te(()=>{if(r("present"))return;const s=Xo(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{Te(()=>{e.set("prevAnimationName",Xo(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=l=>{(l.composedPath?.()?.[0]??l.target)===o&&e.set("prevAnimationName",Xo(t.get("styles")))},s=l=>{const u=Xo(t.get("styles"));Wn(l)===o&&u===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})},a=l=>{Wn(l)===o&&!r("present")&&n({type:"UNMOUNT",src:"animationcancel"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",s);const c=kd(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",s),aa(()=>c())}}}}});function Xo(e){return e?.animationName||"none"}function s1(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}function Zo(e){const t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=L(t),i=_(()=>e().value!=null),s={current:r()},a={current:void 0};V(()=>{const u=i()?e().value:r();a.current=u,s.current=u});const c=u=>{const d=a.current,h=rt(u)?u(s.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:h,prev:d}),i()||o(h),n(h,d)||e().onChange?.(h,d)};function l(){const u=i()?e().value:r;return rt(u)?u():u}return{initial:t,ref:s,get:l,set:c,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}Zo.cleanup=e=>{Y(()=>e())},Zo.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function a1(e){const t={current:e};return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}function ua(e){return rt(e)?e():e}var c1=(e,t)=>{let n=[],r=!0;V(()=>{if(r){n=e.map(i=>ua(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!Ko(n[i],ua(e[i]))){o=!0;break}o&&(n=e.map(i=>ua(i)),t())})};function Od(e,t={}){const n=_(()=>{const{id:D,ids:P,getRootNode:T}=da(t);return o1({id:D,ids:P,getRootNode:T})}),r=(...D)=>{e.debug&&console.log(...D)},o=_(()=>e.props?.({props:Zs(da(t)),scope:n()})??da(t)),i=l1(o),s=e.context?.({prop:i,bindable:Zo,get scope(){return n()},flush:Td,getContext(){return a},getComputed(){return w},getRefs(){return f},getEvent(){return h()}}),a={get(D){return s?.[D].get()},set(D,P){s?.[D].set(P)},initial(D){return s?.[D].initial},hash(D){const P=s?.[D].get();return s?.[D].hash(P)}},c={current:new Map},l={current:null},u={current:null},d={current:{type:""}},h=()=>N(d.current,{current(){return d.current},previous(){return u.current}}),g=()=>N(C,{matches(...D){const P=C.get();return D.some(T=>yx(P,T))},hasTag(D){const P=C.get();return vx(e,P,D)}}),f=a1(e.refs?.({prop:i,context:a})??{}),p=()=>({state:g(),context:a,event:h(),prop:i,send:O,action:m,guard:y,track:c1,refs:f,computed:w,flush:Td,get scope(){return n()},choose:x}),m=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map(I=>{const $=e.implementations?.actions?.[I];return $||zo(`[zag-js] No implementation found for action "${JSON.stringify(I)}"`),$});for(const I of T)I?.(p())},y=D=>{if(rt(D))return D(p());const P=e.implementations?.guards?.[D];return P||zo(`[zag-js] No implementation found for guard "${JSON.stringify(D)}"`),P?.(p())},b=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map($=>{const K=e.implementations?.effects?.[$];return K||zo(`[zag-js] No implementation found for effect "${JSON.stringify($)}"`),K}),I=[];for(const $ of T){const K=$?.(p());K&&I.push(K)}return()=>I.forEach($=>$?.())},x=D=>N0(D).find(P=>{let T=!P.guard;return zn(P.guard)?T=!!y(P.guard):rt(P.guard)&&(T=P.guard(p())),T}),w=D=>{Js(e.computed,()=>"[zag-js] No computed object found on machine");const P=e.computed[D];return P({context:a,event:d.current,prop:i,refs:f,scope:n(),computed:w})},C=Zo(()=>({defaultValue:fd(e,e.initialState({prop:i})),onChange(D,P){const{exiting:T,entering:I}=mx(e,P,D,l.current?.reenter);if(T.forEach($=>{c.current.get($.path)?.(),c.current.delete($.path)}),T.forEach($=>{m($.state?.exit)}),m(l.current?.actions),I.forEach($=>{const K=b($.state?.effects);if(K){const U=c.current.get($.path);c.current.set($.path,U?kr(U,K):K)}}),P===jo){m(e.entry);const $=b(e.effects);if($){const K=c.current.get(jo);c.current.set(jo,K?kr(K,$):$)}}I.forEach($=>{m($.state?.entry)})}}));let S=Un.NotStarted;an(()=>{const D=S===Un.Started;S=Un.Started,r(D?"rehydrating...":"initializing..."),C.invoke(C.initial,jo)}),Y(()=>{r("unmounting..."),S=Un.Stopped,c.current.forEach(P=>P?.()),c.current=new Map,l.current=null,m(e.exit)});const O=D=>{queueMicrotask(()=>{if(S!==Un.Started)return;u.current=d.current,d.current=D;let P=ne(()=>C.get());const{transitions:T,source:I}=px(e,P,D.type),$=x(T);if(!$)return;l.current=$;const K=fd(e,$.target??P,I);r("transition",D.type,$.target||P,`(${$.actions})`),K!==P?C.set(K):$.reenter?C.invoke(P,P):m($.actions)})};return e.watch?.(p()),{state:g(),send:O,context:a,prop:i,get scope(){return n()},refs:f,computed:w,event:h(),getStatus:()=>S}}function Td(e){e()}function da(e){return rt(e)?e():e}function l1(e){return function(n){return e()[n]}}function ee(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let c=e[a];typeof c=="function"&&(c=c()),s=cx(s,{[i]:(c||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let c,l=e[a];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}})}}return t}var Ad={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},u1=e=>e.startsWith("--")?e:y1(e);function d1(e){return e in Ad?Ad[e]:e}var f1=s1(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&z0(r)){t.style=h1(r);continue}if(n==="children"){zn(r)&&(t.textContent=r);continue}t[d1(n)]=r}}return t});function h1(e){let t={};for(const n in e){const r=e[n];!zn(r)&&!U0(r)||(t[u1(n)]=r)}return t}var g1=/[A-Z]/g,p1=/^ms-/;function m1(e){return"-"+e.toLowerCase()}var fa={};function y1(e){if(fa.hasOwnProperty(e))return fa[e];const t=e.replace(g1,m1);return fa[e]=p1.test(t)?"-"+t:t}var $d=e=>{const[t,n]=nx(id(e)),[r,o]=L(!1),i=Od(i1,e),s=_(()=>ox(i));V(()=>{s().present&&o(!0)});const a=c=>{c&&i.send({type:"NODE.SET",node:c})};return _(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,ref:a,presenceProps:{hidden:!s().present,"data-state":s().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))},v1=e=>typeof e=="function",Dd=(e,t)=>{for(const n of e)v1(n)&&n(t)};function b1(...e){let t=null;return V(()=>{Dd(e,t)}),n=>{t=n,Dd(e,n)}}var ha=e=>n=>{const[r,o]=J(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=J(o,["ref"]);return ee(a,s)};return r.asChild(i)}return v(dr,N({component:e},o))};function w1(){const e=new Map;return new Proxy(ha,{apply(t,n,r){return ha(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,ha(r)),e.get(r)}})}var re=w1(),Rd=e=>pt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),[Md,Id]=Gt({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),$r=(e,t=[])=>({parts:(...n)=>{if(x1(t))return $r(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>$r(e,[...t,...n]),omit:(...n)=>$r(e,t.filter(r=>!n.includes(r))),rename:n=>$r(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Yn(e)}"][data-part="${Yn(r)}"]`,`& [data-scope="${Yn(e)}"][data-part="${Yn(r)}"]`].join(", "),attrs:{"data-scope":Yn(e),"data-part":Yn(r)}}}),{})}),Yn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),x1=e=>e.length===0;const S1=["top","right","bottom","left"],Zt=Math.min,Le=Math.max,Jo=Math.round,Qo=Math.floor,mt=e=>({x:e,y:e}),E1={left:"right",right:"left",bottom:"top",top:"bottom"};function ga(e,t,n){return Le(e,Zt(t,n))}function Tt(e,t){return typeof e=="function"?e(t):e}function At(e){return e.split("-")[0]}function qn(e){return e.split("-")[1]}function pa(e){return e==="x"?"y":"x"}function ma(e){return e==="y"?"height":"width"}function yt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ya(e){return pa(yt(e))}function P1(e,t,n){n===void 0&&(n=!1);const r=qn(e),o=ya(e),i=ma(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ei(s)),[s,ei(s)]}function C1(e){const t=ei(e);return[va(e),t,va(t)]}function va(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _d=["left","right"],Ld=["right","left"],k1=["top","bottom"],O1=["bottom","top"];function T1(e,t,n){switch(e){case"top":case"bottom":return n?t?Ld:_d:t?_d:Ld;case"left":case"right":return t?k1:O1;default:return[]}}function A1(e,t,n,r){const o=qn(e);let i=T1(At(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(va)))),i}function ei(e){const t=At(e);return E1[t]+e.slice(t.length)}function $1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nd(e){return typeof e!="number"?$1(e):{top:e,right:e,bottom:e,left:e}}function ti(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 Fd(e,t,n){let{reference:r,floating:o}=e;const i=yt(t),s=ya(t),a=ma(s),c=At(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(qn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}async function D1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=Tt(t,e),f=Nd(g),m=a[h?d==="floating"?"reference":"floating":d],y=ti(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=ti(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-C.top+f.top)/w.y,bottom:(C.bottom-y.bottom+f.bottom)/w.y,left:(y.left-C.left+f.left)/w.x,right:(C.right-y.right+f.right)/w.x}}const R1=50,M1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:D1},c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fd(l,r,c),h=r,g=0;const f={};for(let p=0;p<i.length;p++){const m=i[p];if(!m)continue;const{name:y,fn:b}=m,{x,y:w,data:C,reset:S}=await b({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:l,platform:a,elements:{reference:e,floating:t}});u=x??u,d=w??d,f[y]={...f[y],...C},S&&g<R1&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=Fd(l,h,c)),p=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}},I1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Tt(e,t)||{};if(l==null)return{};const d=Nd(u),h={x:n,y:r},g=ya(o),f=ma(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",b=m?"bottom":"right",x=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=w/2-C/2,P=O/2-p[f]/2-1,T=Zt(d[y],P),I=Zt(d[b],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=ga($,U,K),F=!c.arrow&&qn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,j=F?U<$?U-$:U-K:0;return{[g]:h[g]+j,data:{[g]:Q,centerOffset:U-Q-j,...F&&{alignmentOffset:j}},reset:F}}}),_1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=Tt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=At(o),b=yt(a),x=At(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[ei(a)]:C1(a)),S=f!=="none";!h&&S&&C.push(...A1(a,p,f,w));const O=[a,...C],D=await c.detectOverflow(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&P.push(D[y]),d){const U=P1(o,s,w);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q&&(!(d==="alignment"?b!==yt(Q):!1)||T.every(G=>yt(G.placement)===b?G.overflows[0]>0:!0)))return{data:{index:U,overflows:T},reset:{placement:Q}};let F=($=T.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(g){case"bestFit":{var K;const j=(K=T.filter(G=>{if(S){const q=yt(G.placement);return q===b||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];j&&(F=j);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Vd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bd(e){return S1.some(t=>e[t]>=0)}const L1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Tt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Vd(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Bd(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Vd(s,n.floating);return{data:{escapedOffsets:a,escaped:Bd(a)}}}default:return{}}}}},Kd=new Set(["left","top"]);async function N1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=At(n),a=qn(n),c=yt(n)==="y",l=Kd.has(s)?-1:1,u=i&&c?-1:1,d=Tt(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*u,y:h*l}:{x:h*l,y:g*u}}const F1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await N1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},V1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=Tt(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),h=yt(At(o)),g=pa(h);let f=u[g],p=u[h];if(s){const y=g==="y"?"top":"left",b=g==="y"?"bottom":"right",x=f+d[y],w=f-d[b];f=ga(x,f,w)}if(a){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[y],w=p-d[b];p=ga(x,p,w)}const m=c.fn({...t,[g]:f,[h]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:s,[h]:a}}}}}},B1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Tt(e,t),u={x:n,y:r},d=yt(o),h=pa(d);let g=u[h],f=u[d];const p=Tt(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=h==="y"?"height":"width",w=i.reference[h]-i.floating[x]+m.mainAxis,C=i.reference[h]+i.reference[x]-m.mainAxis;g<w?g=w:g>C&&(g=C)}if(l){var y,b;const x=h==="y"?"width":"height",w=Kd.has(At(o)),C=i.reference[d]-i.floating[x]+(w&&((y=s.offset)==null?void 0:y[d])||0)+(w?0:m.crossAxis),S=i.reference[d]+i.reference[x]+(w?0:((b=s.offset)==null?void 0:b[d])||0)-(w?m.crossAxis:0);f<C?f=C:f>S&&(f=S)}return{[h]:g,[d]:f}}}},K1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=Tt(e,t),u=await s.detectOverflow(t,l),d=At(o),h=qn(o),g=yt(o)==="y",{width:f,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=h==="end"?"top":"bottom");const b=p-u.top-u.bottom,x=f-u.left-u.right,w=Zt(p-u[m],b),C=Zt(f-u[y],x),S=!t.middlewareData.shift;let O=w,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=b),S&&!h){const T=Le(u.left,0),I=Le(u.right,0),$=Le(u.top,0),K=Le(u.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Le(u.left,u.right)):O=p-2*($!==0||K!==0?$+K:Le(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function ni(){return typeof window<"u"}function Gn(e){return zd(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vt(e){var t;return(t=(zd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zd(e){return ni()?e instanceof Node||e instanceof Ne(e).Node:!1}function ot(e){return ni()?e instanceof Element||e instanceof Ne(e).Element:!1}function $t(e){return ni()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function Ud(e){return!ni()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}function Dr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=it(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function z1(e){return/^(table|td|th)$/.test(Gn(e))}function ri(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const U1=/transform|translate|scale|rotate|perspective|filter/,j1=/paint|layout|strict|content/,yn=e=>!!e&&e!=="none";let ba;function wa(e){const t=ot(e)?it(e):e;return yn(t.transform)||yn(t.translate)||yn(t.scale)||yn(t.rotate)||yn(t.perspective)||!xa()&&(yn(t.backdropFilter)||yn(t.filter))||U1.test(t.willChange||"")||j1.test(t.contain||"")}function W1(e){let t=Jt(e);for(;$t(t)&&!Xn(t);){if(wa(t))return t;if(ri(t))return null;t=Jt(t)}return null}function xa(){return ba==null&&(ba=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ba}function Xn(e){return/^(html|body|#document)$/.test(Gn(e))}function it(e){return Ne(e).getComputedStyle(e)}function oi(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(Gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ud(e)&&e.host||vt(e);return Ud(t)?t.host:t}function jd(e){const t=Jt(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:$t(t)&&Dr(t)?t:jd(t)}function Rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=jd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Sa(s);return t.concat(s,s.visualViewport||[],Dr(o)?o:[],a&&n?Rr(a):[])}else return t.concat(o,Rr(o,[],n))}function Sa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wd(e){const t=it(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$t(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Jo(n)!==i||Jo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ea(e){return ot(e)?e:e.contextElement}function Zn(e){const t=Ea(e);if(!$t(t))return mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Wd(t);let s=(i?Jo(n.width):n.width)/r,a=(i?Jo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const H1=mt(0);function Hd(e){const t=Ne(e);return!xa()||!t.visualViewport?H1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Y1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ea(e);let s=mt(1);t&&(r?ot(r)&&(s=Zn(r)):s=Zn(e));const a=Y1(i,n,r)?Hd(i):mt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=Ne(i),g=r&&ot(r)?Ne(r):r;let f=h,p=Sa(f);for(;p&&r&&g!==f;){const m=Zn(p),y=p.getBoundingClientRect(),b=it(p),x=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,w=y.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=w,f=Ne(p),p=Sa(f)}}return ti({width:u,height:d,x:c,y:l})}function ii(e,t){const n=oi(e).scrollLeft;return t?t.left+n:vn(vt(e)).left+n}function Yd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ii(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function q1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=vt(r),a=t?ri(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=mt(1);const u=mt(0),d=$t(r);if((d||!d&&!i)&&((Gn(r)!=="body"||Dr(s))&&(c=oi(r)),d)){const g=vn(r);l=Zn(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!i?Yd(s,c):mt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function G1(e){return Array.from(e.getClientRects())}function X1(e){const t=vt(e),n=oi(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ii(e);const a=-n.scrollTop;return it(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const qd=25;function Z1(e,t){const n=Ne(e),r=vt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const u=xa();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=ii(r);if(l<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,f=Math.abs(r.clientWidth-d.clientWidth-g);f<=qd&&(i-=f)}else l<=qd&&(i+=l);return{width:i,height:s,x:a,y:c}}function J1(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$t(e)?Zn(e):mt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Gd(e,t,n){let r;if(t==="viewport")r=Z1(e,n);else if(t==="document")r=X1(vt(e));else if(ot(t))r=J1(t,n);else{const o=Hd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ti(r)}function Xd(e,t){const n=Jt(e);return n===t||!ot(n)||Xn(n)?!1:it(n).position==="fixed"||Xd(n,t)}function Q1(e,t){const n=t.get(e);if(n)return n;let r=Rr(e,[],!1).filter(a=>ot(a)&&Gn(a)!=="body"),o=null;const i=it(e).position==="fixed";let s=i?Jt(e):e;for(;ot(s)&&!Xn(s);){const a=it(s),c=wa(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Dr(s)&&!c&&Xd(e,s))?r=r.filter(u=>u!==s):o=a,s=Jt(s)}return t.set(e,r),r}function eS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ri(t)?[]:Q1(t,this._c):[].concat(n),r],a=Gd(t,s[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let h=1;h<s.length;h++){const g=Gd(t,s[h],o);c=Le(g.top,c),l=Zt(g.right,l),u=Zt(g.bottom,u),d=Le(g.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function tS(e){const{width:t,height:n}=Wd(e);return{width:t,height:n}}function nS(e,t,n){const r=$t(t),o=vt(t),i=n==="fixed",s=vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=mt(0);function l(){c.x=ii(o)}if(r||!r&&!i)if((Gn(t)!=="body"||Dr(o))&&(a=oi(t)),r){const g=vn(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=o&&!r&&!i?Yd(o,a):mt(0),d=s.left+a.scrollLeft-c.x-u.x,h=s.top+a.scrollTop-c.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function Pa(e){return it(e).position==="static"}function Zd(e,t){if(!$t(e)||it(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vt(e)===n&&(n=n.ownerDocument.body),n}function Jd(e,t){const n=Ne(e);if(ri(e))return n;if(!$t(e)){let o=Jt(e);for(;o&&!Xn(o);){if(ot(o)&&!Pa(o))return o;o=Jt(o)}return n}let r=Zd(e,t);for(;r&&z1(r)&&Pa(r);)r=Zd(r,t);return r&&Xn(r)&&Pa(r)&&!wa(r)?n:r||W1(e)||n}const rS=async function(e){const t=this.getOffsetParent||Jd,n=this.getDimensions,r=await n(e.floating);return{reference:nS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oS(e){return it(e).direction==="rtl"}const iS={convertOffsetParentRelativeRectToViewportRelativeRect:q1,getDocumentElement:vt,getClippingRect:eS,getOffsetParent:Jd,getElementRects:rS,getClientRects:G1,getDimensions:tS,getScale:Zn,isElement:ot,isRTL:oS};function Qd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sS(e,t){let n=null,r;const o=vt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=Qo(d),p=Qo(o.clientWidth-(u+h)),m=Qo(o.clientHeight-(d+g)),y=Qo(u),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Le(0,Zt(1,c))||1};let w=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!w)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Qd(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function aS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Ea(e),u=o||i?[...l?Rr(l):[],...t?Rr(t):[]]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?sS(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let f,p=c?vn(e):null;c&&m();function m(){const y=vn(e);p&&!Qd(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const cS=F1,lS=V1,uS=_1,dS=K1,fS=L1,hS=I1,gS=B1,pS=(e,t,n)=>{const r=new Map,o={platform:iS,...n},i={...o.platform,_c:r};return M1(e,t,{...o,platform:i})};function ef(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function mS(e){if(!e)return ef();const{x:t,y:n,width:r,height:o}=e;return ef(t,n,r,o)}function yS(e,t){return{contextElement:_e(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?mS(r):n.getBoundingClientRect()}}}var Mr=e=>({variable:e,reference:`var(${e})`}),Dt={arrowSize:Mr("--arrow-size"),arrowSizeHalf:Mr("--arrow-size-half"),arrowBg:Mr("--arrow-background"),transformOrigin:Mr("--transform-origin"),arrowOffset:Mr("--arrow-offset")},vS=e=>e==="top"||e==="bottom"?"y":"x";function bS(e,t){return{name:"transformOrigin",fn(n){const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,c=i.split("-")[0],l=vS(c),u=o.arrow?.x||0,d=o.arrow?.y||0,h=t?.clientWidth||0,g=t?.clientHeight||0,f=u+h/2,p=d+g/2,m=Math.abs(o.shift?.y||0),y=s.reference.height/2,b=g/2,x=e.offset?.mainAxis??e.gutter,w=typeof x=="number"?x+b:x??b,C=m>w,S={top:`${f}px calc(100% + ${w}px)`,bottom:`${f}px ${-w}px`,left:`calc(100% + ${w}px) ${p}px`,right:`${-w}px ${p}px`}[c],O=`${f}px ${s.reference.y+y-a}px`,D=!!e.overlap&&l==="y"&&C;return r.floating.style.setProperty(Dt.transformOrigin.variable,D?O:S),{data:{transformOrigin:D?O:S}}}}}var wS={name:"rects",fn({rects:e}){return{data:e}}},xS=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Dt.arrowOffset.reference})`}),{}}}};function SS(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function ES(e){return e.split("-")[0]}var PS={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function tf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Jn(e,t){return e!=null&&Math.abs(e-t)<.5}function si(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function CS(e,t,n){const r=e||t.createElement("div");return hS({element:r,padding:n.arrowPadding})}function kS(e,t){if(!j0(t.offset??t.gutter))return cS(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=SS(n),a=s?void 0:t.shift,c=t.offset?.crossAxis??a;return Zs({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function OS(e){if(e.flip)return uS(()=>{const t=si(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function TS(e){if(!(!e.slide&&!e.overlap))return lS(()=>{const t=si(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:gS()}})}function AS(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,o;return dS(()=>{const i=si(e.boundary);return{padding:e.overflowPadding,...i?{boundary:i}:void 0,apply({elements:s,rects:a,availableHeight:c,availableWidth:l}){const u=s.floating,d=Math.round(a.reference.width),h=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),Jn(t,d)||(u.style.setProperty("--reference-width",`${d}px`),t=d),Jn(n,h)||(u.style.setProperty("--reference-height",`${h}px`),n=h),Jn(r,l)||(u.style.setProperty("--available-width",`${l}px`),r=l),Jn(o,c)||(u.style.setProperty("--available-height",`${c}px`),o=c)}}})}function $S(e){if(e.hideWhenDetached)return fS(()=>({strategy:"referenceHidden",boundary:si(e.boundary)??"clippingAncestors"}))}function DS(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var RS=["transform","visibility","pointer-events","--x","--y","--z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],MS=["top","right","bottom","left"];function nf(e,t){if(!e)return nd;const n=new Map(t.map(r=>[r,e.style.getPropertyValue(r)]));return()=>{n.forEach((r,o)=>{r?e.style.setProperty(o,r):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function rf(e){return e==null?null:_e(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function IS(e,t,n={}){const r=()=>(typeof t=="function"?t():t)??null,o=()=>{const T=typeof e=="function"?e():e;return n.getAnchorElement?.()??T},i=()=>{const T=o();return!T&&!n.getAnchorRect?null:yS(T,n.getAnchorRect)},s=Object.assign({},PS,n);let a=[],c=null,l,u;function d(T){l?.(),u?.(),c=T,l=s.restoreStyles?nf(T,RS):void 0;const I=T.querySelector("[data-part=arrow]");u=s.restoreStyles?nf(I,MS):void 0,a=[kS(I,s),OS(s),TS(s),CS(I,T.ownerDocument,s),xS(I),bS({gutter:s.gutter,offset:s.offset,overlap:s.overlap},I),AS(s),$S(s),wS]}const{placement:h,strategy:g,onComplete:f,onPositioned:p}=s;let m,y,b=!1,x,w,C=nd;const S=DS(s.listeners);function O(){if(!s.listeners)return;const T=o(),I=i(),$=r();if(!I||!$)return;(rf(T)!==rf(x)||$!==w)&&(C(),x=T,w=$,C=aS(I,$,P,S))}async function D(){O();const T=r();if(!T)return;T!==c&&(d(T),b=!1);const I=i();if(!I)return;const $=await pS(I,T,{placement:h,middleware:a,strategy:g});f?.($);const K=Ot(T),U=tf(K,$.x),Q=tf(K,$.y);if(Jn(m,U)||(T.style.setProperty("--x",`${U}px`),m=U),Jn(y,Q)||(T.style.setProperty("--y",`${Q}px`),y=Q),s.hideWhenDetached&&($.middlewareData.hide?.referenceHidden?(T.style.setProperty("visibility","hidden"),T.style.setProperty("pointer-events","none")):(T.style.removeProperty("visibility"),T.style.removeProperty("pointer-events"))),!b){const F=T.firstElementChild;F&&(T.style.setProperty("--z-index",ia(F).zIndex),b=!0)}}async function P(){n.updatePosition?(await n.updatePosition({updatePosition:D,floatingElement:r()}),p?.({placed:!0})):await D()}return P(),()=>{C(),u?.(),l?.(),p?.({placed:!1})}}function _S(e,t,n={}){const{defer:r,...o}=n,i=r?Te:a=>a(),s=[];return s.push(i(()=>{s.push(IS(e,t,o))})),()=>{s.forEach(a=>a?.())}}var LS={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function NS(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Dt.arrowSize.reference,height:Dt.arrowSize.reference,[Dt.arrowSizeHalf.variable]:`calc(${Dt.arrowSize.reference} / 2)`,[Dt.arrowOffset.variable]:`calc(${Dt.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?LS[t.split("-")[0]]:void 0,background:Dt.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function FS(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function VS(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var of="pointerdown.outside",sf="focus.outside";function BS(e){for(const t of e)if(_e(t)&&Pd(t))return!0;return!1}var af=e=>"clientY"in e;function KS(e,t){if(!af(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function zS(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function cf(e,t){if(!t||!af(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return zS(s,a)?r||i:!1}function US(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const c=mn(e),l=Ot(e),u=FS(l),d=VS(l);function h(w,C){if(!_e(C)||!C.isConnected||Ho(e,C)||KS(e,w)||a&&_x(e,C))return!1;const S=c.querySelector(`[aria-controls="${e.id}"]`);if(S){const D=ca(S);if(cf(w,D))return!1}const O=ca(e);return cf(w,O)?!1:!n?.(C)}const g=new Set,f=jn(e?.getRootNode());let p=!1;function m(w){p=!0;const C=()=>{p=!1};c.addEventListener("pointerup",C,{once:!0}),l.addEventListener("pointerup",C,{once:!0});function S(O){const D=s&&!bd()?Te:I=>I(),P=O??w,T=P?.composedPath?.()??[P?.target];D(()=>{const I=f?T[0]:Wn(w);if(!(!e||!h(w,I))){if(o||i){const $=kr(o,i);e.addEventListener(of,$,{once:!0})}lf(e,of,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:Kx(P),focusable:BS(T),target:I}})}})}w.pointerType==="touch"?(g.forEach(O=>O()),g.add(Yo(c,"click",S,{once:!0})),g.add(d.addEventListener("click",S,{once:!0})),g.add(u.addEventListener("click",S,{once:!0}))):S()}const y=new Set,b=setTimeout(()=>{y.add(Yo(c,"pointerdown",m,!0)),y.add(d.addEventListener("pointerdown",m,!0)),y.add(u.addEventListener("pointerdown",m,!0))},0);function x(w){if(p)return;(s?Te:S=>S())(()=>{const S=w?.composedPath?.()??[w?.target],O=f?S[0]:Wn(w);if(!(!e||!h(w,O))){if(r||i){const D=kr(r,i);e.addEventListener(sf,D,{once:!0})}lf(e,sf,{bubbles:!1,cancelable:!0,detail:{originalEvent:w,contextmenu:!1,focusable:Pd(O),target:O}})}})}return bd()||(y.add(Yo(c,"focusin",x,!0)),y.add(d.addEventListener("focusin",x,!0)),y.add(u.addEventListener("focusin",x,!0))),()=>{clearTimeout(b),g.forEach(w=>w()),y.forEach(w=>w())}}function jS(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(US(i,t))})),()=>{o.forEach(i=>i?.())}}function lf(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function WS(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Yo(mn(e),"keydown",n,{capture:!0})}var uf="layer:request-dismiss",Ae={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(r=>Ho(r.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>Ho(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(r=>{const o=r();o&&HS(o)}),this.recentlyRemoved.add(e),aa(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>Ae.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{df(e,t,e.node),e.styleTargets?.forEach(n=>{const r=n();if(!r||r===e.node)return;df(e,t,r);const{zIndex:o}=ia(e.node);r.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];qS(e,uf,o=>{r.requestDismiss?.(o),o.defaultPrevented||r?.dismiss()}),YS(e,uf,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function df(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),Ae.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=Ae.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function HS(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.style.removeProperty("--z-index"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function YS(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function qS(e,t,n){e.addEventListener(t,n,{once:!0})}var Ca=new WeakMap,Ir=new WeakMap;function GS(e){return Ae.isBelowPointerBlockingLayer(e)?"none":"auto"}function ff(e){const t=GS(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function XS(e){if(Ir.has(e))return;const t=Ot(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{Ir.has(e)&&ff(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),Ir.set(e,n)}function hf(){Ae.layers.forEach(({node:e})=>{ff(e),XS(e)})}function ZS(e){const t=Ir.get(e);t&&(t.disconnect(),Ir.delete(e)),e.style.pointerEvents=""}function JS(e,t){const n=mn(e),r=[];return Ae.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Ca.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[i,s]=r1(()=>{const a=o();return _e(a)?a:null},{timeout:1e3});i.then(a=>r.push(kd(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{Ae.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const i=Ca.get(o);i!==void 0&&(o.style.pointerEvents=i,Ca.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),r.forEach(o=>o()))}}function QS(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){zo("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:c="dialog",layerStyleTargets:l}=t,u={dismiss:r,node:e,type:c,pointerBlocking:i,requestDismiss:o,styleTargets:l};Ae.add(u),hf();function d(m){const y=Wn(m.detail.originalEvent);Ae.isBelowPointerBlockingLayer(e)||Ae.isInBranch(y)||(t.onPointerDownOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),r?.()))}function h(m){const y=Wn(m.detail.originalEvent);Ae.isInBranch(y)||(t.onFocusOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),r?.()))}function g(m){Ae.isTopMost(e)&&(t.onEscapeKeyDown?.(m),!m.defaultPrevented&&r&&(m.preventDefault(),r()))}function f(m){if(!e)return!1;const y=typeof s=="function"?s():s,b=Array.isArray(y)?y:[y],x=t.persistentElements?.map(w=>w()).filter(_e);return x&&b.push(...x),b.some(w=>Ho(w,m))||Ae.isInNestedLayer(e,m)}const p=[i?JS(e,t.persistentElements):void 0,WS(e,g),jS(e,{exclude:f,onFocusOutside:h,onPointerDownOutside:d,defer:t.defer})];return()=>{Ae.remove(e),hf(),ZS(e),p.forEach(m=>m?.())}}function eE(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=rt(e)?e():e;o.push(QS(i,t))})),()=>{o.forEach(i=>i?.())}}var[dk,tE]=Gt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});function ka(e,t){return e-t*Math.floor(e/t)}const gf=1721426;function ai(e,t,n,r){t=Oa(e,t);let o=t-1,i=-2;return n<=2?i=0:ci(t)&&(i=-1),gf-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function ci(e){return e%4===0&&(e%100!==0||e%400===0)}function Oa(e,t){return e==="BC"?1-t:t}function nE(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const rE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Qn{fromJulianDay(t){let n=t,r=n-gf,o=Math.floor(r/146097),i=ka(r,146097),s=Math.floor(i/36524),a=ka(i,36524),c=Math.floor(a/1461),l=ka(a,1461),u=Math.floor(l/365),d=o*400+s*100+c*4+u+(s!==4&&u!==4?1:0),[h,g]=nE(d),f=n-ai(h,g,1,1),p=2;n<ai(h,g,3,1)?p=0:ci(g)&&(p=1);let m=Math.floor(((f+p)*12+373)/367),y=n-ai(h,g,m,1)+1;return new Lt(h,g,m,y)}toJulianDay(t){return ai(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return rE[ci(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ci(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const oE={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Fe(e,t){return t=ve(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function iE(e,t){return t=ve(t,e.calendar),e=Rt(e),t=Rt(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function sE(e,t){return t=ve(t,e.calendar),e=Nr(e),t=Nr(t),e.era===t.era&&e.year===t.year}function aE(e,t){return li(e.calendar,t.calendar)&&Fe(e,t)}function _r(e,t){return li(e.calendar,t.calendar)&&iE(e,t)}function Lr(e,t){return li(e.calendar,t.calendar)&&sE(e,t)}function li(e,t){var n,r,o,i;return(i=(o=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function cE(e,t){return Fe(e,ui(t))}const lE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function pf(e,t,n){let r=e.calendar.toJulianDay(e),o=n?lE[n]:hE(t),i=Math.ceil(r+1-o)%7;return i<0&&(i+=7),i}function mf(e){return It(Date.now(),e)}function ui(e){return bn(mf(e))}function yf(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function uE(e,t){return vf(e)-vf(t)}function vf(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ta=null,dE=!1;function Aa(){return Ta==null&&(Ta=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ta}function bf(){return dE}function Rt(e){return e.subtract({days:e.day-1})}function $a(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Nr(e){return Rt(e.subtract({months:e.month-1}))}function fE(e){return $a(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function Qt(e,t,n){let r=pf(e,t,n);return e.subtract({days:r})}function wf(e,t,n){return Qt(e,t,n).add({days:6})}const xf=new Map,Da=new Map;function Sf(e){if(Intl.Locale){let n=xf.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&xf.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function hE(e){let t=Da.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo(),t))return Da.set(e,t),t.firstDay}let n=Sf(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];r==="mon"?t={firstDay:1}:r==="tue"?t={firstDay:2}:r==="wed"?t={firstDay:3}:r==="thu"?t={firstDay:4}:r==="fri"?t={firstDay:5}:r==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&oE[n]||0};Da.set(e,t)}return t.firstDay}function gE(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((pf(Rt(e),t,n)+r)/7)}function Ef(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Pf(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const pE={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function mE(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Sf(t),[i,s]=pE[o]||[6,0];return r===i||r===s}function er(e){e=ve(e,new Qn);let t=Oa(e.era,e.year);return Cf(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Cf(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Ra(e,t){if(t==="UTC")return 0;if(e>0&&t===Aa()&&!bf())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=Of(e,t);return Cf(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const kf=new Map;function Of(e,t){let n=kf.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),kf.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const Tf=864e5;function yE(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>vE(e,t,i))}function vE(e,t,n){let r=Of(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Mt(e,t,n="compatible"){let r=We(e);if(t==="UTC")return er(r);if(t===Aa()&&n==="compatible"&&!bf()){r=ve(r,new Qn);let c=new Date,l=Oa(r.era,r.year);return c.setFullYear(l,r.month-1,r.day),c.setHours(r.hour,r.minute,r.second,r.millisecond),c.getTime()}let o=er(r),i=Ra(o-Tf,t),s=Ra(o+Tf,t),a=yE(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function Af(e,t,n="compatible"){return new Date(Mt(e,t,n))}function It(e,t){let n=Ra(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new Vr(o<1?"BC":"AD",o<1?-o+1:o,i,s,t,n,a,c,l,u)}function bn(e){return new Lt(e.calendar,e.era,e.year,e.month,e.day)}function We(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new gi(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function ve(e,t){if(li(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,wn(r),r}function $f(e,t,n){if(e instanceof Vr)return e.timeZone===t?e:wE(e,t);let r=Mt(e,t,n);return It(r,t)}function bE(e){let t=er(e)-e.offset;return new Date(t)}function wE(e,t){let n=er(e)-e.offset;return ve(It(n,t),e.calendar)}const Fr=36e5;function di(e,t){let n=e.copy(),r="hour"in n?PE(n,t):0;Ma(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Ia(n),Df(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,xE(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let c=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Ma(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function Ia(e){for(;e.month<1;)Ma(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Ma(e,1)}function xE(e){for(;e.day<1;)e.month--,Ia(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Ia(e)}function Df(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function wn(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Df(e)}function Rf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Mf(e,t){return di(e,Rf(t))}function _a(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),wn(n),n}function fi(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),EE(n),n}function SE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=hi(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=hi(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=hi(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=hi(e.hour,24),t}function EE(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function hi(e,t){let n=e%t;return n<0&&(n+=t),n}function PE(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,SE(e)}function La(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),c=a.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=_t(c,n,0,a.length-1,r?.round),o.era=a[c],wn(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=_t(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=_t(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=_t(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),wn(o),o}function If(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let c=i>=12;s=c?12:0,a=c?23:11}o.hour=_t(i,n,s,a,r?.round);break}case"minute":o.minute=_t(e.minute,n,0,59,r?.round);break;case"second":o.second=_t(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=_t(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function _t(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function _f(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=di(We(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Mt(o,e.timeZone)}else n=er(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=It(n,e.timeZone);return ve(r,e.calendar)}function CE(e,t){return _f(e,Rf(t))}function kE(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let f=e.hour>=12;o=f?12:0,i=f?23:11}let s=We(e),a=ve(fi(s,{hour:o}),new Qn),c=[Mt(a,e.timeZone,"earlier"),Mt(a,e.timeZone,"later")].filter(f=>It(f,e.timeZone).day===a.day)[0],l=ve(fi(s,{hour:i}),new Qn),u=[Mt(l,e.timeZone,"earlier"),Mt(l,e.timeZone,"later")].filter(f=>It(f,e.timeZone).day===l.day).pop(),d=er(e)-e.offset,h=Math.floor(d/Fr),g=d%Fr;return d=_t(h,n,Math.floor(c/Fr),Math.floor(u/Fr),r?.round)*Fr+g,ve(It(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return If(e,t,n,r);case"era":case"year":case"month":case"day":{let o=La(We(e),t,n,r),i=Mt(o,e.timeZone);return ve(It(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function OE(e,t,n){let r=We(e),o=fi(_a(r,t),t);if(o.compare(r)===0)return e;let i=Mt(o,e.timeZone,n);return ve(It(i,e.timeZone),e.calendar)}function TE(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Lf(e){let t=ve(e,new Qn),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Nf(e){return`${Lf(e)}T${TE(e)}`}function AE(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return o!==0&&(i+=`:${String(o).padStart(2,"0")}`),i}function $E(e){return`${Nf(e)}${AE(e.offset)}[${e.timeZone}]`}function Na(e){let t=typeof e[0]=="object"?e.shift():new Qn,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var DE=new WeakMap;class Lt{copy(){return this.era?new Lt(this.calendar,this.era,this.year,this.month,this.day):new Lt(this.calendar,this.year,this.month,this.day)}add(t){return di(this,t)}subtract(t){return Mf(this,t)}set(t){return _a(this,t)}cycle(t,n,r){return La(this,t,n,r)}toDate(t){return Af(this,t)}toString(){return Lf(this)}compare(t){return yf(this,t)}constructor(...t){cs(this,DE,{writable:!0,value:void 0});let[n,r,o,i,s]=Na(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,wn(this)}}var RE=new WeakMap;class gi{copy(){return this.era?new gi(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new gi(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return di(this,t)}subtract(t){return Mf(this,t)}set(t){return _a(fi(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return La(this,t,n,r);default:return If(this,t,n,r)}}toDate(t,n){return Af(this,t,n)}toString(){return Nf(this)}compare(t){let n=yf(this,t);return n===0?uE(this,We(t)):n}constructor(...t){cs(this,RE,{writable:!0,value:void 0});let[n,r,o,i,s]=Na(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,wn(this)}}var ME=new WeakMap;class Vr{copy(){return this.era?new Vr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Vr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return _f(this,t)}subtract(t){return CE(this,t)}set(t,n){return OE(this,t,n)}cycle(t,n,r){return kE(this,t,n,r)}toDate(){return bE(this)}toString(){return $E(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-$f(t,this.timeZone).toDate().getTime()}constructor(...t){cs(this,ME,{writable:!0,value:void 0});let[n,r,o,i,s]=Na(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,wn(this)}}let Fa=new Map;class He{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return LE()&&(this.resolvedHourCycle||(this.resolvedHourCycle=NE(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=Ff(t,n),this.options=n}}const IE={true:{ja:"h11"},false:{}};function Ff(e,t={}){if(typeof t.hour12=="boolean"&&_E()){t={...t};let o=IE[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Fa.has(n))return Fa.get(n);let r=new Intl.DateTimeFormat(e,t);return Fa.set(n,r),r}let Va=null;function _E(){return Va==null&&(Va=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Va}let Ba=null;function LE(){return Ba==null&&(Ba=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Ba}function NE(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=Ff(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}var[fk,FE]=Gt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),VE=Object.defineProperty,BE=(e,t)=>{for(var n in t)VE(e,n,{get:t[n],enumerable:!0})},pi="__live-region__",Ka="__live-region-debug__",KE="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;";function zE(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0,debug:i=!1}=e,s=n.defaultView??window,a=r??n.body;function c(){if(!i)return;let d=n.getElementById(Ka);return d||(d=n.createElement("div"),d.id=Ka,d.dataset.liveAnnouncerDebug="true",d.setAttribute("aria-hidden","true"),d.style.cssText=KE,a.appendChild(d),d)}function l(d,h){n.getElementById(pi)?.remove(),h=h??o;const f=n.createElement("span");f.id=pi,f.dataset.liveAnnouncer="true";const p=t!=="assertive"?"status":"alert";f.setAttribute("aria-live",t),f.setAttribute("role",p),Object.assign(f.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),a.appendChild(f),s.setTimeout(()=>{if(!f.isConnected)return;f.textContent=d;const m=c();m&&(m.textContent=d)},h)}function u(){n.getElementById(pi)?.remove(),n.getElementById(Ka)?.remove()}return{announce:l,destroy:u,toJSON(){return pi}}}function UE(e,t,n,r,o){const i={};for(let a in t){const c=a,l=t[c];l!=null&&(i[c]=Math.floor(l/2),i[c]>0&&l%2===0&&i[c]--)}const s=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function xn(e,t,n,r,o){let i=e;return t.years?i=Nr(e):t.months?i=Rt(e):t.weeks&&(i=Qt(e,n)),Br(e,i,t,n,r,o)}function za(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function Br(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=Pf(t,xn(bn(o),n,r))),i&&e.compare(i)<=0&&(t=Ef(t,za(bn(i),n,r))),t}function Ye(e,t,n){const r=bn(e),o=t?bn(t):void 0,i=n?bn(n):void 0;let s=r;return o&&(s=Pf(s,o)),i&&(s=Ef(s,i)),s.compare(r)===0?e:"hour"in e?e.set({year:s.year,month:s.month,day:s.day}):s}function Vf(e,t,n,r,o,i){switch(t){case"start":return xn(e,n,r,o,i);case"end":return za(e,n,r,o,i);case"center":default:return UE(e,n,r,o,i)}}function en(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?Fe(e,t):We(e).compare(We(t))===0}function Bf(e,t,n,r,o){return e?t?.(e,n)?!0:bt(e,r,o):!1}function bt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function jE(e,t,n){const r=e.subtract({days:1});return Fe(r,e)||bt(r,t,n)}function WE(e,t,n){const r=e.add({days:1});return Fe(r,e)||bt(r,t,n)}function Ua(e){let t={...e};for(let n in t)t[n]=1;return t}function Kf(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function zf(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function Uf(e,t,n){const r=n??We(ui(t));return new He(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:zf(r),calendar:r.calendar.identifier,timeZone:t})}function jf(e,t,n){const r=n??ui(t);return new He(e,{month:"long",year:"numeric",era:zf(r),calendar:r.calendar.identifier,timeZone:t})}function HE(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let l=0;l<i.length;l++){let u=i[l];if(u.source==="shared"&&u.type==="literal")s=l;else if(u.source==="endRange")break}let a="",c="";for(let l=0;l<i.length;l++)l<s?a+=i[l].value:l>s&&(c+=i[l].value);return r(a,c)}function mi(e,t,n,r){if(!e)return"";let o=e,i=t??e,s=Uf(n,r);return Fe(o,i)?s.format(o.toDate(r)):HE(o,i,s,(a,c)=>`${a} – ${c}`,r)}var YE=["sun","mon","tue","wed","thu","fri","sat"];function Wf(e){return e!=null?YE[e]:void 0}function Hf(e,t,n){const r=Wf(n);return Qt(e,t,r)}function Yf(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=Hf(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(Fe(s,a))break;s=a}return i}function qE(e,t,n,r){const o=Wf(r),i=n??gE(e,t,o);return[...new Array(i).keys()].map(a=>Yf(a,e,t,r))}function GE(e,t){const n=new He(e,{weekday:"long",timeZone:t}),r=new He(e,{weekday:"short",timeZone:t}),o=new He(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function XE(e,t,n,r){const o=Hf(e,r,t),i=[...new Array(7).keys()],s=GE(r,n);return i.map(a=>s(o.add({days:a})))}function ZE(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const s=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(s.toLocaleString(e,{month:t})),s.setMonth(s.getMonth()+1);return a}const r=n.calendar.getMonthsInYear(n),o=new He(e,{month:t,calendar:n.calendar.identifier}),i=[];for(let s=1;s<=r;s++){const a=n.set({month:s});i.push(o.format(a.toDate("UTC")))}return i}function qf(e,t){const n=Qt(e,t,"mon"),r=n.year,o=n.set({month:1,day:4}),i=Qt(o,t,"mon"),s=n.calendar.toJulianDay(n),a=i.calendar.toJulianDay(i);if(s>=a)return 1+Math.floor((s-a)/7);const c=n.set({year:r-1,month:1,day:4}),l=Qt(c,t,"mon"),u=l.calendar.toJulianDay(l);return 1+Math.floor((s-u)/7)}function JE(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var QE=1900,eP=2099;function tP(e,t,n){const r=e.calendar,o=t?.year??ve(new Lt(QE,1,1),r).year,i=n?.year??ve(new Lt(eP,12,31),r).year;return{from:o,to:i}}var nP=10;function rP(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,r=parseInt(e.slice(-2),10),o=n+r;return o>t+nP?(o-100).toString():o.toString()}return e}}function tr(e,t){const n=t?.strict?10:12,r=e-e%10,o=[];for(let i=0;i<n;i+=1){const s=r+i;o.push(s)}return o}function Kr(e,t){const n=ui(e??Aa());return t?ve(n,t):n}function zr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,c=Kf(s,e);return bt(a,n,r)?{startDate:s,focusedDate:Ye(a,n,r),endDate:c}:a.compare(s)<0?{startDate:za(a,e,t,n,r),focusedDate:Ye(a,n,r),endDate:c}:a.compare(c)>0?{startDate:xn(a,e,t,n,r),endDate:c,focusedDate:Ye(a,n,r)}:{startDate:s,endDate:c,focusedDate:Ye(a,n,r)}}}function Gf(e,t,n,r,o,i){const s=zr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function Xf(e,t,n,r,o,i){const s=zr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function oP(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(Ua(r)),startDate:t});if(r.days)return Gf(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function iP(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(Ua(r)),startDate:t});if(r.days)return Xf(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var Zf=(e,t)=>e?/\d/.test(e)||t.includes(e)||e.length!==1:!0,sP=(e,t)=>e.split("").filter(n=>Zf(n,t)).join(""),Jf=new Map;function aP(e){let t=Jf.get(e);if(t!=null)return t;const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=r?r.value:"/",Jf.set(e,t),t}var Qf=e=>e!=null&&e.length===4,cP=e=>e!=null&&parseFloat(e)<=12,lP=e=>e!=null&&parseFloat(e)<=31;function uP(e,t,n){const r=dP(t,n);let{year:o,month:i,day:s}=fP(r,e)??{};if(o!=null||i!=null||s!=null){const l=new Date;o||(o=l.getFullYear().toString()),i||(i=(l.getMonth()+1).toString()),s||(s=l.getDate().toString())}if(Qf(o)||(o=rP(o)),Qf(o)&&cP(i)&&lP(s))return new Lt(+o,+i,+s);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new Lt(l.getFullYear(),l.getMonth()+1,l.getDate())}}function dP(e,t){return new He(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function fP(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function eh(e,t,n){const r=bn(mf(n));switch(e){case"thisWeek":return[Qt(r,t),wf(r,t)];case"thisMonth":return[Rt(r),r];case"thisQuarter":return[Rt(r).add({months:-((r.month-1)%3)}),r];case"thisYear":return[Nr(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[Rt(r.add({months:-1})),$a(r.add({months:-1}))];case"lastQuarter":return[Rt(r.add({months:-((r.month-1)%3)-3})),$a(r.add({months:-((r.month-1)%3)-1}))];case"lastWeek":return[Qt(r,t).add({weeks:-1}),wf(r,t).add({weeks:-1})];case"lastYear":return[Nr(r.add({years:-1})),fE(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var th=$r("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),oe=th.build(),hP=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,gP=e=>e.ids?.root??`datepicker:${e.id}`,pP=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,ja=e=>e.ids?.content??`datepicker:${e.id}:content`,Wa=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,mP=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,yP=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,vP=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,nh=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,rh=e=>e.ids?.control??`datepicker:${e.id}:control`,oh=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,ih=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,sh=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,ah=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,ch=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,lh=(e,t)=>e1(vi(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),yi=e=>e.getById(ih(e)),vi=e=>e.getById(ja(e)),Ur=e=>Qx(dh(e),"[data-part=input]"),bP=e=>e.getById(ch(e)),wP=e=>e.getById(ah(e)),xP=e=>e.getById(nh(e)),uh=e=>e.getById(sh(e)),dh=e=>e.getById(rh(e));function Ha(e){const[t,n]=e;let r;return!t||!n?r=e:r=t.compare(n)<=0?e:[n,t],r}function nr(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function bi(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function SP(e){return Or(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var EP={day:"dd",month:"mm",year:"yyyy"};function PP(e){return new He(e).formatToParts(new Date).map(t=>EP[t.type]??t.value).join("")}var fh=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),CP={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return Or(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return Or(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return Or(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function Nt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Ya(e){return e===0?"day":e===1?"month":"year"}function qa(e,t,n){return Ya(ex(Nt(e,0),Nt(t,0),Nt(n,2)))}function kP(e,t){return Nt(e,0)>Nt(t,0)}function OP(e,t){return Nt(e,0)<Nt(t,0)}function TP(e,t,n){const r=Nt(e,0)+1;return qa(Ya(r),t,n)}function AP(e,t,n){const r=Nt(e,0)-1;return qa(Ya(r),t,n)}var $P=["day","month","year"];function DP(e){$P.forEach(t=>e(t))}var RP=lx(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale],([e],t)=>{const{startValue:n,endValue:r,locale:o,timeZone:i,selectionMode:s}=t;if(e==="year"){const d=tr(n.year,{strict:!0}),h=d.at(0).toString(),g=d.at(-1).toString();return{start:h,end:g,formatted:`${h} - ${g}`}}if(e==="month"){const d=new He(o,{year:"numeric",timeZone:i,calendar:n.calendar.identifier}),h=d.format(n.toDate(i)),g=d.format(r.toDate(i)),f=s==="range"?`${h} - ${g}`:h;return{start:h,end:g,formatted:f}}const a=new He(o,{month:"long",year:"numeric",timeZone:i,calendar:n.calendar.identifier}),c=a.format(n.toDate(i)),l=a.format(r.toDate(i)),u=s==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:u}});function MP(e,t){const{state:n,context:r,prop:o,send:i,computed:s,scope:a}=e,c=r.get("startValue"),l=s("endValue"),u=r.get("value"),d=r.get("focusedValue"),h=r.get("hoveredValue"),g=h?Ha([u[0],h]):[],f=!!o("disabled"),p=!!o("readOnly"),m=!!o("invalid"),y=s("isInteractive"),b=u.length===0,x=o("min"),w=o("max"),C=o("locale"),S=o("timeZone"),O=o("startOfWeek"),D=n.matches("focused"),P=n.matches("open"),T=o("selectionMode")==="range",I=o("selectionMode")==="multiple",$=o("isDateUnavailable"),K=o("maxSelectedDates"),U=I&&K!=null&&u.length>=K,Q=r.get("currentPlacement"),F=Q?ES(Q):void 0,j=NS({...o("positioning"),placement:Q}),G=aP(C),q={...CP,...o("translations")};function qe(A=c){const E=o("fixedWeeks")?6:void 0;return qE(A,C,E,O)}function $e(A={}){const{format:E}=A;return ZE(C,E,d).map((k,R)=>{const le=R+1,Ge=d.set({month:le}),Pe=bt(Ge,x,w);return{label:k,value:le,disabled:Pe}})}function ec(){const A=tP(d,x,w);return JE(A).map(k=>({label:k.toString(),value:k,disabled:!Xs(k,x?.year,w?.year)}))}function Ei(A){return Bf(A,$,C,x,w)}function Pi(A){const E=c??Kr(S,d.calendar);i({type:"FOCUS.SET",value:E.set({month:A})})}function X(A){const E=c??Kr(S,d.calendar);i({type:"FOCUS.SET",value:E.set({year:A})})}function Vt(A){const{value:E,disabled:k}=A,R=d.set({year:E}),Ge=!tr(c.year,{strict:!0}).includes(E),Pe=Xs(E,x?.year,w?.year),st=T&&nr(R,u),nn=T&&u[0]&&Lr(R,u[0]),rr=T&&u[1]&&Lr(R,u[1]),En=T&&g.length>0,or=En&&nr(R,g),rn=En&&g[0]&&Lr(R,g[0]),on=En&&g[1]&&Lr(R,g[1]),Ci={focused:d.year===A.value,selectable:!Ge&&Pe,outsideRange:Ge,selected:!!u.find(ki=>ki&&ki.year===E),valueText:E.toString(),inRange:st||or,firstInRange:!!nn,lastInRange:!!rr,inHoveredRange:!!or,firstInHoveredRange:!!rn,lastInHoveredRange:!!on,value:R,get disabled(){return k||!Ci.selectable}};return Ci}function tn(A){const{value:E,disabled:k}=A,R=d.set({month:E}),le=jf(C,S,d),Ge=T&&nr(R,u),Pe=T&&u[0]&&_r(R,u[0]),st=T&&u[1]&&_r(R,u[1]),nn=T&&g.length>0,rr=nn&&nr(R,g),En=nn&&g[0]&&_r(R,g[0]),or=nn&&g[1]&&_r(R,g[1]),rn={focused:d.month===A.value,selectable:!bt(R,x,w),selected:!!u.find(on=>on&&on.month===E&&on.year===d.year),valueText:le.format(R.toDate(S)),inRange:Ge||rr,firstInRange:!!Pe,lastInRange:!!st,inHoveredRange:!!rr,firstInHoveredRange:!!En,lastInHoveredRange:!!or,outsideRange:!1,value:R,get disabled(){return k||!rn.selectable}};return rn}function tc(A){const{value:E,disabled:k,visibleRange:R=s("visibleRange")}=A,le=Uf(C,S,d),Ge=Ua(s("visibleDuration")),Pe=o("outsideDaySelectable"),st=R.start.add(Ge).subtract({days:1}),nn=bt(E,R.start,st),rr=T&&nr(E,u),En=T&&u[0]&&Fe(E,u[0]),or=T&&u[1]&&Fe(E,u[1]),rn=T&&g.length>0,on=rn&&nr(E,g),Ci=rn&&g[0]&&Fe(E,g[0]),ki=rn&&g[1]&&Fe(E,g[1]),mh=u.some(yh=>yh!=null&&Fe(E,yh)),Oi={invalid:bt(E,x,w),disabled:k||!Pe&&nn||bt(E,x,w)||U&&!mh,selected:mh,unavailable:Bf(E,$,C,x,w)&&!k,outsideRange:nn,today:cE(E,S),weekend:mE(E,C),value:E,valueText:le.format(E.toDate(S)),get focused(){return d!=null&&Fe(E,d)&&(!Oi.outsideRange||Pe)},get selectable(){return!Oi.disabled&&!Oi.unavailable},inRange:rr||on,firstInRange:En,lastInRange:or,inHoveredRange:on,firstInHoveredRange:Ci,lastInHoveredRange:ki};return Oi}function sk(A){const{view:E="day",id:k}=A;return[E,k].filter(Boolean).join(" ")}return{focused:D,open:P,disabled:f,invalid:m,readOnly:p,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:K,isMaxSelected:U,view:r.get("view"),getRangePresetValue(A){return eh(A,C,S)},getWeekNumber(A){const E=A[0];return E?qf(E,C):0},getDaysInWeek(A,E=c){return Yf(A,E,C,O)},getOffset(A){const E=c.add(A),k=l.add(A),R=jf(C,S,d);return{visibleRange:{start:E,end:k},weeks:qe(E),visibleRangeText:{start:R.format(E.toDate(S)),end:R.format(k.toDate(S))}}},getMonthWeeks:qe,isUnavailable:Ei,weeks:qe(),weekDays:XE(c,O,S,C),visibleRangeText:s("visibleRangeText"),value:u,valueAsDate:u.filter(A=>A!=null).map(A=>A.toDate(S)),valueAsString:s("valueAsString"),focusedValue:d,focusedValueAsDate:d?.toDate(S),focusedValueAsString:o("format")(d,{locale:C,timeZone:S}),visibleRange:s("visibleRange"),selectToday(){const A=Ye(Kr(S,d.calendar),x,w);i({type:"VALUE.SET",value:[A]})},setValue(A){const E=A.map(k=>Ye(k,x,w));i({type:"VALUE.SET",value:E})},setTime(A,E=0){const k=Array.from(u);let R=k[E];R&&("hour"in R||(R=We(R)),R=R.set({hour:A.hour??("hour"in R?R.hour:0),minute:A.minute??("minute"in R?R.minute:0),second:A.second??("second"in R?R.second:0),millisecond:A.millisecond??("millisecond"in R?R.millisecond:0)}),k[E]=Ye(R,x,w),i({type:"VALUE.SET",value:k}))},clearValue(A={}){const{focus:E=!0}=A;i({type:"VALUE.CLEAR",focus:E})},setFocusedValue(A){i({type:"FOCUS.SET",value:A})},setOpen(A){o("inline")||n.matches("open")===A||i({type:A?"OPEN":"CLOSE"})},focusMonth:Pi,focusYear:X,getYears:ec,getMonths:$e,getYearsGrid(A={}){const{columns:E=1}=A,k=tr(c.year,{strict:!0}).map(R=>({label:R.toString(),value:R,disabled:!Xs(R,x?.year,w?.year)}));return Zu(k,E)},getDecade(){const A=tr(c.year,{strict:!0});return{start:A.at(0),end:A.at(-1)}},getMonthsGrid(A={}){const{columns:E=1,format:k}=A;return Zu($e({format:k}),E)},format(A,E={month:"long",year:"numeric"}){return new He(C,{...E,calendar:A.calendar.identifier}).format(A.toDate(S))},setView(A){i({type:"VIEW.SET",view:A})},goToNext(){i({type:"GOTO.NEXT",view:r.get("view")})},goToPrev(){i({type:"GOTO.PREV",view:r.get("view")})},getRootProps(){return t.element({...oe.root.attrs,dir:o("dir"),id:gP(a),"data-state":P?"open":"closed","data-disabled":z(f),"data-readonly":z(p),"data-empty":z(b)})},getLabelProps(A={}){const{index:E=0}=A;return t.label({...oe.label.attrs,id:hP(a,E),dir:o("dir"),htmlFor:oh(a,E),"data-state":P?"open":"closed","data-index":E,"data-disabled":z(f),"data-readonly":z(p)})},getControlProps(){return t.element({...oe.control.attrs,dir:o("dir"),id:rh(a),"data-disabled":z(f),"data-placeholder-shown":z(b)})},getRangeTextProps(){return t.element({...oe.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...oe.content.attrs,hidden:!P,dir:o("dir"),"data-state":P?"open":"closed","data-placement":Q,"data-side":F,"data-inline":z(o("inline")),id:ja(a),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":q.content})},getTableProps(A={}){const{view:E="day",columns:k=E==="day"?7:4}=A,R=sk(A);return t.element({...oe.table.attrs,role:"grid","data-columns":k,"aria-roledescription":SP(E),id:pP(a,R),"aria-readonly":Se(p),"aria-disabled":Se(f),"aria-multiselectable":Se(o("selectionMode")!=="single"),"data-view":E,dir:o("dir"),tabIndex:-1,onKeyDown(le){if(le.defaultPrevented)return;const Pe={Enter(){E==="day"&&Ei(d)||E==="month"&&!tn({value:d.month}).selectable||E==="year"&&!Vt({value:d.year}).selectable||i({type:"TABLE.ENTER",view:E,columns:k,focus:!0})},ArrowLeft(){i({type:"TABLE.ARROW_LEFT",view:E,columns:k,focus:!0})},ArrowRight(){i({type:"TABLE.ARROW_RIGHT",view:E,columns:k,focus:!0})},ArrowUp(){i({type:"TABLE.ARROW_UP",view:E,columns:k,focus:!0})},ArrowDown(){i({type:"TABLE.ARROW_DOWN",view:E,columns:k,focus:!0})},PageUp(st){i({type:"TABLE.PAGE_UP",larger:st.shiftKey,view:E,columns:k,focus:!0})},PageDown(st){i({type:"TABLE.PAGE_DOWN",larger:st.shiftKey,view:E,columns:k,focus:!0})},Home(){i({type:"TABLE.HOME",view:E,columns:k,focus:!0})},End(){i({type:"TABLE.END",view:E,columns:k,focus:!0})}}[Ux(le,{dir:o("dir")})];Pe&&(Pe(le),le.preventDefault(),le.stopPropagation())},onPointerLeave(){i({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){i({type:"TABLE.POINTER_DOWN",view:E})},onPointerUp(){i({type:"TABLE.POINTER_UP",view:E})}})},getTableHeadProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableHeaderProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHeader.attrs,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableBodyProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableBody.attrs,"data-view":E,"data-disabled":z(f)})},getTableRowProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableRow.attrs,"aria-disabled":Se(f),"data-disabled":z(f),"data-view":E})},getWeekNumberHeaderCellProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableCell.attrs,scope:"col","aria-label":q.weekColumnHeader,"data-view":E,"data-type":"week-number","data-disabled":z(f)})},getWeekNumberCellProps(A){const{weekIndex:E,week:k}=A,R=k[0]?qf(k[0],C):0;return t.element({...oe.tableCell.attrs,role:"rowheader","aria-label":q.weekNumberCell?.(R),"data-view":"day","data-week-index":E,"data-type":"week-number","data-disabled":z(f)})},getDayTableCellState:tc,getDayTableCellProps(A){const{value:E}=A,k=tc(A);return t.element({...oe.tableCell.attrs,role:"gridcell","aria-disabled":Se(!k.selectable),"aria-selected":k.selected||k.inRange,"aria-invalid":Se(k.invalid),"aria-current":k.today?"date":void 0,"data-value":E.toString()})},getDayTableCellTriggerProps(A){const{value:E}=A,k=tc(A);return t.element({...oe.tableCellTrigger.attrs,id:Wa(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":q.dayCell(k),"aria-disabled":Se(!k.selectable),"aria-invalid":Se(k.invalid),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E.toString(),"data-view":"day","data-today":z(k.today),"data-focus":z(k.focused),"data-unavailable":z(k.unavailable),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-outside-range":z(k.outsideRange),"data-weekend":z(k.weekend),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"day",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&aE(E,h)||i({type:"CELL.POINTER_MOVE",cell:"day",value:E,focus:le,outsideRange:k.outsideRange})}:void 0})},getMonthTableCellState:tn,getMonthTableCellProps(A){const{value:E,columns:k}=A,R=tn(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Se(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Se(!R.selectable),"data-value":E})},getMonthTableCellTriggerProps(A){const{value:E}=A,k=tn(A);return t.element({...oe.tableCellTrigger.attrs,id:Wa(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Se(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"month","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"month",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&_r(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"month",value:k.value,focus:le})}:void 0})},getYearTableCellState:Vt,getYearTableCellProps(A){const{value:E,columns:k}=A,R=Vt(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Se(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Se(!R.selectable),"data-value":E})},getYearTableCellTriggerProps(A){const{value:E}=A,k=Vt(A);return t.element({...oe.tableCellTrigger.attrs,id:Wa(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Se(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"year","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"year",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&Lr(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"year",value:k.value,focus:le})}:void 0})},getNextTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isNextVisibleRangeValid");return t.button({...oe.nextTrigger.attrs,dir:o("dir"),id:yP(a,E),type:"button","aria-label":q.nextTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.NEXT",view:E})}})},getPrevTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isPrevVisibleRangeValid");return t.button({...oe.prevTrigger.attrs,dir:o("dir"),id:mP(a,E),type:"button","aria-label":q.prevTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.PREV",view:E})}})},getClearTriggerProps(){return t.button({...oe.clearTrigger.attrs,id:nh(a),dir:o("dir"),type:"button","aria-label":q.clearTrigger,hidden:!u.length,onClick(A){A.defaultPrevented||i({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...oe.trigger.attrs,id:ih(a),dir:o("dir"),type:"button","data-placement":Q,"data-side":F,"aria-label":q.trigger(P),"aria-controls":ja(a),"aria-expanded":P,"data-state":P?"open":"closed","data-placeholder-shown":z(b),"aria-haspopup":"grid",disabled:f,onClick(A){A.defaultPrevented||y&&i({type:"TRIGGER.CLICK"})}})},getViewProps(A={}){const{view:E="day"}=A;return t.element({...oe.view.attrs,"data-view":E,hidden:r.get("view")!==E})},getViewTriggerProps(A={}){const{view:E="day"}=A;return t.button({...oe.viewTrigger.attrs,"data-view":E,dir:o("dir"),id:vP(a,E),type:"button",disabled:f,"aria-label":q.viewTrigger(E),onClick(k){k.defaultPrevented||y&&i({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(A={}){const{view:E="day"}=A;return t.element({...oe.viewControl.attrs,"data-view":E,dir:o("dir")})},getInputProps(A={}){const{index:E=0,fixOnBlur:k=!0}=A;return t.input({...oe.input.attrs,id:oh(a,E),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":E,"data-state":P?"open":"closed","data-placeholder-shown":z(b),readOnly:p,disabled:f,required:o("required"),"aria-invalid":Se(m),"data-invalid":z(m),placeholder:o("placeholder")||PP(C),defaultValue:s("valueAsString")[E],onBeforeInput(R){const{data:le}=Ed(R);Zf(le,G)||R.preventDefault()},onClick(R){R.defaultPrevented||o("openOnClick")&&y&&i({type:"OPEN",src:"input.click"})},onFocus(){i({type:"INPUT.FOCUS",index:E})},onBlur(R){const le=R.currentTarget.value.trim();i({type:"INPUT.BLUR",value:le,index:E,fixOnBlur:k})},onKeyDown(R){if(R.defaultPrevented||!y)return;const Ge={Enter(Pe){Bx(Pe)||Ei(d)||Pe.currentTarget.value.trim()!==""&&i({type:"INPUT.ENTER",value:Pe.currentTarget.value,index:E})}}[R.key];Ge&&(Ge(R),R.preventDefault())},onInput(R){const le=R.currentTarget.value;i({type:"INPUT.CHANGE",value:sP(le,G),index:E})}})},getMonthSelectProps(){return t.select({...oe.monthSelect.attrs,id:ah(a),"aria-label":q.monthSelect,disabled:f,dir:o("dir"),defaultValue:c.month,onChange(A){Pi(Number(A.currentTarget.value))}})},getYearSelectProps(){return t.select({...oe.yearSelect.attrs,id:ch(a),disabled:f,"aria-label":q.yearSelect,dir:o("dir"),defaultValue:c.year,onChange(A){X(Number(A.currentTarget.value))}})},getPositionerProps(){return t.element({id:sh(a),...oe.positioner.attrs,dir:o("dir"),style:j.floating})},getPresetTriggerProps(A){const E=Array.isArray(A.value)?A.value:eh(A.value,C,S),k=E.filter(R=>R!=null).map(R=>R.toDate(S).toDateString());return t.button({...oe.presetTrigger.attrs,"aria-label":q.presetTrigger(k),type:"button",onClick(R){R.defaultPrevented||i({type:"PRESET.CLICK",value:E})}})}}}var{and:Ee}=bx();function IP(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if(!en(e[r],t[r]))return!1;return!0}function wi(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var _P=hd({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1;let i;if(e.createCalendar){const f=new Intl.DateTimeFormat(t).resolvedOptions().calendar;f!=="gregory"&&f!=="iso8601"&&(i=e.createCalendar(f))}const s=g=>!i||g.calendar.identifier===i.identifier?g:ve(g,i),a=e.defaultValue?bi(e.defaultValue).map(g=>Ye(s(g),e.min,e.max)):void 0,c=e.value?bi(e.value).map(g=>Ye(s(g),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||Kr(n,i);l=Ye(s(l),e.min,e.max);const u="day",d="year",h=qa(e.view||u,u,d);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:r,defaultView:h,minView:u,maxView:d,outsideDaySelectable:!1,closeOnSelect:!0,format(g,{locale:f,timeZone:p}){return new He(f,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric",calendar:i?.identifier}).format(g.toDate(p))},parse(g,{locale:f,timeZone:p}){return uP(g,f,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")||e("inline")?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:en,hash:r=>r.toString(),sync:!0,onChange(r){const o=n(),i=o.get("view"),s=o.get("value"),a=wi(s,e);e("onFocusChange")?.({value:s,valueAsString:a,view:i,focusedValue:r})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:IP,hash:r=>r.map(o=>o?.toString()??"").join(","),onChange(r){const o=n(),i=wi(r,e);e("onValueChange")?.({value:r,valueAsString:i,view:o.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:en})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(r){e("onViewChange")?.({view:r})}})),startValue:t(()=>{const r=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:Vf(r,"start",{months:e("numOfMonths")},e("locale")),isEqual:en,hash:o=>o.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>Kf(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>RP({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!jE(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!WE(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>wi(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:r,computed:o}){e([()=>t("locale")],()=>{r(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{r(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{r(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{r(["syncInputValue"])}),e([()=>n.hash("value")],()=>{r(["syncInputElement"])}),e([()=>o("valueAsString").toString()],()=>{r(["announceValueText"])}),e([()=>n.get("view")],()=>{r(["focusActiveCell"])}),e([()=>t("open")],()=>{r(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:Ee("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:Ee("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>kP(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:({context:e,prop:t,event:n})=>{const r=t("maxSelectedDates");if(r==null)return!0;const o=e.get("value"),i=n.value??e.get("focusedValue");return o.some(a=>en(a,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const r=dh(n);return _S(r,()=>uh(n),{...t("positioning"),defer:!0,onComplete(i){e.set("currentPlacement",i.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",zE({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:r}){return r("inline")?void 0:eE(()=>vi(e),{type:"popover",defer:!0,layerStyleTargets:[()=>uh(e)],exclude:[...Ur(e),yi(e),xP(e)],onInteractOutside(i){n.set("restoreFocus",!i.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(i){i.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setNextView({context:e,prop:t}){const n=TP(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=AP(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const r=e.get("value"),o=t("locale"),i=t("timeZone");let s;if(t("selectionMode")==="range"){const[a,c]=r;a&&c?s=mi(a,c,o,i):a?s=mi(a,null,o,i):c?s=mi(c,null,o,i):s=""}else s=r.map(a=>mi(a,null,o,i)).filter(Boolean).join(",");n.get("announcer")?.announce(s,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){Jx({target:vi(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Cd({doc:e.getDoc(),target:vi(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&fe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){Te(()=>{Ur(e).forEach((r,o)=>{qo(r,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;fe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;fe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const r=t.value.map(o=>Ye(o,n("min"),n("max")));e.set("value",r)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,r=Array.from(t.get("value")),o=t.get("activeIndex"),i=r[o],s=xi(e,n.value??t.get("focusedValue"));r[o]=Ga(i,s),t.set("value",Ha(r))},resetSelection(e){const{context:t,event:n}=e,r=t.get("value")[0],o=xi(e,n.value??t.get("focusedValue"));t.set("value",[Ga(r,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,r=xi(e,n.value??t.get("focusedValue")),o=t.get("value"),i=o.findIndex(s=>en(s,r));if(i===-1){const s=[...o,r];t.set("value",bi(s))}else{const s=Array.from(o);s.splice(i,1),t.set("value",bi(s))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),r=e.get("activeIndex"),o=n[r],i=e.get("focusedValue").copy();n[r]=Ga(o,i),e.set("value",Ha(n));const s=t("valueAsString");e.set("inputValue",s[r])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});fe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});fe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});fe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});fe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:r}=e,o=Gf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Si(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:r}=e,o=Xf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Si(e,o)},focusSectionStart(e){const{context:t}=e;fe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;fe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=oP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Si(e,i)},focusPreviousSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=iP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Si(e,i)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});fe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});fe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});fe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});fe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,r=t.get("focusedValue").calendar;fe(e,Kr(n("timeZone"),r))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({months:n.columns});fe(e,r)},focusNextMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({months:n.columns});fe(e,r)},focusPreviousYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({years:n.columns});fe(e,r)},focusNextYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({years:n.columns});fe(e,r)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMinimumMonthInYear?.(n)??1;fe(e,n.set({month:r}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMonthsInYear(n);fe(e,n.set({month:r}))},focusFirstYear(e){const{context:t}=e,n=tr(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[0]});fe(e,r)},focusLastYear(e){const{context:t}=e,n=tr(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[n.length-1]});fe(e,r)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&Te(()=>{const r=t.get("view");lh(e,r)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&Te(()=>{const r=t.get("view");lh(e,r)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!t.type.startsWith("TABLE.ARROW")||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},focusTriggerElement({scope:e}){Te(()=>{yi(e)?.focus({preventScroll:!0})})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&Te(()=>{const[n]=Ur(e);(n??yi(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){Te(()=>{const t=Ur(e);if(t.length===0){yi(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(i=>i.value!==""),r=Math.max(n,0),o=t[r];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=wP(e);qo(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=bP(e);qo(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const r=Ur(e),o=n.index??t.get("activeIndex");qo(r[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!fh(o)||fe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!fh(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Ye(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const s=wi(i,n);e.set("inputValue",s[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const r=e.get("focusedValue");if(!bt(r,e.get("startValue"),t("endValue")))return;const i=Vf(r,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),xi=(e,t)=>{const{context:n,prop:r}=e,o=n.get("view");let i=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return DP(s=>{OP(s,r("minView"))&&(i=i.set({[s]:s==="day"?1:0}))}),i},Ga=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let r=t;return"hour"in t||(n?r=$f(We(t),e.timeZone):r=We(t)),r.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function fe(e,t){const{context:n,prop:r,computed:o}=e;if(!t)return;const i=xi(e,t);if(en(n.get("focusedValue"),i))return;const a=zr(o("visibleDuration"),r("locale"),r("min"),r("max"))({focusedDate:i,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Si(e,t){const{context:n}=e;n.set("startValue",t.startDate);const r=n.get("focusedValue");en(r,t.focusedDate)||n.set("focusedValue",t.focusedDate)}var hh=th.extendWith("view","valueText"),[gh,ae]=Gt({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),LP=e=>{const t=ae(),n=ee(()=>t().getClearTriggerProps(),e);return v(re.button,n)},NP=e=>{const t=ae(),n=Id(),r=ee(()=>t().getContentProps(),()=>n().presenceProps,e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,N(r,{ref(o){var i=b1(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},FP=e=>e.children(ae()),VP=e=>{const t=ae(),n=ee(()=>t().getControlProps(),e);return v(re.div,n)},BP=e=>{const[t,n]=pt()(e,["index","fixOnBlur"]),r=ae(),o=ee(()=>r().getInputProps(t),n);return v(re.input,o)},KP=e=>{const t=ae(),n=ee(()=>t().getLabelProps(),e);return v(re.label,n)},zP=e=>{const t=ae(),n=ee(()=>t().getMonthSelectProps(),e);return v(re.select,N(n,{get children(){return v(kc,{get each(){return t().getMonths()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},[UP,Sn]=Gt({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),jP=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getNextTriggerProps(n),e);return v(re.button,r)},WP=e=>{const t=ae(),n=Id(),r=ee(()=>t().getPositionerProps(),e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,r)}})},HP=e=>{const[t,n]=pt()(e,["value"]),r=ae(),o=ee(()=>r().getPresetTriggerProps(t),n);return v(re.button,o)},YP=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getPrevTriggerProps(n),e);return v(re.button,r)},qP=e=>{const t=ae(),n=ee(()=>t().getRangeTextProps(),e),r=_(()=>{const{start:o,end:i}=t().visibleRangeText;return V0([o,i]).filter(Boolean).join(" - ")});return v(re.div,N(n,{get children(){return r()}}))},GP=e=>{const t=ae(),n=()=>t().value.length>0;return v(ie,{get when(){return typeof e.children=="function"},get fallback(){return v(re.span,N(()=>hh.build().valueText.attrs,e,{get children(){return Ut(()=>!!n())()?t().valueAsString.join(e.separator??", "):e.placeholder}}))},get children(){return v(ie,{get when(){return n()},get fallback(){return e.placeholder},get children(){return v(cn,{get each(){return t().value},children:(r,o)=>Ut(()=>e.children({value:r,index:o(),valueAsString:t().valueAsString[o()],remove:()=>{t().setValue(t().value.filter((i,s)=>s!==o()))}}))})}})}})},XP=e=>{const t=Be(),n=FE(),r=tE(),o=_(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...id(e)})),i=Od(_P,o);return _(()=>MP(i,f1))},ZP=e=>{const[t,n]=Rd(e),[r,o]=pt()(n,["closeOnSelect","createCalendar","defaultFocusedValue","defaultOpen","defaultValue","defaultView","disabled","fixedWeeks","focusedValue","format","id","ids","inline","invalid","isDateUnavailable","locale","max","maxSelectedDates","maxView","min","minView","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","onVisibleRangeChange","open","openOnClick","outsideDaySelectable","parse","placeholder","positioning","readOnly","required","selectionMode","showWeekNumbers","startOfWeek","timeZone","translations","value","view"]),i=XP(r),s=$d(ee(t,()=>({present:i().open}))),a=ee(()=>i().getRootProps(),o);return v(gh,{value:i,get children(){return v(Md,{value:s,get children(){return v(re.div,a)}})}})},JP=e=>{const[t,n]=Rd(e),[{value:r},o]=pt()(n,["value"]),i=$d(ee(t,()=>({present:r().open}))),s=ee(()=>r().getRootProps(),o);return v(gh,{value:r,get children(){return v(Md,{value:i,get children(){return v(re.div,s)}})}})},[QP,jr]=Gt({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),eC=e=>{const[t,n]=pt()(e,["columns"]),r=ae(),o=Sn(),i=Be(),s=ee(()=>({columns:t.columns,id:i}),o),a=ee(()=>r().getTableProps(s),n);return v(QP,{value:s,get children(){return v(re.table,a)}})},tC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableBodyProps(n),e);return v(re.tbody,r)},[nC,rC]=Gt({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),oC=e=>{const[t,n]=pt()(e,["disabled","value","visibleRange","columns"]),r=ae(),o=Sn(),i=_(()=>{const c={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return c(t)}),s=ee(i,n);return v(nC,{value:t,get children(){return v(re.td,s)}})},iC=e=>{const t=ae(),n=rC(),r=Sn(),o=_(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=ee(o,e);return v(re.div,i)},sC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableHeadProps(n),e);return v(re.thead,r)},aC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableHeaderProps(n),e);return v(re.th,r)},cC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getTableRowProps(n),e);return v(re.tr,r)},lC=e=>{const t=ae(),n=ee(()=>t().getTriggerProps(),e);return v(re.button,n)},uC=e=>{const[t,n]=pt()(e,["view"]),r=ae(),o=ee(()=>hh.build().view.attrs,n);return v(UP,{value:t,get children(){return v(re.div,N(o,{get hidden(){return r().view!==t.view}}))}})},dC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewControlProps(n),e);return v(re.div,r)},fC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewTriggerProps(n),e);return v(re.button,r)},hC=pt(),gC=e=>{const[t,n]=hC(e,["weekIndex","week"]),r=ae(),o=ee(()=>r().getWeekNumberCellProps(t),n);return v(re.td,o)},pC=e=>{const t=ae(),n=jr(),r=ee(()=>t().getWeekNumberHeaderCellProps(n),e);return v(re.th,r)},mC=e=>{const t=ae(),n=ee(()=>t().getYearSelectProps(),e);return v(re.select,N(n,{get children(){return v(kc,{get each(){return t().getYears()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},Ft={};BE(Ft,{ClearTrigger:()=>LP,Content:()=>NP,Context:()=>FP,Control:()=>VP,Input:()=>BP,Label:()=>KP,MonthSelect:()=>zP,NextTrigger:()=>jP,Positioner:()=>WP,PresetTrigger:()=>HP,PrevTrigger:()=>YP,RangeText:()=>qP,Root:()=>ZP,RootProvider:()=>JP,Table:()=>eC,TableBody:()=>tC,TableCell:()=>oC,TableCellTrigger:()=>iC,TableHead:()=>sC,TableHeader:()=>aC,TableRow:()=>cC,Trigger:()=>lC,ValueText:()=>GP,View:()=>uC,ViewControl:()=>dC,ViewTrigger:()=>fC,WeekNumberCell:()=>gC,WeekNumberHeaderCell:()=>pC,YearSelect:()=>mC}),Ft.Label,Ft.TableHead,Ft.TableBody,Ft.ClearTrigger,Ft.YearSelect,Ft.MonthSelect,Ft.Context,Ft.RootProvider;var yC=W("<div>Unknown bot message type");const vC=e=>v(Wb,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(Gs,{get text(){return e.text}}):e.type==="buttons"?v(qb,N(()=>e.buttons)):e.type==="list"?v(O0,N(()=>e.list)):e.type==="media"?v(Xu,N(()=>e.media)):e.type==="link"?v(Qb,N(()=>e.link)):e.type==="cards"?v(Zb,N(()=>e.cards)):e.type==="date"?v(Gs,{get text(){return e.text}}):yC()}});var bC=W('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const wC=e=>(()=>{var t=bC(),n=t.firstChild;return B(n,()=>e.text?.trim()),t})();var xC=W('<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 SC=({children:e,createdAt:t})=>(()=>{var n=xC(),r=n.firstChild;return B(r,e),B(n,v(Iu,{createdAt:t,anchor:"end"}),null),n})();var EC=W("<div>Unknown user message type");const PC=e=>v(SC,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(Gs,{get text(){return e.text}}):e.type==="media"?v(Xu,N(()=>e.media)):EC()}});var CC=W("<div>Unknown message origin");const kC=e=>e.origin==="bot"?v(vC,e):e.origin==="user"?v(PC,e):e.origin==="service"?v(wC,e):CC();function Xa(e){return Ke({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 OC=W('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),TC=W("<div>");const Za=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o,maybeAutostart:i}=qt(),{onOpen:s}=Nc(),a=(c=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},c)};return pe("reset",()=>{r()}),an(()=>{o(),a(200),i()}),n(a),s(()=>a(200)),(()=>{var c=OC(),l=e;return typeof l=="function"?Ki(l,c):e=c,B(c,v(cn,{get each(){return t()},get fallback(){return(()=>{var u=TC();return B(u,()=>kn("emptyMessages")),u})()},children:u=>v(kC,u)})),c})()};var AC=W("<textarea>");const $C=e=>{const[,t]=J(e,["class"]);return(()=>{var n=AC();return un(n,N({get class(){return zt("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 DC=W('<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 RC=e=>(()=>{var t=DC();return un(t,e,!0,!0),t})();var MC=W('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const IC=()=>(()=>{var e=MC(),t=e.firstChild;return B(e,v(RC,{height:15}),t),e})();var _C=W('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"></div><div class="flex justify-center opacity-70 scale-95">');const Ja=()=>{const{pushMessage:e}=qt(),[t,n]=L(""),r=()=>{t().trim()&&(e(t()),n(""))},o=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),r())};return pe("setInput",i=>{i&&n(i)}),(()=>{var i=_C(),s=i.firstChild,a=s.firstChild,c=a.nextSibling;return B(a,v($C,{id:"chat-input",get placeholder(){return kn("inputPlaceholder")},get value(){return t()},onInput:l=>n(l.currentTarget.value),onKeyDown:o,class:"focus-visible:ring-primary min-h-[44px] max-h-[120px] py-3 leading-tight resize-none"}),null),B(a,v(Je,{variant:"outline",class:"h-[44px] w-[44px] p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",onClick:r,get children(){return v(Op,{size:20})}}),null),B(c,v(IC,{})),i})()};var LC=W('<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">'),NC=W("<span class=sr-only>Close"),FC=W('<div><div class="flex justify-center gap-3 items-center">'),VC=W("<span class=sr-only>Open"),BC=W("<span class=font-bold>"),KC=W("<span>"),zC=W('<div class="animate-pulse flex p-1">');const UC=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Nc(),{chatWidget:s}=ge(),[a,c]=L(!0),[l,u]=L("");setTimeout(()=>c(!1),2e3),s()?.openDelay&&!s()?.hideWidget&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const d=()=>(s()?.style.margin??5)*4,h=()=>s()?.style.position==="left"?{left:`${d()}px`}:{right:`${d()}px`};return pe("open",()=>{o()}),pe("close",()=>{i()}),pe("toggle",()=>{r()}),pe("onAnswer",g=>{g.text&&u(g.text),o()}),(()=>{var g=FC(),f=g.firstChild;return B(g,v(ie,{get when(){return Ut(()=>!!n())()&&!s()?.hideWidget},get children(){var p=LC();return B(p,e),p}}),f),B(f,v(ie,{get when(){return s()?.whatsappBtn},get children(){return v(Je,{onclick:()=>window.open(s()?.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 v(Bb,{class:"size-9",color:"white"})}})}}),null),B(f,v(ie,{get when(){return!s()?.hideWidget},get children(){return v(ie,{get when(){return n()},get fallback(){return v(Je,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,VC(),v(ie,{get when(){return s()?.balloonMessage},get children(){var p=KC();return B(p,v(ie,{get when(){return l()},get fallback(){return v(ie,{get when(){return!a()},get fallback(){return(()=>{var m=zC();return B(m,v(Xa,{class:"size-2 animate-bounce"}),null),B(m,v(Xa,{class:"size-2 animate-bounce delay-150"}),null),B(m,v(Xa,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return Ut(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=BC();return B(m,(()=>{var y=Ut(()=>l().length>20);return()=>y()?l().substring(0,17)+"...":l()})()),m}})),ye(()=>ln(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return v(Je,{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,NC()]}})}})}}),null),ye(p=>{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 "+(s()?.style.position==="left"?" items-start":" items-end"),y=h();return m!==p.e&&ln(g,p.e=m),p.t=ro(g,y,p.t),p},{e:void 0,t:void 0}),g})()};var jC=W('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const WC=({children:e})=>{const{chatWidget:t}=ge(),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=jC();return ro(r,n),B(r,e),r})()};var HC=W("<div id=smarttalks-widget>");const YC=({children:e})=>{const{chatWidget:t}=ge(),[n,r]=L(!1),[o,i]=L(!1),[s,a]=L("100%"),c=()=>{typeof window<"u"&&i(window.innerWidth<768)},l=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};V(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),an(()=>{c(),window.addEventListener("resize",c),window.visualViewport&&(window.visualViewport.addEventListener("resize",l),window.visualViewport.addEventListener("scroll",l))}),Y(()=>{window.removeEventListener("resize",c),window.visualViewport&&(window.visualViewport.removeEventListener("resize",l),window.visualViewport.removeEventListener("scroll",l)),document.body.style.overflow="",document.body.style.position=""});const u=()=>(t()?.style.margin??5)*4,d=()=>{if(o())return{height:s(),top:"0px"};const h={};return t()?.fullscreen?(h.height="100%",h["max-height"]="100%",h.width="100%",h["max-width"]="100%",h.bottom=0,h.left=0):t()?.style.position&&(h[t()?.style.position||"right"]=`${u()}px`),h};return pe("open",()=>{r(!0),he("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),pe("close",()=>{r(!1),he("onClose")}),pe("toggle",()=>{r(!n()),he("onToggle")}),pe("onAnswer",()=>{r(!0),he("onOpen")}),setTimeout(()=>{r(!0),he("onOpen")},(t()?.openDelay||0)*1e3),v(ie,{get when(){return n()},get children(){var h=HC();return B(h,e),ye(g=>{var f=`
|
|
181
|
+
*/function cv(e,t){return t?om([e.clientX,e.clientY],t):!1}function lv(e){const t=Fn(),n=kl(),r=nu(),o=ct({placement:"bottom-start"},e),[i,s]=J(o,["open","defaultOpen","onOpenChange"]);let a=0,c=null,l="right";const[u,d]=L(),[h,g]=L(),[f,p]=L(),[m,y]=L(),[w,x]=L(!0),[b,C]=L(s.placement),[S,O]=L([]),[D,P]=L([]),{DomCollectionProvider:T}=ry({items:D,onItemsChange:P}),I=ll({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:X=>i.onOpenChange?.(X)}),$=Pm(()=>t.forceMount()||I.isOpen()),K=jm({selectionMode:"none",dataSource:D}),U=X=>{x(X),I.open()},Q=(X=!1)=>{I.close(),X&&r&&r.close(!0)},V=X=>{x(X),I.toggle()},j=()=>{const X=m();X&&(Oe(X),K.selectionManager().setFocused(!0),K.selectionManager().setFocusedKey(void 0))},G=X=>{O(nn=>[...nn,X]);const Vt=r?.registerNestedMenu(X);return()=>{O(nn=>Gi(nn,X)),Vt?.()}},q=X=>l===c?.side&&cv(X,c?.area),qe=X=>{q(X)&&X.preventDefault()},$e=X=>{q(X)||j()},tc=X=>{q(X)&&X.preventDefault()};xm({isDisabled:()=>!(r==null&&I.isOpen()&&t.isModal()),targets:()=>[m(),...S()].filter(Boolean)}),B(()=>{const X=m();if(!X||!r)return;const Vt=r.registerNestedMenu(X);H(()=>{Vt()})});const ki={dataset:_(()=>({"data-expanded":I.isOpen()?"":void 0,"data-closed":I.isOpen()?void 0:""})),isOpen:I.isOpen,contentPresence:$,nestedMenus:S,currentPlacement:b,pointerGraceTimeoutId:()=>a,autoFocus:w,listState:()=>K,parentMenuContext:()=>r,triggerRef:f,contentRef:m,triggerId:u,contentId:h,setTriggerRef:p,setContentRef:y,open:U,close:Q,toggle:V,focusContent:j,onItemEnter:qe,onItemLeave:$e,onTriggerLeave:tc,setPointerDir:X=>l=X,setPointerGraceTimeoutId:X=>a=X,setPointerGraceIntent:X=>c=X,registerNestedMenu:G,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:mo(d),registerContentId:mo(g)};return v(T,{get children(){return v(tu.Provider,{value:ki,get children(){return v(av,N({anchorRef:f,contentRef:m,onCurrentPlacementChange:C},s))}})}})}const uv=xe();function dv(e){let t;const n=Fn(),r=Nn(),o=ct({id:n.generateId(`item-${Be()}`)},e),[i,s]=J(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,c]=L(),[l,u]=L(),[d,h]=L(),g=()=>r.listState().selectionManager(),f=()=>s.id,p=()=>g().focusedKey()===f(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};oy({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const y=Um({key:f,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),w=P=>{De(P,i.onPointerMove),P.pointerType==="mouse"&&(i.disabled?r.onItemLeave(P):(r.onItemEnter(P),P.defaultPrevented||(Oe(P.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},x=P=>{De(P,i.onPointerLeave),P.pointerType==="mouse"&&r.onItemLeave(P)},b=P=>{De(P,i.onPointerUp),!i.disabled&&P.button===0&&m()},C=P=>{if(De(P,i.onKeyDown),!P.repeat&&!i.disabled)switch(P.key){case"Enter":case" ":m();break}},S=_(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),O=_(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),D={isChecked:()=>i.checked,dataset:O,setLabelRef:h,generateId:Jc(()=>s.id),registerLabel:mo(c),registerDescription:mo(u)};return v(uv.Provider,{value:D,get children(){return v(yo,N({as:"div",ref(P){var T=fn(I=>t=I,i.ref);typeof T=="function"&&T(P)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return y.dataKey()},get onPointerDown(){return ze([i.onPointerDown,y.onPointerDown])},get onPointerUp(){return ze([b,y.onPointerUp])},get onClick(){return ze([i.onClick,y.onClick])},get onKeyDown(){return ze([C,y.onKeyDown])},get onMouseDown(){return ze([i.onMouseDown,y.onMouseDown])},get onFocus(){return ze([i.onFocus,y.onFocus])},onPointerMove:w,onPointerLeave:x},O,s))}})}const fv=xe();function ou(){return ke(fv)}function hv(e){let t;const n=Fn(),r=Nn(),o=ou(),i=ct({id:n.generateId(`content-${Be()}`)},e),[s,a]=J(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const l=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=Ym({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);wm({trapFocus:()=>l()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=m=>{if(at(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=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},f=m=>{De(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(De(m,s.onPointerMove),m.pointerType!=="mouse")return;const y=m.target,w=c!==m.clientX;at(m.currentTarget,y)&&w&&(r.setPointerDir(m.clientX>c?"right":"left"),c=m.clientX)};return B(()=>H(r.registerContentId(s.id))),v(ie,{get when(){return r.contentPresence.isPresent()},get children(){return v(my,{get children(){return v(gy,N({ref(m){var y=fn(w=>{r.setContentRef(w),r.contentPresence.setRef(w),t=w},s.ref);typeof y=="function"&&y(m)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return Ut(()=>!!l())()&&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",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return ze([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return ze([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return ze([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return ze([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:p},()=>r.dataset(),a))}})}})}function gv(e){let t;const n=Fn(),r=Nn(),[o,i]=J(e,["ref"]);return Il({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),v(hv,N({ref(s){var a=fn(c=>{t=c},o.ref);typeof a=="function"&&a(s)}},i))}function pv(e){return v(dv,N({role:"menuitem",closeOnSelect:!0},e))}function mv(e){const t=Nn();return v(ie,{get when(){return t.contentPresence.isPresent()},get children(){return v(Ic,e)}})}function yv(e){const t=`menu-${Be()}`,n=ct({id:t,modal:!0},e),[r,o]=J(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=ll({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:Jc(()=>r.id),value:()=>r.value};return v(ru.Provider,{value:s,get children(){return v(lv,N({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function vv(e){const t=Fn(),n=Nn(),r=ou(),o=ct({id:t.generateId("trigger")},e),[i,s]=J(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,B(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),B(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),B(()=>{n.isOpen()&&r.setValue(a)}),H(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const c=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},l=f=>{De(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&c()},u=f=>{De(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&c()},d=f=>{if(De(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),im(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=>{De(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=f=>{De(f,i.onFocus),r!==void 0&&r.setValue(a)};return B(()=>H(n.registerTriggerId(i.id))),v(Xm,N({ref(f){var p=fn(n.setTriggerRef,i.ref);typeof p=="function"&&p(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Ut(()=>!!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:l,onMouseOver:h,onClick:u,onKeyDown:d,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function wv(e){const t=Fn(),n=Nn(),[r,o]=J(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return v(gv,N({onCloseAutoFocus:c=>{r.onCloseAutoFocus?.(c),i||Oe(n.triggerRef()),i=!1,c.preventDefault()},onInteractOutside:c=>{r.onInteractOutside?.(c),(!t.isModal()||c.detail.isContextMenu)&&(i=!0)}},o))}function bv(e){const t=`dropdownmenu-${Be()}`,n=ct({id:t},e);return v(yv,n)}function xv(e){return Ke({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 Sv(e){return Ke({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 Ev(e){return Ke({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 Pv=e=>v(bv,N({gutter:4},e)),Cv=vv,kv=e=>{const[,t]=J(e,["class"]);return v(mv,{get mount(){return Hr()},get children(){return v(wv,N({get class(){return zt("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))}})},Ov=e=>{const[,t]=J(e,["class"]);return v(pv,N({get class(){return zt("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 Tv(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 Av(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function $v(e,t,n){const r=`${On}/v1/messages`,o=lo(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:Wc()})};await fetch(r,s)}async function Dv(e){const t=`${On}/v1/messages`,n=lo(),r={"Content-Type":"application/json"};n&&(r["x-session-id"]=n);const o={credentials:"include",method:"POST",headers:r,body:JSON.stringify({channelId:e,type:"open",metadata:Wc()})},i=await fetch(t,o);if(!i.ok)throw new Error(`open event rejected: ${i.status}`)}async function Rv(e,t,n){if(!e||!t||!n)return;const r=`${On}/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 ft=Object.create(null);ft.open="0",ft.close="1",ft.ping="2",ft.pong="3",ft.message="4",ft.upgrade="5",ft.noop="6";const ko=Object.create(null);Object.keys(ft).forEach(e=>{ko[ft[e]]=e});const Ss={type:"error",data:"parser error"},iu=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",su=typeof ArrayBuffer=="function",au=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Es=({type:e,data:t},n,r)=>iu&&t instanceof Blob?n?r(t):cu(t,r):su&&(t instanceof ArrayBuffer||au(t))?n?r(t):cu(new Blob([t]),r):r(ft[e]+(t||"")),cu=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function lu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ps;function Mv(e,t){if(iu&&e.data instanceof Blob)return e.data.arrayBuffer().then(lu).then(t);if(su&&(e.data instanceof ArrayBuffer||au(e.data)))return t(lu(e.data));Es(e,!1,n=>{Ps||(Ps=new TextEncoder),t(Ps.encode(n))})}const uu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Er=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<uu.length;e++)Er[uu.charCodeAt(e)]=e;const Iv=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)i=Er[e.charCodeAt(r)],s=Er[e.charCodeAt(r+1)],a=Er[e.charCodeAt(r+2)],c=Er[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|c&63;return l},_v=typeof ArrayBuffer=="function",Cs=(e,t)=>{if(typeof e!="string")return{type:"message",data:du(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Lv(e.substring(1),t)}:ko[n]?e.length>1?{type:ko[n],data:e.substring(1)}:{type:ko[n]}:Ss},Lv=(e,t)=>{if(_v){const n=Iv(e);return du(n,t)}else return{base64:!0,data:e}},du=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},fu="",Nv=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Es(i,!1,a=>{r[s]=a,++o===n&&t(r.join(fu))})})},Fv=(e,t)=>{const n=e.split(fu),r=[];for(let o=0;o<n.length;o++){const i=Cs(n[o],t);if(r.push(i),i.type==="error")break}return r};function Vv(){return new TransformStream({transform(e,t){Mv(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 i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let ks;function Oo(e){return e.reduce((t,n)=>t+n.length,0)}function To(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 Bv(e,t){ks||(ks=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(Oo(n)<1)break;const c=To(n,1);i=(c[0]&128)===128,o=c[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Oo(n)<2)break;const c=To(n,2);o=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(Oo(n)<8)break;const c=To(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Ss);break}o=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(Oo(n)<o)break;const c=To(n,o);a.enqueue(Cs(i?c:ks.decode(c),t)),r=0}if(o===0||o>e){a.enqueue(Ss);break}}}})}const hu=4;function me(e){if(e)return Kv(e)}function Kv(e){for(var t in me.prototype)e[t]=me.prototype[t];return e}me.prototype.on=me.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},me.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},me.prototype.off=me.prototype.removeListener=me.prototype.removeAllListeners=me.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},me.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},me.prototype.emitReserved=me.prototype.emit,me.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},me.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ao=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),We=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),zv="arraybuffer";function fk(){}function gu(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Uv=We.setTimeout,Wv=We.clearTimeout;function $o(e,t){t.useNativeTimers?(e.setTimeoutFn=Uv.bind(We),e.clearTimeoutFn=Wv.bind(We)):(e.setTimeoutFn=We.setTimeout.bind(We),e.clearTimeoutFn=We.clearTimeout.bind(We))}const jv=1.33;function Hv(e){return typeof e=="string"?Yv(e):Math.ceil((e.byteLength||e.size)*jv)}function Yv(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 pu(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function qv(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Gv(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Xv extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Os extends me{constructor(t){super(),this.writable=!1,$o(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 Xv(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=Cs(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=qv(t);return n.length?"?"+n:""}}class Zv extends Os{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)};Fv(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,Nv(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]=pu()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let mu=!1;try{mu=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Jv=mu;function Qv(){}class ew extends Zv{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,i)=>{this.onError("xhr post error",o,i)})}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 ht extends me{constructor(t,n,r){super(),this.createRequest=t,$o(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=gu(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=ht.requestsCount++,ht.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=Qv,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ht.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(ht.requestsCount=0,ht.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",yu);else if(typeof addEventListener=="function"){const e="onpagehide"in We?"pagehide":"unload";addEventListener(e,yu,!1)}}function yu(){for(let e in ht.requests)ht.requests.hasOwnProperty(e)&&ht.requests[e].abort()}const tw=(function(){const e=vu({xdomain:!1});return e&&e.responseType!==null})();class nw extends ew{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=tw&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ht(vu,this.uri(),t)}}function vu(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Jv))return new XMLHttpRequest}catch{}if(!t)try{return new We[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const wu=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class rw extends Os{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=wu?{}:gu(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;Es(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Ao(()=>{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]=pu()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ts=We.WebSocket||We.MozWebSocket;class ow extends rw{createSocket(t,n,r){return wu?new Ts(t,n,r):n?new Ts(t,n):new Ts(t)}doWrite(t,n){this.ws.send(n)}}class iw extends Os{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=Bv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Vv();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).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&&Ao(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const sw={websocket:ow,webtransport:iw,polling:nw},aw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,cw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function As(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=aw.exec(e||""),i={},s=14;for(;s--;)i[cw[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=lw(i,i.path),i.queryKey=uw(i,i.query),i}function lw(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 uw(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const $s=typeof addEventListener=="function"&&typeof removeEventListener=="function",Do=[];$s&&addEventListener("offline",()=>{Do.forEach(e=>e())},!1);class qt extends me{constructor(t,n){if(super(),this.binaryType=zv,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=As(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=As(n.host).host);$o(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=Gv(this.opts.query)),$s&&(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"})},Do.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=hu,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&&qt.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",qt.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+=Hv(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,Ao(()=>{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 i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),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(qt.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(),$s&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Do.indexOf(this._offlineEventListener);r!==-1&&Do.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}qt.protocol=hu;class dw extends qt{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;qt.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;qt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),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 i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function c(){s("socket closed")}function l(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),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 fw=class extends dw{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=>sw[o]).filter(o=>!!o)),super(t,r)}};function hw(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=As(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 i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const gw=typeof ArrayBuffer=="function",pw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,bu=Object.prototype.toString,mw=typeof Blob=="function"||typeof Blob<"u"&&bu.call(Blob)==="[object BlobConstructor]",yw=typeof File=="function"||typeof File<"u"&&bu.call(File)==="[object FileConstructor]";function Ds(e){return gw&&(e instanceof ArrayBuffer||pw(e))||mw&&e instanceof Blob||yw&&e instanceof File}function Ro(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ro(e[n]))return!0;return!1}if(Ds(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ro(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ro(e[n]))return!0;return!1}function vw(e){const t=[],n=e.data,r=e;return r.data=Rs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Rs(e,t){if(!e)return e;if(Ds(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]=Rs(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]=Rs(e[r],t));return n}return e}function ww(e,t){return e.data=Ms(e.data,t),delete e.attachments,e}function Ms(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]=Ms(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ms(e[n],t));return e}const bw=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];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 xw{constructor(t){this.replacer=t}encode(t){return(t.type===Z.EVENT||t.type===Z.ACK)&&Ro(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=vw(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class Is extends me{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}: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 Sw(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ds(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 i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(s);if(!Ew(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Is.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Z.CONNECT:return xu(n);case Z.DISCONNECT:return n===void 0;case Z.CONNECT_ERROR:return typeof n=="string"||xu(n);case Z.EVENT:case Z.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&bw.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 Sw{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=ww(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Ew=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function xu(e){return Object.prototype.toString.call(e)==="[object Object]"}const Pw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Is,Encoder:xw,get PacketType(){return Z}},Symbol.toStringTag,{value:"Module"}));function nt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Cw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Su extends me{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=[nt(t,"open",this.onopen.bind(this)),nt(t,"packet",this.onpacket.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(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,i;if(Cw.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 s={type:Z.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,c=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),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 i=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),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),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,...i)=>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,...i)),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 Vn(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}Vn.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)==0?e-n:e+n}return Math.min(e,this.max)|0},Vn.prototype.reset=function(){this.attempts=0},Vn.prototype.setMin=function(e){this.ms=e},Vn.prototype.setMax=function(e){this.max=e},Vn.prototype.setJitter=function(e){this.jitter=e};class _s extends me{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,$o(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 Vn({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||Pw;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 fw(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=nt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=nt(n,"error",i);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(nt(t,"ping",this.onping.bind(this)),nt(t,"data",this.ondata.bind(this)),nt(t,"error",this.onerror.bind(this)),nt(t,"close",this.onclose.bind(this)),nt(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){Ao(()=>{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 Su(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 Pr={};function Mo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=hw(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Pr[o]&&i in Pr[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new _s(r,t):(Pr[o]||(Pr[o]=new _s(r,t)),c=Pr[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Mo,{Manager:_s,Socket:Su,io:Mo,connect:Mo});class gt{static instance;constructor(){}static init(t){if(!gt.instance){const n=lo();gt.instance=Mo(tg,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),gt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",gt.instance.id)})}return gt.instance}static on(t,n,r){const o=gt.instance||this.init(n);o.off(t),o.on(t,r)}static waitForConnection(t){const n=gt.instance||this.init(t);return n.connected?Promise.resolve():new Promise(r=>{n.once("connect",()=>r())})}}const Ls=1e3*60*60*24,[Io,Eu]=Hi("smarttalks-widget-messages",{},Ls),Pu=()=>{const{widgetId:e}=ge();return Io[e()]??[]},kw=e=>{const{widgetId:t}=ge();Eu({...Io,[t()]:[...Io[t()]??[],e]})},Ow=()=>{const{widgetId:e}=ge();Eu({...Io,[e()]:[]})},[Cu,Tw]=Hi("smarttalks-widget-conversationinfo",{},Ls),Ns=()=>{const{widgetId:e}=ge();return Cu[e()]??{}},ku=e=>{const{widgetId:t}=ge();Tw({...Cu,[t()]:e})},[Ou,Aw]=Hi("smarttalks-widget-autostarted",{},Ls),$w=()=>{const{widgetId:e}=ge();return Ou[e()]??!1},Tu=e=>{const{widgetId:t}=ge();Aw({...Ou,[t()]:e})},[Dw,Fs]=L(!1),[Rw,Au]=L(!1),$u=[],Du=()=>{$u.forEach(e=>e())},Mw=e=>$u.push(e),Vs=e=>{const t=Tv(e);if(kw(t),t.type==="media"){setTimeout(Du,200);return}Du()},Ru=()=>{const{widgetId:e}=ge(),t=Ns();gt.on("message",e(),n=>{(n.contactId!==t.contactId||n.interactionId!==t.interactionId)&&ku({contactId:n.contactId,interactionId:n.interactionId});for(const r of n.messages)Vs(r),he("onAnswer",r);Fs(!1),Av(n.debug)})},Iw=(e,t)=>{const{chatWidget:n}=ge();e.trim()&&(Vs({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),he("onInput",e),Ru(),Fs(!0),$v(e,t,n()?._id).catch(r=>{console.error(r),Fs(!1)}))};let Bs=!1;const _w=()=>{const{chatWidget:e,widgetId:t}=ge();Ru(),Bs=!0,gt.waitForConnection(t()).then(()=>Dv(e()?._id)).then(()=>Tu(!0)).catch(n=>console.error(n)).finally(()=>{Bs=!1})},Mu=()=>{Ns().interactionId||$w()||Bs||_w()},Lw=()=>{const{chatWidget:e}=ge(),t=Ns();Au(!0),Ow(),Rv(e()?._id,t.contactId,t.interactionId).finally(()=>{ku({}),Au(!1),Iu(),Tu(!1),Mu()}),he("onReset")},Iu=()=>{const{chatWidget:e}=ge();if(Pu().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Vs({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Gt=()=>({getMessages:Pu,pushMessage:Iw,maybeAutostart:Mu,clearMessages:Lw,addBalloonMessage:Iu,onMessage:Mw,typing:Dw,loading:Rw});var Nw=W("<span>");const Fw=()=>{const{clearMessages:e}=Gt();L(!1);const[t,n]=L(!1);return v(Pv,{get open(){return t()},onOpenChange:n,get children(){return[v(Cv,{get children(){return v(Je,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return v(kp,{size:20})}})}}),v(kv,{get children(){return v(Ov,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[v(Cp,{size:14}),(()=>{var r=Nw();return F(r,()=>kn("restart")),r})()]}})}})]}})};function Vw(e){return Ke({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 Bw(e){return Ke({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 Kw(e){return Ke({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 zw(e){return Ke({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 Uw=W('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Ks=()=>{const{chatWidget:e}=ge(),[t,n]=L(!1);let r=null;cn(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&l()});const o=h=>{const g=h;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async h=>{const g=h;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=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)},c=h=>{h.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},l=async()=>{try{const h=Hr();if(!h)return;if(!t())o(h)&&await i(h)||a(h);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||c(h)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},u=()=>{const h=document,g=!!(document.fullscreenElement||h.webkitFullscreenElement||h.msFullscreenElement);if(n(g),!g)try{const f=Hr();f.classList.contains("st-fullscreen")&&c(f)}catch{}};document.addEventListener("fullscreenchange",u),document.addEventListener("webkitfullscreenchange",u);const d=()=>{e()?.mode==="popup"&&he("close")};return pe("toggleFullscreen",()=>{l()}),(()=>{var h=Uw(),g=h.firstChild;return F(h,v(Ep,{}),g),F(g,v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:l,get children(){return v(ie,{get when(){return t()},get fallback(){return v(Bw,{size:16})},get children(){return v(Vw,{size:16})}})}}),null),F(g,v(ie,{get when(){return e()?.showSettings},get children(){return v(Fw,{})}}),null),F(g,v(ie,{get when(){return e()?.mode==="popup"},get children(){return v(Je,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:d,get children(){return v(zw,{size:16})}})}}),null),h})()};var Ww=W("<span>");const _u=({createdAt:e,anchor:t="end"})=>(()=>{var n=Ww();return Wt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),F(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var jw=W('<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 Hw=({children:e,createdAt:t})=>(()=>{var n=jw(),r=n.firstChild;return F(r,e),F(n,v(_u,{createdAt:t,anchor:"start"}),null),n})();var Yw=W("<span>");const _o=e=>{const[t,n]=L(!1),r=o=>{const i=new ResizeObserver(()=>{n(o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)});i.observe(o),H(()=>i.disconnect())};return(()=>{var o=Yw();return oo(r,o),F(o,()=>e.text),ye(i=>{var s=e.class,a=t()?e.text:void 0;return s!==i.e&&Wt(o,i.e=s),a!==i.t&&Se(o,"title",i.t=a),i},{e:void 0,t:void 0}),o})()};var qw=W("<span>");const Bn=e=>{const[,t]=J(e,["class","children"]);let n=e.children?.toString();return n&&(n=Jh(Qh(n))),(()=>{var r=qw();return r.innerHTML=n,un(r,N({get class(){return zt("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Gw=W('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Xw=({options:e,text:t})=>{let n;const{pushMessage:r}=Gt(),[o,i]=L(!1),s=(a,c)=>{i(!0),r(a,c)};return(()=>{var a=Gw(),c=a.firstChild,l=c.firstChild;F(a,v(Bn,{get children(){return t?.trim()}}),c);var u=n;return typeof u=="function"?oo(u,l):n=l,F(l,v(ln,{each:e,children:d=>v(Je,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 max-w-full min-w-0",onClick:()=>s(d.label,d.value),get children(){return v(_o,{class:"min-w-0 truncate",get text(){return d.label?.trim()}})}})})),ye(()=>Wt(c,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Zw=W('<div class="flex flex-col"><span>'),Jw=W("<a target=_blank><img><span></span><span>");const Qw=({options:e,text:t})=>(()=>{var n=Zw(),r=n.firstChild;return F(r,()=>t?.trim()),F(n,v(ln,{each:e,children:o=>(()=>{var i=Jw(),s=i.firstChild,a=s.nextSibling,c=a.nextSibling;return F(a,()=>o.title?.trim()),F(c,()=>o.description?.trim()),ye(l=>{var u=o.url,d=o.image;return u!==l.e&&Se(i,"href",l.e=u),d!==l.t&&Se(s,"src",l.t=d),l},{e:void 0,t:void 0}),i})()}),null),n})();var eb=W("<a target=_blank>");const tb=({url:e,text:t})=>(()=>{var n=eb();return Se(n,"href",e),F(n,()=>t?.trim()),n})();var ce=e=>typeof e=="function"?e():e,Lu=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),nb=e=>{const t=N({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[_(()=>{if(n())return ce(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Nu=nb,Cr=e=>typeof e=="function",rb=["button","color","file","image","reset","submit"],ob=(e,t)=>e==="button"?!0:e==="input"&&t?rb.indexOf(t)!==-1:!1;function ib(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>ne(()=>{let a;return Cr(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var zs=ib,Lo=new Map,No=(e,t)=>{if(Lo.has(e))return Lo.get(e);const n=xe(t);return Lo.set(e,n),n},Us=e=>{const t=Lo.get(e);if(t)return ke(t)},Fo=new Map,sb=e=>{B(()=>{const t=ce(e.style)??{},n=ce(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Fo.get(e.key);o?o.activeCount++:Fo.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);H(()=>{const i=Fo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Fo.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},ab=sb,cb=e=>{const t=N({enabled:!0},e);B(()=>{ce(t.enabled)&&(document.addEventListener("keydown",n),H(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},lb=cb,ub=e=>{const t=N({enabled:!0},e);B(()=>{const{body:n}=document;ce(t.enabled)&&ab({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},db=ub,fb=e=>{const t=N({enabled:!0,strategy:"pointerup"},e);B(()=>{if(!ce(t.enabled))return;const r=ce(t.strategy);document.addEventListener(r,n),H(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=ce(t.element),i=ce(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},hb=fb,gb=e=>{const t=N({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);lb({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),hb({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}),db({enabled:t.noOutsidePointerEvents})},pb=gb,Ws=xe(),mb=e=>_(()=>{if(ke(Ws))return v(Fu,e);const r=Be(),[o,i]=L([r]),s=c=>{i(l=>[...l,c])},a=c=>{i(l=>l.filter(u=>u!==c))};return v(Ws.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return v(Fu,e)}})}),Fu=e=>{const t=N({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=J(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ke(Ws),i=Be();B(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;pb({dismissOnEscapeKeyDown:()=>ce(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>ce(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>ce(n.noOutsidePointerEvents)&&n.enabled,onDismiss:l=>{n.onDismiss(l)},...r});const a=_(()=>n.children),c=()=>{const l=a();return Cr(l)?l({get isLastLayer(){return s()}}):l};return ne(()=>c())},yb=mb,vb=()=>{const[e,t]=L(!1);return B(()=>t(!0)),e},wb=vb,bb=(e,t)=>(e&&(Cr(e)?e(t):e[0](e[1],t)),t.defaultPrevented),js=(...e)=>e.some(t=>!!t()),xb=e=>(...t)=>{for(const n of e)n&&n(...t)},Vo=(...e)=>xb(e),be=e=>e?"":void 0,Sb="div",Eb=e=>{const[t,n]=J(e,["as"]),r=_(()=>t.as??Sb);return _(()=>{const i=r();switch(typeof i){case"function":return ne(()=>i(n));case"string":return v(dr,N({component:i},n))}})},Hs=Eb,Pb=e=>{let t,n=!1;return()=>n?t:(n=!0,t=_(e))},Vu=Pb,Cb=e=>_(()=>ce(e.element)?.tagName.toLowerCase()||e.fallback),kb=Cb,Bu="button",Ob=e=>{const[t,n]=L(null),[r,o]=J(e,["as","ref","type"]),i=kb({element:t,fallback:Bu}),s=_(()=>ob(i(),r.type));return v(Hs,N({get as(){return r.as??Bu},ref(a){var c=Vo(n,r.ref);typeof c=="function"&&c(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},Tb=Ob,Ab='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"])',Ys="focusTrap.initialFocus",qs="focusTrap.finalFocus",Ku={bubbles:!1,cancelable:!0},$b=e=>{const t=N({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=_(()=>{const f=n();return f?f[0]??null:null}),i=_(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{us(()=>{c(de(t.element)),(document.activeElement===null||document.activeElement===document.body)&&l(de(t.element))})};B(()=>{const f=de(t.element);if(f&&de(t.enabled)){s=document.activeElement,ne(()=>{c(f),l(f)});const p=new MutationObserver(a);de(t.observeChanges)&&p.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),H(()=>{de(t.observeChanges)&&p.disconnect(),r(null),g(f)})}}),B(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),H(()=>{document.removeEventListener("keydown",h)}))}),B(()=>{const f=o();f&&(f.addEventListener("keydown",u),H(()=>{f.removeEventListener("keydown",u)}))}),B(()=>{const f=i();f&&(f.addEventListener("keydown",d),H(()=>{f.removeEventListener("keydown",d)}))});const c=f=>{const p=Array.from(f.querySelectorAll(Ab)).map((m,y)=>({element:m,domIndex:y,tabIndex:m.tabIndex})).sort((m,y)=>m.tabIndex===y.tabIndex?m.domIndex-y.domIndex:m.tabIndex-y.tabIndex);r(p.map(({element:m})=>m))},l=f=>{us(()=>{const p=de(t.initialFocusElement)??o()??f,m=t.onInitialFocus;let y;m&&(y=new CustomEvent(Ys,Ku),f.addEventListener(Ys,m),f.dispatchEvent(y),f.removeEventListener(Ys,m)),y?.defaultPrevented!==!0&&p.focus()})},u=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},d=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},g=f=>{us(()=>{if(!de(t.restoreFocus))return;const m=de(t.finalFocusElement)??s;if(!m)return;let y;const w=t.onFinalFocus;w&&(y=new CustomEvent(qs,Ku),f.addEventListener(qs,w),f.dispatchEvent(y),f.removeEventListener(qs,w)),y?.defaultPrevented!==!0&&m.focus()})}},Db=$b,Rb=Db,Mb=e=>{const t=_(()=>{const s=de(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(de(e.show)?"present":"hidden");let i="none";return B(s=>{const a=de(e.show);return ne(()=>{if(s===a)return a;const c=i,l=n();a?o("present"):l==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&c!==l?"hiding":"hidden")}),a}),B(()=>{const s=de(e.element);if(!s)return;const a=l=>{l.target===s&&(i=n())},c=l=>{const d=n().includes(l.animationName);l.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c),H(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",c),s.removeEventListener("animationend",c)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},Ib=Mb,zu=Ib,_b=xe(),Lb=e=>e?No(`dialog-${e}`):_b,Uu=xe(),Nb=e=>e?No(`dialog-internal-${e}`):Uu,Kn=e=>{if(!e){const n=ke(Uu);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=Us(`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},Fb="div",Vb=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().contentPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return v(yb,{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:s=>{const a=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Hs,N({ref(c){var l=Vo(r().setContentRef,t.ref);typeof l=="function"&&l(c)},get as(){return t.as??Fb},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 be(r().open())},get"data-closed"(){return be(!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":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},Bb=Vb,Kb="div",zb=e=>{const[t,n]=J(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().overlayPresent),i=_(s=>s||o(),!1);return v(ie,{get when(){return i()},get children(){return(()=>{const s=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Hs,N({get as(){return t.as??Kb},ref(a){var c=Vo(r().setOverlayRef,t.ref);typeof c=="function"&&c(a)},"aria-hidden":"true",get"data-open"(){return be(r().open())},get"data-closed"(){return be(!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 s()}}))}})})()}})},Ub=zb,Wb=e=>{const[t,n]=J(e,["forceMount","contextId","children"]),r=_(()=>Kn(t.contextId)),o=()=>js(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=wb(),s=_(a=>a||o()&&i(),!1);return v(ie,{get when(){return s()},get children(){return(()=>{const a=_(()=>t.children);return v(ie,{get when(){return o()},get children(){return v(Ic,N(n,{get children(){return a()}}))}})})()}})},jb=Wb,Gs=!0,Hb=e=>{const t=N({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Gs),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Gs),preventScroll:()=>!!(e.modal??Gs),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Be()},e),[n,r]=zs({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Nu({value:()=>t.labelId??Be()}),[a,c,l]=Nu({value:()=>t.descriptionId??Be()}),[u,d]=L(null),[h,g]=L(null),[f,p]=L(null),{present:m}=zu({show:n,element:h}),{present:y}=zu({show:n,element:f});Rb({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Il({element:h,enabled:()=>m()&&ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const w={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return ce(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return ce(t.noOutsidePointerEvents)},get preventScroll(){return ce(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return ce(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 y()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},x=Vu(()=>t.children),b=()=>{const S=x()();return Cr(S)?S(w):S};return _(()=>{const S=Lb(t.contextId),O=Nb(t.contextId);return v(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(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:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return v(O.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(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:y,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:c,unregisterDescriptionId:l,setContentRef:g,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return ne(()=>b())}})}})})},Yb=Hb,qb="button",Gb=e=>{const[t,n]=J(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=_(()=>Kn(t.contextId));return v(Tb,N({ref(i){var s=Vo(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??qb},onClick:i=>{!bb(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return be(r().open())},get"data-closed"(){return be(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},Xb=Gb,Bo=e=>typeof e=="function"?e():e,Wu=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function Zb(e){const t=N({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;B(()=>{const l=Bo(t.element),u=Bo(t.enabled);if(!l||!u)return;const d=new ResizeObserver(a);d.observe(l),l.addEventListener("transitionend",c),H(()=>{d.disconnect(),l.removeEventListener("transitionend",c),c()})});const a=([l])=>{if(n())return;const u=l.target,d=[u.offsetWidth,u.offsetHeight],h=Bo(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Ze(()=>{i(s),r(!0)}),Wu(()=>{i(d),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d:s?Ko(h,s)!==Ko(h,d)&&(Ze(()=>{i(Ko(h,s)),r(!0)}),Wu(()=>{i(Ko(h,d)),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d},c=()=>{if(!n())return;const l=Bo(t.element);l?s=[l.offsetWidth,l.offsetHeight]:s=null,Ze(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Ko=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Jb=Zb,Qb=Jb;const e0=(e,t)=>e.length>0?()=>e(ne(t)):e;function t0(e,t){let n=0;const r=e.map((o,i)=>_(()=>(n=i,o()),void 0,Yi));return _(()=>r.map(o=>o())[n],void 0,t)}function ju(e,t,n){let r=()=>t;const[o,i]=L(t,Yi),s=_(e0(e,()=>r()),t,Yi);return[r=t0([o,s],n),(a=>i(()=>typeof a=="function"?a(ne(r)):a))]}var n0=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},r0=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},o0=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[c,l,u]=n0(o,t),d=u-c-r*l;(l!==0||d!==0)&&r0(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},i0=e=>v(Xb,N({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Hu=xe(),s0=e=>e?No(`drawer-${e}`):Hu,a0=e=>{if(!e){const n=ke(Hu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Us(`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},Yu=xe(),c0=e=>e?No(`drawer-internal-${e}`):Yu,qu=e=>{if(!e){const n=ke(Yu);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Us(`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},Gu=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:zo(e,t)};const o=r[n-1]?zo(r[n-1],t):void 0,i=r[n]?zo(r[n],t):void 0;return{value:e,offset:zo(e,t),lowerBreakPoint:i,upperBreakPoint:o}},zo=(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)},l0=(e,t,n,r)=>{const o=Xu("upper",e,r?n:t),i=Xu("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Xu=(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),u0=(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},d0=void 0,f0=e=>{const t=N({initialOpen:!1,snapPoints:[0,1],breakPoints:[d0],defaultSnapPoint:1,side:"bottom",dampFunction:V=>6*Math.log(V+1),velocityFunction:(V,j)=>{const G=V/j;return G<1&&G>-1?1:G},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,i]=zs({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=zs({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[c,l]=L(),{transitioning:u,transitionSize:d}=Qb({element:()=>c()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,g]=L(!1),[f,p]=ju(()=>u()?"resizing":null),m=_(()=>{const V=c()?.contentRef();if(V)return getComputedStyle(V)}),[y,w]=L(!1);B(()=>{const V=o();ne(()=>{y()!==V&&(V?(w(!0),Lu(()=>{Ze(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(Ze(()=>{p("closing"),a(0)}),Lu(()=>{parseFloat(m().transitionDuration)===0&&x()})))})});const x=()=>{Ze(()=>{w(!1),p(null)})},[b,C]=L(0);B(()=>{const V=c()?.contentRef();if(!V)return;O(V);const j=new ResizeObserver(S);j.observe(V),H(()=>{j.disconnect()})});const S=V=>{for(const j of V)j.target===c()?.contentRef()&&O(j.target)},O=V=>{const j=ne(()=>b());switch(n.side){case"top":case"bottom":if(j===V.offsetHeight)return;C(V.offsetHeight);break;case"left":case"right":if(j===V.offsetWidth)return;C(V.offsetWidth);break}},D=_(()=>Gu(s(),b())),[P,T]=ju(()=>D().offset),I=_(()=>b()?(b()-P())/b():0),$={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return I()},get translate(){return P()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},K=Vu(()=>n.children),U=V=>{l(Kn(n.contextId));const j=K()();if(Cr(j)){const G=N(V,$);return j(G)}return j};return _(()=>{const V=s0(n.contextId),j=c0(n.contextId);return ne(()=>v(V.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return v(j.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:P,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:T,drawerSize:b,resolvedActiveSnapPoint:D,drawerStyles:m,setTransitionState:p,transitionSize:d,closeDrawer:x}},get children(){return v(Yb,N({get open(){return y()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:G=>U(G)}))}})}}))})},h0=f0,g0=e=>{const[t,n]=J(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const c=_(()=>qu(t.contextId)),l=_(()=>Kn(t.contextId)),u=_(()=>c().snapPoints().map((x,b)=>Gu(x,c().drawerSize(),b,c().breakPoints()))),d=_(()=>{switch(c().side()){case"top":return`translate3d(0, ${-c().translate()}px, 0)`;case"bottom":return`translate3d(0, ${c().translate()}px, 0)`;case"right":return`translate3d(${c().translate()}px, 0, 0)`;case"left":return`translate3d(${-c().translate()}px, 0, 0)`}}),h=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"top":case"bottom":return`${x}px`}}),g=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"left":case"right":return`${x}px`}});B(()=>{l().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",w),document.addEventListener("touchend",w),H(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)}))});const f=x=>{u0(x.target,l().contentRef())&&c().transitionState()!=="closing"&&(r=!0,c().handleScrollableElements()&&(i=[x.clientX,x.clientY]))},p=x=>{y(x.target,x.clientX,x.clientY)},m=x=>{x.touches[0]&&y(x.target,x.touches[0].clientX,x.touches[0].clientY)},y=(x,b,C)=>{if(!r)return;if(!c().isDragging()||o===null){const D=window.getSelection();if(D&&D.toString().length>0){w();return}if(c().handleScrollableElements()){const P=[b,C].map((Q,V)=>i[V]-Q),T=Math.abs(P[0])>Math.abs(P[1])?"x":"y",I=T==="x"?P[0]:P[1];if(Math.abs(I)<.3)return;const $=l().contentRef(),[K,U]=o0(x,T,$);if(I>0&&Math.abs(K)>1||I<0&&Math.abs(U)>0){w();return}}switch(c().side()){case"top":case"bottom":o=C;break;case"right":case"left":o=b}s=new Date,a=c().translate(),Ze(()=>{c().setIsDragging(!0),c().setTransitionState(null)})}let S;switch(c().side()){case"top":S=-(o-C);break;case"bottom":S=o-C;break;case"right":S=o-b;break;case"left":S=-(o-b);break}S-=c().resolvedActiveSnapPoint().offset,S>0&&(S=c().dampFunction(S));const O=new Date;O.getTime()-s.getTime()>c().velocityCacheReset()&&(s=O,a=c().translate()),c().setTranslate(-S)},w=()=>{if(r=!1,!c().isDragging())return;const x=new Date,b=c().velocityFunction(-(a-c().translate()),x.getTime()-s.getTime()||1),C=c().translate()*b,S=l0(u(),c().translate(),C,c().allowSkippingSnapPoints());Ze(()=>{c().setTransitionState("snapping"),c().setIsDragging(!1)}),Ze(()=>{c().setActiveSnapPoint(S.value),S.offset===c().drawerSize()?l().setOpen(!1):(c().setTranslate(S.offset),parseFloat(c().drawerStyles().transitionDuration)===0&&c().setTransitionState(null))})};return v(Bb,N({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":c().isDragging()?"0ms":void 0,height:h(),width:g(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Ze(()=>{c().transitionState()==="closing"&&c().closeDrawer(),c().transitionState()!=="resizing"&&c().setTransitionState(null)})},get"data-transitioning"(){return be(c().isTransitioning())},get"data-opening"(){return be(c().transitionState()==="opening")},get"data-closing"(){return be(c().transitionState()==="closing")},get"data-snapping"(){return be(c().transitionState()==="snapping")},get"data-resizing"(){return be(c().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},p0=g0,m0=e=>{const[t,n]=J(e,["contextId"]),r=_(()=>qu(t.contextId));return v(Ub,N({get contextId(){return t.contextId},get"data-transitioning"(){return be(r().isTransitioning())},get"data-opening"(){return be(r().transitionState()==="opening")},get"data-closing"(){return be(r().transitionState()==="closing")},get"data-snapping"(){return be(r().transitionState()==="snapping")},get"data-resizing"(){return be(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},y0=m0,v0=W('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const w0=h0,b0=i0,x0=jb,S0=e=>{const[,t]=J(e,["class"]),n=a0();return v(y0,N({get class(){return zt("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))},E0=e=>{const[,t]=J(e,["class","children"]);return v(x0,{get mount(){return Hr()},get children(){return[v(S0,{}),v(p0,N({id:"smarttalks-list-content",get class(){return zt("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[v0(),Ut(()=>e.children)]}}))]}})};var P0=W('<span class="font-semibold mt-2 max-w-full px-4 text-center break-words">'),C0=W('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),k0=W('<div class="flex flex-col space-y-2"><div>'),O0=W('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),T0=W('<div class="flex min-w-0 flex-col items-start text-left">');const A0=({options:e,text:t,title:n})=>{const{pushMessage:r}=Gt(),[o,i]=L(!1),[s,a]=L(!1),[c,l]=L(),u=(h,g)=>{a(!1),i(!0),r(h,g)},d=h=>{const g=h.composedPath();for(const f of g)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=k0(),g=h.firstChild;return F(h,v(Bn,{get children(){return t?.trim()}}),g),F(g,v(w0,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[v(b0,{as:Je,variant:"outline",class:"w-full min-w-0",get children(){return v(_o,{class:"min-w-0 truncate",get text(){return n?.trim()??kn("selectOption")}})}}),v(E0,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=P0();return F(f,()=>n?.trim()??kn("selectOption")),f})(),(()=>{var f=C0();return F(f,v(ln,{each:e,children:p=>(()=>{var m=O0(),y=m.firstChild;return F(y,()=>p.label?.trim()??""),F(m,v(ln,{get each(){return p.items},children:w=>v(Je,{variant:"outline",get disabled(){return o()},get class(){return`h-auto py-3 flex justify-between gap-2 hover:bg-slate-200 ${c()===w?"bg-slate-200":""}`},onClick:()=>l(w),get children(){return[(()=>{var x=T0();return F(x,v(_o,{class:"max-w-full truncate",get text(){return w.label?.trim()}}),null),F(x,v(_o,{class:"max-w-full line-clamp-2 text-slate-500",get text(){return w.description?.trim()}}),null),x})(),v(ie,{get when(){return c()===w},get fallback(){return v(Sv,{class:"size-4 shrink-0 text-slate-500"})},get children(){return v(xv,{class:"size-4 shrink-0 text-slate-500"})}})]}})}),null),m})()})),f})(),v(Je,{get disabled(){return o()||!c()},onClick:()=>u(c().label,c().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return kn("send")}})]}})]}})),ye(()=>Wt(g,o()?"opacity-50":"")),h})()};var $0=W("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const D0=e=>(()=>{var t=$0(),n=t.firstChild,r=n.nextSibling;return ye(o=>{var i=e.link,s=e.link;return i!==o.e&&Se(n,"src",o.e=i),s!==o.t&&Se(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var R0=W('<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 M0=e=>(()=>{var t=R0(),n=t.firstChild,r=n.firstChild;return F(n,v(Ev,{class:"size-10"}),r),F(r,()=>e.filename?.trim()),F(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(()=>Se(n,"href",e.link)),t})();var I0=W('<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 _0=e=>(()=>{var t=I0(),n=t.firstChild,r=n.firstChild;return F(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&Se(n,"href",o.e=i),s!==o.t&&Se(r,"src",o.t=s),a!==o.a&&Se(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var L0=W('<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 N0=e=>(()=>{var t=L0(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return F(t,v(Bn,{get children(){return e.text?.trim()}}),null),ye(i=>{var s=e.link,a=e.link;return s!==i.e&&Se(r,"src",i.e=s),a!==i.t&&Se(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var F0=W("<div>Media type not supported");const Zu=e=>e.type==="image"?v(_0,e):e.type==="audio"?v(D0,e):e.type==="document"?v(M0,e):e.type==="video"?v(N0,e):F0(),Xs=({text:e})=>v(Bn,{get children(){return e?.trim()}});var pt=()=>(e,t)=>J(e,t);function V0(e){return e==null?[]:Array.isArray(e)?e:[e]}var B0=e=>e[e.length-1],K0=e=>Array.from(new Set(e));function Ju(e,t){return e.reduce((n,r,o)=>(o%t===0?n.push([r]):B0(n)?.push(r),n),[])}var Qu=e=>e?.constructor.name==="Array",z0=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Uo(e[n],t[n]))return!1;return!0},Uo=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Qu(e)&&Qu(t))return z0(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Uo(e[i],t[i]))return!1}return!0},U0=e=>Array.isArray(e),ed=e=>e!=null&&typeof e=="object",W0=e=>ed(e)&&!U0(e),j0=e=>typeof e=="number"&&!Number.isNaN(e),zn=e=>typeof e=="string",rt=e=>typeof e=="function",H0=e=>e==null,td=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Y0=e=>Object.prototype.toString.call(e),nd=Function.prototype.toString,q0=nd.call(Object),G0=e=>{if(!ed(e)||Y0(e)!="[object Object]"||J0(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=td(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&nd.call(n)==q0},X0=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,Z0=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,J0=e=>X0(e)||Z0(e),rd=()=>{},kr=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function Or(e,t,...n){if(e in t){const o=t[e];return rt(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,Or),r}var{min:Q0,max:ex}=Math,tx=e=>Number.isNaN(e),od=e=>tx(e)?0:e,Zs=(e,t,n)=>{const r=od(e),o=t==null||r>=t,i=n==null||r<=n;return o&&i},nx=(e,t,n)=>Q0(ex(od(e),t),n);function Js(e){if(!G0(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Js(o))}return n}function Wo(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function id(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function Qs(e,t){if(e==null)throw new Error(t())}function rx(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Xt(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=xe(i);function a(){const c=ke(s);if(!c&&t){const l=new Error(o??rx(n,r));throw l.name="ContextError",td(Error,"captureStackTrace")&&rt(Error.captureStackTrace)&&Error.captureStackTrace(l,a),l}return c}return[s.Provider,a,s]}Xt({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});var ox=e=>pt()(e,["lazyMount","unmountOnExit"]),ix=e=>typeof e=="function",sd=(e,...t)=>ix(e)?e(...t):e;function sx(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var ax=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),cx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,ad=e=>{const t={};let n;for(;n=cx.exec(e);)t[n[1]]=n[2];return t},lx=(e,t)=>{if(zn(e)){if(zn(t))return`${e};${t}`;e=ad(e)}else zn(t)&&(t=ad(t));return Object.assign({},e??{},t??{})};function ux(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=kr(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=ax(t[o],n[o]);continue}if(o==="style"){t[o]=lx(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function dx(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((c,l)=>!Uo(r[l],c)))&&(r=s,o=t(s,i)),o}}var Zt=".",cd="#",ld=new WeakMap,ud=new WeakMap;function ea(e){return e.join(Zt)}function fx(e){return e.includes(Zt)}function dd(e){return e.startsWith(cd)}function hx(e){return e.startsWith(Zt)}function gx(e){return dd(e)?e.slice(cd.length):e}function ta(e,t){return e?`${e}${Zt}${t}`:t}function px(e){const t=new Map,n=new Map,r=(o,i)=>{t.set(o,i);const s=i.id;s&&(n.has(s)&&id(`[zag-js] Duplicate state id: "${s}"`),n.set(s,o));const a=i.states;if(a){Qs(i.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),i.initial in a||id(`[zag-js] Compound state "${o}" has initial "${String(i.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const u=ta(o,c);r(u,l)}}};for(const[o,i]of Object.entries(e.states))i&&r(o,i);return{index:t,idIndex:n}}function Tr(e){const t=ld.get(e);if(t)return t;const{index:n,idIndex:r}=px(e);return ld.set(e,n),ud.set(e,r),n}function mx(e,t){return Tr(e),ud.get(e)?.get(t)}function na(e){return e?String(e).split(Zt).filter(Boolean):[]}function jo(e,t){if(!t)return[];const n=Tr(e),r=na(t),o=[],i=[];for(const s of r){i.push(s);const a=ea(i),c=n.get(a);if(!c)break;o.push({path:a,state:c})}return o}function Ar(e,t){const n=Tr(e),r=na(t);if(!r.length)return t;const o=[];for(const a of r){o.push(a);const c=ea(o);if(!n.has(c))return t}let i=ea(o),s=n.get(i);for(;s?.initial;){const a=`${i}${Zt}${s.initial}`,c=n.get(a);if(!c)break;i=a,s=c}return i}function fd(e,t){return Tr(e).has(t)}function hd(e,t,n){const r=String(t);if(dd(r)){const o=gx(r),i=mx(e,o);return Qs(i,()=>`[zag-js] Unknown state id: "${o}"`),Ar(e,i)}if(hx(r)&&n){const o=ta(n,r.slice(1));return Ar(e,o)}if(!fx(r)&&n){const o=na(n);for(let i=o.length-1;i>=1;i--){const s=o.slice(0,i).join(Zt),a=ta(s,r);if(fd(e,a))return Ar(e,a)}if(fd(e,r))return Ar(e,r)}return Ar(e,r)}function yx(e,t,n){const r=jo(e,t);for(let i=r.length-1;i>=0;i--){const a=r[i]?.state.on?.[n];if(a)return{transitions:a,source:r[i]?.path}}return{transitions:e.on?.[n],source:void 0}}function vx(e,t,n,r){const o=t?jo(e,t):[],i=jo(e,n);let s=0;for(;s<o.length&&s<i.length&&o[s]?.path===i[s]?.path;)s+=1;let a=o.slice(s).reverse(),c=i.slice(s);const l=o.at(-1)?.path===i.at(-1)?.path;return r&&l&&(a=o.slice().reverse(),c=i),{exiting:a,entering:c}}function wx(e,t){return e?e===t||e.startsWith(`${t}${Zt}`):!1}function bx(e,t,n){return jo(e,t).some(r=>r.state.tags?.includes(n))}function xx(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function gd(e){return Tr(e),e}var Un=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Un||{}),Ho="__init__",Sx=Object.defineProperty,Ex=(e,t,n)=>t in e?Sx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>Ex(e,typeof t!="symbol"?t+"":t,n),pd=()=>{},Yo=e=>typeof e=="object"&&e!==null,z=e=>e?"":void 0,Ee=e=>e?"true":void 0,Px=1,Cx=9,kx=11,_e=e=>Yo(e)&&e.nodeType===Px&&typeof e.nodeName=="string",oa=e=>Yo(e)&&e.nodeType===Cx,Ox=e=>Yo(e)&&e===e.window,md=e=>_e(e)?e.localName||"":"#document";function Tx(e){return["html","body","#document"].includes(md(e))}var yd=e=>Yo(e)&&e.nodeType!==void 0,Wn=e=>yd(e)&&e.nodeType===kx&&"host"in e,Ax=e=>_e(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function $x(e){if(!e)return!1;const t=e.getRootNode();return vd(t)===e}function qo(e,t){if(!e||!t||!_e(e)||!yd(t))return!1;if(_e(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&Wn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function mn(e){return oa(e)?e:Ox(e)?e.document:e?.ownerDocument??document}function Dx(e){return mn(e).documentElement}function Ot(e){return Wn(e)?Ot(e.host):oa(e)?e.defaultView??window:_e(e)?e.ownerDocument?.defaultView??window:window}function vd(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function Rx(e){if(md(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wn(e)&&e.host||Dx(e);return Wn(t)?t.host:t}function Mx(e){let t;try{if(t=e.getRootNode({composed:!0}),oa(t)||Wn(t))return t}catch{}return e.ownerDocument??document}var ia=new WeakMap;function sa(e){return ia.has(e)||ia.set(e,Ot(e).getComputedStyle(e)),ia.get(e)}var Ix=new Set(["menu","listbox","dialog","grid","tree","region","application"]),_x=e=>Ix.has(e),Lx=e=>e.getAttribute("aria-controls")?.split(" ")||[];function Nx(e,t){const n=new Set,r=Mx(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const c=Lx(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const u=r.getElementById(l);if(u){const d=u.getAttribute("role"),h=u.getAttribute("aria-modal")==="true";if(d&&_x(d)&&!h&&(u===t||u.contains(t)||o(u)))return!0}}}return!1};return o(e)}var wd=()=>typeof document<"u";function Fx(){return navigator.userAgentData?.platform??navigator.platform}var aa=e=>wd()&&e.test(Fx()),bd=()=>wd()&&!!navigator.maxTouchPoints,Vx=()=>aa(/^iPhone/i),Bx=()=>aa(/^iPad/i)||Sd()&&navigator.maxTouchPoints>1,xd=()=>Vx()||Bx(),Sd=()=>aa(/^Mac/i);function Kx(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function jn(e){return Kx(e)?.[0]??e.target}function zx(e){return Pd(e).isComposing||e.keyCode===229}var Ux=e=>e.button===2||Sd()&&e.ctrlKey&&e.button===0,Wx={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Ed={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function jx(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=Wx[o]??o,n==="rtl"&&r==="horizontal"&&o in Ed&&(o=Ed[o]),o}function Pd(e){return e.nativeEvent??e}var Go=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function Hx(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=Ot(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function Yx(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Xo(e,t,n="value"){if(!e)return;const r=Yx(e);r&&Hx(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}var qx="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Cd(e){return!_e(e)||e.closest("[inert]")?!1:e.matches(qx)&&Ax(e)}var Gx=class wh{constructor(){ra(this,"id",null),ra(this,"fn_cleanup"),ra(this,"cleanup",()=>{this.cancel()})}static create(){return new wh}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function Te(e){const t=Gx.create();return t.request(e),t.cleanup}function ca(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function la(e){const t=Rx(e);return Tx(t)?mn(t).body:_e(t)&&Jx(t)?t:la(t)}var Xx=/auto|scroll|overlay|hidden|clip/,Zx=new Set(["inline","contents"]);function Jx(e){const t=Ot(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return Xx.test(n+o+r)&&!Zx.has(i)}var Hn="default",ua="",Zo=new WeakMap;function Qx(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return xd()?(Hn==="default"&&(ua=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Hn="disabled"):t&&(Zo.set(t,t.style.userSelect),t.style.userSelect="none"),()=>kd({target:t,doc:r})}function kd(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(xd()){if(Hn!=="disabled")return;Hn="restoring",setTimeout(()=>{ca(()=>{Hn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=ua||""),ua="",Hn="default")})},300)}else if(t&&Zo.has(t)){const i=Zo.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Zo.delete(t)}}function e1(e={}){const{defer:t,target:n,...r}=e,o=t?Te:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(Qx({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function t1(e,t){return Array.from(e?.querySelectorAll(t)??[])}function n1(e,t){return e?.querySelector(t)??null}function Od(e,t){if(!e)return pd;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return r1(n,t)?pd:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function r1(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function o1(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{r.aborted||(clearTimeout(c),s(l))}).catch(l=>{r.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function i1(e,t){const{timeout:n,rootNode:r}=t,o=Ot(r),i=mn(r),s=new o.AbortController;return o1(new Promise(a=>{const c=e();if(c){a(c);return}const l=new o.MutationObserver(()=>{const u=e();u&&u.isConnected&&(l.disconnect(),a(u))});l.observe(i.body,{childList:!0,subtree:!0})}),s,n)}function s1(e){const t=()=>e.getRootNode?.()??document,n=()=>mn(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>vd(t()),isActiveElement:$x,getById:s=>t().getElementById(s)}}var a1=gd({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e("onExitComplete")?.();const n=t.get("node");if(!n)return;const r=Ot(n),o=new r.CustomEvent("exitcomplete",{bubbles:!1});n.dispatchEvent(o)},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",sa(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Te(()=>{if(r("present"))return;const s=Jo(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{Te(()=>{e.set("prevAnimationName",Jo(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=l=>{(l.composedPath?.()?.[0]??l.target)===o&&e.set("prevAnimationName",Jo(t.get("styles")))},s=l=>{const u=Jo(t.get("styles"));jn(l)===o&&u===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})},a=l=>{jn(l)===o&&!r("present")&&n({type:"UNMOUNT",src:"animationcancel"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",s);const c=Od(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",s),ca(()=>c())}}}}});function Jo(e){return e?.animationName||"none"}function c1(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}function Qo(e){const t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=L(t),i=_(()=>e().value!=null),s={current:r()},a={current:void 0};B(()=>{const u=i()?e().value:r();a.current=u,s.current=u});const c=u=>{const d=a.current,h=rt(u)?u(s.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:h,prev:d}),i()||o(h),n(h,d)||e().onChange?.(h,d)};function l(){const u=i()?e().value:r;return rt(u)?u():u}return{initial:t,ref:s,get:l,set:c,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}Qo.cleanup=e=>{H(()=>e())},Qo.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function l1(e){const t={current:e};return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}function da(e){return rt(e)?e():e}var u1=(e,t)=>{let n=[],r=!0;B(()=>{if(r){n=e.map(i=>da(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!Uo(n[i],da(e[i]))){o=!0;break}o&&(n=e.map(i=>da(i)),t())})};function Td(e,t={}){const n=_(()=>{const{id:D,ids:P,getRootNode:T}=fa(t);return s1({id:D,ids:P,getRootNode:T})}),r=(...D)=>{e.debug&&console.log(...D)},o=_(()=>e.props?.({props:Js(fa(t)),scope:n()})??fa(t)),i=d1(o),s=e.context?.({prop:i,bindable:Qo,get scope(){return n()},flush:Ad,getContext(){return a},getComputed(){return b},getRefs(){return f},getEvent(){return h()}}),a={get(D){return s?.[D].get()},set(D,P){s?.[D].set(P)},initial(D){return s?.[D].initial},hash(D){const P=s?.[D].get();return s?.[D].hash(P)}},c={current:new Map},l={current:null},u={current:null},d={current:{type:""}},h=()=>N(d.current,{current(){return d.current},previous(){return u.current}}),g=()=>N(C,{matches(...D){const P=C.get();return D.some(T=>wx(P,T))},hasTag(D){const P=C.get();return bx(e,P,D)}}),f=l1(e.refs?.({prop:i,context:a})??{}),p=()=>({state:g(),context:a,event:h(),prop:i,send:O,action:m,guard:y,track:u1,refs:f,computed:b,flush:Ad,get scope(){return n()},choose:x}),m=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map(I=>{const $=e.implementations?.actions?.[I];return $||Wo(`[zag-js] No implementation found for action "${JSON.stringify(I)}"`),$});for(const I of T)I?.(p())},y=D=>{if(rt(D))return D(p());const P=e.implementations?.guards?.[D];return P||Wo(`[zag-js] No implementation found for guard "${JSON.stringify(D)}"`),P?.(p())},w=D=>{const P=rt(D)?D(p()):D;if(!P)return;const T=P.map($=>{const K=e.implementations?.effects?.[$];return K||Wo(`[zag-js] No implementation found for effect "${JSON.stringify($)}"`),K}),I=[];for(const $ of T){const K=$?.(p());K&&I.push(K)}return()=>I.forEach($=>$?.())},x=D=>V0(D).find(P=>{let T=!P.guard;return zn(P.guard)?T=!!y(P.guard):rt(P.guard)&&(T=P.guard(p())),T}),b=D=>{Qs(e.computed,()=>"[zag-js] No computed object found on machine");const P=e.computed[D];return P({context:a,event:d.current,prop:i,refs:f,scope:n(),computed:b})},C=Qo(()=>({defaultValue:hd(e,e.initialState({prop:i})),onChange(D,P){const{exiting:T,entering:I}=vx(e,P,D,l.current?.reenter);if(T.forEach($=>{c.current.get($.path)?.(),c.current.delete($.path)}),T.forEach($=>{m($.state?.exit)}),m(l.current?.actions),I.forEach($=>{const K=w($.state?.effects);if(K){const U=c.current.get($.path);c.current.set($.path,U?kr(U,K):K)}}),P===Ho){m(e.entry);const $=w(e.effects);if($){const K=c.current.get(Ho);c.current.set(Ho,K?kr(K,$):$)}}I.forEach($=>{m($.state?.entry)})}}));let S=Un.NotStarted;cn(()=>{const D=S===Un.Started;S=Un.Started,r(D?"rehydrating...":"initializing..."),C.invoke(C.initial,Ho)}),H(()=>{r("unmounting..."),S=Un.Stopped,c.current.forEach(P=>P?.()),c.current=new Map,l.current=null,m(e.exit)});const O=D=>{queueMicrotask(()=>{if(S!==Un.Started)return;u.current=d.current,d.current=D;let P=ne(()=>C.get());const{transitions:T,source:I}=yx(e,P,D.type),$=x(T);if(!$)return;l.current=$;const K=hd(e,$.target??P,I);r("transition",D.type,$.target||P,`(${$.actions})`),K!==P?C.set(K):$.reenter?C.invoke(P,P):m($.actions)})};return e.watch?.(p()),{state:g(),send:O,context:a,prop:i,get scope(){return n()},refs:f,computed:b,event:h(),getStatus:()=>S}}function Ad(e){e()}function fa(e){return rt(e)?e():e}function d1(e){return function(n){return e()[n]}}function ee(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let c=e[a];typeof c=="function"&&(c=c()),s=ux(s,{[i]:(c||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let c,l=e[a];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}})}}return t}var $d={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},f1=e=>e.startsWith("--")?e:w1(e);function h1(e){return e in $d?$d[e]:e}var g1=c1(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&W0(r)){t.style=p1(r);continue}if(n==="children"){zn(r)&&(t.textContent=r);continue}t[h1(n)]=r}}return t});function p1(e){let t={};for(const n in e){const r=e[n];!zn(r)&&!j0(r)||(t[f1(n)]=r)}return t}var m1=/[A-Z]/g,y1=/^ms-/;function v1(e){return"-"+e.toLowerCase()}var ha={};function w1(e){if(ha.hasOwnProperty(e))return ha[e];const t=e.replace(m1,v1);return ha[e]=y1.test(t)?"-"+t:t}var Dd=e=>{const[t,n]=ox(sd(e)),[r,o]=L(!1),i=Td(a1,e),s=_(()=>sx(i));B(()=>{s().present&&o(!0)});const a=c=>{c&&i.send({type:"NODE.SET",node:c})};return _(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,ref:a,presenceProps:{hidden:!s().present,"data-state":s().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))},b1=e=>typeof e=="function",Rd=(e,t)=>{for(const n of e)b1(n)&&n(t)};function x1(...e){let t=null;return B(()=>{Rd(e,t)}),n=>{t=n,Rd(e,n)}}var ga=e=>n=>{const[r,o]=J(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=J(o,["ref"]);return ee(a,s)};return r.asChild(i)}return v(dr,N({component:e},o))};function S1(){const e=new Map;return new Proxy(ga,{apply(t,n,r){return ga(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,ga(r)),e.get(r)}})}var re=S1(),Md=e=>pt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),[Id,_d]=Xt({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),$r=(e,t=[])=>({parts:(...n)=>{if(E1(t))return $r(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>$r(e,[...t,...n]),omit:(...n)=>$r(e,t.filter(r=>!n.includes(r))),rename:n=>$r(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Yn(e)}"][data-part="${Yn(r)}"]`,`& [data-scope="${Yn(e)}"][data-part="${Yn(r)}"]`].join(", "),attrs:{"data-scope":Yn(e),"data-part":Yn(r)}}}),{})}),Yn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),E1=e=>e.length===0;const P1=["top","right","bottom","left"],Jt=Math.min,Le=Math.max,ei=Math.round,ti=Math.floor,mt=e=>({x:e,y:e}),C1={left:"right",right:"left",bottom:"top",top:"bottom"};function pa(e,t,n){return Le(e,Jt(t,n))}function Tt(e,t){return typeof e=="function"?e(t):e}function At(e){return e.split("-")[0]}function qn(e){return e.split("-")[1]}function ma(e){return e==="x"?"y":"x"}function ya(e){return e==="y"?"height":"width"}function yt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function va(e){return ma(yt(e))}function k1(e,t,n){n===void 0&&(n=!1);const r=qn(e),o=va(e),i=ya(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ni(s)),[s,ni(s)]}function O1(e){const t=ni(e);return[wa(e),t,wa(t)]}function wa(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ld=["left","right"],Nd=["right","left"],T1=["top","bottom"],A1=["bottom","top"];function $1(e,t,n){switch(e){case"top":case"bottom":return n?t?Nd:Ld:t?Ld:Nd;case"left":case"right":return t?T1:A1;default:return[]}}function D1(e,t,n,r){const o=qn(e);let i=$1(At(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(wa)))),i}function ni(e){const t=At(e);return C1[t]+e.slice(t.length)}function R1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fd(e){return typeof e!="number"?R1(e):{top:e,right:e,bottom:e,left:e}}function ri(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 Vd(e,t,n){let{reference:r,floating:o}=e;const i=yt(t),s=va(t),a=ya(s),c=At(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(qn(t)){case"start":g[s]-=h*(n&&l?-1:1);break;case"end":g[s]+=h*(n&&l?-1:1);break}return g}async function M1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=Tt(t,e),f=Fd(g),m=a[h?d==="floating"?"reference":"floating":d],y=ri(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=ri(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-C.top+f.top)/b.y,bottom:(C.bottom-y.bottom+f.bottom)/b.y,left:(y.left-C.left+f.left)/b.x,right:(C.right-y.right+f.right)/b.x}}const I1=50,_1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:M1},c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Vd(l,r,c),h=r,g=0;const f={};for(let p=0;p<i.length;p++){const m=i[p];if(!m)continue;const{name:y,fn:w}=m,{x,y:b,data:C,reset:S}=await w({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:l,platform:a,elements:{reference:e,floating:t}});u=x??u,d=b??d,f[y]={...f[y],...C},S&&g<I1&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=Vd(l,h,c)),p=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}},L1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Tt(e,t)||{};if(l==null)return{};const d=Fd(u),h={x:n,y:r},g=va(o),f=ya(g),p=await s.getDimensions(l),m=g==="y",y=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[f]+i.reference[g]-h[g]-i.floating[f],C=h[g]-i.reference[g],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let O=S?S[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[x]||i.floating[f]);const D=b/2-C/2,P=O/2-p[f]/2-1,T=Jt(d[y],P),I=Jt(d[w],P),$=T,K=O-p[f]-I,U=O/2-p[f]/2+D,Q=pa($,U,K),V=!c.arrow&&qn(o)!=null&&U!==Q&&i.reference[f]/2-(U<$?T:I)-p[f]/2<0,j=V?U<$?U-$:U-K:0;return{[g]:h[g]+j,data:{[g]:Q,centerOffset:U-Q-j,...V&&{alignmentOffset:j}},reset:V}}}),N1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...m}=Tt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=At(o),w=yt(a),x=At(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=h||(x||!p?[ni(a)]:O1(a)),S=f!=="none";!h&&S&&C.push(...D1(a,p,f,b));const O=[a,...C],D=await c.detectOverflow(t,m),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&P.push(D[y]),d){const U=k1(o,s,b);P.push(D[U[0]],D[U[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(U=>U<=0)){var I,$;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=O[U];if(Q&&(!(d==="alignment"?w!==yt(Q):!1)||T.every(G=>yt(G.placement)===w?G.overflows[0]>0:!0)))return{data:{index:U,overflows:T},reset:{placement:Q}};let V=($=T.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(g){case"bestFit":{var K;const j=(K=T.filter(G=>{if(S){const q=yt(G.placement);return q===w||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,qe)=>q+qe,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:K[0];j&&(V=j);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function Bd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kd(e){return P1.some(t=>e[t]>=0)}const F1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Tt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Bd(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Kd(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Bd(s,n.floating);return{data:{escapedOffsets:a,escaped:Kd(a)}}}default:return{}}}}},zd=new Set(["left","top"]);async function V1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=At(n),a=qn(n),c=yt(n)==="y",l=zd.has(s)?-1:1,u=i&&c?-1:1,d=Tt(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(g=a==="end"?f*-1:f),c?{x:g*u,y:h*l}:{x:h*l,y:g*u}}const B1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await V1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},K1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...l}=Tt(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),h=yt(At(o)),g=ma(h);let f=u[g],p=u[h];if(s){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=f+d[y],b=f-d[w];f=pa(x,f,b)}if(a){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",x=p+d[y],b=p-d[w];p=pa(x,p,b)}const m=c.fn({...t,[g]:f,[h]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:s,[h]:a}}}}}},z1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Tt(e,t),u={x:n,y:r},d=yt(o),h=ma(d);let g=u[h],f=u[d];const p=Tt(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=h==="y"?"height":"width",b=i.reference[h]-i.floating[x]+m.mainAxis,C=i.reference[h]+i.reference[x]-m.mainAxis;g<b?g=b:g>C&&(g=C)}if(l){var y,w;const x=h==="y"?"width":"height",b=zd.has(At(o)),C=i.reference[d]-i.floating[x]+(b&&((y=s.offset)==null?void 0:y[d])||0)+(b?0:m.crossAxis),S=i.reference[d]+i.reference[x]+(b?0:((w=s.offset)==null?void 0:w[d])||0)-(b?m.crossAxis:0);f<C?f=C:f>S&&(f=S)}return{[h]:g,[d]:f}}}},U1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=Tt(e,t),u=await s.detectOverflow(t,l),d=At(o),h=qn(o),g=yt(o)==="y",{width:f,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=h==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=f-u.left-u.right,b=Jt(p-u[m],w),C=Jt(f-u[y],x),S=!t.middlewareData.shift;let O=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=w),S&&!h){const T=Le(u.left,0),I=Le(u.right,0),$=Le(u.top,0),K=Le(u.bottom,0);g?D=f-2*(T!==0||I!==0?T+I:Le(u.left,u.right)):O=p-2*($!==0||K!==0?$+K:Le(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:O});const P=await s.getDimensions(a.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function oi(){return typeof window<"u"}function Gn(e){return Ud(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vt(e){var t;return(t=(Ud(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ud(e){return oi()?e instanceof Node||e instanceof Ne(e).Node:!1}function ot(e){return oi()?e instanceof Element||e instanceof Ne(e).Element:!1}function $t(e){return oi()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function Wd(e){return!oi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}function Dr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=it(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function W1(e){return/^(table|td|th)$/.test(Gn(e))}function ii(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const j1=/transform|translate|scale|rotate|perspective|filter/,H1=/paint|layout|strict|content/,yn=e=>!!e&&e!=="none";let ba;function xa(e){const t=ot(e)?it(e):e;return yn(t.transform)||yn(t.translate)||yn(t.scale)||yn(t.rotate)||yn(t.perspective)||!Sa()&&(yn(t.backdropFilter)||yn(t.filter))||j1.test(t.willChange||"")||H1.test(t.contain||"")}function Y1(e){let t=Qt(e);for(;$t(t)&&!Xn(t);){if(xa(t))return t;if(ii(t))return null;t=Qt(t)}return null}function Sa(){return ba==null&&(ba=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ba}function Xn(e){return/^(html|body|#document)$/.test(Gn(e))}function it(e){return Ne(e).getComputedStyle(e)}function si(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qt(e){if(Gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wd(e)&&e.host||vt(e);return Wd(t)?t.host:t}function jd(e){const t=Qt(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:$t(t)&&Dr(t)?t:jd(t)}function Rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=jd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Ea(s);return t.concat(s,s.visualViewport||[],Dr(o)?o:[],a&&n?Rr(a):[])}else return t.concat(o,Rr(o,[],n))}function Ea(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hd(e){const t=it(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$t(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ei(n)!==i||ei(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Pa(e){return ot(e)?e:e.contextElement}function Zn(e){const t=Pa(e);if(!$t(t))return mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Hd(t);let s=(i?ei(n.width):n.width)/r,a=(i?ei(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const q1=mt(0);function Yd(e){const t=Ne(e);return!Sa()||!t.visualViewport?q1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function G1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Pa(e);let s=mt(1);t&&(r?ot(r)&&(s=Zn(r)):s=Zn(e));const a=G1(i,n,r)?Yd(i):mt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=Ne(i),g=r&&ot(r)?Ne(r):r;let f=h,p=Ea(f);for(;p&&r&&g!==f;){const m=Zn(p),y=p.getBoundingClientRect(),w=it(p),x=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=y.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=b,f=Ne(p),p=Ea(f)}}return ri({width:u,height:d,x:c,y:l})}function ai(e,t){const n=si(e).scrollLeft;return t?t.left+n:vn(vt(e)).left+n}function qd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ai(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function X1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=vt(r),a=t?ii(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=mt(1);const u=mt(0),d=$t(r);if((d||!d&&!i)&&((Gn(r)!=="body"||Dr(s))&&(c=si(r)),d)){const g=vn(r);l=Zn(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!i?qd(s,c):mt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function Z1(e){return Array.from(e.getClientRects())}function J1(e){const t=vt(e),n=si(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ai(e);const a=-n.scrollTop;return it(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Gd=25;function Q1(e,t){const n=Ne(e),r=vt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const u=Sa();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=ai(r);if(l<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,f=Math.abs(r.clientWidth-d.clientWidth-g);f<=Gd&&(i-=f)}else l<=Gd&&(i+=l);return{width:i,height:s,x:a,y:c}}function eS(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$t(e)?Zn(e):mt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Xd(e,t,n){let r;if(t==="viewport")r=Q1(e,n);else if(t==="document")r=J1(vt(e));else if(ot(t))r=eS(t,n);else{const o=Yd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ri(r)}function Zd(e,t){const n=Qt(e);return n===t||!ot(n)||Xn(n)?!1:it(n).position==="fixed"||Zd(n,t)}function tS(e,t){const n=t.get(e);if(n)return n;let r=Rr(e,[],!1).filter(a=>ot(a)&&Gn(a)!=="body"),o=null;const i=it(e).position==="fixed";let s=i?Qt(e):e;for(;ot(s)&&!Xn(s);){const a=it(s),c=xa(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Dr(s)&&!c&&Zd(e,s))?r=r.filter(u=>u!==s):o=a,s=Qt(s)}return t.set(e,r),r}function nS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ii(t)?[]:tS(t,this._c):[].concat(n),r],a=Xd(t,s[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let h=1;h<s.length;h++){const g=Xd(t,s[h],o);c=Le(g.top,c),l=Jt(g.right,l),u=Jt(g.bottom,u),d=Le(g.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function rS(e){const{width:t,height:n}=Hd(e);return{width:t,height:n}}function oS(e,t,n){const r=$t(t),o=vt(t),i=n==="fixed",s=vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=mt(0);function l(){c.x=ai(o)}if(r||!r&&!i)if((Gn(t)!=="body"||Dr(o))&&(a=si(t)),r){const g=vn(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=o&&!r&&!i?qd(o,a):mt(0),d=s.left+a.scrollLeft-c.x-u.x,h=s.top+a.scrollTop-c.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function Ca(e){return it(e).position==="static"}function Jd(e,t){if(!$t(e)||it(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vt(e)===n&&(n=n.ownerDocument.body),n}function Qd(e,t){const n=Ne(e);if(ii(e))return n;if(!$t(e)){let o=Qt(e);for(;o&&!Xn(o);){if(ot(o)&&!Ca(o))return o;o=Qt(o)}return n}let r=Jd(e,t);for(;r&&W1(r)&&Ca(r);)r=Jd(r,t);return r&&Xn(r)&&Ca(r)&&!xa(r)?n:r||Y1(e)||n}const iS=async function(e){const t=this.getOffsetParent||Qd,n=this.getDimensions,r=await n(e.floating);return{reference:oS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sS(e){return it(e).direction==="rtl"}const aS={convertOffsetParentRelativeRectToViewportRelativeRect:X1,getDocumentElement:vt,getClippingRect:nS,getOffsetParent:Qd,getElementRects:iS,getClientRects:Z1,getDimensions:rS,getScale:Zn,isElement:ot,isRTL:sS};function ef(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cS(e,t){let n=null,r;const o=vt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=l;if(a||t(),!h||!g)return;const f=ti(d),p=ti(o.clientWidth-(u+h)),m=ti(o.clientHeight-(d+g)),y=ti(u),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Le(0,Jt(1,c))||1};let b=!0;function C(S){const O=S[0].intersectionRatio;if(O!==c){if(!b)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!ef(l,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function lS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Pa(e),u=o||i?[...l?Rr(l):[],...t?Rr(t):[]]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?cS(l,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let f,p=c?vn(e):null;c&&m();function m(){const y=vn(e);p&&!ef(p,y)&&n(),p=y,f=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(f)}}const uS=B1,dS=K1,fS=N1,hS=U1,gS=F1,pS=L1,mS=z1,yS=(e,t,n)=>{const r=new Map,o={platform:aS,...n},i={...o.platform,_c:r};return _1(e,t,{...o,platform:i})};function tf(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function vS(e){if(!e)return tf();const{x:t,y:n,width:r,height:o}=e;return tf(t,n,r,o)}function wS(e,t){return{contextElement:_e(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?vS(r):n.getBoundingClientRect()}}}var Mr=e=>({variable:e,reference:`var(${e})`}),Dt={arrowSize:Mr("--arrow-size"),arrowSizeHalf:Mr("--arrow-size-half"),arrowBg:Mr("--arrow-background"),transformOrigin:Mr("--transform-origin"),arrowOffset:Mr("--arrow-offset")},bS=e=>e==="top"||e==="bottom"?"y":"x";function xS(e,t){return{name:"transformOrigin",fn(n){const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,c=i.split("-")[0],l=bS(c),u=o.arrow?.x||0,d=o.arrow?.y||0,h=t?.clientWidth||0,g=t?.clientHeight||0,f=u+h/2,p=d+g/2,m=Math.abs(o.shift?.y||0),y=s.reference.height/2,w=g/2,x=e.offset?.mainAxis??e.gutter,b=typeof x=="number"?x+w:x??w,C=m>b,S={top:`${f}px calc(100% + ${b}px)`,bottom:`${f}px ${-b}px`,left:`calc(100% + ${b}px) ${p}px`,right:`${-b}px ${p}px`}[c],O=`${f}px ${s.reference.y+y-a}px`,D=!!e.overlap&&l==="y"&&C;return r.floating.style.setProperty(Dt.transformOrigin.variable,D?O:S),{data:{transformOrigin:D?O:S}}}}}var SS={name:"rects",fn({rects:e}){return{data:e}}},ES=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Dt.arrowOffset.reference})`}),{}}}};function PS(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function CS(e){return e.split("-")[0]}var kS={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function nf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Jn(e,t){return e!=null&&Math.abs(e-t)<.5}function ci(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function OS(e,t,n){const r=e||t.createElement("div");return pS({element:r,padding:n.arrowPadding})}function TS(e,t){if(!H0(t.offset??t.gutter))return uS(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=PS(n),a=s?void 0:t.shift,c=t.offset?.crossAxis??a;return Js({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function AS(e){if(e.flip)return fS(()=>{const t=ci(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function $S(e){if(!(!e.slide&&!e.overlap))return dS(()=>{const t=ci(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:mS()}})}function DS(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,o;return hS(()=>{const i=ci(e.boundary);return{padding:e.overflowPadding,...i?{boundary:i}:void 0,apply({elements:s,rects:a,availableHeight:c,availableWidth:l}){const u=s.floating,d=Math.round(a.reference.width),h=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),Jn(t,d)||(u.style.setProperty("--reference-width",`${d}px`),t=d),Jn(n,h)||(u.style.setProperty("--reference-height",`${h}px`),n=h),Jn(r,l)||(u.style.setProperty("--available-width",`${l}px`),r=l),Jn(o,c)||(u.style.setProperty("--available-height",`${c}px`),o=c)}}})}function RS(e){if(e.hideWhenDetached)return gS(()=>({strategy:"referenceHidden",boundary:ci(e.boundary)??"clippingAncestors"}))}function MS(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var IS=["transform","visibility","pointer-events","--x","--y","--z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],_S=["top","right","bottom","left"];function rf(e,t){if(!e)return rd;const n=new Map(t.map(r=>[r,e.style.getPropertyValue(r)]));return()=>{n.forEach((r,o)=>{r?e.style.setProperty(o,r):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function of(e){return e==null?null:_e(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function LS(e,t,n={}){const r=()=>(typeof t=="function"?t():t)??null,o=()=>{const T=typeof e=="function"?e():e;return n.getAnchorElement?.()??T},i=()=>{const T=o();return!T&&!n.getAnchorRect?null:wS(T,n.getAnchorRect)},s=Object.assign({},kS,n);let a=[],c=null,l,u;function d(T){l?.(),u?.(),c=T,l=s.restoreStyles?rf(T,IS):void 0;const I=T.querySelector("[data-part=arrow]");u=s.restoreStyles?rf(I,_S):void 0,a=[TS(I,s),AS(s),$S(s),OS(I,T.ownerDocument,s),ES(I),xS({gutter:s.gutter,offset:s.offset,overlap:s.overlap},I),DS(s),RS(s),SS]}const{placement:h,strategy:g,onComplete:f,onPositioned:p}=s;let m,y,w=!1,x,b,C=rd;const S=MS(s.listeners);function O(){if(!s.listeners)return;const T=o(),I=i(),$=r();if(!I||!$)return;(of(T)!==of(x)||$!==b)&&(C(),x=T,b=$,C=lS(I,$,P,S))}async function D(){O();const T=r();if(!T)return;T!==c&&(d(T),w=!1);const I=i();if(!I)return;const $=await yS(I,T,{placement:h,middleware:a,strategy:g});f?.($);const K=Ot(T),U=nf(K,$.x),Q=nf(K,$.y);if(Jn(m,U)||(T.style.setProperty("--x",`${U}px`),m=U),Jn(y,Q)||(T.style.setProperty("--y",`${Q}px`),y=Q),s.hideWhenDetached&&($.middlewareData.hide?.referenceHidden?(T.style.setProperty("visibility","hidden"),T.style.setProperty("pointer-events","none")):(T.style.removeProperty("visibility"),T.style.removeProperty("pointer-events"))),!w){const V=T.firstElementChild;V&&(T.style.setProperty("--z-index",sa(V).zIndex),w=!0)}}async function P(){n.updatePosition?(await n.updatePosition({updatePosition:D,floatingElement:r()}),p?.({placed:!0})):await D()}return P(),()=>{C(),u?.(),l?.(),p?.({placed:!1})}}function NS(e,t,n={}){const{defer:r,...o}=n,i=r?Te:a=>a(),s=[];return s.push(i(()=>{s.push(LS(e,t,o))})),()=>{s.forEach(a=>a?.())}}var FS={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function VS(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Dt.arrowSize.reference,height:Dt.arrowSize.reference,[Dt.arrowSizeHalf.variable]:`calc(${Dt.arrowSize.reference} / 2)`,[Dt.arrowOffset.variable]:`calc(${Dt.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?FS[t.split("-")[0]]:void 0,background:Dt.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function BS(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function KS(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var sf="pointerdown.outside",af="focus.outside";function zS(e){for(const t of e)if(_e(t)&&Cd(t))return!0;return!1}var cf=e=>"clientY"in e;function US(e,t){if(!cf(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function WS(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function lf(e,t){if(!t||!cf(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return WS(s,a)?r||i:!1}function jS(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const c=mn(e),l=Ot(e),u=BS(l),d=KS(l);function h(b,C){if(!_e(C)||!C.isConnected||qo(e,C)||US(e,b)||a&&Nx(e,C))return!1;const S=c.querySelector(`[aria-controls="${e.id}"]`);if(S){const D=la(S);if(lf(b,D))return!1}const O=la(e);return lf(b,O)?!1:!n?.(C)}const g=new Set,f=Wn(e?.getRootNode());let p=!1;function m(b){p=!0;const C=()=>{p=!1};c.addEventListener("pointerup",C,{once:!0}),l.addEventListener("pointerup",C,{once:!0});function S(O){const D=s&&!bd()?Te:I=>I(),P=O??b,T=P?.composedPath?.()??[P?.target];D(()=>{const I=f?T[0]:jn(b);if(!(!e||!h(b,I))){if(o||i){const $=kr(o,i);e.addEventListener(sf,$,{once:!0})}uf(e,sf,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:Ux(P),focusable:zS(T),target:I}})}})}b.pointerType==="touch"?(g.forEach(O=>O()),g.add(Go(c,"click",S,{once:!0})),g.add(d.addEventListener("click",S,{once:!0})),g.add(u.addEventListener("click",S,{once:!0}))):S()}const y=new Set,w=setTimeout(()=>{y.add(Go(c,"pointerdown",m,!0)),y.add(d.addEventListener("pointerdown",m,!0)),y.add(u.addEventListener("pointerdown",m,!0))},0);function x(b){if(p)return;(s?Te:S=>S())(()=>{const S=b?.composedPath?.()??[b?.target],O=f?S[0]:jn(b);if(!(!e||!h(b,O))){if(r||i){const D=kr(r,i);e.addEventListener(af,D,{once:!0})}uf(e,af,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:Cd(O),target:O}})}})}return bd()||(y.add(Go(c,"focusin",x,!0)),y.add(d.addEventListener("focusin",x,!0)),y.add(u.addEventListener("focusin",x,!0))),()=>{clearTimeout(w),g.forEach(b=>b()),y.forEach(b=>b())}}function HS(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(jS(i,t))})),()=>{o.forEach(i=>i?.())}}function uf(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function YS(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return Go(mn(e),"keydown",n,{capture:!0})}var df="layer:request-dismiss",Ae={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(r=>qo(r.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>qo(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(r=>{const o=r();o&&qS(o)}),this.recentlyRemoved.add(e),ca(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>Ae.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{ff(e,t,e.node),e.styleTargets?.forEach(n=>{const r=n();if(!r||r===e.node)return;ff(e,t,r);const{zIndex:o}=sa(e.node);r.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];XS(e,df,o=>{r.requestDismiss?.(o),o.defaultPrevented||r?.dismiss()}),GS(e,df,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function ff(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),Ae.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=Ae.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function qS(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.style.removeProperty("--z-index"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function GS(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function XS(e,t,n){e.addEventListener(t,n,{once:!0})}var ka=new WeakMap,Ir=new WeakMap;function ZS(e){return Ae.isBelowPointerBlockingLayer(e)?"none":"auto"}function hf(e){const t=ZS(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function JS(e){if(Ir.has(e))return;const t=Ot(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{Ir.has(e)&&hf(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),Ir.set(e,n)}function gf(){Ae.layers.forEach(({node:e})=>{hf(e),JS(e)})}function QS(e){const t=Ir.get(e);t&&(t.disconnect(),Ir.delete(e)),e.style.pointerEvents=""}function eE(e,t){const n=mn(e),r=[];return Ae.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(ka.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[i,s]=i1(()=>{const a=o();return _e(a)?a:null},{timeout:1e3});i.then(a=>r.push(Od(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{Ae.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const i=ka.get(o);i!==void 0&&(o.style.pointerEvents=i,ka.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),r.forEach(o=>o()))}}function tE(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Wo("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:c="dialog",layerStyleTargets:l}=t,u={dismiss:r,node:e,type:c,pointerBlocking:i,requestDismiss:o,styleTargets:l};Ae.add(u),gf();function d(m){const y=jn(m.detail.originalEvent);Ae.isBelowPointerBlockingLayer(e)||Ae.isInBranch(y)||(t.onPointerDownOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),r?.()))}function h(m){const y=jn(m.detail.originalEvent);Ae.isInBranch(y)||(t.onFocusOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),r?.()))}function g(m){Ae.isTopMost(e)&&(t.onEscapeKeyDown?.(m),!m.defaultPrevented&&r&&(m.preventDefault(),r()))}function f(m){if(!e)return!1;const y=typeof s=="function"?s():s,w=Array.isArray(y)?y:[y],x=t.persistentElements?.map(b=>b()).filter(_e);return x&&w.push(...x),w.some(b=>qo(b,m))||Ae.isInNestedLayer(e,m)}const p=[i?eE(e,t.persistentElements):void 0,YS(e,g),HS(e,{exclude:f,onFocusOutside:h,onPointerDownOutside:d,defer:t.defer})];return()=>{Ae.remove(e),gf(),QS(e),p.forEach(m=>m?.())}}function nE(e,t){const{defer:n}=t,r=n?Te:i=>i(),o=[];return o.push(r(()=>{const i=rt(e)?e():e;o.push(tE(i,t))})),()=>{o.forEach(i=>i?.())}}var[hk,rE]=Xt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});function Oa(e,t){return e-t*Math.floor(e/t)}const pf=1721426;function li(e,t,n,r){t=Ta(e,t);let o=t-1,i=-2;return n<=2?i=0:ui(t)&&(i=-1),pf-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function ui(e){return e%4===0&&(e%100!==0||e%400===0)}function Ta(e,t){return e==="BC"?1-t:t}function oE(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const iE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Qn{fromJulianDay(t){let n=t,r=n-pf,o=Math.floor(r/146097),i=Oa(r,146097),s=Math.floor(i/36524),a=Oa(i,36524),c=Math.floor(a/1461),l=Oa(a,1461),u=Math.floor(l/365),d=o*400+s*100+c*4+u+(s!==4&&u!==4?1:0),[h,g]=oE(d),f=n-li(h,g,1,1),p=2;n<li(h,g,3,1)?p=0:ui(g)&&(p=1);let m=Math.floor(((f+p)*12+373)/367),y=n-li(h,g,m,1)+1;return new Lt(h,g,m,y)}toJulianDay(t){return li(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return iE[ui(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ui(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const sE={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Fe(e,t){return t=ve(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function aE(e,t){return t=ve(t,e.calendar),e=Rt(e),t=Rt(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function cE(e,t){return t=ve(t,e.calendar),e=Nr(e),t=Nr(t),e.era===t.era&&e.year===t.year}function lE(e,t){return di(e.calendar,t.calendar)&&Fe(e,t)}function _r(e,t){return di(e.calendar,t.calendar)&&aE(e,t)}function Lr(e,t){return di(e.calendar,t.calendar)&&cE(e,t)}function di(e,t){var n,r,o,i;return(i=(o=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function uE(e,t){return Fe(e,fi(t))}const dE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function mf(e,t,n){let r=e.calendar.toJulianDay(e),o=n?dE[n]:pE(t),i=Math.ceil(r+1-o)%7;return i<0&&(i+=7),i}function yf(e){return It(Date.now(),e)}function fi(e){return wn(yf(e))}function vf(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function fE(e,t){return wf(e)-wf(t)}function wf(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Aa=null,hE=!1;function $a(){return Aa==null&&(Aa=new Intl.DateTimeFormat().resolvedOptions().timeZone),Aa}function bf(){return hE}function Rt(e){return e.subtract({days:e.day-1})}function Da(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Nr(e){return Rt(e.subtract({months:e.month-1}))}function gE(e){return Da(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function en(e,t,n){let r=mf(e,t,n);return e.subtract({days:r})}function xf(e,t,n){return en(e,t,n).add({days:6})}const Sf=new Map,Ra=new Map;function Ef(e){if(Intl.Locale){let n=Sf.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Sf.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function pE(e){let t=Ra.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo(),t))return Ra.set(e,t),t.firstDay}let n=Ef(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];r==="mon"?t={firstDay:1}:r==="tue"?t={firstDay:2}:r==="wed"?t={firstDay:3}:r==="thu"?t={firstDay:4}:r==="fri"?t={firstDay:5}:r==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&sE[n]||0};Ra.set(e,t)}return t.firstDay}function mE(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((mf(Rt(e),t,n)+r)/7)}function Pf(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Cf(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const yE={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function vE(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Ef(t),[i,s]=yE[o]||[6,0];return r===i||r===s}function er(e){e=ve(e,new Qn);let t=Ta(e.era,e.year);return kf(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function kf(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Ma(e,t){if(t==="UTC")return 0;if(e>0&&t===$a()&&!bf())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=Tf(e,t);return kf(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const Of=new Map;function Tf(e,t){let n=Of.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Of.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const Af=864e5;function wE(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>bE(e,t,i))}function bE(e,t,n){let r=Tf(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Mt(e,t,n="compatible"){let r=je(e);if(t==="UTC")return er(r);if(t===$a()&&n==="compatible"&&!bf()){r=ve(r,new Qn);let c=new Date,l=Ta(r.era,r.year);return c.setFullYear(l,r.month-1,r.day),c.setHours(r.hour,r.minute,r.second,r.millisecond),c.getTime()}let o=er(r),i=Ma(o-Af,t),s=Ma(o+Af,t),a=wE(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function $f(e,t,n="compatible"){return new Date(Mt(e,t,n))}function It(e,t){let n=Ma(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new Vr(o<1?"BC":"AD",o<1?-o+1:o,i,s,t,n,a,c,l,u)}function wn(e){return new Lt(e.calendar,e.era,e.year,e.month,e.day)}function je(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new mi(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function ve(e,t){if(di(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,bn(r),r}function Df(e,t,n){if(e instanceof Vr)return e.timeZone===t?e:SE(e,t);let r=Mt(e,t,n);return It(r,t)}function xE(e){let t=er(e)-e.offset;return new Date(t)}function SE(e,t){let n=er(e)-e.offset;return ve(It(n,t),e.calendar)}const Fr=36e5;function hi(e,t){let n=e.copy(),r="hour"in n?kE(n,t):0;Ia(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,_a(n),Rf(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,EE(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let c=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Ia(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function _a(e){for(;e.month<1;)Ia(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Ia(e,1)}function EE(e){for(;e.day<1;)e.month--,_a(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,_a(e)}function Rf(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function bn(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Rf(e)}function Mf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function If(e,t){return hi(e,Mf(t))}function La(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),bn(n),n}function gi(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),CE(n),n}function PE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=pi(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=pi(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=pi(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=pi(e.hour,24),t}function CE(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function pi(e,t){let n=e%t;return n<0&&(n+=t),n}function kE(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,PE(e)}function Na(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),c=a.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=_t(c,n,0,a.length-1,r?.round),o.era=a[c],bn(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=_t(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=_t(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=_t(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),bn(o),o}function _f(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let c=i>=12;s=c?12:0,a=c?23:11}o.hour=_t(i,n,s,a,r?.round);break}case"minute":o.minute=_t(e.minute,n,0,59,r?.round);break;case"second":o.second=_t(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=_t(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function _t(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function Lf(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=hi(je(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Mt(o,e.timeZone)}else n=er(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=It(n,e.timeZone);return ve(r,e.calendar)}function OE(e,t){return Lf(e,Mf(t))}function TE(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let f=e.hour>=12;o=f?12:0,i=f?23:11}let s=je(e),a=ve(gi(s,{hour:o}),new Qn),c=[Mt(a,e.timeZone,"earlier"),Mt(a,e.timeZone,"later")].filter(f=>It(f,e.timeZone).day===a.day)[0],l=ve(gi(s,{hour:i}),new Qn),u=[Mt(l,e.timeZone,"earlier"),Mt(l,e.timeZone,"later")].filter(f=>It(f,e.timeZone).day===l.day).pop(),d=er(e)-e.offset,h=Math.floor(d/Fr),g=d%Fr;return d=_t(h,n,Math.floor(c/Fr),Math.floor(u/Fr),r?.round)*Fr+g,ve(It(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return _f(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Na(je(e),t,n,r),i=Mt(o,e.timeZone);return ve(It(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function AE(e,t,n){let r=je(e),o=gi(La(r,t),t);if(o.compare(r)===0)return e;let i=Mt(o,e.timeZone,n);return ve(It(i,e.timeZone),e.calendar)}function $E(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Nf(e){let t=ve(e,new Qn),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Ff(e){return`${Nf(e)}T${$E(e)}`}function DE(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return o!==0&&(i+=`:${String(o).padStart(2,"0")}`),i}function RE(e){return`${Ff(e)}${DE(e.offset)}[${e.timeZone}]`}function Fa(e){let t=typeof e[0]=="object"?e.shift():new Qn,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var ME=new WeakMap;class Lt{copy(){return this.era?new Lt(this.calendar,this.era,this.year,this.month,this.day):new Lt(this.calendar,this.year,this.month,this.day)}add(t){return hi(this,t)}subtract(t){return If(this,t)}set(t){return La(this,t)}cycle(t,n,r){return Na(this,t,n,r)}toDate(t){return $f(this,t)}toString(){return Nf(this)}compare(t){return vf(this,t)}constructor(...t){ls(this,ME,{writable:!0,value:void 0});let[n,r,o,i,s]=Fa(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,bn(this)}}var IE=new WeakMap;class mi{copy(){return this.era?new mi(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new mi(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return hi(this,t)}subtract(t){return If(this,t)}set(t){return La(gi(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Na(this,t,n,r);default:return _f(this,t,n,r)}}toDate(t,n){return $f(this,t,n)}toString(){return Ff(this)}compare(t){let n=vf(this,t);return n===0?fE(this,je(t)):n}constructor(...t){ls(this,IE,{writable:!0,value:void 0});let[n,r,o,i,s]=Fa(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,bn(this)}}var _E=new WeakMap;class Vr{copy(){return this.era?new Vr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Vr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Lf(this,t)}subtract(t){return OE(this,t)}set(t,n){return AE(this,t,n)}cycle(t,n,r){return TE(this,t,n,r)}toDate(){return xE(this)}toString(){return RE(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Df(t,this.timeZone).toDate().getTime()}constructor(...t){ls(this,_E,{writable:!0,value:void 0});let[n,r,o,i,s]=Fa(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,bn(this)}}let Va=new Map;class He{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return FE()&&(this.resolvedHourCycle||(this.resolvedHourCycle=VE(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=Vf(t,n),this.options=n}}const LE={true:{ja:"h11"},false:{}};function Vf(e,t={}){if(typeof t.hour12=="boolean"&&NE()){t={...t};let o=LE[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Va.has(n))return Va.get(n);let r=new Intl.DateTimeFormat(e,t);return Va.set(n,r),r}let Ba=null;function NE(){return Ba==null&&(Ba=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Ba}let Ka=null;function FE(){return Ka==null&&(Ka=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Ka}function VE(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=Vf(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}var[gk,BE]=Xt({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),KE=Object.defineProperty,zE=(e,t)=>{for(var n in t)KE(e,n,{get:t[n],enumerable:!0})},yi="__live-region__",za="__live-region-debug__",UE="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;";function WE(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0,debug:i=!1}=e,s=n.defaultView??window,a=r??n.body;function c(){if(!i)return;let d=n.getElementById(za);return d||(d=n.createElement("div"),d.id=za,d.dataset.liveAnnouncerDebug="true",d.setAttribute("aria-hidden","true"),d.style.cssText=UE,a.appendChild(d),d)}function l(d,h){n.getElementById(yi)?.remove(),h=h??o;const f=n.createElement("span");f.id=yi,f.dataset.liveAnnouncer="true";const p=t!=="assertive"?"status":"alert";f.setAttribute("aria-live",t),f.setAttribute("role",p),Object.assign(f.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),a.appendChild(f),s.setTimeout(()=>{if(!f.isConnected)return;f.textContent=d;const m=c();m&&(m.textContent=d)},h)}function u(){n.getElementById(yi)?.remove(),n.getElementById(za)?.remove()}return{announce:l,destroy:u,toJSON(){return yi}}}function jE(e,t,n,r,o){const i={};for(let a in t){const c=a,l=t[c];l!=null&&(i[c]=Math.floor(l/2),i[c]>0&&l%2===0&&i[c]--)}const s=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function xn(e,t,n,r,o){let i=e;return t.years?i=Nr(e):t.months?i=Rt(e):t.weeks&&(i=en(e,n)),Br(e,i,t,n,r,o)}function Ua(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=xn(e,t,n).subtract(i);return Br(e,s,t,n,r,o)}function Br(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=Cf(t,xn(wn(o),n,r))),i&&e.compare(i)<=0&&(t=Pf(t,Ua(wn(i),n,r))),t}function Ye(e,t,n){const r=wn(e),o=t?wn(t):void 0,i=n?wn(n):void 0;let s=r;return o&&(s=Cf(s,o)),i&&(s=Pf(s,i)),s.compare(r)===0?e:"hour"in e?e.set({year:s.year,month:s.month,day:s.day}):s}function Bf(e,t,n,r,o,i){switch(t){case"start":return xn(e,n,r,o,i);case"end":return Ua(e,n,r,o,i);case"center":default:return jE(e,n,r,o,i)}}function tn(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?Fe(e,t):je(e).compare(je(t))===0}function Kf(e,t,n,r,o){return e?t?.(e,n)?!0:wt(e,r,o):!1}function wt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function HE(e,t,n){const r=e.subtract({days:1});return Fe(r,e)||wt(r,t,n)}function YE(e,t,n){const r=e.add({days:1});return Fe(r,e)||wt(r,t,n)}function Wa(e){let t={...e};for(let n in t)t[n]=1;return t}function zf(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Uf(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function Wf(e,t,n){const r=n??je(fi(t));return new He(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Uf(r),calendar:r.calendar.identifier,timeZone:t})}function jf(e,t,n){const r=n??fi(t);return new He(e,{month:"long",year:"numeric",era:Uf(r),calendar:r.calendar.identifier,timeZone:t})}function qE(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let l=0;l<i.length;l++){let u=i[l];if(u.source==="shared"&&u.type==="literal")s=l;else if(u.source==="endRange")break}let a="",c="";for(let l=0;l<i.length;l++)l<s?a+=i[l].value:l>s&&(c+=i[l].value);return r(a,c)}function vi(e,t,n,r){if(!e)return"";let o=e,i=t??e,s=Wf(n,r);return Fe(o,i)?s.format(o.toDate(r)):qE(o,i,s,(a,c)=>`${a} – ${c}`,r)}var GE=["sun","mon","tue","wed","thu","fri","sat"];function Hf(e){return e!=null?GE[e]:void 0}function Yf(e,t,n){const r=Hf(n);return en(e,t,r)}function qf(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=Yf(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(Fe(s,a))break;s=a}return i}function XE(e,t,n,r){const o=Hf(r),i=n??mE(e,t,o);return[...new Array(i).keys()].map(a=>qf(a,e,t,r))}function ZE(e,t){const n=new He(e,{weekday:"long",timeZone:t}),r=new He(e,{weekday:"short",timeZone:t}),o=new He(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function JE(e,t,n,r){const o=Yf(e,r,t),i=[...new Array(7).keys()],s=ZE(r,n);return i.map(a=>s(o.add({days:a})))}function QE(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const s=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(s.toLocaleString(e,{month:t})),s.setMonth(s.getMonth()+1);return a}const r=n.calendar.getMonthsInYear(n),o=new He(e,{month:t,calendar:n.calendar.identifier}),i=[];for(let s=1;s<=r;s++){const a=n.set({month:s});i.push(o.format(a.toDate("UTC")))}return i}function Gf(e,t){const n=en(e,t,"mon"),r=n.year,o=n.set({month:1,day:4}),i=en(o,t,"mon"),s=n.calendar.toJulianDay(n),a=i.calendar.toJulianDay(i);if(s>=a)return 1+Math.floor((s-a)/7);const c=n.set({year:r-1,month:1,day:4}),l=en(c,t,"mon"),u=l.calendar.toJulianDay(l);return 1+Math.floor((s-u)/7)}function eP(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var tP=1900,nP=2099;function rP(e,t,n){const r=e.calendar,o=t?.year??ve(new Lt(tP,1,1),r).year,i=n?.year??ve(new Lt(nP,12,31),r).year;return{from:o,to:i}}var oP=10;function iP(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,r=parseInt(e.slice(-2),10),o=n+r;return o>t+oP?(o-100).toString():o.toString()}return e}}function tr(e,t){const n=t?.strict?10:12,r=e-e%10,o=[];for(let i=0;i<n;i+=1){const s=r+i;o.push(s)}return o}function Kr(e,t){const n=fi(e??$a());return t?ve(n,t):n}function zr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,c=zf(s,e);return wt(a,n,r)?{startDate:s,focusedDate:Ye(a,n,r),endDate:c}:a.compare(s)<0?{startDate:Ua(a,e,t,n,r),focusedDate:Ye(a,n,r),endDate:c}:a.compare(c)>0?{startDate:xn(a,e,t,n,r),endDate:c,focusedDate:Ye(a,n,r)}:{startDate:s,endDate:c,focusedDate:Ye(a,n,r)}}}function Xf(e,t,n,r,o,i){const s=zr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function Zf(e,t,n,r,o,i){const s=zr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:xn(Br(e,a,n,r,o,i),n,r)})}function sP(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(Wa(r)),startDate:t});if(r.days)return Xf(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function aP(e,t,n,r,o,i,s){const a=zr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(Wa(r)),startDate:t});if(r.days)return Zf(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var Jf=(e,t)=>e?/\d/.test(e)||t.includes(e)||e.length!==1:!0,cP=(e,t)=>e.split("").filter(n=>Jf(n,t)).join(""),Qf=new Map;function lP(e){let t=Qf.get(e);if(t!=null)return t;const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=r?r.value:"/",Qf.set(e,t),t}var eh=e=>e!=null&&e.length===4,uP=e=>e!=null&&parseFloat(e)<=12,dP=e=>e!=null&&parseFloat(e)<=31;function fP(e,t,n){const r=hP(t,n);let{year:o,month:i,day:s}=gP(r,e)??{};if(o!=null||i!=null||s!=null){const l=new Date;o||(o=l.getFullYear().toString()),i||(i=(l.getMonth()+1).toString()),s||(s=l.getDate().toString())}if(eh(o)||(o=iP(o)),eh(o)&&uP(i)&&dP(s))return new Lt(+o,+i,+s);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new Lt(l.getFullYear(),l.getMonth()+1,l.getDate())}}function hP(e,t){return new He(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function gP(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function th(e,t,n){const r=wn(yf(n));switch(e){case"thisWeek":return[en(r,t),xf(r,t)];case"thisMonth":return[Rt(r),r];case"thisQuarter":return[Rt(r).add({months:-((r.month-1)%3)}),r];case"thisYear":return[Nr(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[Rt(r.add({months:-1})),Da(r.add({months:-1}))];case"lastQuarter":return[Rt(r.add({months:-((r.month-1)%3)-3})),Da(r.add({months:-((r.month-1)%3)-1}))];case"lastWeek":return[en(r,t).add({weeks:-1}),xf(r,t).add({weeks:-1})];case"lastYear":return[Nr(r.add({years:-1})),gE(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var nh=$r("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),oe=nh.build(),pP=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,mP=e=>e.ids?.root??`datepicker:${e.id}`,yP=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,ja=e=>e.ids?.content??`datepicker:${e.id}:content`,Ha=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,vP=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,wP=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,bP=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,rh=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,oh=e=>e.ids?.control??`datepicker:${e.id}:control`,ih=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,sh=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,ah=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,ch=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,lh=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,uh=(e,t)=>n1(bi(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),wi=e=>e.getById(sh(e)),bi=e=>e.getById(ja(e)),Ur=e=>t1(fh(e),"[data-part=input]"),xP=e=>e.getById(lh(e)),SP=e=>e.getById(ch(e)),EP=e=>e.getById(rh(e)),dh=e=>e.getById(ah(e)),fh=e=>e.getById(oh(e));function Ya(e){const[t,n]=e;let r;return!t||!n?r=e:r=t.compare(n)<=0?e:[n,t],r}function nr(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function xi(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function PP(e){return Or(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var CP={day:"dd",month:"mm",year:"yyyy"};function kP(e){return new He(e).formatToParts(new Date).map(t=>CP[t.type]??t.value).join("")}var hh=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),OP={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return Or(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return Or(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return Or(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function Nt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function qa(e){return e===0?"day":e===1?"month":"year"}function Ga(e,t,n){return qa(nx(Nt(e,0),Nt(t,0),Nt(n,2)))}function TP(e,t){return Nt(e,0)>Nt(t,0)}function AP(e,t){return Nt(e,0)<Nt(t,0)}function $P(e,t,n){const r=Nt(e,0)+1;return Ga(qa(r),t,n)}function DP(e,t,n){const r=Nt(e,0)-1;return Ga(qa(r),t,n)}var RP=["day","month","year"];function MP(e){RP.forEach(t=>e(t))}var IP=dx(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale],([e],t)=>{const{startValue:n,endValue:r,locale:o,timeZone:i,selectionMode:s}=t;if(e==="year"){const d=tr(n.year,{strict:!0}),h=d.at(0).toString(),g=d.at(-1).toString();return{start:h,end:g,formatted:`${h} - ${g}`}}if(e==="month"){const d=new He(o,{year:"numeric",timeZone:i,calendar:n.calendar.identifier}),h=d.format(n.toDate(i)),g=d.format(r.toDate(i)),f=s==="range"?`${h} - ${g}`:h;return{start:h,end:g,formatted:f}}const a=new He(o,{month:"long",year:"numeric",timeZone:i,calendar:n.calendar.identifier}),c=a.format(n.toDate(i)),l=a.format(r.toDate(i)),u=s==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:u}});function _P(e,t){const{state:n,context:r,prop:o,send:i,computed:s,scope:a}=e,c=r.get("startValue"),l=s("endValue"),u=r.get("value"),d=r.get("focusedValue"),h=r.get("hoveredValue"),g=h?Ya([u[0],h]):[],f=!!o("disabled"),p=!!o("readOnly"),m=!!o("invalid"),y=s("isInteractive"),w=u.length===0,x=o("min"),b=o("max"),C=o("locale"),S=o("timeZone"),O=o("startOfWeek"),D=n.matches("focused"),P=n.matches("open"),T=o("selectionMode")==="range",I=o("selectionMode")==="multiple",$=o("isDateUnavailable"),K=o("maxSelectedDates"),U=I&&K!=null&&u.length>=K,Q=r.get("currentPlacement"),V=Q?CS(Q):void 0,j=VS({...o("positioning"),placement:Q}),G=lP(C),q={...OP,...o("translations")};function qe(A=c){const E=o("fixedWeeks")?6:void 0;return XE(A,C,E,O)}function $e(A={}){const{format:E}=A;return QE(C,E,d).map((k,R)=>{const le=R+1,Ge=d.set({month:le}),Ce=wt(Ge,x,b);return{label:k,value:le,disabled:Ce}})}function tc(){const A=rP(d,x,b);return eP(A).map(k=>({label:k.toString(),value:k,disabled:!Zs(k,x?.year,b?.year)}))}function Ci(A){return Kf(A,$,C,x,b)}function ki(A){const E=c??Kr(S,d.calendar);i({type:"FOCUS.SET",value:E.set({month:A})})}function X(A){const E=c??Kr(S,d.calendar);i({type:"FOCUS.SET",value:E.set({year:A})})}function Vt(A){const{value:E,disabled:k}=A,R=d.set({year:E}),Ge=!tr(c.year,{strict:!0}).includes(E),Ce=Zs(E,x?.year,b?.year),st=T&&nr(R,u),rn=T&&u[0]&&Lr(R,u[0]),rr=T&&u[1]&&Lr(R,u[1]),En=T&&g.length>0,or=En&&nr(R,g),on=En&&g[0]&&Lr(R,g[0]),sn=En&&g[1]&&Lr(R,g[1]),Oi={focused:d.year===A.value,selectable:!Ge&&Ce,outsideRange:Ge,selected:!!u.find(Ti=>Ti&&Ti.year===E),valueText:E.toString(),inRange:st||or,firstInRange:!!rn,lastInRange:!!rr,inHoveredRange:!!or,firstInHoveredRange:!!on,lastInHoveredRange:!!sn,value:R,get disabled(){return k||!Oi.selectable}};return Oi}function nn(A){const{value:E,disabled:k}=A,R=d.set({month:E}),le=jf(C,S,d),Ge=T&&nr(R,u),Ce=T&&u[0]&&_r(R,u[0]),st=T&&u[1]&&_r(R,u[1]),rn=T&&g.length>0,rr=rn&&nr(R,g),En=rn&&g[0]&&_r(R,g[0]),or=rn&&g[1]&&_r(R,g[1]),on={focused:d.month===A.value,selectable:!wt(R,x,b),selected:!!u.find(sn=>sn&&sn.month===E&&sn.year===d.year),valueText:le.format(R.toDate(S)),inRange:Ge||rr,firstInRange:!!Ce,lastInRange:!!st,inHoveredRange:!!rr,firstInHoveredRange:!!En,lastInHoveredRange:!!or,outsideRange:!1,value:R,get disabled(){return k||!on.selectable}};return on}function nc(A){const{value:E,disabled:k,visibleRange:R=s("visibleRange")}=A,le=Wf(C,S,d),Ge=Wa(s("visibleDuration")),Ce=o("outsideDaySelectable"),st=R.start.add(Ge).subtract({days:1}),rn=wt(E,R.start,st),rr=T&&nr(E,u),En=T&&u[0]&&Fe(E,u[0]),or=T&&u[1]&&Fe(E,u[1]),on=T&&g.length>0,sn=on&&nr(E,g),Oi=on&&g[0]&&Fe(E,g[0]),Ti=on&&g[1]&&Fe(E,g[1]),yh=u.some(vh=>vh!=null&&Fe(E,vh)),Ai={invalid:wt(E,x,b),disabled:k||!Ce&&rn||wt(E,x,b)||U&&!yh,selected:yh,unavailable:Kf(E,$,C,x,b)&&!k,outsideRange:rn,today:uE(E,S),weekend:vE(E,C),value:E,valueText:le.format(E.toDate(S)),get focused(){return d!=null&&Fe(E,d)&&(!Ai.outsideRange||Ce)},get selectable(){return!Ai.disabled&&!Ai.unavailable},inRange:rr||sn,firstInRange:En,lastInRange:or,inHoveredRange:sn,firstInHoveredRange:Oi,lastInHoveredRange:Ti};return Ai}function ck(A){const{view:E="day",id:k}=A;return[E,k].filter(Boolean).join(" ")}return{focused:D,open:P,disabled:f,invalid:m,readOnly:p,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:K,isMaxSelected:U,view:r.get("view"),getRangePresetValue(A){return th(A,C,S)},getWeekNumber(A){const E=A[0];return E?Gf(E,C):0},getDaysInWeek(A,E=c){return qf(A,E,C,O)},getOffset(A){const E=c.add(A),k=l.add(A),R=jf(C,S,d);return{visibleRange:{start:E,end:k},weeks:qe(E),visibleRangeText:{start:R.format(E.toDate(S)),end:R.format(k.toDate(S))}}},getMonthWeeks:qe,isUnavailable:Ci,weeks:qe(),weekDays:JE(c,O,S,C),visibleRangeText:s("visibleRangeText"),value:u,valueAsDate:u.filter(A=>A!=null).map(A=>A.toDate(S)),valueAsString:s("valueAsString"),focusedValue:d,focusedValueAsDate:d?.toDate(S),focusedValueAsString:o("format")(d,{locale:C,timeZone:S}),visibleRange:s("visibleRange"),selectToday(){const A=Ye(Kr(S,d.calendar),x,b);i({type:"VALUE.SET",value:[A]})},setValue(A){const E=A.map(k=>Ye(k,x,b));i({type:"VALUE.SET",value:E})},setTime(A,E=0){const k=Array.from(u);let R=k[E];R&&("hour"in R||(R=je(R)),R=R.set({hour:A.hour??("hour"in R?R.hour:0),minute:A.minute??("minute"in R?R.minute:0),second:A.second??("second"in R?R.second:0),millisecond:A.millisecond??("millisecond"in R?R.millisecond:0)}),k[E]=Ye(R,x,b),i({type:"VALUE.SET",value:k}))},clearValue(A={}){const{focus:E=!0}=A;i({type:"VALUE.CLEAR",focus:E})},setFocusedValue(A){i({type:"FOCUS.SET",value:A})},setOpen(A){o("inline")||n.matches("open")===A||i({type:A?"OPEN":"CLOSE"})},focusMonth:ki,focusYear:X,getYears:tc,getMonths:$e,getYearsGrid(A={}){const{columns:E=1}=A,k=tr(c.year,{strict:!0}).map(R=>({label:R.toString(),value:R,disabled:!Zs(R,x?.year,b?.year)}));return Ju(k,E)},getDecade(){const A=tr(c.year,{strict:!0});return{start:A.at(0),end:A.at(-1)}},getMonthsGrid(A={}){const{columns:E=1,format:k}=A;return Ju($e({format:k}),E)},format(A,E={month:"long",year:"numeric"}){return new He(C,{...E,calendar:A.calendar.identifier}).format(A.toDate(S))},setView(A){i({type:"VIEW.SET",view:A})},goToNext(){i({type:"GOTO.NEXT",view:r.get("view")})},goToPrev(){i({type:"GOTO.PREV",view:r.get("view")})},getRootProps(){return t.element({...oe.root.attrs,dir:o("dir"),id:mP(a),"data-state":P?"open":"closed","data-disabled":z(f),"data-readonly":z(p),"data-empty":z(w)})},getLabelProps(A={}){const{index:E=0}=A;return t.label({...oe.label.attrs,id:pP(a,E),dir:o("dir"),htmlFor:ih(a,E),"data-state":P?"open":"closed","data-index":E,"data-disabled":z(f),"data-readonly":z(p)})},getControlProps(){return t.element({...oe.control.attrs,dir:o("dir"),id:oh(a),"data-disabled":z(f),"data-placeholder-shown":z(w)})},getRangeTextProps(){return t.element({...oe.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...oe.content.attrs,hidden:!P,dir:o("dir"),"data-state":P?"open":"closed","data-placement":Q,"data-side":V,"data-inline":z(o("inline")),id:ja(a),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":q.content})},getTableProps(A={}){const{view:E="day",columns:k=E==="day"?7:4}=A,R=ck(A);return t.element({...oe.table.attrs,role:"grid","data-columns":k,"aria-roledescription":PP(E),id:yP(a,R),"aria-readonly":Ee(p),"aria-disabled":Ee(f),"aria-multiselectable":Ee(o("selectionMode")!=="single"),"data-view":E,dir:o("dir"),tabIndex:-1,onKeyDown(le){if(le.defaultPrevented)return;const Ce={Enter(){E==="day"&&Ci(d)||E==="month"&&!nn({value:d.month}).selectable||E==="year"&&!Vt({value:d.year}).selectable||i({type:"TABLE.ENTER",view:E,columns:k,focus:!0})},ArrowLeft(){i({type:"TABLE.ARROW_LEFT",view:E,columns:k,focus:!0})},ArrowRight(){i({type:"TABLE.ARROW_RIGHT",view:E,columns:k,focus:!0})},ArrowUp(){i({type:"TABLE.ARROW_UP",view:E,columns:k,focus:!0})},ArrowDown(){i({type:"TABLE.ARROW_DOWN",view:E,columns:k,focus:!0})},PageUp(st){i({type:"TABLE.PAGE_UP",larger:st.shiftKey,view:E,columns:k,focus:!0})},PageDown(st){i({type:"TABLE.PAGE_DOWN",larger:st.shiftKey,view:E,columns:k,focus:!0})},Home(){i({type:"TABLE.HOME",view:E,columns:k,focus:!0})},End(){i({type:"TABLE.END",view:E,columns:k,focus:!0})}}[jx(le,{dir:o("dir")})];Ce&&(Ce(le),le.preventDefault(),le.stopPropagation())},onPointerLeave(){i({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){i({type:"TABLE.POINTER_DOWN",view:E})},onPointerUp(){i({type:"TABLE.POINTER_UP",view:E})}})},getTableHeadProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableHeaderProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableHeader.attrs,dir:o("dir"),"data-view":E,"data-disabled":z(f)})},getTableBodyProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableBody.attrs,"data-view":E,"data-disabled":z(f)})},getTableRowProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableRow.attrs,"aria-disabled":Ee(f),"data-disabled":z(f),"data-view":E})},getWeekNumberHeaderCellProps(A={}){const{view:E="day"}=A;return t.element({...oe.tableCell.attrs,scope:"col","aria-label":q.weekColumnHeader,"data-view":E,"data-type":"week-number","data-disabled":z(f)})},getWeekNumberCellProps(A){const{weekIndex:E,week:k}=A,R=k[0]?Gf(k[0],C):0;return t.element({...oe.tableCell.attrs,role:"rowheader","aria-label":q.weekNumberCell?.(R),"data-view":"day","data-week-index":E,"data-type":"week-number","data-disabled":z(f)})},getDayTableCellState:nc,getDayTableCellProps(A){const{value:E}=A,k=nc(A);return t.element({...oe.tableCell.attrs,role:"gridcell","aria-disabled":Ee(!k.selectable),"aria-selected":k.selected||k.inRange,"aria-invalid":Ee(k.invalid),"aria-current":k.today?"date":void 0,"data-value":E.toString()})},getDayTableCellTriggerProps(A){const{value:E}=A,k=nc(A);return t.element({...oe.tableCellTrigger.attrs,id:Ha(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":q.dayCell(k),"aria-disabled":Ee(!k.selectable),"aria-invalid":Ee(k.invalid),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E.toString(),"data-view":"day","data-today":z(k.today),"data-focus":z(k.focused),"data-unavailable":z(k.unavailable),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-outside-range":z(k.outsideRange),"data-weekend":z(k.weekend),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"day",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&lE(E,h)||i({type:"CELL.POINTER_MOVE",cell:"day",value:E,focus:le,outsideRange:k.outsideRange})}:void 0})},getMonthTableCellState:nn,getMonthTableCellProps(A){const{value:E,columns:k}=A,R=nn(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Ee(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Ee(!R.selectable),"data-value":E})},getMonthTableCellTriggerProps(A){const{value:E}=A,k=nn(A);return t.element({...oe.tableCellTrigger.attrs,id:Ha(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Ee(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"month","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"month",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&_r(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"month",value:k.value,focus:le})}:void 0})},getYearTableCellState:Vt,getYearTableCellProps(A){const{value:E,columns:k}=A,R=Vt(A);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:k,role:"gridcell","aria-selected":Ee(R.selected||R.inRange),"data-selected":z(R.selected),"aria-disabled":Ee(!R.selectable),"data-value":E})},getYearTableCellTriggerProps(A){const{value:E}=A,k=Vt(A);return t.element({...oe.tableCellTrigger.attrs,id:Ha(a,E.toString()),role:"button",dir:o("dir"),tabIndex:k.focused?0:-1,"aria-label":k.valueText,"aria-disabled":Ee(!k.selectable),"data-disabled":z(!k.selectable),"data-selectable":z(k.selectable),"data-selected":z(k.selected),"data-value":E,"data-view":"year","data-focus":z(k.focused),"data-outside-range":z(k.outsideRange),"data-range-start":z(k.firstInRange),"data-range-end":z(k.lastInRange),"data-in-range":z(k.inRange),"data-in-hover-range":z(k.inHoveredRange),"data-hover-range-start":z(k.firstInHoveredRange),"data-hover-range-end":z(k.lastInHoveredRange),onClick(R){R.defaultPrevented||k.selectable&&i({type:"CELL.CLICK",cell:"year",value:E})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!k.selectable)return;const le=!a.isActiveElement(R.currentTarget);h&&k.value&&Lr(k.value,h)||i({type:"CELL.POINTER_MOVE",cell:"year",value:k.value,focus:le})}:void 0})},getNextTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isNextVisibleRangeValid");return t.button({...oe.nextTrigger.attrs,dir:o("dir"),id:wP(a,E),type:"button","aria-label":q.nextTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.NEXT",view:E})}})},getPrevTriggerProps(A={}){const{view:E="day"}=A,k=f||!s("isPrevVisibleRangeValid");return t.button({...oe.prevTrigger.attrs,dir:o("dir"),id:vP(a,E),type:"button","aria-label":q.prevTrigger(E),disabled:k,"data-disabled":z(k),onClick(R){R.defaultPrevented||i({type:"GOTO.PREV",view:E})}})},getClearTriggerProps(){return t.button({...oe.clearTrigger.attrs,id:rh(a),dir:o("dir"),type:"button","aria-label":q.clearTrigger,hidden:!u.length,onClick(A){A.defaultPrevented||i({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...oe.trigger.attrs,id:sh(a),dir:o("dir"),type:"button","data-placement":Q,"data-side":V,"aria-label":q.trigger(P),"aria-controls":ja(a),"aria-expanded":P,"data-state":P?"open":"closed","data-placeholder-shown":z(w),"aria-haspopup":"grid",disabled:f,onClick(A){A.defaultPrevented||y&&i({type:"TRIGGER.CLICK"})}})},getViewProps(A={}){const{view:E="day"}=A;return t.element({...oe.view.attrs,"data-view":E,hidden:r.get("view")!==E})},getViewTriggerProps(A={}){const{view:E="day"}=A;return t.button({...oe.viewTrigger.attrs,"data-view":E,dir:o("dir"),id:bP(a,E),type:"button",disabled:f,"aria-label":q.viewTrigger(E),onClick(k){k.defaultPrevented||y&&i({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(A={}){const{view:E="day"}=A;return t.element({...oe.viewControl.attrs,"data-view":E,dir:o("dir")})},getInputProps(A={}){const{index:E=0,fixOnBlur:k=!0}=A;return t.input({...oe.input.attrs,id:ih(a,E),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":E,"data-state":P?"open":"closed","data-placeholder-shown":z(w),readOnly:p,disabled:f,required:o("required"),"aria-invalid":Ee(m),"data-invalid":z(m),placeholder:o("placeholder")||kP(C),defaultValue:s("valueAsString")[E],onBeforeInput(R){const{data:le}=Pd(R);Jf(le,G)||R.preventDefault()},onClick(R){R.defaultPrevented||o("openOnClick")&&y&&i({type:"OPEN",src:"input.click"})},onFocus(){i({type:"INPUT.FOCUS",index:E})},onBlur(R){const le=R.currentTarget.value.trim();i({type:"INPUT.BLUR",value:le,index:E,fixOnBlur:k})},onKeyDown(R){if(R.defaultPrevented||!y)return;const Ge={Enter(Ce){zx(Ce)||Ci(d)||Ce.currentTarget.value.trim()!==""&&i({type:"INPUT.ENTER",value:Ce.currentTarget.value,index:E})}}[R.key];Ge&&(Ge(R),R.preventDefault())},onInput(R){const le=R.currentTarget.value;i({type:"INPUT.CHANGE",value:cP(le,G),index:E})}})},getMonthSelectProps(){return t.select({...oe.monthSelect.attrs,id:ch(a),"aria-label":q.monthSelect,disabled:f,dir:o("dir"),defaultValue:c.month,onChange(A){ki(Number(A.currentTarget.value))}})},getYearSelectProps(){return t.select({...oe.yearSelect.attrs,id:lh(a),disabled:f,"aria-label":q.yearSelect,dir:o("dir"),defaultValue:c.year,onChange(A){X(Number(A.currentTarget.value))}})},getPositionerProps(){return t.element({id:ah(a),...oe.positioner.attrs,dir:o("dir"),style:j.floating})},getPresetTriggerProps(A){const E=Array.isArray(A.value)?A.value:th(A.value,C,S),k=E.filter(R=>R!=null).map(R=>R.toDate(S).toDateString());return t.button({...oe.presetTrigger.attrs,"aria-label":q.presetTrigger(k),type:"button",onClick(R){R.defaultPrevented||i({type:"PRESET.CLICK",value:E})}})}}}var{and:Pe}=xx();function LP(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if(!tn(e[r],t[r]))return!1;return!0}function Si(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var NP=gd({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1;let i;if(e.createCalendar){const f=new Intl.DateTimeFormat(t).resolvedOptions().calendar;f!=="gregory"&&f!=="iso8601"&&(i=e.createCalendar(f))}const s=g=>!i||g.calendar.identifier===i.identifier?g:ve(g,i),a=e.defaultValue?xi(e.defaultValue).map(g=>Ye(s(g),e.min,e.max)):void 0,c=e.value?xi(e.value).map(g=>Ye(s(g),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||Kr(n,i);l=Ye(s(l),e.min,e.max);const u="day",d="year",h=Ga(e.view||u,u,d);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:r,defaultView:h,minView:u,maxView:d,outsideDaySelectable:!1,closeOnSelect:!0,format(g,{locale:f,timeZone:p}){return new He(f,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric",calendar:i?.identifier}).format(g.toDate(p))},parse(g,{locale:f,timeZone:p}){return fP(g,f,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")||e("inline")?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:tn,hash:r=>r.toString(),sync:!0,onChange(r){const o=n(),i=o.get("view"),s=o.get("value"),a=Si(s,e);e("onFocusChange")?.({value:s,valueAsString:a,view:i,focusedValue:r})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:LP,hash:r=>r.map(o=>o?.toString()??"").join(","),onChange(r){const o=n(),i=Si(r,e);e("onValueChange")?.({value:r,valueAsString:i,view:o.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:tn})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(r){e("onViewChange")?.({view:r})}})),startValue:t(()=>{const r=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:Bf(r,"start",{months:e("numOfMonths")},e("locale")),isEqual:tn,hash:o=>o.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>zf(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>IP({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!HE(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!YE(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>Si(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:r,computed:o}){e([()=>t("locale")],()=>{r(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{r(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{r(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{r(["syncInputValue"])}),e([()=>n.hash("value")],()=>{r(["syncInputElement"])}),e([()=>o("valueAsString").toString()],()=>{r(["announceValueText"])}),e([()=>n.get("view")],()=>{r(["focusActiveCell"])}),e([()=>t("open")],()=>{r(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:Pe("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Pe("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Pe("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Pe("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Pe("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Pe("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:Pe("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:Pe("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:Pe("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:Pe("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:Pe("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Pe("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:Pe("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:Pe("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:Pe("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>TP(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:({context:e,prop:t,event:n})=>{const r=t("maxSelectedDates");if(r==null)return!0;const o=e.get("value"),i=n.value??e.get("focusedValue");return o.some(a=>tn(a,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const r=fh(n);return NS(r,()=>dh(n),{...t("positioning"),defer:!0,onComplete(i){e.set("currentPlacement",i.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",WE({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:r}){return r("inline")?void 0:nE(()=>bi(e),{type:"popover",defer:!0,layerStyleTargets:[()=>dh(e)],exclude:[...Ur(e),wi(e),EP(e)],onInteractOutside(i){n.set("restoreFocus",!i.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(i){i.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setNextView({context:e,prop:t}){const n=$P(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=DP(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const r=e.get("value"),o=t("locale"),i=t("timeZone");let s;if(t("selectionMode")==="range"){const[a,c]=r;a&&c?s=vi(a,c,o,i):a?s=vi(a,null,o,i):c?s=vi(c,null,o,i):s=""}else s=r.map(a=>vi(a,null,o,i)).filter(Boolean).join(",");n.get("announcer")?.announce(s,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){e1({target:bi(e),doc:e.getDoc()})},enableTextSelection({scope:e}){kd({doc:e.getDoc(),target:bi(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&fe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){Te(()=>{Ur(e).forEach((r,o)=>{Xo(r,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;fe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;fe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const r=t.value.map(o=>Ye(o,n("min"),n("max")));e.set("value",r)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,r=Array.from(t.get("value")),o=t.get("activeIndex"),i=r[o],s=Ei(e,n.value??t.get("focusedValue"));r[o]=Xa(i,s),t.set("value",Ya(r))},resetSelection(e){const{context:t,event:n}=e,r=t.get("value")[0],o=Ei(e,n.value??t.get("focusedValue"));t.set("value",[Xa(r,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,r=Ei(e,n.value??t.get("focusedValue")),o=t.get("value"),i=o.findIndex(s=>tn(s,r));if(i===-1){const s=[...o,r];t.set("value",xi(s))}else{const s=Array.from(o);s.splice(i,1),t.set("value",xi(s))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),r=e.get("activeIndex"),o=n[r],i=e.get("focusedValue").copy();n[r]=Xa(o,i),e.set("value",Ya(n));const s=t("valueAsString");e.set("inputValue",s[r])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});fe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});fe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});fe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});fe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:r}=e,o=Xf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Pi(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:r}=e,o=Zf(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Pi(e,o)},focusSectionStart(e){const{context:t}=e;fe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;fe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=sP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Pi(e,i)},focusPreviousSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=aP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Pi(e,i)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});fe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});fe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});fe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});fe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,r=t.get("focusedValue").calendar;fe(e,Kr(n("timeZone"),r))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({months:n.columns});fe(e,r)},focusNextMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({months:n.columns});fe(e,r)},focusPreviousYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({years:n.columns});fe(e,r)},focusNextYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({years:n.columns});fe(e,r)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMinimumMonthInYear?.(n)??1;fe(e,n.set({month:r}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMonthsInYear(n);fe(e,n.set({month:r}))},focusFirstYear(e){const{context:t}=e,n=tr(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[0]});fe(e,r)},focusLastYear(e){const{context:t}=e,n=tr(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[n.length-1]});fe(e,r)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&Te(()=>{const r=t.get("view");uh(e,r)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&Te(()=>{const r=t.get("view");uh(e,r)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!t.type.startsWith("TABLE.ARROW")||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},focusTriggerElement({scope:e}){Te(()=>{wi(e)?.focus({preventScroll:!0})})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&Te(()=>{const[n]=Ur(e);(n??wi(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){Te(()=>{const t=Ur(e);if(t.length===0){wi(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(i=>i.value!==""),r=Math.max(n,0),o=t[r];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=SP(e);Xo(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=xP(e);Xo(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const r=Ur(e),o=n.index??t.get("activeIndex");Xo(r[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!hh(o)||fe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!hh(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Ye(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const s=Si(i,n);e.set("inputValue",s[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const r=e.get("focusedValue");if(!wt(r,e.get("startValue"),t("endValue")))return;const i=Bf(r,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),Ei=(e,t)=>{const{context:n,prop:r}=e,o=n.get("view");let i=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return MP(s=>{AP(s,r("minView"))&&(i=i.set({[s]:s==="day"?1:0}))}),i},Xa=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let r=t;return"hour"in t||(n?r=Df(je(t),e.timeZone):r=je(t)),r.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function fe(e,t){const{context:n,prop:r,computed:o}=e;if(!t)return;const i=Ei(e,t);if(tn(n.get("focusedValue"),i))return;const a=zr(o("visibleDuration"),r("locale"),r("min"),r("max"))({focusedDate:i,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Pi(e,t){const{context:n}=e;n.set("startValue",t.startDate);const r=n.get("focusedValue");tn(r,t.focusedDate)||n.set("focusedValue",t.focusedDate)}var gh=nh.extendWith("view","valueText"),[ph,ae]=Xt({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),FP=e=>{const t=ae(),n=ee(()=>t().getClearTriggerProps(),e);return v(re.button,n)},VP=e=>{const t=ae(),n=_d(),r=ee(()=>t().getContentProps(),()=>n().presenceProps,e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,N(r,{ref(o){var i=x1(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},BP=e=>e.children(ae()),KP=e=>{const t=ae(),n=ee(()=>t().getControlProps(),e);return v(re.div,n)},zP=e=>{const[t,n]=pt()(e,["index","fixOnBlur"]),r=ae(),o=ee(()=>r().getInputProps(t),n);return v(re.input,o)},UP=e=>{const t=ae(),n=ee(()=>t().getLabelProps(),e);return v(re.label,n)},WP=e=>{const t=ae(),n=ee(()=>t().getMonthSelectProps(),e);return v(re.select,N(n,{get children(){return v(Oc,{get each(){return t().getMonths()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},[jP,Sn]=Xt({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),HP=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getNextTriggerProps(n),e);return v(re.button,r)},YP=e=>{const t=ae(),n=_d(),r=ee(()=>t().getPositionerProps(),e);return v(ie,{get when(){return!n().unmounted},get children(){return v(re.div,r)}})},qP=e=>{const[t,n]=pt()(e,["value"]),r=ae(),o=ee(()=>r().getPresetTriggerProps(t),n);return v(re.button,o)},GP=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getPrevTriggerProps(n),e);return v(re.button,r)},XP=e=>{const t=ae(),n=ee(()=>t().getRangeTextProps(),e),r=_(()=>{const{start:o,end:i}=t().visibleRangeText;return K0([o,i]).filter(Boolean).join(" - ")});return v(re.div,N(n,{get children(){return r()}}))},ZP=e=>{const t=ae(),n=()=>t().value.length>0;return v(ie,{get when(){return typeof e.children=="function"},get fallback(){return v(re.span,N(()=>gh.build().valueText.attrs,e,{get children(){return Ut(()=>!!n())()?t().valueAsString.join(e.separator??", "):e.placeholder}}))},get children(){return v(ie,{get when(){return n()},get fallback(){return e.placeholder},get children(){return v(ln,{get each(){return t().value},children:(r,o)=>Ut(()=>e.children({value:r,index:o(),valueAsString:t().valueAsString[o()],remove:()=>{t().setValue(t().value.filter((i,s)=>s!==o()))}}))})}})}})},JP=e=>{const t=Be(),n=BE(),r=rE(),o=_(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...sd(e)})),i=Td(NP,o);return _(()=>_P(i,g1))},QP=e=>{const[t,n]=Md(e),[r,o]=pt()(n,["closeOnSelect","createCalendar","defaultFocusedValue","defaultOpen","defaultValue","defaultView","disabled","fixedWeeks","focusedValue","format","id","ids","inline","invalid","isDateUnavailable","locale","max","maxSelectedDates","maxView","min","minView","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","onVisibleRangeChange","open","openOnClick","outsideDaySelectable","parse","placeholder","positioning","readOnly","required","selectionMode","showWeekNumbers","startOfWeek","timeZone","translations","value","view"]),i=JP(r),s=Dd(ee(t,()=>({present:i().open}))),a=ee(()=>i().getRootProps(),o);return v(ph,{value:i,get children(){return v(Id,{value:s,get children(){return v(re.div,a)}})}})},eC=e=>{const[t,n]=Md(e),[{value:r},o]=pt()(n,["value"]),i=Dd(ee(t,()=>({present:r().open}))),s=ee(()=>r().getRootProps(),o);return v(ph,{value:r,get children(){return v(Id,{value:i,get children(){return v(re.div,s)}})}})},[tC,Wr]=Xt({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),nC=e=>{const[t,n]=pt()(e,["columns"]),r=ae(),o=Sn(),i=Be(),s=ee(()=>({columns:t.columns,id:i}),o),a=ee(()=>r().getTableProps(s),n);return v(tC,{value:s,get children(){return v(re.table,a)}})},rC=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableBodyProps(n),e);return v(re.tbody,r)},[oC,iC]=Xt({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),sC=e=>{const[t,n]=pt()(e,["disabled","value","visibleRange","columns"]),r=ae(),o=Sn(),i=_(()=>{const c={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return c(t)}),s=ee(i,n);return v(oC,{value:t,get children(){return v(re.td,s)}})},aC=e=>{const t=ae(),n=iC(),r=Sn(),o=_(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=ee(o,e);return v(re.div,i)},cC=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableHeadProps(n),e);return v(re.thead,r)},lC=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableHeaderProps(n),e);return v(re.th,r)},uC=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getTableRowProps(n),e);return v(re.tr,r)},dC=e=>{const t=ae(),n=ee(()=>t().getTriggerProps(),e);return v(re.button,n)},fC=e=>{const[t,n]=pt()(e,["view"]),r=ae(),o=ee(()=>gh.build().view.attrs,n);return v(jP,{value:t,get children(){return v(re.div,N(o,{get hidden(){return r().view!==t.view}}))}})},hC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewControlProps(n),e);return v(re.div,r)},gC=e=>{const t=ae(),n=Sn(),r=ee(()=>t().getViewTriggerProps(n),e);return v(re.button,r)},pC=pt(),mC=e=>{const[t,n]=pC(e,["weekIndex","week"]),r=ae(),o=ee(()=>r().getWeekNumberCellProps(t),n);return v(re.td,o)},yC=e=>{const t=ae(),n=Wr(),r=ee(()=>t().getWeekNumberHeaderCellProps(n),e);return v(re.th,r)},vC=e=>{const t=ae(),n=ee(()=>t().getYearSelectProps(),e);return v(re.select,N(n,{get children(){return v(Oc,{get each(){return t().getYears()},children:r=>v(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},Ft={};zE(Ft,{ClearTrigger:()=>FP,Content:()=>VP,Context:()=>BP,Control:()=>KP,Input:()=>zP,Label:()=>UP,MonthSelect:()=>WP,NextTrigger:()=>HP,Positioner:()=>YP,PresetTrigger:()=>qP,PrevTrigger:()=>GP,RangeText:()=>XP,Root:()=>QP,RootProvider:()=>eC,Table:()=>nC,TableBody:()=>rC,TableCell:()=>sC,TableCellTrigger:()=>aC,TableHead:()=>cC,TableHeader:()=>lC,TableRow:()=>uC,Trigger:()=>dC,ValueText:()=>ZP,View:()=>fC,ViewControl:()=>hC,ViewTrigger:()=>gC,WeekNumberCell:()=>mC,WeekNumberHeaderCell:()=>yC,YearSelect:()=>vC}),Ft.Label,Ft.TableHead,Ft.TableBody,Ft.ClearTrigger,Ft.YearSelect,Ft.MonthSelect,Ft.Context,Ft.RootProvider;var wC=W("<div>Unknown bot message type");const bC=e=>v(Hw,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(Xs,{get text(){return e.text}}):e.type==="buttons"?v(Xw,N(()=>e.buttons)):e.type==="list"?v(A0,N(()=>e.list)):e.type==="media"?v(Zu,N(()=>e.media)):e.type==="link"?v(tb,N(()=>e.link)):e.type==="cards"?v(Qw,N(()=>e.cards)):e.type==="date"?v(Xs,{get text(){return e.text}}):wC()}});var xC=W('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const SC=e=>(()=>{var t=xC(),n=t.firstChild;return F(n,()=>e.text?.trim()),t})();var EC=W('<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 PC=({children:e,createdAt:t})=>(()=>{var n=EC(),r=n.firstChild;return F(r,e),F(n,v(_u,{createdAt:t,anchor:"end"}),null),n})();var CC=W("<div>Unknown user message type");const kC=e=>v(PC,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?v(Xs,{get text(){return e.text}}):e.type==="media"?v(Zu,N(()=>e.media)):CC()}});var OC=W("<div>Unknown message origin");const TC=e=>e.origin==="bot"?v(bC,e):e.origin==="user"?v(kC,e):e.origin==="service"?v(SC,e):OC();function Za(e){return Ke({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 AC=W('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),$C=W("<div>");const Ja=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o,maybeAutostart:i}=Gt(),{onOpen:s}=Fc(),a=(c=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},c)};return pe("reset",()=>{r()}),cn(()=>{o(),a(200),i()}),n(a),s(()=>a(200)),(()=>{var c=AC(),l=e;return typeof l=="function"?oo(l,c):e=c,F(c,v(ln,{get each(){return t()},get fallback(){return(()=>{var u=$C();return F(u,()=>kn("emptyMessages")),u})()},children:u=>v(TC,u)})),c})()};var DC=W("<textarea>");const RC=e=>{const[,t]=J(e,["class"]);return(()=>{var n=DC();return un(n,N({get class(){return zt("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 MC=W('<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 IC=e=>(()=>{var t=MC();return un(t,e,!0,!0),t})();var _C=W('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const LC=()=>(()=>{var e=_C(),t=e.firstChild;return F(e,v(IC,{height:15}),t),e})();var NC=W('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"></div><div class="flex justify-center opacity-70 scale-95">');const Qa=()=>{const{pushMessage:e}=Gt(),[t,n]=L(""),r=()=>{t().trim()&&(e(t()),n(""))},o=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),r())};return pe("setInput",i=>{i&&n(i)}),(()=>{var i=NC(),s=i.firstChild,a=s.firstChild,c=a.nextSibling;return F(a,v(RC,{id:"chat-input",get placeholder(){return kn("inputPlaceholder")},get value(){return t()},onInput:l=>n(l.currentTarget.value),onKeyDown:o,class:"focus-visible:ring-primary min-h-[44px] max-h-[120px] py-3 leading-tight resize-none"}),null),F(a,v(Je,{variant:"outline",class:"h-[44px] w-[44px] p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",onClick:r,get children(){return v(Tp,{size:20})}}),null),F(c,v(LC,{})),i})()};var FC=W('<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">'),VC=W("<span class=sr-only>Close"),BC=W('<div><div class="flex justify-center gap-3 items-center">'),KC=W("<span class=sr-only>Open"),zC=W("<span class=font-bold>"),UC=W("<span>"),WC=W('<div class="animate-pulse flex p-1">');const jC=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Fc(),{chatWidget:s}=ge(),[a,c]=L(!0),[l,u]=L("");setTimeout(()=>c(!1),2e3),s()?.openDelay&&!s()?.hideWidget&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const d=()=>(s()?.style.margin??5)*4,h=()=>s()?.style.position==="left"?{left:`${d()}px`}:{right:`${d()}px`};return pe("open",()=>{o()}),pe("close",()=>{i()}),pe("toggle",()=>{r()}),pe("onAnswer",g=>{g.text&&u(g.text),o()}),(()=>{var g=BC(),f=g.firstChild;return F(g,v(ie,{get when(){return Ut(()=>!!n())()&&!s()?.hideWidget},get children(){var p=FC();return F(p,e),p}}),f),F(f,v(ie,{get when(){return s()?.whatsappBtn},get children(){return v(Je,{onclick:()=>window.open(s()?.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 v(Kw,{class:"size-9",color:"white"})}})}}),null),F(f,v(ie,{get when(){return!s()?.hideWidget},get children(){return v(ie,{get when(){return n()},get fallback(){return v(Je,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,KC(),v(ie,{get when(){return s()?.balloonMessage},get children(){var p=UC();return F(p,v(ie,{get when(){return l()},get fallback(){return v(ie,{get when(){return!a()},get fallback(){return(()=>{var m=WC();return F(m,v(Za,{class:"size-2 animate-bounce"}),null),F(m,v(Za,{class:"size-2 animate-bounce delay-150"}),null),F(m,v(Za,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return Ut(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=zC();return F(m,(()=>{var y=Ut(()=>l().length>20);return()=>y()?l().substring(0,17)+"...":l()})()),m}})),ye(()=>Wt(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return v(Je,{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,VC()]}})}})}}),null),ye(p=>{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 "+(s()?.style.position==="left"?" items-start":" items-end"),y=h();return m!==p.e&&Wt(g,p.e=m),p.t=ro(g,y,p.t),p},{e:void 0,t:void 0}),g})()};var HC=W('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const YC=({children:e})=>{const{chatWidget:t}=ge(),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=HC();return ro(r,n),F(r,e),r})()};var qC=W("<div id=smarttalks-widget>");const GC=({children:e})=>{const{chatWidget:t}=ge(),[n,r]=L(!1),[o,i]=L(!1),[s,a]=L("100%"),c=()=>{typeof window<"u"&&i(window.innerWidth<768)},l=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};B(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),cn(()=>{c(),window.addEventListener("resize",c),window.visualViewport&&(window.visualViewport.addEventListener("resize",l),window.visualViewport.addEventListener("scroll",l))}),H(()=>{window.removeEventListener("resize",c),window.visualViewport&&(window.visualViewport.removeEventListener("resize",l),window.visualViewport.removeEventListener("scroll",l)),document.body.style.overflow="",document.body.style.position=""});const u=()=>(t()?.style.margin??5)*4,d=()=>{if(o())return{height:s(),top:"0px"};const h={};return t()?.fullscreen?(h.height="100%",h["max-height"]="100%",h.width="100%",h["max-width"]="100%",h.bottom=0,h.left=0):t()?.style.position&&(h[t()?.style.position||"right"]=`${u()}px`),h};return pe("open",()=>{r(!0),he("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),pe("close",()=>{r(!1),he("onClose")}),pe("toggle",()=>{r(!n()),he("onToggle")}),pe("onAnswer",()=>{r(!0),he("onOpen")}),setTimeout(()=>{r(!0),he("onOpen")},(t()?.openDelay||0)*1e3),v(ie,{get when(){return n()},get children(){var h=qC();return F(h,e),ye(g=>{var f=`
|
|
182
182
|
fixed flex flex-col bg-background text-foreground shadow-xl overflow-hidden z-[99999]
|
|
183
183
|
|
|
184
184
|
${o()?"inset-x-0 top-0 w-full rounded-none m-0":"transition-all duration-300 ease-in-out w-[400px] h-[min(85vh,700px)] md:w-[400px] md:max-h-[90%] md:rounded-xl md:bottom-5"}
|
|
185
|
-
`,p=d();return f!==g.e&&
|
|
185
|
+
`,p=d();return f!==g.e&&Wt(h,g.e=f),g.t=ro(h,p,g.t),g},{e:void 0,t:void 0}),h}})};var XC=W('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const ec=()=>(()=>{var e=XC();return F(e,v(Op,{size:45,class:"animate-spin"})),e})(),ZC=()=>{const{chatWidget:e}=ge(),{loading:t}=Gt();return v(jC,{get openIcon(){return v(qc,{get src(){return e()?.avatar}})},get children(){return[v(ie,{get when(){return t()},get children(){return v(ec,{})}}),v(Ks,{}),v(Ja,{}),v(Qa,{})]}})},JC=()=>{const{loading:e}=Gt();return v(GC,{get children(){return[v(ie,{get when(){return e()},get children(){return v(ec,{})}}),v(Ks,{}),v(Ja,{}),v(Qa,{})]}})},QC=()=>{const{loading:e}=Gt();return v(YC,{get children(){return[v(ie,{get when(){return e()},get children(){return v(ec,{})}}),v(Ks,{}),v(Ja,{}),v(Qa,{})]}})},ek=()=>{const{chatWidget:e}=ge();return v(Tc,{get children(){return[v(lr,{get when(){return e()?.mode==="standard"},get children(){return v(ZC,{})}}),v(lr,{get when(){return e()?.mode==="popup"},get children(){return v(JC,{})}}),v(lr,{get when(){return e()?.mode==="static"},get children(){return v(QC,{})}})]}})};var tk=W("<div><div>Form");const nk=()=>{const{formWidget:e}=ge();return(()=>{var t=tk();return t.firstChild,F(t,()=>e()?._id,null),t})()};function rk(){const{widget:e}=ge();return v(Tc,{get children(){return[v(lr,{get when(){return e()?.type==="chat"},get children(){return v(ek,{})}}),v(lr,{get when(){return e()?.type==="form"},get children(){return v(nk,{})}})]}})}var ok=W("<style>"),ik=W("<div>");let mh=!1;const sk=({id:e,settings:t,side:n,margin:r,mode:o})=>{if(mh)return console.warn("SmartTalks.ai Widget: duplicate instance blocked"),[];mh=!0;const{setWidgetId:i}=ge(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=ok();return F(a,Jg),a})(),(()=>{var a=ik();return F(a,v(rk,{})),a})()]},ak={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Zg("smarttalks-widget",ak,sk)})(),ng()}));
|