@embedreach/components 0.1.50 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/index.js +5 -2
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/function Jd(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Zd(e))&&(r&&(r+=" "),r+=t);return r}const Zd=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zd(e[r]))&&(n&&(n+=" "),n+=t);return n};function eh(e,...t){let n,r,o,i=function(a){const l=t.reduce(((e,t)=>t(e)),e());return n=(e=>({cache:Gd(e.cacheSize),parseClassName:Yd(e),...$d(e)}))(l),r=n.cache.get,o=n.cache.set,i=s,s(a)};function s(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Xd);let a="";for(let l=s.length-1;l>=0;l-=1){const e=s[l],{modifiers:t,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(e);let h=Boolean(d),f=r(h?u.substring(0,d):u);if(!f){if(!h){a=e+(a.length>0?" "+a:a);continue}if(f=r(u),!f){a=e+(a.length>0?" "+a:a);continue}h=!1}const p=Qd(t).join(":"),m=c?p+"!":p,g=m+f;if(i.includes(g))continue;i.push(g);const v=o(f,h);for(let n=0;n<v.length;++n)i.push(m+v[n]);a=e+(a.length>0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(Jd.apply(null,arguments))}}const th=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},nh=/^\[(?:([a-z-]+):)?(.+)\]$/i,rh=/^\d+\/\d+$/,oh=new Set(["px","full","screen"]),ih=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sh=/\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$/,ah=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ch=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uh=e=>hh(e)||oh.has(e)||rh.test(e),dh=e=>Eh(e,"length",jh),hh=e=>Boolean(e)&&!Number.isNaN(Number(e)),fh=e=>Eh(e,"number",hh),ph=e=>Boolean(e)&&Number.isInteger(Number(e)),mh=e=>e.endsWith("%")&&hh(e.slice(0,-1)),gh=e=>nh.test(e),vh=e=>ih.test(e),yh=new Set(["length","size","percentage"]),bh=e=>Eh(e,yh,Th),xh=e=>Eh(e,"position",Th),wh=new Set(["image","url"]),Sh=e=>Eh(e,wh,Nh),Ch=e=>Eh(e,"",Ph),kh=()=>!0,Eh=(e,t,n)=>{const r=nh.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},jh=e=>sh.test(e)&&!ah.test(e),Th=()=>!1,Ph=e=>lh.test(e),Nh=e=>ch.test(e),_h=eh((()=>{const e=th("colors"),t=th("spacing"),n=th("blur"),r=th("brightness"),o=th("borderColor"),i=th("borderRadius"),s=th("borderSpacing"),a=th("borderWidth"),l=th("contrast"),c=th("grayscale"),u=th("hueRotate"),d=th("invert"),h=th("gap"),f=th("gradientColorStops"),p=th("gradientColorStopPositions"),m=th("inset"),g=th("margin"),v=th("opacity"),y=th("padding"),b=th("saturate"),x=th("scale"),w=th("sepia"),S=th("skew"),C=th("space"),k=th("translate"),E=()=>["auto",gh,t],j=()=>[gh,t],T=()=>["",uh,dh],P=()=>["auto",hh,gh],N=()=>["","0",gh],_=()=>[hh,gh];return{cacheSize:500,separator:":",theme:{colors:[kh],spacing:[uh,dh],blur:["none","",vh,gh],brightness:_(),borderColor:[e],borderRadius:["none","","full",vh,gh],borderSpacing:j(),borderWidth:T(),contrast:_(),grayscale:N(),hueRotate:_(),invert:N(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[mh,dh],inset:E(),margin:E(),opacity:_(),padding:j(),saturate:_(),scale:_(),sepia:N(),skew:_(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",gh]}],container:["container"],columns:[{columns:[vh]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",gh]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ph,gh]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gh]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",ph,gh]}],"grid-cols":[{"grid-cols":[kh]}],"col-start-end":[{col:["auto",{span:["full",ph,gh]},gh]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[kh]}],"row-start-end":[{row:["auto",{span:[ph,gh]},gh]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gh]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gh]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",gh,t]}],"min-w":[{"min-w":[gh,t,"min","max","fit"]}],"max-w":[{"max-w":[gh,t,"none","full","min","max","fit","prose",{screen:[vh]},vh]}],h:[{h:[gh,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gh,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gh,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gh,t,"auto","min","max","fit"]}],"font-size":[{text:["base",vh,dh]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fh]}],"font-family":[{font:[kh]}],"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",gh]}],"line-clamp":[{"line-clamp":["none",hh,fh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",uh,gh]}],"list-image":[{"list-image":["none",gh]}],"list-style-type":[{list:["none","disc","decimal",gh]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",uh,dh]}],"underline-offset":[{"underline-offset":["auto",uh,gh]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gh]}],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",gh]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",xh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],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":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","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":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"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:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[uh,gh]}],"outline-w":[{outline:[uh,dh]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[uh,dh]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vh,Ch]}],"shadow-color":[{shadow:[kh]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",vh,gh]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"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",gh]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",gh]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",gh]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[ph,gh]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"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",gh]}],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",gh]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",gh]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[uh,dh,fh]}],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 Dh(...e){return _h(Zu(e))}const Mh=Ku,Oh=i.forwardRef((({className:e,...n},r)=>t.jsx(Hu,{ref:r,className:Dh("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-0 sm:right-0 sm:bottom-auto sm:flex-col md:max-w-[420px]",e),...n})));Oh.displayName=Hu.displayName;const Rh=nd("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Ah=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx(Wu,{ref:o,className:Dh(Rh({variant:n}),e),...r})));Ah.displayName=Wu.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(Qu,{ref:r,className:Dh("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...n}))).displayName=Qu.displayName;const Lh=i.forwardRef((({className:e,...n},r)=>t.jsx(Xu,{ref:r,className:Dh("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...n,children:t.jsx(Fd,{className:"h-4 w-4"})})));Lh.displayName=Xu.displayName;const Ih=i.forwardRef((({className:e,...n},r)=>t.jsx(Gu,{ref:r,className:Dh("text-sm font-semibold [&+div]:text-xs",e),...n})));Ih.displayName=Gu.displayName;const Fh=i.forwardRef((({className:e,...n},r)=>t.jsx(Yu,{ref:r,className:Dh("text-sm opacity-90",e),...n})));function $h(){const{toasts:e}=Dc();return t.jsxs(Mh,{children:[e.map((function({id:e,title:n,description:r,action:o,...i}){return t.jsxs(Ah,{...i,children:[t.jsxs("div",{className:"grid gap-1",children:[n&&t.jsx(Ih,{children:n}),r&&t.jsx(Fh,{children:r})]}),o,t.jsx(Lh,{})]},e)})),t.jsx(Oh,{})]})}Fh.displayName=Yu.displayName;const qh=n.createContext({});function zh(e){const t=n.useRef(null);return null===t.current&&(t.current=e()),t.current}const Uh=n.createContext(null),Vh=n.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Bh extends i.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=e instanceof HTMLElement&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Kh({children:e,isPresent:r,anchorX:o}){const s=n.useId(),a=n.useRef(null),l=n.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=n.useContext(Vh);return n.useInsertionEffect((()=>{const{width:e,height:t,top:n,left:i,right:u}=l.current;if(r||!a.current||!e||!t)return;const d="left"===o?`left: ${i}`:`right: ${u}`;a.current.dataset.motionPopId=s;const h=document.createElement("style");return c&&(h.nonce=c),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`\n [data-motion-pop-id="${s}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n ${d}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.removeChild(h)}}),[r]),t.jsx(Bh,{isPresent:r,childRef:a,sizeRef:l,children:i.cloneElement(e,{ref:a})})}const Hh=({children:e,initial:r,isPresent:o,onExitComplete:s,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const d=zh(Wh),h=n.useId(),f=n.useCallback((e=>{d.set(e,!0);for(const t of d.values())if(!t)return;s&&s()}),[d,s]),p=n.useMemo((()=>({id:h,initial:r,isPresent:o,custom:a,onExitComplete:f,register:e=>(d.set(e,!1),()=>d.delete(e))})),l?[Math.random(),f]:[o,f]);return n.useMemo((()=>{d.forEach(((e,t)=>d.set(t,!1)))}),[o]),i.useEffect((()=>{!o&&!d.size&&s&&s()}),[o]),"popLayout"===c&&(e=t.jsx(Kh,{isPresent:o,anchorX:u,children:e})),t.jsx(Uh.Provider,{value:p,children:e})};function Wh(){return new Map}function Gh(e=!0){const t=n.useContext(Uh);if(null===t)return[!0,null];const{isPresent:r,onExitComplete:o,register:i}=t,s=n.useId();n.useEffect((()=>{e&&i(s)}),[e]);const a=n.useCallback((()=>e&&o&&o(s)),[s,o,e]);return!r&&o?[!1,a]:[!0]}const Yh=e=>e.key||"";function Qh(e){const t=[];return n.Children.forEach(e,(e=>{n.isValidElement(e)&&t.push(e)})),t}const Xh="undefined"!=typeof window,Jh=Xh?n.useLayoutEffect:n.useEffect,Zh=({children:e,custom:r,initial:o=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,d]=Gh(l),h=n.useMemo((()=>Qh(e)),[e]),f=l&&!u?[]:h.map(Yh),p=n.useRef(!0),m=n.useRef(h),g=zh((()=>new Map)),[v,y]=n.useState(h),[b,x]=n.useState(h);Jh((()=>{p.current=!1,m.current=h;for(let e=0;e<b.length;e++){const t=Yh(b[e]);f.includes(t)?g.delete(t):!0!==g.get(t)&&g.set(t,!1)}}),[b,f.length,f.join("-")]);const w=[];if(h!==v){let e=[...h];for(let t=0;t<b.length;t++){const n=b[t],r=Yh(n);f.includes(r)||(e.splice(t,0,n),w.push(n))}return"wait"===a&&w.length&&(e=w),x(Qh(e)),y(h),null}process;const{forceRender:S}=n.useContext(qh);return t.jsx(t.Fragment,{children:b.map((e=>{const n=Yh(e),v=!(l&&!u)&&(h===b||f.includes(n));return t.jsx(Hh,{isPresent:v,initial:!(p.current&&!o)&&void 0,custom:r,presenceAffectsLayout:s,mode:a,onExitComplete:v?void 0:()=>{if(!g.has(n))return;g.set(n,!0);let e=!0;g.forEach((t=>{t||(e=!1)})),e&&(null==S||S(),x(m.current),l&&(null==d||d()),i&&i())},anchorX:c,children:e},n)}))})},ef=e=>e;let tf=ef,nf=ef;function rf(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(tf=(e,t)=>{},nf=(e,t)=>{if(!e)throw new Error(t)});const of=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},sf=e=>1e3*e,af=e=>e/1e3,lf=!1,cf=["read","resolveKeyframes","update","preRender","render","postRender"],uf={value:null};function df(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=cf.reduce(((e,n)=>(e[n]=function(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){s.has(t)&&(u.schedule(t),e()),l++,t(a)}const u={schedule:(e,t=!1,i=!1)=>{const a=i&&o?n:r;return t&&s.add(e),a.has(e)||a.add(e),e},cancel:e=>{r.delete(e),s.delete(e)},process:e=>{a=e,o?i=!0:(o=!0,[n,r]=[r,n],n.forEach(c),t&&uf.value&&uf.value.frameloop[t].push(l),l=0,n.clear(),o=!1,i&&(i=!1,u.process(e)))}};return u}(i,t?n:void 0),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=s,f=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),h.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(f))};return{schedule:cf.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(f)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t<cf.length;t++)s[cf[t]].cancel(e)},state:o,steps:s}}const{schedule:hf,cancel:ff,state:pf,steps:mf}=df("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ef,!0),gf=n.createContext({strict:!1}),vf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},yf={};for(const iQ in vf)yf[iQ]={isEnabled:e=>vf[iQ].some((t=>!!e[t]))};const bf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function xf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bf.has(e)}let wf=e=>!xf(e);try{(Sf=require("@emotion/is-prop-valid").default)&&(wf=e=>e.startsWith("on")?!xf(e):Sf(e))}catch(rQ){}var Sf;const Cf=new Set;function kf(e,t,n){e||Cf.has(t)||Cf.add(t)}function Ef(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>("production"!==process.env.NODE_ENV&&kf(!1,"motion() is deprecated. Use motion.create() instead."),e(...t))),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const jf=n.createContext({});function Tf(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Pf(e){return"string"==typeof e||Array.isArray(e)}const Nf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_f=["initial",...Nf];function Df(e){return Tf(e.animate)||_f.some((t=>Pf(e[t])))}function Mf(e){return Boolean(Df(e)||e.variants)}function Of(e){const{initial:t,animate:r}=function(e,t){if(Df(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Pf(t)?t:void 0,animate:Pf(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,n.useContext(jf));return n.useMemo((()=>({initial:t,animate:r})),[Rf(t),Rf(r)])}function Rf(e){return Array.isArray(e)?e.join(" "):e}const Af=Symbol.for("motionComponentSymbol");function Lf(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function If(e,t,r){return n.useCallback((n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&("function"==typeof r?r(n):Lf(r)&&(r.current=n))}),[t])}const Ff=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$f="data-"+Ff("framerAppearId"),{schedule:qf}=df(queueMicrotask,!1),zf=n.createContext({});function Uf(e,t,r,o,i){var s,a;const{visualElement:l}=n.useContext(jf),c=n.useContext(gf),u=n.useContext(Uh),d=n.useContext(Vh).reducedMotion,h=n.useRef(null);o=o||c.renderer,!h.current&&o&&(h.current=o(e,{visualState:t,parent:l,props:r,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const f=h.current,p=n.useContext(zf);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Vf(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&Lf(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(h.current,r,i,p);const m=n.useRef(!1);n.useInsertionEffect((()=>{f&&m.current&&f.update(r,u)}));const g=r[$f],v=n.useRef(Boolean(g)&&!(null===(s=window.MotionHandoffIsComplete)||void 0===s?void 0:s.call(window,g))&&(null===(a=window.MotionHasOptimisedAnimation)||void 0===a?void 0:a.call(window,g)));return Jh((()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),qf.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())})),n.useEffect((()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask((()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,g)})),v.current=!1))})),f}function Vf(e){if(e)return!1!==e.options.allowProjection?e.projection:Vf(e.parent)}function Bf({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:i,Component:s}){var a,l;function c(a,l){let c;const u={...n.useContext(Vh),...a,layoutId:Kf(a)},{isStatic:d}=u,h=Of(a),f=i(a,d);if(!d&&Xh){!function(e,t){const r=n.useContext(gf).strict;if("production"!==process.env.NODE_ENV&&t&&r){const t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?tf(!1,t):nf(!1,t)}}(u,e);const t=function(e){const{drag:t,layout:n}=yf;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(u);c=t.MeasureLayout,h.visualElement=Uf(s,f,u,r,t.ProjectionNode)}return t.jsxs(jf.Provider,{value:h,children:[c&&h.visualElement?t.jsx(c,{visualElement:h.visualElement,...u}):null,o(s,a,If(f,h.visualElement,l),f,d,h.visualElement)]})}e&&function(e){for(const t in e)yf[t]={...yf[t],...e[t]}}(e),c.displayName=`motion.${"string"==typeof s?s:`create(${null!==(l=null!==(a=s.displayName)&&void 0!==a?a:s.name)&&void 0!==l?l:""})`}`;const u=n.forwardRef(c);return u[Af]=s,u}function Kf({layoutId:e}){const t=n.useContext(qh).id;return t&&void 0!==e?t+"-"+e:e}const Hf=e=>t=>"string"==typeof t&&t.startsWith(e),Wf=Hf("--"),Gf=Hf("var(--"),Yf=e=>!!Gf(e)&&Qf.test(e.split("/*")[0].trim()),Qf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xf={};const Jf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zf=new Set(Jf);function ep(e,{layout:t,layoutId:n}){return Zf.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Xf[e]||"opacity"===e)}const tp=e=>Boolean(e&&e.getVelocity),np=(e,t)=>t&&"number"==typeof e?t.transform(e):e,rp=(e,t,n)=>n>t?t:n<e?e:n,op={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ip={...op,transform:e=>rp(0,1,e)},sp={...op,default:1},ap=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),lp=ap("deg"),cp=ap("%"),up=ap("px"),dp=ap("vh"),hp=ap("vw"),fp={...cp,parse:e=>cp.parse(e)/100,transform:e=>cp.transform(100*e)},pp={borderWidth:up,borderTopWidth:up,borderRightWidth:up,borderBottomWidth:up,borderLeftWidth:up,borderRadius:up,radius:up,borderTopLeftRadius:up,borderTopRightRadius:up,borderBottomRightRadius:up,borderBottomLeftRadius:up,width:up,maxWidth:up,height:up,maxHeight:up,top:up,right:up,bottom:up,left:up,padding:up,paddingTop:up,paddingRight:up,paddingBottom:up,paddingLeft:up,margin:up,marginTop:up,marginRight:up,marginBottom:up,marginLeft:up,backgroundPositionX:up,backgroundPositionY:up},mp={rotate:lp,rotateX:lp,rotateY:lp,rotateZ:lp,scale:sp,scaleX:sp,scaleY:sp,scaleZ:sp,skew:lp,skewX:lp,skewY:lp,distance:up,translateX:up,translateY:up,translateZ:up,x:up,y:up,z:up,perspective:up,transformPerspective:up,opacity:ip,originX:fp,originY:fp,originZ:up},gp={...op,transform:Math.round},vp={...pp,...mp,zIndex:gp,size:up,fillOpacity:ip,strokeOpacity:ip,numOctaves:gp},yp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bp=Jf.length;function xp(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const e=t[l];if(Zf.has(l))s=!0;else if(Wf(l))o[l]=e;else{const t=np(e,vp[l]);l.startsWith("origin")?(a=!0,i[l]=t):r[l]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i<bp;i++){const s=Jf[i],a=e[s];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(s.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=np(a,vp[s]);l||(o=!1,r+=`${yp[s]||s}(${e}) `),n&&(t[s]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=i;r.transformOrigin=`${e} ${t} ${n}`}}const wp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sp(e,t,n){for(const r in t)tp(t[r])||ep(r,n)||(e[r]=t[r])}function Cp(e,t){const r={};return Sp(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t){return n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return xp(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),r}function kp(e,t){const n={},r=Cp(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ep=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jp(e){return"string"==typeof e&&!e.includes("-")&&!!(Ep.indexOf(e)>-1||/[A-Z]/u.test(e))}const Tp={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pp={offset:"strokeDashoffset",array:"strokeDasharray"};function Np(e,t,n){return"string"==typeof e?e:up.transform(t+n*e)}function _p(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(xp(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:h,style:f,dimensions:p}=e;h.transform&&(p&&(f.transform=h.transform),delete h.transform),p&&(void 0!==o||void 0!==i||f.transform)&&(f.transformOrigin=function(e,t,n){return`${Np(t,e.x,e.width)} ${Np(n,e.y,e.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(h.x=t),void 0!==n&&(h.y=n),void 0!==r&&(h.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Tp:Pp;e[i.offset]=up.transform(-r);const s=up.transform(t),a=up.transform(n);e[i.array]=`${s} ${a}`}(h,s,a,l,!1)}const Dp=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Mp=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Op(e,t,r,o){const i=n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return _p(n,t,Mp(o),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Sp(t,e.style,e),i.style={...t,...i.style}}return i}function Rp(e=!1){return(t,r,o,{latestValues:i},s)=>{const a=(jp(t)?Op:kp)(r,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(wf(o)||!0===n&&xf(o)||!t&&!xf(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(r,"string"==typeof t,e),c=t!==n.Fragment?{...l,...a,ref:o}:{},{children:u}=r,d=n.useMemo((()=>tp(u)?u.get():u),[u]);return n.createElement(t,{...c,children:d})}}function Ap(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Lp(e,t,n,r){if("function"==typeof t){const[o,i]=Ap(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=Ap(r);t=t(void 0!==n?n:e.custom,o,i)}return t}const Ip=e=>Array.isArray(e);function Fp(e){const t=tp(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const $p=e=>(t,r)=>{const o=n.useContext(jf),i=n.useContext(Uh),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:qp(r,o,i,e),renderState:t()};return n&&(s.onMount=e=>n({props:r,current:e,...s}),s.onUpdate=e=>n(e)),s}(e,t,o,i);return r?s():zh(s)};function qp(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=Fp(i[h]);let{initial:s,animate:a}=e;const l=Df(e),c=Mf(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!Tf(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=Lp(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const r in n){let e=n[r];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[r]=e)}for(const r in e)o[r]=e[r]}}}return o}function zp(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(tp(o[s])||t.style&&tp(t.style[s])||ep(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return i}const Up={useVisualState:$p({scrapeMotionValuesFromProps:zp,createRenderState:wp})};function Vp(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(nQ){t.dimensions={x:0,y:0,width:0,height:0}}}function Bp(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const Kp=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Hp(e,t,n,r){Bp(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Kp.has(o)?o:Ff(o),t.attrs[o])}function Wp(e,t,n){const r=zp(e,t,n);for(const o in e)if(tp(e[o])||tp(t[o])){r[-1!==Jf.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}const Gp=["x","y","width","height","cx","cy","r"],Yp={useVisualState:$p({scrapeMotionValuesFromProps:Wp,createRenderState:Dp,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i)for(const a in o)if(Zf.has(a)){i=!0;break}if(!i)return;let s=!t;if(t)for(let a=0;a<Gp.length;a++){const n=Gp[a];e[n]!==t[n]&&(s=!0)}s&&hf.read((()=>{Vp(n,r),hf.render((()=>{_p(r,o,Mp(n.tagName),e.transformTemplate),Hp(n,r)}))}))}})};function Qp(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Bf({...jp(n)?Yp:Up,preloadedFeatures:e,useRender:Rp(r),createVisualElement:t,Component:n})}}function Xp(e,t,n){const r=e.getProps();return Lp(r,t,void 0!==n?n:r.custom,e)}const Jp=rf((()=>void 0!==window.ScrollTimeline));class Zp{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map((e=>"finished"in e?e.finished:e)))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map((n=>Jp()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0));return()=>{n.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach((t=>t[e]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class em extends Zp{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function tm(e,t){return e?e[t]||e.default||e:void 0}const nm=2e4;function rm(e){let t=0;let n=e.next(t);for(;!n.done&&t<nm;)t+=50,n=e.next(t);return t>=nm?1/0:t}function om(e){return"function"==typeof e}function im(e,t){e.timeline=t,e.onfinish=null}const sm=e=>Array.isArray(e)&&"number"==typeof e[0],am={linearEasing:void 0};function lm(e,t){const n=rf(e);return()=>{var e;return null!==(e=am[t])&&void 0!==e?e:n()}}const cm=lm((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(nQ){return!1}return!0}),"linearEasing"),um=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(of(0,o-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function dm(e){return Boolean("function"==typeof e&&cm()||!e||"string"==typeof e&&(e in fm||cm())||sm(e)||Array.isArray(e)&&e.every(dm))}const hm=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,fm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hm([0,.65,.55,1]),circOut:hm([.55,0,1,.45]),backIn:hm([.31,.01,.66,-.59]),backOut:hm([.33,1.53,.69,.99])};function pm(e,t){return e?"function"==typeof e&&cm()?um(e,t):sm(e)?hm(e):Array.isArray(e)?e.map((e=>pm(e,t)||fm.easeOut)):fm[e]:void 0}const mm={x:!1,y:!1};function gm(){return mm.x||mm.y}function vm(e,t){const n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ym(e){return!("touch"===e.pointerType||gm())}const bm=(e,t)=>!!t&&(e===t||bm(e,t.parentElement)),xm=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,wm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Sm=new WeakSet;function Cm(e){return t=>{"Enter"===t.key&&e(t)}}function km(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Em(e){return xm(e)&&!gm()}function jm(e,t,n={}){const[r,o,i]=vm(e,n),s=e=>{const r=e.currentTarget;if(!Em(e)||Sm.has(r))return;Sm.add(r);const i=t(r,e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Em(e)&&Sm.has(r)&&(Sm.delete(r),"function"==typeof i&&i(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||bm(r,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return r.forEach((e=>{(function(e){return wm.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0);(n.useGlobalTarget?window:e).addEventListener("pointerdown",s,o),e.addEventListener("focus",(e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Cm((()=>{if(Sm.has(n))return;km(n,"down");const e=Cm((()=>{km(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>km(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),i}const Tm=new Set(["width","height","top","left","right","bottom",...Jf]);let Pm;function Nm(){Pm=void 0}const _m={now:()=>(void 0===Pm&&_m.set(pf.isProcessing||lf?pf.timestamp:performance.now()),Pm),set:e=>{Pm=e,queueMicrotask(Nm)}};function Dm(e,t){-1===e.indexOf(t)&&e.push(t)}function Mm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Om{constructor(){this.subscriptions=[]}add(e){return Dm(this.subscriptions,e),()=>Mm(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Rm(e,t){return t?e*(1e3/t):0}class Am{constructor(e,t={}){this.version="12.4.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=_m.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=_m.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&kf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Om);const n=this.events[e].add(t);return"change"===e?()=>{n(),hf.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=_m.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Rm(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Lm(e,t){return new Am(e,t)}function Im(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Lm(n))}function Fm(e,t){const n=e.getValue("willChange");if(r=n,Boolean(tp(r)&&r.add))return n.add(t);var r}function $m(e){return e.props[$f]}const qm=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function zm(e,t,n,r){if(e===t&&n===r)return ef;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=qm(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:qm(o(e),t,r)}const Um=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vm=e=>t=>1-e(1-t),Bm=zm(.33,1.53,.69,.99),Km=Vm(Bm),Hm=Um(Km),Wm=e=>(e*=2)<1?.5*Km(e):.5*(2-Math.pow(2,-10*(e-1))),Gm=e=>1-Math.sin(Math.acos(e)),Ym=Vm(Gm),Qm=Um(Gm),Xm=e=>/^0[^.\s]+$/u.test(e);const Jm=e=>Math.round(1e5*e)/1e5,Zm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const eg=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tg=(e,t)=>n=>Boolean("string"==typeof n&&eg.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),ng=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,i,s,a]=r.match(Zm);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},rg={...op,transform:e=>Math.round((e=>rp(0,255,e))(e))},og={test:tg("rgb","red"),parse:ng("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+rg.transform(e)+", "+rg.transform(t)+", "+rg.transform(n)+", "+Jm(ip.transform(r))+")"};const ig={test:tg("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:og.transform},sg={test:tg("hsl","hue"),parse:ng("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+cp.transform(Jm(t))+", "+cp.transform(Jm(n))+", "+Jm(ip.transform(r))+")"},ag={test:e=>og.test(e)||ig.test(e)||sg.test(e),parse:e=>og.test(e)?og.parse(e):sg.test(e)?sg.parse(e):ig.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?og.transform(e):sg.transform(e)},lg=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const cg="number",ug="color",dg=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function hg(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(dg,(e=>(ag.test(e)?(r.color.push(i),o.push(ug),n.push(ag.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(cg),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function fg(e){return hg(e).values}function pg(e){const{split:t,types:n}=hg(e),r=t.length;return e=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],void 0!==e[i]){const t=n[i];o+=t===cg?Jm(e[i]):t===ug?ag.transform(e[i]):e[i]}return o}}const mg=e=>"number"==typeof e?0:e;const gg={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Zm))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(lg))||void 0===n?void 0:n.length)||0)>0},parse:fg,createTransformer:pg,getAnimatableNone:function(e){const t=fg(e);return pg(e)(t.map(mg))}},vg=new Set(["brightness","contrast","saturate","opacity"]);function yg(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Zm)||[];if(!r)return e;const o=n.replace(r,"");let i=vg.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const bg=/\b([a-z-]*)\(.*?\)/gu,xg={...gg,getAnimatableNone:e=>{const t=e.match(bg);return t?t.map(yg).join(" "):e}},wg={...vp,color:ag,backgroundColor:ag,outlineColor:ag,fill:ag,stroke:ag,borderColor:ag,borderTopColor:ag,borderRightColor:ag,borderBottomColor:ag,borderLeftColor:ag,filter:xg,WebkitFilter:xg},Sg=e=>wg[e];function Cg(e,t){let n=Sg(e);return n!==xg&&(n=gg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const kg=new Set(["auto","none","0"]);const Eg=e=>e===op||e===up,jg=(e,t)=>parseFloat(e.split(", ")[t]),Tg=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return jg(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?jg(t[1],e):0}},Pg=new Set(["x","y","z"]),Ng=Jf.filter((e=>!Pg.has(e)));const _g={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Tg(4,13),y:Tg(5,14)};_g.translateX=_g.x,_g.translateY=_g.y;const Dg=new Set;let Mg=!1,Og=!1;function Rg(){if(Og){const e=Array.from(Dg).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return Ng.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Og=!1,Mg=!1,Dg.forEach((e=>e.complete())),Dg.clear()}function Ag(){Dg.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Og=!0)}))}class Lg{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Dg.add(this),Mg||(Mg=!0,hf.read(Ag),hf.resolveKeyframes(Rg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==r?void 0:r.get(),i=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,i);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=i),r&&void 0===o&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Dg.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Dg.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ig=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Fg=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $g(e,t,n=1){nf(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Fg.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Ig(e)?parseFloat(e):e}return Yf(o)?$g(o,t,n+1):o}const qg=e=>t=>t.test(e),zg=[op,up,cp,lp,hp,dp,{test:e=>"auto"===e,parse:e=>e}],Ug=e=>zg.find(qg(e));class Vg extends Lg{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let a=0;a<e.length;a++){let n=e[a];if("string"==typeof n&&(n=n.trim(),Yf(n))){const r=$g(n,t.current);void 0!==r&&(e[a]=r),a===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Tm.has(n)||2!==e.length)return;const[r,o]=e,i=Ug(r),s=Ug(o);if(i!==s)if(Eg(i)&&Eg(s))for(let a=0;a<e.length;a++){const t=e[a];"string"==typeof t&&(e[a]=parseFloat(t))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let o=0;o<e.length;o++)("number"==typeof(r=e[o])?0===r:null===r||"none"===r||"0"===r||Xm(r))&&n.push(o);var r;n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!kg.has(t)&&hg(t).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=Cg(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_g[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=_g[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Bg=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!gg.test(e)&&"0"!==e||e.startsWith("url(")));const Kg=e=>null!==e;function Hg(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Kg),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}class Wg{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=_m.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ag(),Rg()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=_m.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=Bg(o,t),a=Bg(i,t);return tf(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||om(n))&&r)}(e,n,r,o)){if(!i)return a&&a(Hg(e,this.options,t)),s&&s(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((e=>{this.resolveFinishedPromise=e}))}}const Gg=(e,t,n)=>e+(t-e)*n;function Yg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Qg(e,t){return n=>n>0?t:e}const Xg=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Jg=[ig,og,sg];function Zg(e){const t=(n=e,Jg.find((e=>e.test(n))));var n;if(tf(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===sg&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Yg(a,r,e+1/3),i=Yg(a,r,e),s=Yg(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(r)),r}const ev=(e,t)=>{const n=Zg(e),r=Zg(t);if(!n||!r)return Qg(e,t);const o={...n};return e=>(o.red=Xg(n.red,r.red,e),o.green=Xg(n.green,r.green,e),o.blue=Xg(n.blue,r.blue,e),o.alpha=Gg(n.alpha,r.alpha,e),og.transform(o))},tv=(e,t)=>n=>t(e(n)),nv=(...e)=>e.reduce(tv),rv=new Set(["none","hidden"]);function ov(e,t){return n=>Gg(e,t,n)}function iv(e){return"number"==typeof e?ov:"string"==typeof e?Yf(e)?Qg:ag.test(e)?ev:lv:Array.isArray(e)?sv:"object"==typeof e?ag.test(e)?ev:av:Qg}function sv(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>iv(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function av(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=iv(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const lv=(e,t)=>{const n=gg.createTransformer(t),r=hg(e),o=hg(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?rv.has(e)&&!o.values.length||rv.has(t)&&!r.values.length?function(e,t){return rv.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):nv(sv(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=null!==(n=e.values[e.indexes[s][o[s]]])&&void 0!==n?n:0;r[i]=a,o[s]++}return r}(r,o),o.values),n):(tf(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Qg(e,t))};function cv(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Gg(e,t,n);return iv(e)(e,t)}function uv(e,t,n){const r=Math.max(t-5,0);return Rm(n-e(r),t-r)}const dv=100,hv=10,fv=1,pv=0,mv=800,gv=.3,vv=.3,yv={granular:.01,default:2},bv={granular:.005,default:.5},xv=.01,wv=10,Sv=.05,Cv=1;function kv({duration:e=mv,bounce:t=gv,velocity:n=pv,mass:r=fv}){let o,i;tf(e<=sf(wv),"Spring duration must be 10 seconds or less");let s=1-t;s=rp(Sv,Cv,s),e=rp(xv,wv,af(e)),s<1?(o=t=>{const r=t*s,o=r*e;return.001-(r-n)/jv(t,s)*Math.exp(-o)},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=jv(Math.pow(t,2),s);return(.001-o(t)>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let o=1;o<Ev;o++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=sf(e),isNaN(a))return{stiffness:dv,damping:hv,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Ev=12;function jv(e,t){return e*Math.sqrt(1-t*t)}const Tv=["duration","bounce"],Pv=["stiffness","damping","mass"];function Nv(e,t){return t.some((t=>void 0!==e[t]))}function _v(e=vv,t=gv){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=function(e){let t={velocity:pv,stiffness:dv,damping:hv,mass:fv,isResolvedFromDuration:!1,...e};if(!Nv(e,Pv)&&Nv(e,Tv))if(e.visualDuration){const n=2*Math.PI/(1.2*e.visualDuration),r=n*n,o=2*rp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:fv,stiffness:r,damping:o}}else{const n=kv(e);t={...t,...n,mass:fv},t.isResolvedFromDuration=!0}return t}({...n,velocity:-af(n.velocity||0)}),p=h||0,m=c/(2*Math.sqrt(l*u)),g=s-i,v=af(Math.sqrt(l/u)),y=Math.abs(g)<5;let b;if(r||(r=y?yv.granular:yv.default),o||(o=y?bv.granular:bv.default),m<1){const e=jv(v,m);b=t=>{const n=Math.exp(-m*v*t);return s-n*((p+m*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)b=e=>s-Math.exp(-v*e)*(g+(p+v*g)*e);else{const e=v*Math.sqrt(m*m-1);b=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return s-n*((p+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const x={calculatedDuration:f&&d||null,next:e=>{const t=b(e);if(f)a.done=e>=d;else{let n=0;m<1&&(n=0===e?sf(p):uv(b,e,t));const i=Math.abs(n)<=r,l=Math.abs(s-t)<=o;a.done=i&&l}return a.value=a.done?s:t,a},toString:()=>{const e=Math.min(rm(x),nm),t=um((t=>x.next(e*t).value),e,30);return e+"ms "+t}};return x}function Dv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let p=n*t;const m=d+p,g=void 0===s?m:s(m);g!==m&&(p=g-d);const v=e=>-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let x,w;const S=e=>{var t;(t=h.value,void 0!==a&&t<a||void 0!==l&&t>l)&&(x=e,w=_v({keyframes:[h.value,f(h.value)],velocity:uv(y,e,h.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),S(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),h)}}}const Mv=zm(.42,0,1,1),Ov=zm(0,0,.58,1),Rv=zm(.42,0,.58,1),Av={linear:ef,easeIn:Mv,easeInOut:Rv,easeOut:Ov,circIn:Gm,circInOut:Qm,circOut:Ym,backIn:Km,backInOut:Hm,backOut:Bm,anticipate:Wm},Lv=e=>{if(sm(e)){nf(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return zm(t,n,r,o)}return"string"==typeof e?(nf(void 0!==Av[e],`Invalid easing type '${e}'`),Av[e]):e};function Iv(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(nf(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],o=n||cv,i=e.length-1;for(let s=0;s<i;s++){let n=o(e[s],e[s+1]);if(t){const e=Array.isArray(t)?t[s]||ef:t;n=nv(e,n)}r.push(n)}return r}(t,r,o),l=a.length,c=n=>{if(s&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);return a[r](of(e[r],e[r+1],n))};return n?t=>c(rp(e[0],e[i-1],t)):c}function Fv(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++)e.push(Gg(n,1,of(0,t,r)))}(t,e.length-1),t}function $v({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Lv):Lv(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:Fv(t),e),a=Iv(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Rv)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const qv=e=>{const t=({timestamp:t})=>e(t);return{start:()=>hf.update(t,!0),stop:()=>ff(t),now:()=>pf.isProcessing?pf.timestamp:_m.now()}},zv={decay:Dv,inertia:Dv,tween:$v,keyframes:$v,spring:_v},Uv=e=>e/100;class Vv extends Wg{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new((null==r?void 0:r.KeyframeResolver)||Lg)(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=om(t)?t:zv[t]||$v;let a,l;s!==$v&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&nf(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a=nv(Uv,cv(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=rm(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:h,repeatType:f,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),this.currentTime=t?e:null!==this.holdTime?this.holdTime:Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(h){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,h+1);Boolean(t%2)&&("reverse"===f?(n=1-n,p&&(n-=p/u)):"mirror"===f&&(b=i)),y=rp(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&void 0!==r&&(x.value=Hg(a,this.options,r)),m&&m(x.value),S&&this.finish(),x}get duration(){const{resolved:e}=this;return e?af(e.calculatedDuration):0}get time(){return af(this.currentTime)}set time(e){this.currentTime=e=sf(e),null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=af(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=qv,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Bv=new Set(["opacity","clipPath","filter","transform"]);function Kv(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=pm(a,o);Array.isArray(u)&&(c.easing=u);return e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}const Hv=rf((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const Wv={anticipate:Wm,backInOut:Hm,circInOut:Qm};class Gv extends Wg{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new Vg(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:o,type:i,motionValue:s,name:a,startTime:l}=this.options;if(!s.owner||!s.owner.current)return!1;var c;if("string"==typeof o&&cm()&&o in Wv&&(o=Wv[o]),om((c=this.options).type)||"spring"===c.type||!dm(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new Vv({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,r=u.times,o=u.ease,i="keyframes"}const u=Kv(s.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(im(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(Hg(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:n,times:r,type:i,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return af(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return af(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=sf(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return ef;const{animation:n}=t;im(n,e)}else this.pendingTimeline=e;return ef}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new Vv({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=sf(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Hv()&&n&&Bv.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Yv={type:"spring",stiffness:500,damping:25,restSpeed:10},Qv={type:"keyframes",duration:.8},Xv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Jv=(e,{keyframes:t})=>t.length>2?Qv:Zf.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Yv:Xv;const Zv=(e,t,n,r={},o,i)=>s=>{const a=tm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=sf(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...Jv(e,u)}),u.duration&&(u.duration=sf(u.duration)),u.repeatDelay&&(u.repeatDelay=sf(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!i&&void 0!==t.get()){const e=Hg(u.keyframes,a);if(void 0!==e)return hf.update((()=>{u.onUpdate(e),u.onComplete()})),new em([])}return!i&&Gv.supports(u)?new Gv(u):new Vv(u)};function ey({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function ty(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const t=e.getValue(d,null!==(i=e.latestValues[d])&&void 0!==i?i:null),r=l[d];if(void 0===r||u&&ey(u,d))continue;const o={delay:n,...tm(s||{},d)};let a=!1;if(window.MotionHandoffAnimation){const t=$m(e);if(t){const e=window.MotionHandoffAnimation(t,d,hf);null!==e&&(o.startTime=e,a=!0)}}Fm(e,d),t.start(Zv(d,t,r,e.shouldReduceMotion&&Tm.has(d)?{type:!1}:o,e,a));const h=t.animation;h&&c.push(h)}return a&&Promise.all(c).then((()=>{hf.update((()=>{a&&function(e,t){const n=Xp(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i)Im(e,a,Ip(s=i[a])?s[s.length-1]||0:s);var s}(e,a)}))})),c}function ny(e,t,n={}){var r;const o=Xp(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(ty(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(ry).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(ny(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function ry(e,t){return e.sortNodePosition(t)}function oy(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const iy=_f.length;function sy(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&sy(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<iy;n++){const r=_f[n],o=e.props[r];(Pf(o)||!1===o)&&(t[r]=o)}return t}const ay=[...Nf].reverse(),ly=Nf.length;function cy(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>ny(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=ny(e,t,n);else{const o="function"==typeof t?Xp(e,t,n.custom):t;r=Promise.all(ty(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}function uy(e){let t=cy(e),n=fy(),r=!0;const o=t=>(n,r)=>{var o;const i=Xp(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const{props:s}=e,a=sy(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<ly;t++){const h=ay[t],f=n[h],p=void 0!==s[h]?s[h]:a[h],m=Pf(p),g=h===i?f.isActive:null;!1===g&&(d=t);let v=p===a[h]&&p!==s[h]&&m;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...u},!f.isActive&&null===g||!p&&!f.prevProp||Tf(p)||"boolean"==typeof p)continue;const y=dy(f.prevProp,p);let b=y||h===i&&f.isActive&&!v&&m||t>d&&m,x=!1;const w=Array.isArray(p)?p:[p];let S=w.reduce(o(h),{});!1===g&&(S={});const{prevResolvedValues:C={}}=f,k={...C,...S},E=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Ip(t)&&Ip(n)?!oy(t,n):t!==n,r?null!=t?E(e):c.add(e):void 0!==t&&c.has(e)?E(e):f.protectedKeys[e]=!0}f.prevProp=p,f.prevResolvedValues=S,f.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(b=!1);b&&(!(v&&y)||x)&&l.push(...w.map((e=>({animation:e,options:{type:h}}))))}if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let h=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(h=!1),r=!1,h?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=fy(),r=!0}}}function dy(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!oy(t,e)}function hy(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fy(){return{animate:hy(!0),whileInView:hy(),whileHover:hy(),whileTap:hy(),whileDrag:hy(),whileFocus:hy(),exit:hy()}}class py{constructor(e){this.isMounted=!1,this.node=e}update(){}}let my=0;const gy={animation:{Feature:class extends py{constructor(e){super(e),e.animationState||(e.animationState=uy(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Tf(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends py{constructor(){super(...arguments),this.id=my++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>{t(this.id)}))}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function vy(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function yy(e){return{point:{x:e.pageX,y:e.pageY}}}function by(e,t,n,r){return vy(e,t,(e=>t=>xm(t)&&e(t,yy(t)))(n),r)}const xy=(e,t)=>Math.abs(e-t);class wy{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=ky(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=xy(e.x,t.x),r=xy(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=pf;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Sy(t,this.transformPagePoint),hf.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=ky("pointercancel"===e.type?this.lastMoveEventInfo:Sy(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!xm(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Sy(yy(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=pf;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,ky(i,this.history)),this.removeListeners=nv(by(this.contextWindow,"pointermove",this.handlePointerMove),by(this.contextWindow,"pointerup",this.handlePointerUp),by(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ff(this.updatePoint)}}function Sy(e,t){return t?{point:t(e.point)}:e}function Cy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ky({point:e},t){return{point:e,delta:Cy(e,jy(t)),offset:Cy(e,Ey(t)),velocity:Ty(t,.1)}}function Ey(e){return e[0]}function jy(e){return e[e.length-1]}function Ty(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=jy(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>sf(t)));)n--;if(!r)return{x:0,y:0};const i=af(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Py(e){return e.max-e.min}function Ny(e,t,n,r=.5){e.origin=r,e.originPoint=Gg(t.min,t.max,e.origin),e.scale=Py(n)/Py(t),e.translate=Gg(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function _y(e,t,n,r){Ny(e.x,t.x,n.x,r?r.originX:void 0),Ny(e.y,t.y,n.y,r?r.originY:void 0)}function Dy(e,t,n){e.min=n.min+t.min,e.max=e.min+Py(t)}function My(e,t,n){e.min=t.min-n.min,e.max=e.min+Py(t)}function Oy(e,t,n){My(e.x,t.x,n.x),My(e.y,t.y,n.y)}function Ry(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ay(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const Ly=.35;function Iy(e,t,n){return{min:Fy(e,t),max:Fy(e,n)}}function Fy(e,t){return"number"==typeof e?e:e[t]||0}const $y=()=>({x:{min:0,max:0},y:{min:0,max:0}});function qy(e){return[e("x"),e("y")]}function zy({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Uy(e){return void 0===e||1===e}function Vy({scale:e,scaleX:t,scaleY:n}){return!Uy(e)||!Uy(t)||!Uy(n)}function By(e){return Vy(e)||Ky(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ky(e){return Hy(e.x)||Hy(e.y)}function Hy(e){return e&&"0%"!==e}function Wy(e,t,n){return n+t*(e-n)}function Gy(e,t,n,r,o){return void 0!==o&&(e=Wy(e,o,r)),Wy(e,n,r)+t}function Yy(e,t=0,n=1,r,o){e.min=Gy(e.min,t,n,r,o),e.max=Gy(e.max,t,n,r,o)}function Qy(e,{x:t,y:n}){Yy(e.x,t.translate,t.scale,t.originPoint),Yy(e.y,n.translate,n.scale,n.originPoint)}const Xy=.999999999999,Jy=1.0000000000001;function Zy(e,t){e.min=e.min+t,e.max=e.max+t}function eb(e,t,n,r,o=.5){Yy(e,t,n,Gg(e.min,e.max,o),r)}function tb(e,t){eb(e.x,t.x,t.scaleX,t.scale,t.originX),eb(e.y,t.y,t.scaleY,t.scale,t.originY)}function nb(e,t){return zy(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const rb=({current:e})=>e?e.ownerDocument.defaultView:null,ob=new WeakMap;class ib{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new wy(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(yy(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(i=n)||"y"===i?mm[i]?null:(mm[i]=!0,()=>{mm[i]=!1}):mm.x||mm.y?null:(mm.x=mm.y=!0,()=>{mm.x=mm.y=!1}),!this.openDragLock))return;var i;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qy((e=>{let t=this.getAxisMotionValue(e).get()||0;if(cp.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Py(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&hf.postRender((()=>o(e,t))),Fm(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>qy((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:rb(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&hf.postRender((()=>o(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!sb(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Gg(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Gg(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&Lf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Ry(e.x,n,o),y:Ry(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Ly){return!1===e?e=0:!0===e&&(e=Ly),{x:Iy(e,"left","right"),y:Iy(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&qy((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Lf(e))return!1;const n=e.current;nf(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=nb(e,n),{scroll:o}=t;return o&&(Zy(r.x,o.offset.x),Zy(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Ay(e.x,t.x),y:Ay(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=zy(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=qy((s=>{if(!sb(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c={type:"inertia",velocity:n?e[s]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,c)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Fm(this.visualElement,e),n.start(Zv(e,n,0,t,this.visualElement,!1))}stopAnimation(){qy((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){qy((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){qy((t=>{const{drag:n}=this.getProps();if(!sb(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Gg(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Lf(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};qy((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Py(e),o=Py(t);return o>r?n=of(t.min,t.max-r,e.min):r>o&&(n=of(e.min,e.max-o,t.min)),rp(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),qy((t=>{if(!sb(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Gg(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;ob.set(this.visualElement,this);const e=by(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();Lf(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),hf.read(t);const o=vy(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(qy((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Ly,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function sb(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ab=e=>(t,n)=>{e&&hf.postRender((()=>e(t,n)))};const lb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ub={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!up.test(e))return e;e=parseFloat(e)}return`${cb(e,t.target.x)}% ${cb(e,t.target.y)}%`}},db={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=gg.parse(e);if(o.length>5)return r;const i=gg.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Gg(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class hb extends n.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;!function(e){for(const t in e)Xf[t]=e[t],Wf(t)&&(Xf[t].isCSSVariable=!0)}(pb),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),lb.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||hf.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),qf.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function fb(e){const[r,o]=Gh(),i=n.useContext(qh);return t.jsx(hb,{...e,layoutGroup:i,switchLayoutGroup:n.useContext(zf),isPresent:r,safeToRemove:o})}const pb={borderRadius:{...ub,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ub,borderTopRightRadius:ub,borderBottomLeftRadius:ub,borderBottomRightRadius:ub,boxShadow:db};const mb=(e,t)=>e.depth-t.depth;class gb{constructor(){this.children=[],this.isDirty=!1}add(e){Dm(this.children,e),this.isDirty=!0}remove(e){Mm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mb),this.isDirty=!1,this.children.forEach(e)}}const vb=["TopLeft","TopRight","BottomLeft","BottomRight"],yb=vb.length,bb=e=>"string"==typeof e?parseFloat(e):e,xb=e=>"number"==typeof e||up.test(e);function wb(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Sb=kb(0,.5,Ym),Cb=kb(.5,.95,ef);function kb(e,t,n){return r=>r<e?0:r>t?1:n(of(e,t,r))}function Eb(e,t){e.min=t.min,e.max=t.max}function jb(e,t){Eb(e.x,t.x),Eb(e.y,t.y)}function Tb(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Pb(e,t,n,r,o){return e=Wy(e-=t,1/n,r),void 0!==o&&(e=Wy(e,1/o,r)),e}function Nb(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){cp.test(t)&&(t=parseFloat(t),t=Gg(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=Gg(i.min,i.max,r);e===i&&(a-=t),e.min=Pb(e.min,t,n,a,o),e.max=Pb(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const _b=["x","scaleX","originX"],Db=["y","scaleY","originY"];function Mb(e,t,n,r){Nb(e.x,t,_b,n?n.x:void 0,r?r.x:void 0),Nb(e.y,t,Db,n?n.y:void 0,r?r.y:void 0)}function Ob(e){return 0===e.translate&&1===e.scale}function Rb(e){return Ob(e.x)&&Ob(e.y)}function Ab(e,t){return e.min===t.min&&e.max===t.max}function Lb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ib(e,t){return Lb(e.x,t.x)&&Lb(e.y,t.y)}function Fb(e){return Py(e.x)/Py(e.y)}function $b(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class qb{constructor(){this.members=[]}add(e){Dm(this.members,e),e.scheduleRender()}remove(e){if(Mm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let r=t;r>=0;r--){const e=this.members[r];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const zb=["","X","Y","Z"],Ub={visibility:"hidden"};let Vb=0;function Bb(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=$m(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",hf,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kb(r)}function Hb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Vb++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Yb),this.nodes.forEach(nx),this.nodes.forEach(rx),this.nodes.forEach(Qb)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new gb)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Om),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=t)instanceof SVGElement&&"svg"!==r.tagName,this.instance=t;const{layoutId:o,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),e){let n;const r=()=>this.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=_m.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(ff(r),e(i-t))};return hf.read(r,!0),()=>ff(r)}(r,250),lb.hasAnimatedSinceResize&&(lb.hasAnimatedSinceResize=!1,this.nodes.forEach(tx))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||cx,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Ib(this.targetLayout,r),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...tm(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||tx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ff(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ox),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let o=0;o<this.path.length;o++){const e=this.path[o];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Jb);this.isUpdating||this.nodes.forEach(Zb),this.isUpdating=!1,this.nodes.forEach(ex),this.nodes.forEach(Wb),this.nodes.forEach(Gb),this.clearAllSnapshots();const e=_m.now();pf.delta=rp(0,1e3/60,e-pf.timestamp),pf.timestamp=e,pf.isProcessing=!0,mf.update.process(pf),mf.preRender.process(pf),mf.render.process(pf),pf.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xb),this.sharedNodes.forEach(ix)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,hf.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){hf.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Py(this.snapshot.measuredBox.x)||Py(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Rb(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||By(this.latestValues)||i)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),hx((r=n).x),hx(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!((null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)||this.path.some(px))){const{scroll:e}=this.root;e&&(Zy(n.x,e.offset.x),Zy(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(jb(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let r=0;r<this.path.length;r++){const t=this.path[r],{scroll:o,options:i}=t;t!==this.root&&o&&i.layoutScroll&&(o.wasRoot&&jb(n,e),Zy(n.x,o.offset.x),Zy(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};jb(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&tb(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),By(e.latestValues)&&tb(n,e.latestValues)}return By(this.latestValues)&&tb(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};jb(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!By(e.latestValues))continue;Vy(e.latestValues)&&e.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};jb(r,e.measurePageBox()),Mb(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return By(this.latestValues)&&Mb(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==pf.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=pf.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Oy(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),jb(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var s,a,l;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Dy((s=this.target).x,(a=this.relativeTarget).x,(l=this.relativeParent.target).x),Dy(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):jb(this.target,this.layout.layoutBox),Qy(this.target,this.targetDelta)):jb(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Oy(this.relativeTargetOrigin,this.target,e.target),jb(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Vy(this.parent.latestValues)&&!Ky(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===pf.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;jb(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let i,s;t.x=t.y=1;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:o}=i.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&tb(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Qy(e,s)),r&&By(i.latestValues)&&tb(e,i.latestValues))}t.x<Jy&&t.x>Xy&&(t.x=1),t.y<Jy&&t.y>Xy&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Tb(this.prevProjectionDelta.x,this.projectionDelta.x),Tb(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),_y(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&$b(this.projectionDelta.x,this.prevProjectionDelta.x)&&$b(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(lx));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,f,p,m,g;sx(i.x,e.x,n),sx(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Oy(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ax((f=this.relativeTarget).x,(p=this.relativeTargetOrigin).x,(m=s).x,g=n),ax(f.y,p.y,m.y,g),d&&(Ab((l=this.relativeTarget).x,(h=d).x)&&Ab(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),jb(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Gg(0,void 0!==n.opacity?n.opacity:1,Sb(r)),e.opacityExit=Gg(void 0!==t.opacity?t.opacity:1,0,Cb(r))):i&&(e.opacity=Gg(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let s=0;s<yb;s++){const o=`border${vb[s]}Radius`;let i=wb(t,o),a=wb(n,o);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||xb(i)===xb(a)?(e[o]=Math.max(Gg(bb(i),bb(a),r),0),(cp.test(a)||cp.test(i))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=Gg(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ff(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=hf.update((()=>{lb.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=tp(e)?e:Lm(e);return r.start(Zv("",r,t,n)),r.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&fx(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Py(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Py(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}jb(t,n),tb(t,o),_y(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new qb);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Bb("z",e,r,this.animationValues);for(let o=0;o<zb.length;o++)Bb(`rotate${zb[o]}`,e,r,this.animationValues),Bb(`skew${zb[o]}`,e,r,this.animationValues);e.render();for(const o in r)e.setStaticValue(o,r[o]),this.animationValues&&(this.animationValues[o]=r[o]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ub;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Fp(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Fp(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!By(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:i,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),o&&(r.transform=o(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,r.opacity=i.animationValues?i===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const c in Xf){if(void 0===s[c])continue;const{correct:e,applyTo:t,isCSSVariable:n}=Xf[c],o="none"===r.transform?s[c]:e(s[c],i);if(t){const e=t.length;for(let n=0;n<e;n++)r[t[n]]=o}else n?this.options.visualElement.renderState.vars[c]=o:r[c]=o}return this.options.layoutId&&(r.pointerEvents=i===this?Fp(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Jb),this.root.sharedNodes.clear()}}}function Wb(e){e.updateLayout()}function Gb(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?qy((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Py(r);r.min=t[e].min,r.max=r.min+o})):fx(o,n.layoutBox,t)&&qy((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Py(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};_y(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?_y(a,e.applyTransform(r,!0),n.measuredBox):_y(a,t,n.layoutBox);const l=!Rb(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s={x:{min:0,max:0},y:{min:0,max:0}};Oy(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Oy(a,t,i.layoutBox),Ib(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Yb(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Qb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Xb(e){e.clearSnapshot()}function Jb(e){e.clearMeasurements()}function Zb(e){e.isLayoutDirty=!1}function ex(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function tx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nx(e){e.resolveTargetDelta()}function rx(e){e.calcProjection()}function ox(e){e.resetSkewAndRotation()}function ix(e){e.removeLeadSnapshot()}function sx(e,t,n){e.translate=Gg(t.translate,0,n),e.scale=Gg(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ax(e,t,n,r){e.min=Gg(t.min,n.min,r),e.max=Gg(t.max,n.max,r)}function lx(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const cx={duration:.45,ease:[.4,0,.1,1]},ux=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dx=ux("applewebkit/")&&!ux("chrome/")?Math.round:ef;function hx(e){e.min=dx(e.min),e.max=dx(e.max)}function fx(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Fb(t),o=Fb(n),i=.2,!(Math.abs(r-o)<=i));var r,o,i}function px(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const mx=Hb({attachResizeListener:(e,t)=>vy(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),gx={current:void 0},vx=Hb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gx.current){const e=new mx({});e.mount(window),e.setOptions({layoutScroll:!0}),gx.current=e}return gx.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),yx={pan:{Feature:class extends py{constructor(){super(...arguments),this.removePointerDownListener=ef}onPointerDown(e){this.session=new wy(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rb(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ab(e),onStart:ab(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&hf.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=by(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends py{constructor(e){super(e),this.removeGroupControls=ef,this.removeListeners=ef,this.controls=new ib(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ef}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:vx,MeasureLayout:fb}};function bx(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&hf.postRender((()=>o(t,yy(t))))}function xx(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&hf.postRender((()=>o(t,yy(t))))}const wx=new WeakMap,Sx=new WeakMap,Cx=e=>{const t=wx.get(e.target);t&&t(e)},kx=e=>{e.forEach(Cx)};function Ex(e,t,n){const r=function({root:e,...t}){const n=e||document;Sx.has(n)||Sx.set(n,{});const r=Sx.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(kx,{root:e,...t})),r[o]}(t);return wx.set(e,n),r.observe(e),()=>{wx.delete(e),r.unobserve(e)}}const jx={some:0,all:1};const Tx={inView:{Feature:class extends py{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e;return Ex(this.node.current,{root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:jx[r]},(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends py{mount(){const{current:e}=this.node;e&&(this.unmount=jm(e,((e,t)=>(xx(this.node,t,"Start"),(e,{success:t})=>xx(this.node,e,t?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends py{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(nQ){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=nv(vy(this.node.current,"focus",(()=>this.onFocus())),vy(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends py{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,i]=vm(e,n),s=e=>{if(!ym(e))return;const{target:n}=e,r=t(n,e);if("function"!=typeof r||!n)return;const i=e=>{ym(e)&&(r(e),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,o)};return r.forEach((e=>{e.addEventListener("pointerenter",s,o)})),i}(e,((e,t)=>(bx(this.node,t,"Start"),e=>bx(this.node,e,"End")))))}unmount(){}}}},Px={layout:{ProjectionNode:vx,MeasureLayout:fb}},Nx={current:null},_x={current:!1};const Dx=[...zg,ag,gg],Mx=new WeakMap;const Ox=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Rx{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Lg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=_m.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,hf.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=i;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Df(t),this.isVariantNode=Mf(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const h in d){const e=d[h];void 0!==a[h]&&tp(e)&&e.set(a[h],!1)}}mount(e){this.current=e,Mx.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),_x.current||function(){if(_x.current=!0,Xh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nx.current=e.matches;e.addListener(t),t()}else Nx.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Nx.current),"production"!==process.env.NODE_ENV&&kf(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ff(this.notifyUpdate),ff(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Zf.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&hf.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in yf){const t=yf[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<Ox.length;n++){const t=Ox[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],i=n[r];if(tp(o))e.addValue(r,o),"development"===process.env.NODE_ENV&&kf("12.4.0"===o.version,`Attempting to mix Motion versions ${o.version} with 12.4.0 may not work as expected.`);else if(tp(i))e.addValue(r,Lm(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,Lm(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Lm(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ig(r)||Xm(r))?r=parseFloat(r):!Dx.find(qg(r))&&gg.test(t)&&(r=Cg(e,t)),this.setBaseTarget(e,tp(r)?r.get():r)),tp(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=Lp(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||tp(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Om),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Ax extends Rx{constructor(){super(...arguments),this.KeyframeResolver=Vg}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;tp(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class Lx extends Ax{constructor(){super(...arguments),this.type="html",this.renderInstance=Bp}readValueFromInstance(e,t){if(Zf.has(t)){const e=Sg(t);return e&&e.default||0}{const n=window.getComputedStyle(e),r=(Wf(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return nb(e,t)}build(e,t,n){xp(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return zp(e,t,n)}}class Ix extends Ax{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$y,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Vp(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Zf.has(t)){const e=Sg(t);return e&&e.default||0}return t=Kp.has(t)?t:Ff(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Wp(e,t,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&hf.postRender(this.updateDimensions)}build(e,t,n){_p(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Hp(e,t,0,r)}mount(e){this.isSVGTag=Mp(e.tagName),super.mount(e)}}const Fx=Ef(Qp({...gy,...Tx,...yx,...Px},((e,t)=>jp(e)?new Ix(t):new Lx(t,{allowProjection:e!==n.Fragment})))),$x=({children:e,className:n})=>t.jsx(Fx.div,{initial:{opacity:0,filter:"blur(8px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(8px)"},transition:{duration:.3,ease:"easeInOut"},className:n,children:e}),qx=({children:e})=>t.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight",children:e}),zx=({size:e=35,color:r="black",speed:o=.9,strokeWidth:i=3.5,text:s,textSpeed:a=2e3,textColor:l="black"})=>{const[c,u]=n.useState(0),d=Array.isArray(s)?s:s?[s]:[];return n.useEffect((()=>{if(d.length<=1)return;if(c>=d.length-1)return;const e=setInterval((()=>{u((e=>e<d.length-1?e+1:e))}),a);return()=>clearInterval(e)}),[d.length,a,c]),t.jsx("div",{className:"flex flex-col justify-center items-center h-full",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsxs("div",{className:"loader-container",style:{"--uib-size":`${e}px`,"--uib-color":r,"--uib-speed":`${o}s`,"--uib-stroke":`${i}px`},children:[t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"})]}),d.length>0&&t.jsx("div",{className:"text-center text-sm text-muted-foreground animate-fade-in "+(l?`text-${l}`:""),children:t.jsx(qx,{children:d[c]})},c),t.jsx("style",{children:"\n .loader-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--uib-size);\n width: var(--uib-size);\n }\n .line {\n position: absolute;\n top: calc(50% - var(--uib-stroke) / 2);\n left: 0;\n height: var(--uib-stroke);\n width: 100%;\n border-radius: calc(var(--uib-stroke) / 2);\n background-color: var(--uib-color);\n animation: rotate var(--uib-speed) ease-in-out infinite;\n transition: background-color 0.3s ease;\n }\n .line:nth-child(1) {\n animation-delay: calc(var(--uib-speed) * -0.375);\n }\n .line:nth-child(2) {\n animation-delay: calc(var(--uib-speed) * -0.375);\n opacity: 0.8;\n }\n .line:nth-child(3) {\n animation-delay: calc(var(--uib-speed) * -0.3);\n opacity: 0.6;\n }\n .line:nth-child(4) {\n animation-delay: calc(var(--uib-speed) * -0.225);\n opacity: 0.4;\n }\n .line:nth-child(5) {\n animation-delay: calc(var(--uib-speed) * -0.15);\n opacity: 0.2;\n }\n .line:nth-child(6) {\n animation-delay: calc(var(--uib-speed) * -0.075);\n opacity: 0.1;\n }\n @keyframes rotate {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(180deg);\n }\n }\n .animate-fade-in {\n animation: fadeIn 0.5s ease-in-out;\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "})]})})},Ux="/segments",Vx="/automations",Bx="/channel/senders",Kx="/communication-groups",Hx="/stripo",Wx=async(e,t)=>(await Ja(`${Vx}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data,Gx=e=>{const t=ne(),n=ue({queryKey:["automations",e],queryFn:()=>(async e=>(await Ja(`${Vx}/${e}`)).data)(e)});return{automation:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchAutomation:n.refetch,invalidateAutomation:()=>t.invalidateQueries({queryKey:["automations",e]})}},Yx=e=>{const t=ue({queryKey:["automations",e,"recipients"],queryFn:()=>(async e=>(await Ja(`${Vx}/${e}/recipients`)).data)(e)});return{recipients:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomationRecipients:t.refetch}},Qx=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(Vx,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["automations"]})}});return{createAutomation:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess}},Xx=e=>{const t=ne(),n=de({mutationFn:t=>Wx(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["automations"]})}});return{updateAutomation:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}},Jx=e=>{const t=ue({queryKey:["automations",e,"statistics"],queryFn:()=>(async e=>{if(e)return(await Ja(`${Vx}/${e}/statistics`)).data;return(await Ja(`${Vx}/statistics`)).data})(e)});return{statistics:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error}};var Zx=(e=>(e.ONE_TIME="one_time",e))(Zx||{}),ew=(e=>(e.DRAFT="draft",e.ACTIVE="active",e.RUNNING="running",e.COMPLETED="completed",e.FAILED="failed",e.DEACTIVATED="deactivated",e))(ew||{});const tw={CloseButton:Fd,DropdownMenuTrigger:ud,UserIcon:Ad,UsersIcon:Ld,UserEdit:Od,ScheduleButton:ld,SendButton:_d,BackButton:dd,NextButton:hd,MergeField:Rd,PlusIcon:Pd,AlertCircleIcon:md,OneTimeBroadcast:kd,PatronEntersList:xd,DateMilestone:ld,RealtimeActivity:ad,EmailIcon:Sd,SmsIcon:Ed,MessagesSent:wd,LinksClicked:Td,OpenRate:yd,SpamComplies:Md,TotalBounceRate:Md,UnsubscribeRate:Dd},nw=e=>({...tw,...e||{}});var rw=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(sw);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(ow,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(ow,{...o,ref:n,children:r})}));rw.displayName="Slot";var ow=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));ow.displayName="SlotClone";var iw=({children:e})=>t.jsx(t.Fragment,{children:e});function sw(e){return i.isValidElement(e)&&e.type===iw}const aw=nd(["reach-styles-module__base___gfFyc"],{variants:{variant:{default:"reach-styles-module__default___ny1h7",destructive:"reach-styles-module__destructive___XjBvS",outline:"reach-styles-module__outline___gFp3i",secondary:"reach-styles-module__secondary___Pd-e3",ghost:"reach-styles-module__ghost___GcnJq",link:"reach-styles-module__link___EgS2H"},size:{default:"reach-styles-module__sizeDefault___8kU5A",sm:"reach-styles-module__sizeSm___zPIEh",lg:"reach-styles-module__sizeLg___D2G8z",icon:"reach-styles-module__sizeIcon___5XkYW"}},defaultVariants:{variant:"default",size:"default"}}),lw=i.forwardRef((({className:e,variant:n,size:r,asChild:o=!1,...i},s)=>t.jsx(o?rw:"button",{className:Dh(aw({variant:n,size:r,className:e})),ref:s,...i})));lw.displayName="Button";var cw=(e=>(e.ChooseAutomationType="choose-automation-type",e.SetAutomationName="set-automation-name",e))(cw||{});const uw=({onClose:e,currentStep:n,setCurrentStep:r,isDisabled:o,createAutomation:i})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx(lw,{variant:"secondary",className:"px-4 py-2",onClick:()=>{if(n===cw.ChooseAutomationType)e?.(!1);else{if(n!==cw.SetAutomationName)throw new Error("Invalid step");r(cw.ChooseAutomationType)}},children:n===cw.ChooseAutomationType?"Cancel":"Back"}),t.jsx(lw,{className:"px-4 py-2",onClick:()=>{o||n!==cw.SetAutomationName||i()},disabled:o,children:n===cw.SetAutomationName?"Create":"Next"})]})}),dw=({onClick:e,title:n,subtitle:r,icon:o,selected:i,disabled:s=!1})=>t.jsxs("button",{onClick:e,className:"flex flex-col items-center justify-center rounded-lg border-[3px] p-4 transition-all duration-300 ease-in-out "+(s?"opacity-50 cursor-not-allowed":i?"scale-[1.02] hover:scale-[1.04] [border-color:hsl(var(--reach-primary))] [background-color:hsl(var(--reach-primary)/0.05)]":"border-gray-200 hover:[border-color:hsl(var(--reach-primary))] hover:bg-gray-50"),children:[o,t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-sm font-medium text-gray-900",children:n}),t.jsx("div",{className:"text-xs text-gray-500",children:r})]})]}),hw="text-3xl mb-8",fw="grid grid-cols-2 gap-6",pw="relative p-6 rounded-lg",mw=({onNext:e,iconDefinitions:n})=>t.jsxs("div",{className:pw,children:[t.jsx("h1",{className:hw,children:"Choose Your Automation Type"}),t.jsxs("div",{className:fw,children:[t.jsx(dw,{onClick:()=>{e(Zx.ONE_TIME)},title:"One-Time Broadcast",subtitle:"Send a single message to your current list, like announcing a sale or newsletter.",icon:t.jsx(n.OneTimeBroadcast,{}),selected:!1}),t.jsx(dw,{onClick:()=>{},title:"Patron Enters a List",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.PatronEntersList,{}),selected:!1,disabled:!0}),t.jsx(dw,{onClick:()=>{},title:"Date Milestone",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.DateMilestone,{}),selected:!1,disabled:!0}),t.jsx(dw,{onClick:()=>{},title:"Realtime Activity",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.RealtimeActivity,{}),selected:!1,disabled:!0})]})]});function gw(e,t){throw new Error(`Unreachable case statement: ${JSON.stringify(e)}. Valid values are: ${Object.values(t).join(", ")}`)}const vw="mb-4 flex items-center justify-center",yw="text-lg font-medium mb-2",bw="text-sm text-gray-600",xw=({iconDefinitions:e})=>t.jsxs("div",{children:[t.jsx("div",{className:vw,children:t.jsx(e.OneTimeBroadcast,{})}),t.jsx("h3",{className:yw,children:"One-Time Broadcast"}),t.jsx("p",{className:bw,children:"Send a single message to your current list, like announcing a sale or newsletter."})]}),ww=({selectedType:e,setAutomationName:n,automationName:r,iconDefinitions:o})=>t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 max-w-lg mx-auto",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Name Your Automation"}),t.jsxs("div",{className:"w-full space-y-4",children:[t.jsx("div",{className:"bg-gray-50 p-4 rounded-lg items-center justify-center text-center",children:(()=>{if(e===Zx.ONE_TIME)return t.jsx(xw,{iconDefinitions:o});throw gw(e,Zx)})()}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"automationName",className:"block text-sm font-medium text-gray-700",children:"Automation Name"}),t.jsx("input",{id:"automationName",type:"text",value:r,onChange:e=>n(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-indigo-500 focus:border-indigo-500 shadow-sm",placeholder:"Enter a descriptive name...",autoFocus:!0}),t.jsx("p",{className:"text-sm text-gray-500",children:"This name is for your internal reference only - your customers won't see it"})]})]})]}),Sw=({onClose:e,iconDefinitions:r})=>{const{createAutomation:o,isCreating:i}=Qx(),[s,a]=n.useState(!1),l=nw(r),[c,u]=n.useState(cw.ChooseAutomationType),[d,h]=n.useState({name:void 0,type:void 0}),f=void 0!==d.name&&void 0!==d.type;n.useEffect((()=>{if(d.type&&!d.name){const e=new Date,t=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=`Campaign ${e.toLocaleDateString([],{month:"long",day:"numeric"})} ${t}`;h((e=>({...e,name:n})))}}),[d]);return i||s?t.jsx("div",{className:pw,children:t.jsx(zx,{text:["Creating Automation","Finishing up"]})}):t.jsxs("div",{className:"relative overflow-hidden",children:[t.jsxs(Zh,{mode:"wait",children:[c===cw.ChooseAutomationType&&t.jsx($x,{children:t.jsx(mw,{onNext:e=>{h({...d,type:e}),u(cw.SetAutomationName)},iconDefinitions:l})},"choose-automation-type"),c===cw.SetAutomationName&&d.type&&t.jsx($x,{children:t.jsx(ww,{iconDefinitions:l,selectedType:d.type,setAutomationName:e=>{h({...d,name:e})},automationName:d.name??""})},"set-automation-name")]}),t.jsx("div",{className:"pt-2",children:t.jsx(uw,{onClose:e,currentStep:c,setCurrentStep:u,isDisabled:!f,createAutomation:async()=>{if(!f||!d.name||!d.type)return;a(!0);o({name:d.name,type:d.type},{onSuccess:t=>{e?.(t.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{h({name:void 0,type:void 0})}})}})})]})};var Cw={};Object.defineProperty(Cw,"__esModule",{value:!0}),Cw.parse=function(e,t){const n=new Nw,r=e.length;if(r<2)return n;const o=t?.decode||Mw;let i=0;do{const t=e.indexOf("=",i);if(-1===t)break;const s=e.indexOf(";",i),a=-1===s?r:s;if(t>a){i=e.lastIndexOf(";",t-1)+1;continue}const l=_w(e,i,t),c=Dw(e,t,l),u=e.slice(l,c);if(void 0===n[u]){let r=_w(e,t+1,a),i=Dw(e,a,r);const s=o(e.slice(r,i));n[u]=s}i=a+1}while(i<r);return n},Cw.serialize=function(e,t,n){const r=n?.encode||encodeURIComponent;if(!kw.test(e))throw new TypeError(`argument name is invalid: ${e}`);const o=r(t);if(!Ew.test(o))throw new TypeError(`argument val is invalid: ${t}`);let i=e+"="+o;if(!n)return i;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);i+="; Max-Age="+n.maxAge}if(n.domain){if(!jw.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);i+="; Domain="+n.domain}if(n.path){if(!Tw.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);i+="; Path="+n.path}if(n.expires){if(!function(e){return"[object Date]"===Pw.call(e)}
|
|
33
|
+
*/function Jd(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Zd(e))&&(r&&(r+=" "),r+=t);return r}const Zd=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zd(e[r]))&&(n&&(n+=" "),n+=t);return n};function eh(e,...t){let n,r,o,i=function(a){const l=t.reduce(((e,t)=>t(e)),e());return n=(e=>({cache:Gd(e.cacheSize),parseClassName:Yd(e),...$d(e)}))(l),r=n.cache.get,o=n.cache.set,i=s,s(a)};function s(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Xd);let a="";for(let l=s.length-1;l>=0;l-=1){const e=s[l],{modifiers:t,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(e);let h=Boolean(d),f=r(h?u.substring(0,d):u);if(!f){if(!h){a=e+(a.length>0?" "+a:a);continue}if(f=r(u),!f){a=e+(a.length>0?" "+a:a);continue}h=!1}const p=Qd(t).join(":"),m=c?p+"!":p,g=m+f;if(i.includes(g))continue;i.push(g);const v=o(f,h);for(let n=0;n<v.length;++n)i.push(m+v[n]);a=e+(a.length>0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(Jd.apply(null,arguments))}}const th=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},nh=/^\[(?:([a-z-]+):)?(.+)\]$/i,rh=/^\d+\/\d+$/,oh=new Set(["px","full","screen"]),ih=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sh=/\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$/,ah=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ch=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uh=e=>hh(e)||oh.has(e)||rh.test(e),dh=e=>Eh(e,"length",jh),hh=e=>Boolean(e)&&!Number.isNaN(Number(e)),fh=e=>Eh(e,"number",hh),ph=e=>Boolean(e)&&Number.isInteger(Number(e)),mh=e=>e.endsWith("%")&&hh(e.slice(0,-1)),gh=e=>nh.test(e),vh=e=>ih.test(e),yh=new Set(["length","size","percentage"]),bh=e=>Eh(e,yh,Th),xh=e=>Eh(e,"position",Th),wh=new Set(["image","url"]),Sh=e=>Eh(e,wh,Nh),Ch=e=>Eh(e,"",Ph),kh=()=>!0,Eh=(e,t,n)=>{const r=nh.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},jh=e=>sh.test(e)&&!ah.test(e),Th=()=>!1,Ph=e=>lh.test(e),Nh=e=>ch.test(e),_h=eh((()=>{const e=th("colors"),t=th("spacing"),n=th("blur"),r=th("brightness"),o=th("borderColor"),i=th("borderRadius"),s=th("borderSpacing"),a=th("borderWidth"),l=th("contrast"),c=th("grayscale"),u=th("hueRotate"),d=th("invert"),h=th("gap"),f=th("gradientColorStops"),p=th("gradientColorStopPositions"),m=th("inset"),g=th("margin"),v=th("opacity"),y=th("padding"),b=th("saturate"),x=th("scale"),w=th("sepia"),S=th("skew"),C=th("space"),k=th("translate"),E=()=>["auto",gh,t],j=()=>[gh,t],T=()=>["",uh,dh],P=()=>["auto",hh,gh],N=()=>["","0",gh],_=()=>[hh,gh];return{cacheSize:500,separator:":",theme:{colors:[kh],spacing:[uh,dh],blur:["none","",vh,gh],brightness:_(),borderColor:[e],borderRadius:["none","","full",vh,gh],borderSpacing:j(),borderWidth:T(),contrast:_(),grayscale:N(),hueRotate:_(),invert:N(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[mh,dh],inset:E(),margin:E(),opacity:_(),padding:j(),saturate:_(),scale:_(),sepia:N(),skew:_(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",gh]}],container:["container"],columns:[{columns:[vh]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",gh]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ph,gh]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gh]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",ph,gh]}],"grid-cols":[{"grid-cols":[kh]}],"col-start-end":[{col:["auto",{span:["full",ph,gh]},gh]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[kh]}],"row-start-end":[{row:["auto",{span:[ph,gh]},gh]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gh]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gh]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",gh,t]}],"min-w":[{"min-w":[gh,t,"min","max","fit"]}],"max-w":[{"max-w":[gh,t,"none","full","min","max","fit","prose",{screen:[vh]},vh]}],h:[{h:[gh,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gh,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gh,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gh,t,"auto","min","max","fit"]}],"font-size":[{text:["base",vh,dh]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fh]}],"font-family":[{font:[kh]}],"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",gh]}],"line-clamp":[{"line-clamp":["none",hh,fh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",uh,gh]}],"list-image":[{"list-image":["none",gh]}],"list-style-type":[{list:["none","disc","decimal",gh]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",uh,dh]}],"underline-offset":[{"underline-offset":["auto",uh,gh]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gh]}],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",gh]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",xh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],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":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","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":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"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:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[uh,gh]}],"outline-w":[{outline:[uh,dh]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[uh,dh]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vh,Ch]}],"shadow-color":[{shadow:[kh]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",vh,gh]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"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",gh]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",gh]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",gh]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[ph,gh]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"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",gh]}],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",gh]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",gh]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[uh,dh,fh]}],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 Dh(...e){return _h(Zu(e))}const Mh=Ku,Oh=i.forwardRef((({className:e,...n},r)=>t.jsx(Hu,{ref:r,className:Dh("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-0 sm:right-0 sm:bottom-auto sm:flex-col md:max-w-[420px]",e),...n})));Oh.displayName=Hu.displayName;const Rh=nd("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Ah=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx(Wu,{ref:o,className:Dh(Rh({variant:n}),e),...r})));Ah.displayName=Wu.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(Qu,{ref:r,className:Dh("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...n}))).displayName=Qu.displayName;const Lh=i.forwardRef((({className:e,...n},r)=>t.jsx(Xu,{ref:r,className:Dh("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...n,children:t.jsx(Fd,{className:"h-4 w-4"})})));Lh.displayName=Xu.displayName;const Ih=i.forwardRef((({className:e,...n},r)=>t.jsx(Gu,{ref:r,className:Dh("text-sm font-semibold [&+div]:text-xs",e),...n})));Ih.displayName=Gu.displayName;const Fh=i.forwardRef((({className:e,...n},r)=>t.jsx(Yu,{ref:r,className:Dh("text-sm opacity-90",e),...n})));function $h(){const{toasts:e}=Dc();return t.jsxs(Mh,{children:[e.map((function({id:e,title:n,description:r,action:o,...i}){return t.jsxs(Ah,{...i,children:[t.jsxs("div",{className:"grid gap-1",children:[n&&t.jsx(Ih,{children:n}),r&&t.jsx(Fh,{children:r})]}),o,t.jsx(Lh,{})]},e)})),t.jsx(Oh,{})]})}Fh.displayName=Yu.displayName;const qh=n.createContext({});function zh(e){const t=n.useRef(null);return null===t.current&&(t.current=e()),t.current}const Uh=n.createContext(null),Vh=n.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Bh extends i.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=e instanceof HTMLElement&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Kh({children:e,isPresent:r,anchorX:o}){const s=n.useId(),a=n.useRef(null),l=n.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=n.useContext(Vh);return n.useInsertionEffect((()=>{const{width:e,height:t,top:n,left:i,right:u}=l.current;if(r||!a.current||!e||!t)return;const d="left"===o?`left: ${i}`:`right: ${u}`;a.current.dataset.motionPopId=s;const h=document.createElement("style");return c&&(h.nonce=c),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`\n [data-motion-pop-id="${s}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n ${d}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.removeChild(h)}}),[r]),t.jsx(Bh,{isPresent:r,childRef:a,sizeRef:l,children:i.cloneElement(e,{ref:a})})}const Hh=({children:e,initial:r,isPresent:o,onExitComplete:s,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const d=zh(Wh),h=n.useId(),f=n.useCallback((e=>{d.set(e,!0);for(const t of d.values())if(!t)return;s&&s()}),[d,s]),p=n.useMemo((()=>({id:h,initial:r,isPresent:o,custom:a,onExitComplete:f,register:e=>(d.set(e,!1),()=>d.delete(e))})),l?[Math.random(),f]:[o,f]);return n.useMemo((()=>{d.forEach(((e,t)=>d.set(t,!1)))}),[o]),i.useEffect((()=>{!o&&!d.size&&s&&s()}),[o]),"popLayout"===c&&(e=t.jsx(Kh,{isPresent:o,anchorX:u,children:e})),t.jsx(Uh.Provider,{value:p,children:e})};function Wh(){return new Map}function Gh(e=!0){const t=n.useContext(Uh);if(null===t)return[!0,null];const{isPresent:r,onExitComplete:o,register:i}=t,s=n.useId();n.useEffect((()=>{e&&i(s)}),[e]);const a=n.useCallback((()=>e&&o&&o(s)),[s,o,e]);return!r&&o?[!1,a]:[!0]}const Yh=e=>e.key||"";function Qh(e){const t=[];return n.Children.forEach(e,(e=>{n.isValidElement(e)&&t.push(e)})),t}const Xh="undefined"!=typeof window,Jh=Xh?n.useLayoutEffect:n.useEffect,Zh=({children:e,custom:r,initial:o=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,d]=Gh(l),h=n.useMemo((()=>Qh(e)),[e]),f=l&&!u?[]:h.map(Yh),p=n.useRef(!0),m=n.useRef(h),g=zh((()=>new Map)),[v,y]=n.useState(h),[b,x]=n.useState(h);Jh((()=>{p.current=!1,m.current=h;for(let e=0;e<b.length;e++){const t=Yh(b[e]);f.includes(t)?g.delete(t):!0!==g.get(t)&&g.set(t,!1)}}),[b,f.length,f.join("-")]);const w=[];if(h!==v){let e=[...h];for(let t=0;t<b.length;t++){const n=b[t],r=Yh(n);f.includes(r)||(e.splice(t,0,n),w.push(n))}return"wait"===a&&w.length&&(e=w),x(Qh(e)),y(h),null}process;const{forceRender:S}=n.useContext(qh);return t.jsx(t.Fragment,{children:b.map((e=>{const n=Yh(e),v=!(l&&!u)&&(h===b||f.includes(n));return t.jsx(Hh,{isPresent:v,initial:!(p.current&&!o)&&void 0,custom:r,presenceAffectsLayout:s,mode:a,onExitComplete:v?void 0:()=>{if(!g.has(n))return;g.set(n,!0);let e=!0;g.forEach((t=>{t||(e=!1)})),e&&(null==S||S(),x(m.current),l&&(null==d||d()),i&&i())},anchorX:c,children:e},n)}))})},ef=e=>e;let tf=ef,nf=ef;function rf(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(tf=(e,t)=>{},nf=(e,t)=>{if(!e)throw new Error(t)});const of=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},sf=e=>1e3*e,af=e=>e/1e3,lf=!1,cf=["read","resolveKeyframes","update","preRender","render","postRender"],uf={value:null};function df(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=cf.reduce(((e,n)=>(e[n]=function(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){s.has(t)&&(u.schedule(t),e()),l++,t(a)}const u={schedule:(e,t=!1,i=!1)=>{const a=i&&o?n:r;return t&&s.add(e),a.has(e)||a.add(e),e},cancel:e=>{r.delete(e),s.delete(e)},process:e=>{a=e,o?i=!0:(o=!0,[n,r]=[r,n],n.forEach(c),t&&uf.value&&uf.value.frameloop[t].push(l),l=0,n.clear(),o=!1,i&&(i=!1,u.process(e)))}};return u}(i,t?n:void 0),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=s,f=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),h.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(f))};return{schedule:cf.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(f)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t<cf.length;t++)s[cf[t]].cancel(e)},state:o,steps:s}}const{schedule:hf,cancel:ff,state:pf,steps:mf}=df("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ef,!0),gf=n.createContext({strict:!1}),vf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},yf={};for(const iQ in vf)yf[iQ]={isEnabled:e=>vf[iQ].some((t=>!!e[t]))};const bf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function xf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bf.has(e)}let wf=e=>!xf(e);try{(Sf=require("@emotion/is-prop-valid").default)&&(wf=e=>e.startsWith("on")?!xf(e):Sf(e))}catch(rQ){}var Sf;const Cf=new Set;function kf(e,t,n){e||Cf.has(t)||Cf.add(t)}function Ef(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>("production"!==process.env.NODE_ENV&&kf(!1,"motion() is deprecated. Use motion.create() instead."),e(...t))),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const jf=n.createContext({});function Tf(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Pf(e){return"string"==typeof e||Array.isArray(e)}const Nf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_f=["initial",...Nf];function Df(e){return Tf(e.animate)||_f.some((t=>Pf(e[t])))}function Mf(e){return Boolean(Df(e)||e.variants)}function Of(e){const{initial:t,animate:r}=function(e,t){if(Df(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Pf(t)?t:void 0,animate:Pf(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,n.useContext(jf));return n.useMemo((()=>({initial:t,animate:r})),[Rf(t),Rf(r)])}function Rf(e){return Array.isArray(e)?e.join(" "):e}const Af=Symbol.for("motionComponentSymbol");function Lf(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function If(e,t,r){return n.useCallback((n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&("function"==typeof r?r(n):Lf(r)&&(r.current=n))}),[t])}const Ff=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$f="data-"+Ff("framerAppearId"),{schedule:qf}=df(queueMicrotask,!1),zf=n.createContext({});function Uf(e,t,r,o,i){var s,a;const{visualElement:l}=n.useContext(jf),c=n.useContext(gf),u=n.useContext(Uh),d=n.useContext(Vh).reducedMotion,h=n.useRef(null);o=o||c.renderer,!h.current&&o&&(h.current=o(e,{visualState:t,parent:l,props:r,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const f=h.current,p=n.useContext(zf);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Vf(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&Lf(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(h.current,r,i,p);const m=n.useRef(!1);n.useInsertionEffect((()=>{f&&m.current&&f.update(r,u)}));const g=r[$f],v=n.useRef(Boolean(g)&&!(null===(s=window.MotionHandoffIsComplete)||void 0===s?void 0:s.call(window,g))&&(null===(a=window.MotionHasOptimisedAnimation)||void 0===a?void 0:a.call(window,g)));return Jh((()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),qf.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())})),n.useEffect((()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask((()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,g)})),v.current=!1))})),f}function Vf(e){if(e)return!1!==e.options.allowProjection?e.projection:Vf(e.parent)}function Bf({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:i,Component:s}){var a,l;function c(a,l){let c;const u={...n.useContext(Vh),...a,layoutId:Kf(a)},{isStatic:d}=u,h=Of(a),f=i(a,d);if(!d&&Xh){!function(e,t){const r=n.useContext(gf).strict;if("production"!==process.env.NODE_ENV&&t&&r){const t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?tf(!1,t):nf(!1,t)}}(u,e);const t=function(e){const{drag:t,layout:n}=yf;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(u);c=t.MeasureLayout,h.visualElement=Uf(s,f,u,r,t.ProjectionNode)}return t.jsxs(jf.Provider,{value:h,children:[c&&h.visualElement?t.jsx(c,{visualElement:h.visualElement,...u}):null,o(s,a,If(f,h.visualElement,l),f,d,h.visualElement)]})}e&&function(e){for(const t in e)yf[t]={...yf[t],...e[t]}}(e),c.displayName=`motion.${"string"==typeof s?s:`create(${null!==(l=null!==(a=s.displayName)&&void 0!==a?a:s.name)&&void 0!==l?l:""})`}`;const u=n.forwardRef(c);return u[Af]=s,u}function Kf({layoutId:e}){const t=n.useContext(qh).id;return t&&void 0!==e?t+"-"+e:e}const Hf=e=>t=>"string"==typeof t&&t.startsWith(e),Wf=Hf("--"),Gf=Hf("var(--"),Yf=e=>!!Gf(e)&&Qf.test(e.split("/*")[0].trim()),Qf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xf={};const Jf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zf=new Set(Jf);function ep(e,{layout:t,layoutId:n}){return Zf.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Xf[e]||"opacity"===e)}const tp=e=>Boolean(e&&e.getVelocity),np=(e,t)=>t&&"number"==typeof e?t.transform(e):e,rp=(e,t,n)=>n>t?t:n<e?e:n,op={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ip={...op,transform:e=>rp(0,1,e)},sp={...op,default:1},ap=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),lp=ap("deg"),cp=ap("%"),up=ap("px"),dp=ap("vh"),hp=ap("vw"),fp={...cp,parse:e=>cp.parse(e)/100,transform:e=>cp.transform(100*e)},pp={borderWidth:up,borderTopWidth:up,borderRightWidth:up,borderBottomWidth:up,borderLeftWidth:up,borderRadius:up,radius:up,borderTopLeftRadius:up,borderTopRightRadius:up,borderBottomRightRadius:up,borderBottomLeftRadius:up,width:up,maxWidth:up,height:up,maxHeight:up,top:up,right:up,bottom:up,left:up,padding:up,paddingTop:up,paddingRight:up,paddingBottom:up,paddingLeft:up,margin:up,marginTop:up,marginRight:up,marginBottom:up,marginLeft:up,backgroundPositionX:up,backgroundPositionY:up},mp={rotate:lp,rotateX:lp,rotateY:lp,rotateZ:lp,scale:sp,scaleX:sp,scaleY:sp,scaleZ:sp,skew:lp,skewX:lp,skewY:lp,distance:up,translateX:up,translateY:up,translateZ:up,x:up,y:up,z:up,perspective:up,transformPerspective:up,opacity:ip,originX:fp,originY:fp,originZ:up},gp={...op,transform:Math.round},vp={...pp,...mp,zIndex:gp,size:up,fillOpacity:ip,strokeOpacity:ip,numOctaves:gp},yp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bp=Jf.length;function xp(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const e=t[l];if(Zf.has(l))s=!0;else if(Wf(l))o[l]=e;else{const t=np(e,vp[l]);l.startsWith("origin")?(a=!0,i[l]=t):r[l]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i<bp;i++){const s=Jf[i],a=e[s];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(s.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=np(a,vp[s]);l||(o=!1,r+=`${yp[s]||s}(${e}) `),n&&(t[s]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=i;r.transformOrigin=`${e} ${t} ${n}`}}const wp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sp(e,t,n){for(const r in t)tp(t[r])||ep(r,n)||(e[r]=t[r])}function Cp(e,t){const r={};return Sp(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t){return n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return xp(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),r}function kp(e,t){const n={},r=Cp(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ep=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jp(e){return"string"==typeof e&&!e.includes("-")&&!!(Ep.indexOf(e)>-1||/[A-Z]/u.test(e))}const Tp={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pp={offset:"strokeDashoffset",array:"strokeDasharray"};function Np(e,t,n){return"string"==typeof e?e:up.transform(t+n*e)}function _p(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(xp(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:h,style:f,dimensions:p}=e;h.transform&&(p&&(f.transform=h.transform),delete h.transform),p&&(void 0!==o||void 0!==i||f.transform)&&(f.transformOrigin=function(e,t,n){return`${Np(t,e.x,e.width)} ${Np(n,e.y,e.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(h.x=t),void 0!==n&&(h.y=n),void 0!==r&&(h.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Tp:Pp;e[i.offset]=up.transform(-r);const s=up.transform(t),a=up.transform(n);e[i.array]=`${s} ${a}`}(h,s,a,l,!1)}const Dp=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Mp=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Op(e,t,r,o){const i=n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return _p(n,t,Mp(o),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Sp(t,e.style,e),i.style={...t,...i.style}}return i}function Rp(e=!1){return(t,r,o,{latestValues:i},s)=>{const a=(jp(t)?Op:kp)(r,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(wf(o)||!0===n&&xf(o)||!t&&!xf(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(r,"string"==typeof t,e),c=t!==n.Fragment?{...l,...a,ref:o}:{},{children:u}=r,d=n.useMemo((()=>tp(u)?u.get():u),[u]);return n.createElement(t,{...c,children:d})}}function Ap(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Lp(e,t,n,r){if("function"==typeof t){const[o,i]=Ap(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=Ap(r);t=t(void 0!==n?n:e.custom,o,i)}return t}const Ip=e=>Array.isArray(e);function Fp(e){const t=tp(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const $p=e=>(t,r)=>{const o=n.useContext(jf),i=n.useContext(Uh),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:qp(r,o,i,e),renderState:t()};return n&&(s.onMount=e=>n({props:r,current:e,...s}),s.onUpdate=e=>n(e)),s}(e,t,o,i);return r?s():zh(s)};function qp(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=Fp(i[h]);let{initial:s,animate:a}=e;const l=Df(e),c=Mf(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!Tf(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=Lp(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const r in n){let e=n[r];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[r]=e)}for(const r in e)o[r]=e[r]}}}return o}function zp(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(tp(o[s])||t.style&&tp(t.style[s])||ep(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return i}const Up={useVisualState:$p({scrapeMotionValuesFromProps:zp,createRenderState:wp})};function Vp(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(nQ){t.dimensions={x:0,y:0,width:0,height:0}}}function Bp(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const Kp=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Hp(e,t,n,r){Bp(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Kp.has(o)?o:Ff(o),t.attrs[o])}function Wp(e,t,n){const r=zp(e,t,n);for(const o in e)if(tp(e[o])||tp(t[o])){r[-1!==Jf.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}const Gp=["x","y","width","height","cx","cy","r"],Yp={useVisualState:$p({scrapeMotionValuesFromProps:Wp,createRenderState:Dp,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i)for(const a in o)if(Zf.has(a)){i=!0;break}if(!i)return;let s=!t;if(t)for(let a=0;a<Gp.length;a++){const n=Gp[a];e[n]!==t[n]&&(s=!0)}s&&hf.read((()=>{Vp(n,r),hf.render((()=>{_p(r,o,Mp(n.tagName),e.transformTemplate),Hp(n,r)}))}))}})};function Qp(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Bf({...jp(n)?Yp:Up,preloadedFeatures:e,useRender:Rp(r),createVisualElement:t,Component:n})}}function Xp(e,t,n){const r=e.getProps();return Lp(r,t,void 0!==n?n:r.custom,e)}const Jp=rf((()=>void 0!==window.ScrollTimeline));class Zp{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map((e=>"finished"in e?e.finished:e)))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map((n=>Jp()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0));return()=>{n.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach((t=>t[e]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class em extends Zp{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function tm(e,t){return e?e[t]||e.default||e:void 0}const nm=2e4;function rm(e){let t=0;let n=e.next(t);for(;!n.done&&t<nm;)t+=50,n=e.next(t);return t>=nm?1/0:t}function om(e){return"function"==typeof e}function im(e,t){e.timeline=t,e.onfinish=null}const sm=e=>Array.isArray(e)&&"number"==typeof e[0],am={linearEasing:void 0};function lm(e,t){const n=rf(e);return()=>{var e;return null!==(e=am[t])&&void 0!==e?e:n()}}const cm=lm((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(nQ){return!1}return!0}),"linearEasing"),um=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(of(0,o-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function dm(e){return Boolean("function"==typeof e&&cm()||!e||"string"==typeof e&&(e in fm||cm())||sm(e)||Array.isArray(e)&&e.every(dm))}const hm=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,fm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hm([0,.65,.55,1]),circOut:hm([.55,0,1,.45]),backIn:hm([.31,.01,.66,-.59]),backOut:hm([.33,1.53,.69,.99])};function pm(e,t){return e?"function"==typeof e&&cm()?um(e,t):sm(e)?hm(e):Array.isArray(e)?e.map((e=>pm(e,t)||fm.easeOut)):fm[e]:void 0}const mm={x:!1,y:!1};function gm(){return mm.x||mm.y}function vm(e,t){const n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ym(e){return!("touch"===e.pointerType||gm())}const bm=(e,t)=>!!t&&(e===t||bm(e,t.parentElement)),xm=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,wm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Sm=new WeakSet;function Cm(e){return t=>{"Enter"===t.key&&e(t)}}function km(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Em(e){return xm(e)&&!gm()}function jm(e,t,n={}){const[r,o,i]=vm(e,n),s=e=>{const r=e.currentTarget;if(!Em(e)||Sm.has(r))return;Sm.add(r);const i=t(r,e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Em(e)&&Sm.has(r)&&(Sm.delete(r),"function"==typeof i&&i(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||bm(r,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return r.forEach((e=>{(function(e){return wm.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0);(n.useGlobalTarget?window:e).addEventListener("pointerdown",s,o),e.addEventListener("focus",(e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Cm((()=>{if(Sm.has(n))return;km(n,"down");const e=Cm((()=>{km(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>km(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),i}const Tm=new Set(["width","height","top","left","right","bottom",...Jf]);let Pm;function Nm(){Pm=void 0}const _m={now:()=>(void 0===Pm&&_m.set(pf.isProcessing||lf?pf.timestamp:performance.now()),Pm),set:e=>{Pm=e,queueMicrotask(Nm)}};function Dm(e,t){-1===e.indexOf(t)&&e.push(t)}function Mm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Om{constructor(){this.subscriptions=[]}add(e){return Dm(this.subscriptions,e),()=>Mm(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Rm(e,t){return t?e*(1e3/t):0}class Am{constructor(e,t={}){this.version="12.4.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=_m.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=_m.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&kf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Om);const n=this.events[e].add(t);return"change"===e?()=>{n(),hf.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=_m.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Rm(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Lm(e,t){return new Am(e,t)}function Im(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Lm(n))}function Fm(e,t){const n=e.getValue("willChange");if(r=n,Boolean(tp(r)&&r.add))return n.add(t);var r}function $m(e){return e.props[$f]}const qm=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function zm(e,t,n,r){if(e===t&&n===r)return ef;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=qm(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:qm(o(e),t,r)}const Um=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vm=e=>t=>1-e(1-t),Bm=zm(.33,1.53,.69,.99),Km=Vm(Bm),Hm=Um(Km),Wm=e=>(e*=2)<1?.5*Km(e):.5*(2-Math.pow(2,-10*(e-1))),Gm=e=>1-Math.sin(Math.acos(e)),Ym=Vm(Gm),Qm=Um(Gm),Xm=e=>/^0[^.\s]+$/u.test(e);const Jm=e=>Math.round(1e5*e)/1e5,Zm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const eg=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tg=(e,t)=>n=>Boolean("string"==typeof n&&eg.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),ng=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,i,s,a]=r.match(Zm);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},rg={...op,transform:e=>Math.round((e=>rp(0,255,e))(e))},og={test:tg("rgb","red"),parse:ng("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+rg.transform(e)+", "+rg.transform(t)+", "+rg.transform(n)+", "+Jm(ip.transform(r))+")"};const ig={test:tg("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:og.transform},sg={test:tg("hsl","hue"),parse:ng("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+cp.transform(Jm(t))+", "+cp.transform(Jm(n))+", "+Jm(ip.transform(r))+")"},ag={test:e=>og.test(e)||ig.test(e)||sg.test(e),parse:e=>og.test(e)?og.parse(e):sg.test(e)?sg.parse(e):ig.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?og.transform(e):sg.transform(e)},lg=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const cg="number",ug="color",dg=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function hg(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(dg,(e=>(ag.test(e)?(r.color.push(i),o.push(ug),n.push(ag.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(cg),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function fg(e){return hg(e).values}function pg(e){const{split:t,types:n}=hg(e),r=t.length;return e=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],void 0!==e[i]){const t=n[i];o+=t===cg?Jm(e[i]):t===ug?ag.transform(e[i]):e[i]}return o}}const mg=e=>"number"==typeof e?0:e;const gg={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Zm))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(lg))||void 0===n?void 0:n.length)||0)>0},parse:fg,createTransformer:pg,getAnimatableNone:function(e){const t=fg(e);return pg(e)(t.map(mg))}},vg=new Set(["brightness","contrast","saturate","opacity"]);function yg(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Zm)||[];if(!r)return e;const o=n.replace(r,"");let i=vg.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const bg=/\b([a-z-]*)\(.*?\)/gu,xg={...gg,getAnimatableNone:e=>{const t=e.match(bg);return t?t.map(yg).join(" "):e}},wg={...vp,color:ag,backgroundColor:ag,outlineColor:ag,fill:ag,stroke:ag,borderColor:ag,borderTopColor:ag,borderRightColor:ag,borderBottomColor:ag,borderLeftColor:ag,filter:xg,WebkitFilter:xg},Sg=e=>wg[e];function Cg(e,t){let n=Sg(e);return n!==xg&&(n=gg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const kg=new Set(["auto","none","0"]);const Eg=e=>e===op||e===up,jg=(e,t)=>parseFloat(e.split(", ")[t]),Tg=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return jg(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?jg(t[1],e):0}},Pg=new Set(["x","y","z"]),Ng=Jf.filter((e=>!Pg.has(e)));const _g={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Tg(4,13),y:Tg(5,14)};_g.translateX=_g.x,_g.translateY=_g.y;const Dg=new Set;let Mg=!1,Og=!1;function Rg(){if(Og){const e=Array.from(Dg).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return Ng.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Og=!1,Mg=!1,Dg.forEach((e=>e.complete())),Dg.clear()}function Ag(){Dg.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Og=!0)}))}class Lg{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Dg.add(this),Mg||(Mg=!0,hf.read(Ag),hf.resolveKeyframes(Rg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==r?void 0:r.get(),i=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,i);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=i),r&&void 0===o&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Dg.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Dg.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ig=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Fg=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $g(e,t,n=1){nf(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Fg.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Ig(e)?parseFloat(e):e}return Yf(o)?$g(o,t,n+1):o}const qg=e=>t=>t.test(e),zg=[op,up,cp,lp,hp,dp,{test:e=>"auto"===e,parse:e=>e}],Ug=e=>zg.find(qg(e));class Vg extends Lg{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let a=0;a<e.length;a++){let n=e[a];if("string"==typeof n&&(n=n.trim(),Yf(n))){const r=$g(n,t.current);void 0!==r&&(e[a]=r),a===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Tm.has(n)||2!==e.length)return;const[r,o]=e,i=Ug(r),s=Ug(o);if(i!==s)if(Eg(i)&&Eg(s))for(let a=0;a<e.length;a++){const t=e[a];"string"==typeof t&&(e[a]=parseFloat(t))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let o=0;o<e.length;o++)("number"==typeof(r=e[o])?0===r:null===r||"none"===r||"0"===r||Xm(r))&&n.push(o);var r;n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!kg.has(t)&&hg(t).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=Cg(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_g[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=_g[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Bg=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!gg.test(e)&&"0"!==e||e.startsWith("url(")));const Kg=e=>null!==e;function Hg(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Kg),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}class Wg{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=_m.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ag(),Rg()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=_m.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=Bg(o,t),a=Bg(i,t);return tf(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||om(n))&&r)}(e,n,r,o)){if(!i)return a&&a(Hg(e,this.options,t)),s&&s(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((e=>{this.resolveFinishedPromise=e}))}}const Gg=(e,t,n)=>e+(t-e)*n;function Yg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Qg(e,t){return n=>n>0?t:e}const Xg=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Jg=[ig,og,sg];function Zg(e){const t=(n=e,Jg.find((e=>e.test(n))));var n;if(tf(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===sg&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Yg(a,r,e+1/3),i=Yg(a,r,e),s=Yg(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(r)),r}const ev=(e,t)=>{const n=Zg(e),r=Zg(t);if(!n||!r)return Qg(e,t);const o={...n};return e=>(o.red=Xg(n.red,r.red,e),o.green=Xg(n.green,r.green,e),o.blue=Xg(n.blue,r.blue,e),o.alpha=Gg(n.alpha,r.alpha,e),og.transform(o))},tv=(e,t)=>n=>t(e(n)),nv=(...e)=>e.reduce(tv),rv=new Set(["none","hidden"]);function ov(e,t){return n=>Gg(e,t,n)}function iv(e){return"number"==typeof e?ov:"string"==typeof e?Yf(e)?Qg:ag.test(e)?ev:lv:Array.isArray(e)?sv:"object"==typeof e?ag.test(e)?ev:av:Qg}function sv(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>iv(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function av(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=iv(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const lv=(e,t)=>{const n=gg.createTransformer(t),r=hg(e),o=hg(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?rv.has(e)&&!o.values.length||rv.has(t)&&!r.values.length?function(e,t){return rv.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):nv(sv(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=null!==(n=e.values[e.indexes[s][o[s]]])&&void 0!==n?n:0;r[i]=a,o[s]++}return r}(r,o),o.values),n):(tf(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Qg(e,t))};function cv(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Gg(e,t,n);return iv(e)(e,t)}function uv(e,t,n){const r=Math.max(t-5,0);return Rm(n-e(r),t-r)}const dv=100,hv=10,fv=1,pv=0,mv=800,gv=.3,vv=.3,yv={granular:.01,default:2},bv={granular:.005,default:.5},xv=.01,wv=10,Sv=.05,Cv=1;function kv({duration:e=mv,bounce:t=gv,velocity:n=pv,mass:r=fv}){let o,i;tf(e<=sf(wv),"Spring duration must be 10 seconds or less");let s=1-t;s=rp(Sv,Cv,s),e=rp(xv,wv,af(e)),s<1?(o=t=>{const r=t*s,o=r*e;return.001-(r-n)/jv(t,s)*Math.exp(-o)},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=jv(Math.pow(t,2),s);return(.001-o(t)>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let o=1;o<Ev;o++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=sf(e),isNaN(a))return{stiffness:dv,damping:hv,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Ev=12;function jv(e,t){return e*Math.sqrt(1-t*t)}const Tv=["duration","bounce"],Pv=["stiffness","damping","mass"];function Nv(e,t){return t.some((t=>void 0!==e[t]))}function _v(e=vv,t=gv){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=function(e){let t={velocity:pv,stiffness:dv,damping:hv,mass:fv,isResolvedFromDuration:!1,...e};if(!Nv(e,Pv)&&Nv(e,Tv))if(e.visualDuration){const n=2*Math.PI/(1.2*e.visualDuration),r=n*n,o=2*rp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:fv,stiffness:r,damping:o}}else{const n=kv(e);t={...t,...n,mass:fv},t.isResolvedFromDuration=!0}return t}({...n,velocity:-af(n.velocity||0)}),p=h||0,m=c/(2*Math.sqrt(l*u)),g=s-i,v=af(Math.sqrt(l/u)),y=Math.abs(g)<5;let b;if(r||(r=y?yv.granular:yv.default),o||(o=y?bv.granular:bv.default),m<1){const e=jv(v,m);b=t=>{const n=Math.exp(-m*v*t);return s-n*((p+m*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===m)b=e=>s-Math.exp(-v*e)*(g+(p+v*g)*e);else{const e=v*Math.sqrt(m*m-1);b=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return s-n*((p+m*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const x={calculatedDuration:f&&d||null,next:e=>{const t=b(e);if(f)a.done=e>=d;else{let n=0;m<1&&(n=0===e?sf(p):uv(b,e,t));const i=Math.abs(n)<=r,l=Math.abs(s-t)<=o;a.done=i&&l}return a.value=a.done?s:t,a},toString:()=>{const e=Math.min(rm(x),nm),t=um((t=>x.next(e*t).value),e,30);return e+"ms "+t}};return x}function Dv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let p=n*t;const m=d+p,g=void 0===s?m:s(m);g!==m&&(p=g-d);const v=e=>-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?g:n};let x,w;const S=e=>{var t;(t=h.value,void 0!==a&&t<a||void 0!==l&&t>l)&&(x=e,w=_v({keyframes:[h.value,f(h.value)],velocity:uv(y,e,h.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),S(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),h)}}}const Mv=zm(.42,0,1,1),Ov=zm(0,0,.58,1),Rv=zm(.42,0,.58,1),Av={linear:ef,easeIn:Mv,easeInOut:Rv,easeOut:Ov,circIn:Gm,circInOut:Qm,circOut:Ym,backIn:Km,backInOut:Hm,backOut:Bm,anticipate:Wm},Lv=e=>{if(sm(e)){nf(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return zm(t,n,r,o)}return"string"==typeof e?(nf(void 0!==Av[e],`Invalid easing type '${e}'`),Av[e]):e};function Iv(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(nf(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],o=n||cv,i=e.length-1;for(let s=0;s<i;s++){let n=o(e[s],e[s+1]);if(t){const e=Array.isArray(t)?t[s]||ef:t;n=nv(e,n)}r.push(n)}return r}(t,r,o),l=a.length,c=n=>{if(s&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);return a[r](of(e[r],e[r+1],n))};return n?t=>c(rp(e[0],e[i-1],t)):c}function Fv(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++)e.push(Gg(n,1,of(0,t,r)))}(t,e.length-1),t}function $v({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Lv):Lv(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:Fv(t),e),a=Iv(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Rv)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const qv=e=>{const t=({timestamp:t})=>e(t);return{start:()=>hf.update(t,!0),stop:()=>ff(t),now:()=>pf.isProcessing?pf.timestamp:_m.now()}},zv={decay:Dv,inertia:Dv,tween:$v,keyframes:$v,spring:_v},Uv=e=>e/100;class Vv extends Wg{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new((null==r?void 0:r.KeyframeResolver)||Lg)(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=om(t)?t:zv[t]||$v;let a,l;s!==$v&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&nf(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a=nv(Uv,cv(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=rm(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:h,repeatType:f,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),this.currentTime=t?e:null!==this.holdTime?this.holdTime:Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(h){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,h+1);Boolean(t%2)&&("reverse"===f?(n=1-n,p&&(n-=p/u)):"mirror"===f&&(b=i)),y=rp(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&void 0!==r&&(x.value=Hg(a,this.options,r)),m&&m(x.value),S&&this.finish(),x}get duration(){const{resolved:e}=this;return e?af(e.calculatedDuration):0}get time(){return af(this.currentTime)}set time(e){this.currentTime=e=sf(e),null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=af(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=qv,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Bv=new Set(["opacity","clipPath","filter","transform"]);function Kv(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=pm(a,o);Array.isArray(u)&&(c.easing=u);return e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}const Hv=rf((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const Wv={anticipate:Wm,backInOut:Hm,circInOut:Qm};class Gv extends Wg{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new Vg(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:o,type:i,motionValue:s,name:a,startTime:l}=this.options;if(!s.owner||!s.owner.current)return!1;var c;if("string"==typeof o&&cm()&&o in Wv&&(o=Wv[o]),om((c=this.options).type)||"spring"===c.type||!dm(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new Vv({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,r=u.times,o=u.ease,i="keyframes"}const u=Kv(s.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(im(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(Hg(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:n,times:r,type:i,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return af(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return af(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=sf(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return ef;const{animation:n}=t;im(n,e)}else this.pendingTimeline=e;return ef}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new Vv({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=sf(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Hv()&&n&&Bv.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Yv={type:"spring",stiffness:500,damping:25,restSpeed:10},Qv={type:"keyframes",duration:.8},Xv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Jv=(e,{keyframes:t})=>t.length>2?Qv:Zf.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Yv:Xv;const Zv=(e,t,n,r={},o,i)=>s=>{const a=tm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=sf(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...Jv(e,u)}),u.duration&&(u.duration=sf(u.duration)),u.repeatDelay&&(u.repeatDelay=sf(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!i&&void 0!==t.get()){const e=Hg(u.keyframes,a);if(void 0!==e)return hf.update((()=>{u.onUpdate(e),u.onComplete()})),new em([])}return!i&&Gv.supports(u)?new Gv(u):new Vv(u)};function ey({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function ty(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const t=e.getValue(d,null!==(i=e.latestValues[d])&&void 0!==i?i:null),r=l[d];if(void 0===r||u&&ey(u,d))continue;const o={delay:n,...tm(s||{},d)};let a=!1;if(window.MotionHandoffAnimation){const t=$m(e);if(t){const e=window.MotionHandoffAnimation(t,d,hf);null!==e&&(o.startTime=e,a=!0)}}Fm(e,d),t.start(Zv(d,t,r,e.shouldReduceMotion&&Tm.has(d)?{type:!1}:o,e,a));const h=t.animation;h&&c.push(h)}return a&&Promise.all(c).then((()=>{hf.update((()=>{a&&function(e,t){const n=Xp(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i)Im(e,a,Ip(s=i[a])?s[s.length-1]||0:s);var s}(e,a)}))})),c}function ny(e,t,n={}){var r;const o=Xp(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(ty(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(ry).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(ny(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function ry(e,t){return e.sortNodePosition(t)}function oy(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const iy=_f.length;function sy(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&sy(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<iy;n++){const r=_f[n],o=e.props[r];(Pf(o)||!1===o)&&(t[r]=o)}return t}const ay=[...Nf].reverse(),ly=Nf.length;function cy(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>ny(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=ny(e,t,n);else{const o="function"==typeof t?Xp(e,t,n.custom):t;r=Promise.all(ty(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}function uy(e){let t=cy(e),n=fy(),r=!0;const o=t=>(n,r)=>{var o;const i=Xp(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const{props:s}=e,a=sy(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<ly;t++){const h=ay[t],f=n[h],p=void 0!==s[h]?s[h]:a[h],m=Pf(p),g=h===i?f.isActive:null;!1===g&&(d=t);let v=p===a[h]&&p!==s[h]&&m;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...u},!f.isActive&&null===g||!p&&!f.prevProp||Tf(p)||"boolean"==typeof p)continue;const y=dy(f.prevProp,p);let b=y||h===i&&f.isActive&&!v&&m||t>d&&m,x=!1;const w=Array.isArray(p)?p:[p];let S=w.reduce(o(h),{});!1===g&&(S={});const{prevResolvedValues:C={}}=f,k={...C,...S},E=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Ip(t)&&Ip(n)?!oy(t,n):t!==n,r?null!=t?E(e):c.add(e):void 0!==t&&c.has(e)?E(e):f.protectedKeys[e]=!0}f.prevProp=p,f.prevResolvedValues=S,f.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(b=!1);b&&(!(v&&y)||x)&&l.push(...w.map((e=>({animation:e,options:{type:h}}))))}if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let h=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(h=!1),r=!1,h?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=fy(),r=!0}}}function dy(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!oy(t,e)}function hy(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fy(){return{animate:hy(!0),whileInView:hy(),whileHover:hy(),whileTap:hy(),whileDrag:hy(),whileFocus:hy(),exit:hy()}}class py{constructor(e){this.isMounted=!1,this.node=e}update(){}}let my=0;const gy={animation:{Feature:class extends py{constructor(e){super(e),e.animationState||(e.animationState=uy(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Tf(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends py{constructor(){super(...arguments),this.id=my++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>{t(this.id)}))}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function vy(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function yy(e){return{point:{x:e.pageX,y:e.pageY}}}function by(e,t,n,r){return vy(e,t,(e=>t=>xm(t)&&e(t,yy(t)))(n),r)}const xy=(e,t)=>Math.abs(e-t);class wy{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=ky(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=xy(e.x,t.x),r=xy(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=pf;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Sy(t,this.transformPagePoint),hf.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=ky("pointercancel"===e.type?this.lastMoveEventInfo:Sy(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!xm(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Sy(yy(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=pf;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,ky(i,this.history)),this.removeListeners=nv(by(this.contextWindow,"pointermove",this.handlePointerMove),by(this.contextWindow,"pointerup",this.handlePointerUp),by(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ff(this.updatePoint)}}function Sy(e,t){return t?{point:t(e.point)}:e}function Cy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ky({point:e},t){return{point:e,delta:Cy(e,jy(t)),offset:Cy(e,Ey(t)),velocity:Ty(t,.1)}}function Ey(e){return e[0]}function jy(e){return e[e.length-1]}function Ty(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=jy(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>sf(t)));)n--;if(!r)return{x:0,y:0};const i=af(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Py(e){return e.max-e.min}function Ny(e,t,n,r=.5){e.origin=r,e.originPoint=Gg(t.min,t.max,e.origin),e.scale=Py(n)/Py(t),e.translate=Gg(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function _y(e,t,n,r){Ny(e.x,t.x,n.x,r?r.originX:void 0),Ny(e.y,t.y,n.y,r?r.originY:void 0)}function Dy(e,t,n){e.min=n.min+t.min,e.max=e.min+Py(t)}function My(e,t,n){e.min=t.min-n.min,e.max=e.min+Py(t)}function Oy(e,t,n){My(e.x,t.x,n.x),My(e.y,t.y,n.y)}function Ry(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ay(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const Ly=.35;function Iy(e,t,n){return{min:Fy(e,t),max:Fy(e,n)}}function Fy(e,t){return"number"==typeof e?e:e[t]||0}const $y=()=>({x:{min:0,max:0},y:{min:0,max:0}});function qy(e){return[e("x"),e("y")]}function zy({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Uy(e){return void 0===e||1===e}function Vy({scale:e,scaleX:t,scaleY:n}){return!Uy(e)||!Uy(t)||!Uy(n)}function By(e){return Vy(e)||Ky(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ky(e){return Hy(e.x)||Hy(e.y)}function Hy(e){return e&&"0%"!==e}function Wy(e,t,n){return n+t*(e-n)}function Gy(e,t,n,r,o){return void 0!==o&&(e=Wy(e,o,r)),Wy(e,n,r)+t}function Yy(e,t=0,n=1,r,o){e.min=Gy(e.min,t,n,r,o),e.max=Gy(e.max,t,n,r,o)}function Qy(e,{x:t,y:n}){Yy(e.x,t.translate,t.scale,t.originPoint),Yy(e.y,n.translate,n.scale,n.originPoint)}const Xy=.999999999999,Jy=1.0000000000001;function Zy(e,t){e.min=e.min+t,e.max=e.max+t}function eb(e,t,n,r,o=.5){Yy(e,t,n,Gg(e.min,e.max,o),r)}function tb(e,t){eb(e.x,t.x,t.scaleX,t.scale,t.originX),eb(e.y,t.y,t.scaleY,t.scale,t.originY)}function nb(e,t){return zy(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const rb=({current:e})=>e?e.ownerDocument.defaultView:null,ob=new WeakMap;class ib{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new wy(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(yy(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(i=n)||"y"===i?mm[i]?null:(mm[i]=!0,()=>{mm[i]=!1}):mm.x||mm.y?null:(mm.x=mm.y=!0,()=>{mm.x=mm.y=!1}),!this.openDragLock))return;var i;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qy((e=>{let t=this.getAxisMotionValue(e).get()||0;if(cp.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Py(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&hf.postRender((()=>o(e,t))),Fm(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>qy((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:rb(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&hf.postRender((()=>o(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!sb(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Gg(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Gg(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&Lf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Ry(e.x,n,o),y:Ry(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Ly){return!1===e?e=0:!0===e&&(e=Ly),{x:Iy(e,"left","right"),y:Iy(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&qy((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Lf(e))return!1;const n=e.current;nf(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=nb(e,n),{scroll:o}=t;return o&&(Zy(r.x,o.offset.x),Zy(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Ay(e.x,t.x),y:Ay(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=zy(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=qy((s=>{if(!sb(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c={type:"inertia",velocity:n?e[s]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,c)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Fm(this.visualElement,e),n.start(Zv(e,n,0,t,this.visualElement,!1))}stopAnimation(){qy((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){qy((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){qy((t=>{const{drag:n}=this.getProps();if(!sb(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Gg(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Lf(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};qy((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Py(e),o=Py(t);return o>r?n=of(t.min,t.max-r,e.min):r>o&&(n=of(e.min,e.max-o,t.min)),rp(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),qy((t=>{if(!sb(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Gg(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;ob.set(this.visualElement,this);const e=by(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();Lf(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),hf.read(t);const o=vy(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(qy((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Ly,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function sb(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ab=e=>(t,n)=>{e&&hf.postRender((()=>e(t,n)))};const lb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ub={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!up.test(e))return e;e=parseFloat(e)}return`${cb(e,t.target.x)}% ${cb(e,t.target.y)}%`}},db={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=gg.parse(e);if(o.length>5)return r;const i=gg.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Gg(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class hb extends n.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;!function(e){for(const t in e)Xf[t]=e[t],Wf(t)&&(Xf[t].isCSSVariable=!0)}(pb),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),lb.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||hf.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),qf.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function fb(e){const[r,o]=Gh(),i=n.useContext(qh);return t.jsx(hb,{...e,layoutGroup:i,switchLayoutGroup:n.useContext(zf),isPresent:r,safeToRemove:o})}const pb={borderRadius:{...ub,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ub,borderTopRightRadius:ub,borderBottomLeftRadius:ub,borderBottomRightRadius:ub,boxShadow:db};const mb=(e,t)=>e.depth-t.depth;class gb{constructor(){this.children=[],this.isDirty=!1}add(e){Dm(this.children,e),this.isDirty=!0}remove(e){Mm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mb),this.isDirty=!1,this.children.forEach(e)}}const vb=["TopLeft","TopRight","BottomLeft","BottomRight"],yb=vb.length,bb=e=>"string"==typeof e?parseFloat(e):e,xb=e=>"number"==typeof e||up.test(e);function wb(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Sb=kb(0,.5,Ym),Cb=kb(.5,.95,ef);function kb(e,t,n){return r=>r<e?0:r>t?1:n(of(e,t,r))}function Eb(e,t){e.min=t.min,e.max=t.max}function jb(e,t){Eb(e.x,t.x),Eb(e.y,t.y)}function Tb(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Pb(e,t,n,r,o){return e=Wy(e-=t,1/n,r),void 0!==o&&(e=Wy(e,1/o,r)),e}function Nb(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){cp.test(t)&&(t=parseFloat(t),t=Gg(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=Gg(i.min,i.max,r);e===i&&(a-=t),e.min=Pb(e.min,t,n,a,o),e.max=Pb(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const _b=["x","scaleX","originX"],Db=["y","scaleY","originY"];function Mb(e,t,n,r){Nb(e.x,t,_b,n?n.x:void 0,r?r.x:void 0),Nb(e.y,t,Db,n?n.y:void 0,r?r.y:void 0)}function Ob(e){return 0===e.translate&&1===e.scale}function Rb(e){return Ob(e.x)&&Ob(e.y)}function Ab(e,t){return e.min===t.min&&e.max===t.max}function Lb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ib(e,t){return Lb(e.x,t.x)&&Lb(e.y,t.y)}function Fb(e){return Py(e.x)/Py(e.y)}function $b(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class qb{constructor(){this.members=[]}add(e){Dm(this.members,e),e.scheduleRender()}remove(e){if(Mm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let r=t;r>=0;r--){const e=this.members[r];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const zb=["","X","Y","Z"],Ub={visibility:"hidden"};let Vb=0;function Bb(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=$m(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",hf,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kb(r)}function Hb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Vb++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Yb),this.nodes.forEach(nx),this.nodes.forEach(rx),this.nodes.forEach(Qb)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new gb)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Om),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=t)instanceof SVGElement&&"svg"!==r.tagName,this.instance=t;const{layoutId:o,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),e){let n;const r=()=>this.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=_m.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(ff(r),e(i-t))};return hf.read(r,!0),()=>ff(r)}(r,250),lb.hasAnimatedSinceResize&&(lb.hasAnimatedSinceResize=!1,this.nodes.forEach(tx))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||cx,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Ib(this.targetLayout,r),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...tm(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||tx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ff(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ox),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let o=0;o<this.path.length;o++){const e=this.path[o];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Jb);this.isUpdating||this.nodes.forEach(Zb),this.isUpdating=!1,this.nodes.forEach(ex),this.nodes.forEach(Wb),this.nodes.forEach(Gb),this.clearAllSnapshots();const e=_m.now();pf.delta=rp(0,1e3/60,e-pf.timestamp),pf.timestamp=e,pf.isProcessing=!0,mf.update.process(pf),mf.preRender.process(pf),mf.render.process(pf),pf.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xb),this.sharedNodes.forEach(ix)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,hf.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){hf.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Py(this.snapshot.measuredBox.x)||Py(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Rb(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||By(this.latestValues)||i)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),hx((r=n).x),hx(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!((null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)||this.path.some(px))){const{scroll:e}=this.root;e&&(Zy(n.x,e.offset.x),Zy(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(jb(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let r=0;r<this.path.length;r++){const t=this.path[r],{scroll:o,options:i}=t;t!==this.root&&o&&i.layoutScroll&&(o.wasRoot&&jb(n,e),Zy(n.x,o.offset.x),Zy(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};jb(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&tb(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),By(e.latestValues)&&tb(n,e.latestValues)}return By(this.latestValues)&&tb(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};jb(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!By(e.latestValues))continue;Vy(e.latestValues)&&e.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};jb(r,e.measurePageBox()),Mb(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return By(this.latestValues)&&Mb(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==pf.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=pf.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Oy(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),jb(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var s,a,l;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Dy((s=this.target).x,(a=this.relativeTarget).x,(l=this.relativeParent.target).x),Dy(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):jb(this.target,this.layout.layoutBox),Qy(this.target,this.targetDelta)):jb(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Oy(this.relativeTargetOrigin,this.target,e.target),jb(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Vy(this.parent.latestValues)&&!Ky(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===pf.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;jb(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let i,s;t.x=t.y=1;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:o}=i.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&tb(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Qy(e,s)),r&&By(i.latestValues)&&tb(e,i.latestValues))}t.x<Jy&&t.x>Xy&&(t.x=1),t.y<Jy&&t.y>Xy&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Tb(this.prevProjectionDelta.x,this.projectionDelta.x),Tb(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),_y(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&$b(this.projectionDelta.x,this.prevProjectionDelta.x)&&$b(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(lx));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,f,p,m,g;sx(i.x,e.x,n),sx(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Oy(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ax((f=this.relativeTarget).x,(p=this.relativeTargetOrigin).x,(m=s).x,g=n),ax(f.y,p.y,m.y,g),d&&(Ab((l=this.relativeTarget).x,(h=d).x)&&Ab(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),jb(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Gg(0,void 0!==n.opacity?n.opacity:1,Sb(r)),e.opacityExit=Gg(void 0!==t.opacity?t.opacity:1,0,Cb(r))):i&&(e.opacity=Gg(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let s=0;s<yb;s++){const o=`border${vb[s]}Radius`;let i=wb(t,o),a=wb(n,o);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||xb(i)===xb(a)?(e[o]=Math.max(Gg(bb(i),bb(a),r),0),(cp.test(a)||cp.test(i))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=Gg(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ff(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=hf.update((()=>{lb.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=tp(e)?e:Lm(e);return r.start(Zv("",r,t,n)),r.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&fx(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Py(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Py(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}jb(t,n),tb(t,o),_y(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new qb);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Bb("z",e,r,this.animationValues);for(let o=0;o<zb.length;o++)Bb(`rotate${zb[o]}`,e,r,this.animationValues),Bb(`skew${zb[o]}`,e,r,this.animationValues);e.render();for(const o in r)e.setStaticValue(o,r[o]),this.animationValues&&(this.animationValues[o]=r[o]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ub;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Fp(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Fp(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!By(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:i,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),o&&(r.transform=o(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,r.opacity=i.animationValues?i===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const c in Xf){if(void 0===s[c])continue;const{correct:e,applyTo:t,isCSSVariable:n}=Xf[c],o="none"===r.transform?s[c]:e(s[c],i);if(t){const e=t.length;for(let n=0;n<e;n++)r[t[n]]=o}else n?this.options.visualElement.renderState.vars[c]=o:r[c]=o}return this.options.layoutId&&(r.pointerEvents=i===this?Fp(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Jb),this.root.sharedNodes.clear()}}}function Wb(e){e.updateLayout()}function Gb(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?qy((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Py(r);r.min=t[e].min,r.max=r.min+o})):fx(o,n.layoutBox,t)&&qy((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Py(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};_y(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?_y(a,e.applyTransform(r,!0),n.measuredBox):_y(a,t,n.layoutBox);const l=!Rb(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s={x:{min:0,max:0},y:{min:0,max:0}};Oy(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Oy(a,t,i.layoutBox),Ib(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Yb(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Qb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Xb(e){e.clearSnapshot()}function Jb(e){e.clearMeasurements()}function Zb(e){e.isLayoutDirty=!1}function ex(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function tx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nx(e){e.resolveTargetDelta()}function rx(e){e.calcProjection()}function ox(e){e.resetSkewAndRotation()}function ix(e){e.removeLeadSnapshot()}function sx(e,t,n){e.translate=Gg(t.translate,0,n),e.scale=Gg(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ax(e,t,n,r){e.min=Gg(t.min,n.min,r),e.max=Gg(t.max,n.max,r)}function lx(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const cx={duration:.45,ease:[.4,0,.1,1]},ux=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dx=ux("applewebkit/")&&!ux("chrome/")?Math.round:ef;function hx(e){e.min=dx(e.min),e.max=dx(e.max)}function fx(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Fb(t),o=Fb(n),i=.2,!(Math.abs(r-o)<=i));var r,o,i}function px(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const mx=Hb({attachResizeListener:(e,t)=>vy(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),gx={current:void 0},vx=Hb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gx.current){const e=new mx({});e.mount(window),e.setOptions({layoutScroll:!0}),gx.current=e}return gx.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),yx={pan:{Feature:class extends py{constructor(){super(...arguments),this.removePointerDownListener=ef}onPointerDown(e){this.session=new wy(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rb(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ab(e),onStart:ab(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&hf.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=by(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends py{constructor(e){super(e),this.removeGroupControls=ef,this.removeListeners=ef,this.controls=new ib(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ef}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:vx,MeasureLayout:fb}};function bx(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&hf.postRender((()=>o(t,yy(t))))}function xx(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&hf.postRender((()=>o(t,yy(t))))}const wx=new WeakMap,Sx=new WeakMap,Cx=e=>{const t=wx.get(e.target);t&&t(e)},kx=e=>{e.forEach(Cx)};function Ex(e,t,n){const r=function({root:e,...t}){const n=e||document;Sx.has(n)||Sx.set(n,{});const r=Sx.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(kx,{root:e,...t})),r[o]}(t);return wx.set(e,n),r.observe(e),()=>{wx.delete(e),r.unobserve(e)}}const jx={some:0,all:1};const Tx={inView:{Feature:class extends py{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e;return Ex(this.node.current,{root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:jx[r]},(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends py{mount(){const{current:e}=this.node;e&&(this.unmount=jm(e,((e,t)=>(xx(this.node,t,"Start"),(e,{success:t})=>xx(this.node,e,t?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends py{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(nQ){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=nv(vy(this.node.current,"focus",(()=>this.onFocus())),vy(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends py{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,i]=vm(e,n),s=e=>{if(!ym(e))return;const{target:n}=e,r=t(n,e);if("function"!=typeof r||!n)return;const i=e=>{ym(e)&&(r(e),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,o)};return r.forEach((e=>{e.addEventListener("pointerenter",s,o)})),i}(e,((e,t)=>(bx(this.node,t,"Start"),e=>bx(this.node,e,"End")))))}unmount(){}}}},Px={layout:{ProjectionNode:vx,MeasureLayout:fb}},Nx={current:null},_x={current:!1};const Dx=[...zg,ag,gg],Mx=new WeakMap;const Ox=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Rx{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Lg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=_m.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,hf.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=i;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Df(t),this.isVariantNode=Mf(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const h in d){const e=d[h];void 0!==a[h]&&tp(e)&&e.set(a[h],!1)}}mount(e){this.current=e,Mx.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),_x.current||function(){if(_x.current=!0,Xh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nx.current=e.matches;e.addListener(t),t()}else Nx.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Nx.current),"production"!==process.env.NODE_ENV&&kf(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ff(this.notifyUpdate),ff(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Zf.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&hf.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in yf){const t=yf[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<Ox.length;n++){const t=Ox[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],i=n[r];if(tp(o))e.addValue(r,o),"development"===process.env.NODE_ENV&&kf("12.4.0"===o.version,`Attempting to mix Motion versions ${o.version} with 12.4.0 may not work as expected.`);else if(tp(i))e.addValue(r,Lm(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,Lm(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Lm(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ig(r)||Xm(r))?r=parseFloat(r):!Dx.find(qg(r))&&gg.test(t)&&(r=Cg(e,t)),this.setBaseTarget(e,tp(r)?r.get():r)),tp(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=Lp(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||tp(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Om),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Ax extends Rx{constructor(){super(...arguments),this.KeyframeResolver=Vg}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;tp(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class Lx extends Ax{constructor(){super(...arguments),this.type="html",this.renderInstance=Bp}readValueFromInstance(e,t){if(Zf.has(t)){const e=Sg(t);return e&&e.default||0}{const n=window.getComputedStyle(e),r=(Wf(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return nb(e,t)}build(e,t,n){xp(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return zp(e,t,n)}}class Ix extends Ax{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$y,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Vp(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Zf.has(t)){const e=Sg(t);return e&&e.default||0}return t=Kp.has(t)?t:Ff(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Wp(e,t,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&hf.postRender(this.updateDimensions)}build(e,t,n){_p(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Hp(e,t,0,r)}mount(e){this.isSVGTag=Mp(e.tagName),super.mount(e)}}const Fx=Ef(Qp({...gy,...Tx,...yx,...Px},((e,t)=>jp(e)?new Ix(t):new Lx(t,{allowProjection:e!==n.Fragment})))),$x=({children:e,className:n})=>t.jsx(Fx.div,{initial:{opacity:0,filter:"blur(8px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(8px)"},transition:{duration:.3,ease:"easeInOut"},className:n,children:e}),qx=({children:e})=>t.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight",children:e}),zx=({size:e=35,color:r="black",speed:o=.9,strokeWidth:i=3.5,text:s,textSpeed:a=2e3,textColor:l="black"})=>{const[c,u]=n.useState(0),d=Array.isArray(s)?s:s?[s]:[];return n.useEffect((()=>{if(d.length<=1)return;if(c>=d.length-1)return;const e=setInterval((()=>{u((e=>e<d.length-1?e+1:e))}),a);return()=>clearInterval(e)}),[d.length,a,c]),t.jsx("div",{className:"flex flex-col justify-center items-center h-full",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsxs("div",{className:"loader-container",style:{"--uib-size":`${e}px`,"--uib-color":r,"--uib-speed":`${o}s`,"--uib-stroke":`${i}px`},children:[t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"}),t.jsx("div",{className:"line"})]}),d.length>0&&t.jsx("div",{className:"text-center text-sm text-muted-foreground animate-fade-in "+(l?`text-${l}`:""),children:t.jsx(qx,{children:d[c]})},c),t.jsx("style",{children:"\n .loader-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--uib-size);\n width: var(--uib-size);\n }\n .line {\n position: absolute;\n top: calc(50% - var(--uib-stroke) / 2);\n left: 0;\n height: var(--uib-stroke);\n width: 100%;\n border-radius: calc(var(--uib-stroke) / 2);\n background-color: var(--uib-color);\n animation: rotate var(--uib-speed) ease-in-out infinite;\n transition: background-color 0.3s ease;\n }\n .line:nth-child(1) {\n animation-delay: calc(var(--uib-speed) * -0.375);\n }\n .line:nth-child(2) {\n animation-delay: calc(var(--uib-speed) * -0.375);\n opacity: 0.8;\n }\n .line:nth-child(3) {\n animation-delay: calc(var(--uib-speed) * -0.3);\n opacity: 0.6;\n }\n .line:nth-child(4) {\n animation-delay: calc(var(--uib-speed) * -0.225);\n opacity: 0.4;\n }\n .line:nth-child(5) {\n animation-delay: calc(var(--uib-speed) * -0.15);\n opacity: 0.2;\n }\n .line:nth-child(6) {\n animation-delay: calc(var(--uib-speed) * -0.075);\n opacity: 0.1;\n }\n @keyframes rotate {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(180deg);\n }\n }\n .animate-fade-in {\n animation: fadeIn 0.5s ease-in-out;\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "})]})})},Ux="/segments",Vx="/automations",Bx="/channel/senders",Kx="/communication-groups",Hx="/stripo",Wx=async(e,t)=>(await Ja(`${Vx}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data,Gx=e=>{const t=ne(),n=ue({queryKey:["automations",e],queryFn:()=>(async e=>(await Ja(`${Vx}/${e}`)).data)(e)});return{automation:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchAutomation:n.refetch,invalidateAutomation:()=>t.invalidateQueries({queryKey:["automations",e]})}},Yx=e=>{const t=ue({queryKey:["automations",e,"recipients"],queryFn:()=>(async e=>(await Ja(`${Vx}/${e}/recipients`)).data)(e)});return{recipients:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomationRecipients:t.refetch}},Qx=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(Vx,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["automations"]})}});return{createAutomation:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess}},Xx=e=>{const t=ne(),n=de({mutationFn:t=>Wx(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["automations"]}),t.invalidateQueries({queryKey:["automations",e]})}});return{updateAutomation:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}},Jx=e=>{const t=ue({queryKey:["automations",e,"statistics"],queryFn:()=>(async e=>{if(e)return(await Ja(`${Vx}/${e}/statistics`)).data;return(await Ja(`${Vx}/statistics`)).data})(e)});return{statistics:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error}};var Zx=(e=>(e.ONE_TIME="one_time",e))(Zx||{}),ew=(e=>(e.DRAFT="draft",e.ACTIVE="active",e.RUNNING="running",e.COMPLETED="completed",e.FAILED="failed",e.DEACTIVATED="deactivated",e))(ew||{});const tw={CloseButton:Fd,DropdownMenuTrigger:ud,UserIcon:Ad,UsersIcon:Ld,UserEdit:Od,ScheduleButton:ld,SendButton:_d,BackButton:dd,NextButton:hd,MergeField:Rd,PlusIcon:Pd,AlertCircleIcon:md,OneTimeBroadcast:kd,PatronEntersList:xd,DateMilestone:ld,RealtimeActivity:ad,EmailIcon:Sd,SmsIcon:Ed,MessagesSent:wd,LinksClicked:Td,OpenRate:yd,SpamComplies:Md,TotalBounceRate:Md,UnsubscribeRate:Dd},nw=e=>({...tw,...e||{}});var rw=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(sw);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(ow,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(ow,{...o,ref:n,children:r})}));rw.displayName="Slot";var ow=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));ow.displayName="SlotClone";var iw=({children:e})=>t.jsx(t.Fragment,{children:e});function sw(e){return i.isValidElement(e)&&e.type===iw}const aw=nd(["reach-styles-module__base___gfFyc"],{variants:{variant:{default:"reach-styles-module__default___ny1h7",destructive:"reach-styles-module__destructive___XjBvS",outline:"reach-styles-module__outline___gFp3i",secondary:"reach-styles-module__secondary___Pd-e3",ghost:"reach-styles-module__ghost___GcnJq",link:"reach-styles-module__link___EgS2H"},size:{default:"reach-styles-module__sizeDefault___8kU5A",sm:"reach-styles-module__sizeSm___zPIEh",lg:"reach-styles-module__sizeLg___D2G8z",icon:"reach-styles-module__sizeIcon___5XkYW"}},defaultVariants:{variant:"default",size:"default"}}),lw=i.forwardRef((({className:e,variant:n,size:r,asChild:o=!1,...i},s)=>t.jsx(o?rw:"button",{className:Dh(aw({variant:n,size:r,className:e})),ref:s,...i})));lw.displayName="Button";var cw=(e=>(e.ChooseAutomationType="choose-automation-type",e.SetAutomationName="set-automation-name",e))(cw||{});const uw=({onClose:e,currentStep:n,setCurrentStep:r,isDisabled:o,createAutomation:i})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx(lw,{variant:"secondary",className:"px-4 py-2",onClick:()=>{if(n===cw.ChooseAutomationType)e?.(!1);else{if(n!==cw.SetAutomationName)throw new Error("Invalid step");r(cw.ChooseAutomationType)}},children:n===cw.ChooseAutomationType?"Cancel":"Back"}),t.jsx(lw,{className:"px-4 py-2",onClick:()=>{o||n!==cw.SetAutomationName||i()},disabled:o,children:n===cw.SetAutomationName?"Create":"Next"})]})}),dw=({onClick:e,title:n,subtitle:r,icon:o,selected:i,disabled:s=!1})=>t.jsxs("button",{onClick:e,className:"flex flex-col items-center justify-center rounded-lg border-[3px] p-4 transition-all duration-300 ease-in-out "+(s?"opacity-50 cursor-not-allowed":i?"scale-[1.02] hover:scale-[1.04] [border-color:hsl(var(--reach-primary))] [background-color:hsl(var(--reach-primary)/0.05)]":"border-gray-200 hover:[border-color:hsl(var(--reach-primary))] hover:bg-gray-50"),children:[o,t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-sm font-medium text-gray-900",children:n}),t.jsx("div",{className:"text-xs text-gray-500",children:r})]})]}),hw="text-3xl mb-8",fw="grid grid-cols-2 gap-6",pw="relative p-6 rounded-lg",mw=({onNext:e,iconDefinitions:n})=>t.jsxs("div",{className:pw,children:[t.jsx("h1",{className:hw,children:"Choose Your Automation Type"}),t.jsxs("div",{className:fw,children:[t.jsx(dw,{onClick:()=>{e(Zx.ONE_TIME)},title:"One-Time Broadcast",subtitle:"Send a single message to your current list, like announcing a sale or newsletter.",icon:t.jsx(n.OneTimeBroadcast,{}),selected:!1}),t.jsx(dw,{onClick:()=>{},title:"Patron Enters a List",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.PatronEntersList,{}),selected:!1,disabled:!0}),t.jsx(dw,{onClick:()=>{},title:"Date Milestone",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.DateMilestone,{}),selected:!1,disabled:!0}),t.jsx(dw,{onClick:()=>{},title:"Realtime Activity",subtitle:"Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria.",icon:t.jsx(n.RealtimeActivity,{}),selected:!1,disabled:!0})]})]});function gw(e,t){throw new Error(`Unreachable case statement: ${JSON.stringify(e)}. Valid values are: ${Object.values(t).join(", ")}`)}const vw="mb-4 flex items-center justify-center",yw="text-lg font-medium mb-2",bw="text-sm text-gray-600",xw=({iconDefinitions:e})=>t.jsxs("div",{children:[t.jsx("div",{className:vw,children:t.jsx(e.OneTimeBroadcast,{})}),t.jsx("h3",{className:yw,children:"One-Time Broadcast"}),t.jsx("p",{className:bw,children:"Send a single message to your current list, like announcing a sale or newsletter."})]}),ww=({selectedType:e,setAutomationName:n,automationName:r,iconDefinitions:o})=>t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 max-w-lg mx-auto",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Name Your Automation"}),t.jsxs("div",{className:"w-full space-y-4",children:[t.jsx("div",{className:"bg-gray-50 p-4 rounded-lg items-center justify-center text-center",children:(()=>{if(e===Zx.ONE_TIME)return t.jsx(xw,{iconDefinitions:o});throw gw(e,Zx)})()}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"automationName",className:"block text-sm font-medium text-gray-700",children:"Automation Name"}),t.jsx("input",{id:"automationName",type:"text",value:r,onChange:e=>n(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-indigo-500 focus:border-indigo-500 shadow-sm",placeholder:"Enter a descriptive name...",autoFocus:!0}),t.jsx("p",{className:"text-sm text-gray-500",children:"This name is for your internal reference only - your customers won't see it"})]})]})]}),Sw=({onClose:e,iconDefinitions:r})=>{const{createAutomation:o,isCreating:i}=Qx(),[s,a]=n.useState(!1),l=nw(r),[c,u]=n.useState(cw.ChooseAutomationType),[d,h]=n.useState({name:void 0,type:void 0}),f=void 0!==d.name&&void 0!==d.type;n.useEffect((()=>{if(d.type&&!d.name){const e=new Date,t=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=`Campaign ${e.toLocaleDateString([],{month:"long",day:"numeric"})} ${t}`;h((e=>({...e,name:n})))}}),[d]);return i||s?t.jsx("div",{className:pw,children:t.jsx(zx,{text:["Creating Automation","Finishing up"]})}):t.jsxs("div",{className:"relative overflow-hidden",children:[t.jsxs(Zh,{mode:"wait",children:[c===cw.ChooseAutomationType&&t.jsx($x,{children:t.jsx(mw,{onNext:e=>{h({...d,type:e}),u(cw.SetAutomationName)},iconDefinitions:l})},"choose-automation-type"),c===cw.SetAutomationName&&d.type&&t.jsx($x,{children:t.jsx(ww,{iconDefinitions:l,selectedType:d.type,setAutomationName:e=>{h({...d,name:e})},automationName:d.name??""})},"set-automation-name")]}),t.jsx("div",{className:"pt-2",children:t.jsx(uw,{onClose:e,currentStep:c,setCurrentStep:u,isDisabled:!f,createAutomation:async()=>{if(!f||!d.name||!d.type)return;a(!0);o({name:d.name,type:d.type},{onSuccess:t=>{e?.(t.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{h({name:void 0,type:void 0})}})}})})]})};var Cw={};Object.defineProperty(Cw,"__esModule",{value:!0}),Cw.parse=function(e,t){const n=new Nw,r=e.length;if(r<2)return n;const o=t?.decode||Mw;let i=0;do{const t=e.indexOf("=",i);if(-1===t)break;const s=e.indexOf(";",i),a=-1===s?r:s;if(t>a){i=e.lastIndexOf(";",t-1)+1;continue}const l=_w(e,i,t),c=Dw(e,t,l),u=e.slice(l,c);if(void 0===n[u]){let r=_w(e,t+1,a),i=Dw(e,a,r);const s=o(e.slice(r,i));n[u]=s}i=a+1}while(i<r);return n},Cw.serialize=function(e,t,n){const r=n?.encode||encodeURIComponent;if(!kw.test(e))throw new TypeError(`argument name is invalid: ${e}`);const o=r(t);if(!Ew.test(o))throw new TypeError(`argument val is invalid: ${t}`);let i=e+"="+o;if(!n)return i;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);i+="; Max-Age="+n.maxAge}if(n.domain){if(!jw.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);i+="; Domain="+n.domain}if(n.path){if(!Tw.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);i+="; Path="+n.path}if(n.expires){if(!function(e){return"[object Date]"===Pw.call(e)}
|
|
34
34
|
/**
|
|
35
35
|
* react-router v7.1.0
|
|
36
36
|
*
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* LICENSE.md file in the root directory of this source tree.
|
|
41
41
|
*
|
|
42
42
|
* @license MIT
|
|
43
|
-
*/(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);i+="; Expires="+n.expires.toUTCString()}n.httpOnly&&(i+="; HttpOnly");n.secure&&(i+="; Secure");n.partitioned&&(i+="; Partitioned");if(n.priority){switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}}if(n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}}return i};const kw=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Ew=/^[\u0021-\u003A\u003C-\u007E]*$/,jw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Tw=/^[\u0020-\u003A\u003D-\u007E]*$/,Pw=Object.prototype.toString,Nw=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function _w(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Dw(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Mw(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(nQ){return e}}function Ow(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=l(null==r?t.length-1:r),s="POP",a=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function u(e,n=null,r){let o=function(e,t,n=null,r){let o={pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?Fw(t):t,state:n,key:t&&t.key||r||Lw()};return o}(t?c().pathname:"/",e,n,r);return Aw("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:Iw(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?Fw(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){s="PUSH";let r=u(e,n);i+=1,t.splice(i,t.length,r),o&&a&&a({action:s,location:r,delta:1})},replace(e,n){s="REPLACE";let r=u(e,n);t[i]=r,o&&a&&a({action:s,location:r,delta:0})},go(e){s="POP";let n=l(i+e);i=n,a&&a({action:s,location:t[n],delta:e})},listen:e=>(a=e,()=>{a=null})}}function Rw(e,t){if(!1===e||null==e)throw new Error(t)}function Aw(e,t){if(!e)try{throw new Error(t)}catch(nQ){}}function Lw(){return Math.random().toString(36).substring(2,10)}function Iw({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function Fw(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function $w(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?Fw(t):t,i=Zw(o.pathname||"/",n);if(null==i)return null;let s=qw(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(s);let a=null;for(let l=0;null==a&&l<s.length;++l){let e=Jw(i);a=Qw(s[l],e,r)}return a}(e,t,n,!1)}function qw(e,t=[],n=[],r=""){let o=(e,o,i)=>{let s={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};s.relativePath.startsWith("/")&&(Rw(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length));let a=rS([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(Rw(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),qw(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:Yw(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of zw(e.path))o(e,t,n);else o(e,t)})),t}function zw(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let s=zw(r.join("/")),a=[];return a.push(...s.map((e=>""===e?i:[i,e].join("/")))),o&&a.push(...s),a.map((t=>e.startsWith("/")&&""===t?"/":t))}var Uw=/^:[\w-]+$/,Vw=3,Bw=2,Kw=1,Hw=10,Ww=-2,Gw=e=>"*"===e;function Yw(e,t){let n=e.split("/"),r=n.length;return n.some(Gw)&&(r+=Ww),t&&(r+=Bw),n.filter((e=>!Gw(e))).reduce(((e,t)=>e+(Uw.test(t)?Vw:""===t?Kw:Hw)),r)}function Qw(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a<r.length;++a){let e=r[a],l=a===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Xw({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Xw({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:rS([i,u.pathname]),pathnameBase:oS(rS([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=rS([i,u.pathnameBase]))}return s}function Xw(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Aw("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:n},r)=>{if("*"===t){s=i.slice(0,i.length-(a[r]||"").length).replace(/(.)\/+$/,"$1")}const o=a[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:s,pattern:e}}function Jw(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Aw(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Zw(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function eS(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function tS(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function nS(e,t,n,r=!1){let o;"string"==typeof e?o=Fw(e):(o={...e},Rw(!o.pathname||!o.pathname.includes("?"),eS("?","pathname","search",o)),Rw(!o.pathname||!o.pathname.includes("#"),eS("#","pathname","hash",o)),Rw(!o.search||!o.search.includes("#"),eS("#","search","hash",o)));let i,s=""===e||""===o.pathname,a=s?"/":o.pathname;if(null==a)i=n;else{let e=t.length-1;if(!r&&a.startsWith("..")){let t=a.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:n,search:r="",hash:o=""}="string"==typeof e?Fw(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:iS(r),hash:sS(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var rS=e=>e.join("/").replace(/\/\/+/g,"/"),oS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iS=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",sS=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var aS=["POST","PUT","PATCH","DELETE"];new Set(aS);var lS=["GET",...aS];new Set(lS);var cS=i.createContext(null);cS.displayName="DataRouter";var uS=i.createContext(null);uS.displayName="DataRouterState";var dS=i.createContext({isTransitioning:!1});dS.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var hS=i.createContext(null);hS.displayName="Navigation";var fS=i.createContext(null);fS.displayName="Location";var pS=i.createContext({outlet:null,matches:[],isDataRoute:!1});pS.displayName="Route";var mS=i.createContext(null);function gS(){return null!=i.useContext(fS)}function vS(){return Rw(gS(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(fS).location}mS.displayName="RouteError";var yS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bS(e){i.useContext(hS).static||i.useLayoutEffect(e)}function xS(){let{isDataRoute:e}=i.useContext(pS);return e?function(){let{router:e}=function(e){let t=i.useContext(cS);return Rw(t,TS(e)),t}("useNavigate"),t=PS("useNavigate"),n=i.useRef(!1);return bS((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{Aw(n.current,yS),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){Rw(gS(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(cS),{basename:t,navigator:n}=i.useContext(hS),{matches:r}=i.useContext(pS),{pathname:o}=vS(),s=JSON.stringify(tS(r)),a=i.useRef(!1);return bS((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(Aw(a.current,yS),!a.current)return;if("number"==typeof r)return void n.go(r);let l=nS(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:rS([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function wS(e,{relative:t}={}){let{matches:n}=i.useContext(pS),{pathname:r}=vS(),o=JSON.stringify(tS(n));return i.useMemo((()=>nS(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function SS(e,t,n,r){Rw(gS(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(hS),{matches:a}=i.useContext(pS),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;{let e=h&&h.path||"";_S(u,!h||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}o=vS();let f=o.pathname||"/",p=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=$w(e,{pathname:p});Aw(h||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),Aw(null==m||void 0!==m[m.length-1].route.element||void 0!==m[m.length-1].route.Component||void 0!==m[m.length-1].route.lazy,`Matched leaf route at location "${o.pathname}${o.search}${o.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=function(e,t=[],n=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let r=e,o=n?.errors;if(null!=o){let e=r.findIndex((e=>e.route.id&&void 0!==o?.[e.route.id]));Rw(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,e+1))}let s=!1,a=-1;if(n)for(let i=0;i<r.length;i++){let e=r[i];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(a=i),e.route.id){let{loaderData:t,errors:o}=n,i=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!o||void 0===o[e.route.id]);if(e.route.lazy||i){s=!0,r=a>=0?r.slice(0,a+1):[r[0]];break}}}return r.reduceRight(((e,l,c)=>{let u,d=!1,h=null,f=null;n&&(u=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||kS,s&&(a<0&&0===c?(_S("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,f=null):a===c&&(d=!0,f=l.route.hydrateFallbackElement||null)));let p=t.concat(r.slice(0,c+1)),m=()=>{let t;return t=u?h:d?f:l.route.Component?i.createElement(l.route.Component,null):l.route.element?l.route.element:e,i.createElement(jS,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(ES,{location:n.location,revalidation:n.revalidation,component:h,error:u,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:rS([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:rS([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function CS(){let e=function(){let e=i.useContext(mS),t=function(e){let t=i.useContext(uS);return Rw(t,TS(e)),t}("useRouteError"),n=PS("useRouteError");if(void 0!==e)return e;return t.errors?.[n]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return a=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:o},n):null,a)}i.createContext(null);var kS=i.createElement(CS,null),ES=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?i.createElement(pS.Provider,{value:this.props.routeContext},i.createElement(mS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function jS({routeContext:e,match:t,children:n}){let r=i.useContext(cS);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(pS.Provider,{value:e},n)}function TS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function PS(e){let t=function(e){let t=i.useContext(pS);return Rw(t,TS(e)),t}(e),n=t.matches[t.matches.length-1];return Rw(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var NS={};function _S(e,t,n){t||NS[e]||(NS[e]=!0,Aw(!1,n))}function DS({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=Ow({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=o.current,[a,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback((e=>{i.startTransition((()=>l(e)))}),[l]);return i.useLayoutEffect((()=>s.listen(c)),[s,c]),i.createElement(MS,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function MS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){Rw(!gS(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=i.useMemo((()=>({basename:a,navigator:o,static:s,future:{}})),[a,o,s]);"string"==typeof n&&(n=Fw(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,p=i.useMemo((()=>{let e=Zw(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:h,key:f},navigationType:r}}),[a,c,u,d,h,f,r]);return Aw(null!=p,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==p?null:i.createElement(hS.Provider,{value:l},i.createElement(fS.Provider,{children:t,value:p}))}i.memo((function({routes:e,future:t,state:n}){return SS(e,0,n,t)}));var OS="get",RS="application/x-www-form-urlencoded";function AS(e){return null!=e&&"string"==typeof e.tagName}function LS(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}var IS=null;var FS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $S(e){return null==e||FS.has(e)?e:(Aw(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${RS}"`),null)}function qS(e,t){let n,r,o,i,s;if(function(e){return AS(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?Zw(s,t):null,n=e.getAttribute("method")||OS,o=$S(e.getAttribute("enctype"))||RS,i=new FormData(e)}else if(function(e){return AS(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return AS(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||s.getAttribute("action");if(r=a?Zw(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||OS,o=$S(e.getAttribute("formenctype"))||$S(s.getAttribute("enctype"))||RS,i=new FormData(s,e),!function(){if(null===IS)try{new FormData(document.createElement("form"),0),IS=!1}catch(nQ){IS=!0}return IS}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,r)}}else{if(AS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=OS,r=null,o=RS,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function zS(e,t){if(!1===e||null==e)throw new Error(t)}function US(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function VS(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce(((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return window.__reactRouterContext&&window,window.location.reload(),new Promise((()=>{}))}}(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(US).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function BS(e,t,n,r,o,i){let s=(e,t)=>!n[t]||e.route.id!==n[t].route.id,a=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===i?t.filter(((e,t)=>s(e,t)||a(e,t))):"data"===i?t.filter(((t,i)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(s(t,i)||a(t,i))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function KS(e,t){return n=e.map((e=>{let n=t.routes[e.route.id];if(!n)return[];let r=[n.module];return n.imports&&(r=r.concat(n.imports)),r})).flat(1),[...new Set(n)];var n}var HS=i.createContext(void 0);function WS(){let e=i.useContext(HS);return zS(e,"You must render this element inside a <HydratedRouter> element"),e}function GS(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YS({page:e,...t}){let{router:n}=function(){let e=i.useContext(cS);return zS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>$w(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(QS,{page:e,matches:r,...t}):null}function QS({page:e,matches:t,...n}){let r=vS(),{manifest:o,routeModules:s}=WS(),{loaderData:a,matches:l}=function(){let e=i.useContext(uS);return zS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>BS(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>BS(e,t,l,o,r,"assets")),[e,t,l,o,r]),d=i.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,i=!1;if(t.forEach((e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in a&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:n.add(e.route.id))})),0===n.size)return[];let l=function(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return t.pathname="/"===t.pathname?"_root.data":`${t.pathname.replace(/\/$/,"")}.data`,t}(e);return i&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[a,r,o,c,t,e,s]),h=i.useMemo((()=>KS(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=WS(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return VS(e,t,n).then((e=>{r||o(e)})),()=>{r=!0}}),[e,t,n]),r}(u);return i.createElement(i.Fragment,null,d.map((e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),h.map((e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),f.map((({key:e,link:t})=>i.createElement("link",{key:e,...t}))))}function XS(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}HS.displayName="FrameworkContext";var JS="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{JS&&(window.__reactRouterVersion="7.1.0")}catch(nQ){}var ZS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eC=i.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...h},f){let p,{basename:m}=i.useContext(hS),g="string"==typeof c&&ZS.test(c),v=!1;if("string"==typeof c&&g&&(p=c,JS))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=Zw(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:v=!0}catch(nQ){Aw(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=function(e,{relative:t}={}){Rw(gS(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(hS),{hash:o,pathname:s,search:a}=wS(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:rS([n,s])),r.createHref({pathname:l,search:a,hash:o})}(c,{relative:r}),[b,x,w]=function(e,t){let n=i.useContext(HS),[r,o]=i.useState(!1),[s,a]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=t,f=i.useRef(null);i.useEffect((()=>{if("render"===e&&a(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{a(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),i.useEffect((()=>{if(r){let e=setTimeout((()=>{a(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let p=()=>{o(!0)},m=()=>{o(!1),a(!1)};return n?"intent"!==e?[s,f,{}]:[s,f,{onFocus:GS(l,p),onBlur:GS(c,m),onMouseEnter:GS(u,p),onMouseLeave:GS(d,m),onTouchStart:GS(h,p)}]:[!1,f,{}]}(n,h),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=xS(),c=vS(),u=wS(e,{relative:s});return i.useCallback((i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==n?n:Iw(c)===Iw(u);l(e,{replace:t,state:r,preventScrollReset:o,relative:s,viewTransition:a})}}),[c,l,u,n,r,t,e,o,s,a])}(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,viewTransition:d});let C=i.createElement("a",{...h,...w,href:p||y,onClick:v||o?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:XS(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(YS,{page:y})):C}));function tC(e){let t=i.useContext(cS);return Rw(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}function nC(e){Aw("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(LS(e)),n=i.useRef(!1),r=vS(),o=i.useMemo((()=>function(e,t){let n=LS(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),s=xS(),a=i.useCallback(((e,t)=>{const r=LS("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}eC.displayName="Link",i.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:s,viewTransition:a,children:l,...c},u){let d=wS(s,{relative:c.relative}),h=vS(),f=i.useContext(uS),{navigator:p,basename:m}=i.useContext(hS),g=null!=f&&function(e,t={}){let n=i.useContext(dS);Rw(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=tC("useViewTransitionState"),o=wS(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Zw(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Zw(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=Xw(o.pathname,a)||null!=Xw(o.pathname,s)}(d)&&!0===a,v=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,y=h.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&m&&(b=Zw(b,m)||b);const x="/"!==v&&v.endsWith("/")?v.length-1:v.length;let w,S=y===v||!r&&y.startsWith(v)&&"/"===y.charAt(x),C=null!=b&&(b===v||!r&&b.startsWith(v)&&"/"===b.charAt(v.length)),k={isActive:S,isPending:C,isTransitioning:g},E=S?e:void 0;w="function"==typeof n?n(k):[n,S?"active":null,C?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let j="function"==typeof o?o(k):o;return i.createElement(eC,{...c,"aria-current":E,className:w,ref:u,style:j,to:s,viewTransition:a},"function"==typeof l?l(k):l)})).displayName="NavLink",i.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:a=OS,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:h,...f},p)=>{let m=function(){let{router:e}=tC("useSubmit"),{basename:t}=i.useContext(hS),n=PS("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=qS(r,t);if(!1===o.navigate){let t=o.fetcherKey||oC();await e.fetch(t,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,n])}(),g=function(e,{relative:t}={}){let{basename:n}=i.useContext(hS),r=i.useContext(pS);Rw(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...wS(e||".",{relative:t})},a=vS();if(null==e){s.search=a.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();s.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(s.pathname="/"===s.pathname?n:rS([n,s.pathname]));return Iw(s)}(l,{relative:u}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof l&&ZS.test(l);return i.createElement("form",{ref:p,method:v,action:g,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||a;m(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:h})},...f,"data-discover":y||"render"!==e?void 0:"true"})})).displayName="Form";var rC=0,oC=()=>`__${String(++rC)}__`;new TextEncoder;const iC=({tabs:e,activeTab:r,onTabChange:o,actionButton:i,tabsLocation:s="left"})=>{const[a,l]=n.useState(i?.label||""),[c,u]=n.useState(!1),d=n.useRef([]),[h,f]=n.useState({width:0,left:0});return n.useEffect((()=>{const t=d.current[e.findIndex((e=>e.id===r))];t&&f({width:t.offsetWidth,left:t.offsetLeft})}),[r,e]),n.useEffect((()=>{if(i?.label){u(!0);const e=setTimeout((()=>{l(i.label),u(!1)}),200);return()=>clearTimeout(e)}}),[i?.label]),t.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100/50",children:[t.jsxs("div",{className:"relative flex items-center gap-8 "+("left"===s?"w-full justify-start":"w-full justify-center"),children:[t.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-gray-100/50 rounded-full"}),t.jsx("div",{className:"absolute bottom-0 h-[1px] rounded-full transition-all duration-300 ease-out\n bg-gradient-to-r from-primary to-primary/90\n shadow-[0_0_8px_rgba(var(--primary-rgb),0.3)]",style:{width:`${h.width}px`,left:`${h.left}px`}}),e.map(((e,n)=>t.jsx("button",{ref:e=>d.current[n]=e,onClick:()=>o(e.id),className:"relative px-1 py-3 text-lg transition-all duration-200 \n "+(r===e.id?"text-primary font-medium scale-102":"text-gray-500 hover:text-primary/70 hover:scale-102"),children:e.label},e.id)))]}),i&&t.jsx("div",{className:"relative z-10 pl-8 ml-8 border-l border-gray-100/50",children:t.jsx(lw,{onClick:i.onClick,className:"bg-primary hover:bg-primary/90 text-white shadow-sm hover:shadow-md transition-all duration-200",children:t.jsx("span",{className:`\n inline-block min-w-[80px] text-center\n transition-all duration-400 ease-in-out\n ${c?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}\n `,children:a})})})]}),t.jsx("div",{className:"relative min-h-[200px]",children:e.map((n=>t.jsx("div",{className:"absolute w-full transition-all duration-500 ease-in-out transform \n "+(r===n.id?"translate-x-0 opacity-100 pointer-events-auto":(e.findIndex((e=>e.id===n.id))<e.findIndex((e=>e.id===r))?"translate-x-[-100%]":"translate-x-[100%]")+" opacity-0 pointer-events-none"),children:n.content},n.id)))})]})};var sC=i["useId".toString()]||(()=>{}),aC=0;function lC(e){const[t,n]=i.useState(sC());return iu((()=>{n((e=>e??String(aC++)))}),[e]),e||(t?`radix-${t}`:"")}var cC=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(hC);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(uC,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(uC,{...o,ref:n,children:r})}));cC.displayName="Slot";var uC=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));uC.displayName="SlotClone";var dC=({children:e})=>t.jsx(t.Fragment,{children:e});function hC(e){return i.isValidElement(e)&&e.type===dC}var fC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?cC:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});var pC,mC="dismissableLayer.update",gC="dismissableLayer.pointerDownOutside",vC="dismissableLayer.focusOutside",yC=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bC=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(yC),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){wC(gC,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){wC(vC,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(pC=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),xC(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=pC)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),xC())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(mC,e),()=>document.removeEventListener(mC,e)}),[]),t.jsx(fC.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));bC.displayName="DismissableLayer";function xC(){const e=new CustomEvent(mC);document.dispatchEvent(e)}function wC(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(yC),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(fC.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var SC="focusScope.autoFocusOnMount",CC="focusScope.autoFocusOnUnmount",kC={bubbles:!1,cancelable:!0},EC=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:NC(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||NC(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&NC(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){_C.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(SC,kC);c.addEventListener(SC,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(NC(r,{select:t}),document.activeElement!==n)return}((e=jC(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&NC(c))}return()=>{c.removeEventListener(SC,d),setTimeout((()=>{const e=new CustomEvent(CC,kC);c.addEventListener(CC,h),c.dispatchEvent(e),e.defaultPrevented||NC(t??document.body,{select:!0}),c.removeEventListener(CC,h),_C.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=jC(e),n=TC(t,e),r=TC(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&NC(i,{select:!0})):(e.preventDefault(),r&&NC(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(fC.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function jC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function TC(e,t){for(const n of e)if(!PC(n,{upTo:t}))return n}function PC(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function NC(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}EC.displayName="FocusScope";var _C=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=DC(e,t),e.unshift(t)},remove(t){e=DC(e,t),e[0]?.resume()}}}();function DC(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var MC=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);iu((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(fC.div,{...s,ref:n}),c):null}));MC.displayName="Portal";var OC=0;function RC(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??AC()),document.body.insertAdjacentElement("beforeend",e[1]??AC()),OC++,()=>{1===OC&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),OC--}}),[])}function AC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var LC=function(){return LC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},LC.apply(this,arguments)};function IC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function FC(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var $C="right-scroll-bar-position",qC="width-before-scroll-bar";function zC(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var UC="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,VC=new WeakMap;function BC(e,t){var r=function(e,t){var r=n.useState((function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}}))[0];return r.callback=t,r.facade}(null,(function(t){return e.forEach((function(e){return zC(e,t)}))}));return UC((function(){var t=VC.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||zC(e,null)})),o.forEach((function(e){n.has(e)||zC(e,i)}))}VC.set(r,e)}),[e]),r}function KC(e){return e}function HC(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=KC);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=LC({async:!0,ssr:!1},e),t}var WC=function(e){var t=e.sideCar,n=IC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,LC({},n))};function GC(e,t){return e.useMedium(t),WC}WC.isSideCarExport=!0;var YC=HC(),QC=function(){},XC=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:QC,onWheelCapture:QC,onTouchMoveCapture:QC}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=e.gapMode,x=IC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=BC([n,t]),C=LC(LC({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:YC,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),LC(LC({},C),{ref:S})):i.createElement(y,LC({},C,{className:c,ref:S}),l))}));XC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},XC.classNames={fullWidth:qC,zeroRight:$C};function JC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ZC=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=JC())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ek=function(){var e,t=(e=ZC(),function(t,n){i.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){return t(e.styles,e.dynamic),null}},tk={left:0,top:0,right:0,gap:0},nk=function(e){return parseInt(e||"",10)||0},rk=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return tk;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[nk(t["padding"===e?"paddingLeft":"marginLeft"]),nk(n),nk(r)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ok=ek(),ik="data-scroll-locked",sk=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(ik,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat($C," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(qC," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat($C," .").concat($C," {\n right: 0 ").concat(r,";\n }\n \n .").concat(qC," .").concat(qC," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ik,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},ak=function(){var e=parseInt(document.body.getAttribute(ik)||"0",10);return isFinite(e)?e:0},lk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;i.useEffect((function(){return document.body.setAttribute(ik,(ak()+1).toString()),function(){var e=ak()-1;e<=0?document.body.removeAttribute(ik):document.body.setAttribute(ik,e.toString())}}),[]);var s=i.useMemo((function(){return rk(o)}),[o]);return i.createElement(ok,{styles:sk(s,!t,o,n?"":"!important")})},ck=!1;if("undefined"!=typeof window)try{var uk=Object.defineProperty({},"passive",{get:function(){return ck=!0,!0}});window.addEventListener("test",uk,uk),window.removeEventListener("test",uk,uk)}catch(oQ){ck=!1}var dk=!!ck&&{passive:!1},hk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},fk=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),pk(e,r)){var o=mk(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pk=function(e,t){return"v"===e?function(e){return hk(e,"overflowY")}(t):function(e){return hk(e,"overflowX")}(t)},mk=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},gk=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vk=function(e){return[e.deltaX,e.deltaY]},yk=function(e){return e&&"current"in e?e.current:e},bk=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},xk=0,wk=[];function Sk(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ck=GC(YC,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(xk++)[0],s=i.useState(ek)[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=FC([e.lockRef.current],(e.shards||[]).map(yk),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=gk(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=fk(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=fk(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=mk(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&pk(e,s)&&(u+=p,d+=f),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(wk.length&&wk[wk.length-1]===s){var r="deltaY"in n?vk(n):gk(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(yk).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:Sk(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=gk(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,vk(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,gk(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return wk.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,dk),document.addEventListener("touchmove",c,dk),document.addEventListener("touchstart",d,dk),function(){wk=wk.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,dk),document.removeEventListener("touchmove",c,dk),document.removeEventListener("touchstart",d,dk)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:bk(o)}):null,p?i.createElement(lk,{gapMode:e.gapMode}):null)}));var kk=i.forwardRef((function(e,t){return i.createElement(XC,LC({},e,{ref:t,sideCar:Ck}))}));kk.classNames=XC.classNames;var Ek=new WeakMap,jk=new WeakMap,Tk={},Pk=0,Nk=function(e){return e&&(e.host||Nk(e.parentNode))},_k=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Nk(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Tk[n]||(Tk[n]=new WeakMap);var i=Tk[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(Ek.get(e)||0)+1,c=(i.get(e)||0)+1;Ek.set(e,l),i.set(e,c),s.push(e),1===l&&o&&jk.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(nQ){}}))};return u(t),a.clear(),Pk++,function(){s.forEach((function(e){var t=Ek.get(e)-1,o=i.get(e)-1;Ek.set(e,t),i.set(e,o),t||(jk.has(e)||e.removeAttribute(r),jk.delete(e)),o||e.removeAttribute(n)})),--Pk||(Ek=new WeakMap,Ek=new WeakMap,jk=new WeakMap,Tk={})}},Dk=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),_k(r,o,n,"aria-hidden")):function(){return null}},Mk="Dialog",[Ok,Rk]=Lc(Mk),[Ak,Lk]=Ok(Mk),Ik=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d=!1,h]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(Ak,{scope:n,triggerRef:c,contentRef:u,contentId:lC(),titleId:lC(),descriptionId:lC(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};Ik.displayName=Mk;var Fk="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Fk,r),s=Ac(n,i.triggerRef);return t.jsx(fC.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rE(i.open),...o,ref:s,onClick:Mc(e.onClick,i.onOpenToggle)})})).displayName=Fk;var $k="DialogPortal",[qk,zk]=Ok($k,{forceMount:void 0}),Uk=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=Lk($k,n);return t.jsx(qk,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(au,{present:r||a.open,children:t.jsx(MC,{asChild:!0,container:s,children:e})})))})};Uk.displayName=$k;var Vk="DialogOverlay",Bk=i.forwardRef(((e,n)=>{const r=zk(Vk,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=Lk(Vk,e.__scopeDialog);return s.modal?t.jsx(au,{present:o||s.open,children:t.jsx(Kk,{...i,ref:n})}):null}));Bk.displayName=Vk;var Kk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Vk,r);return t.jsx(kk,{as:cC,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(fC.div,{"data-state":rE(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),Hk="DialogContent",Wk=i.forwardRef(((e,n)=>{const r=zk(Hk,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=Lk(Hk,e.__scopeDialog);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?Gk:Yk,{...i,ref:n})})}));Wk.displayName=Hk;var Gk=i.forwardRef(((e,n)=>{const r=Lk(Hk,e.__scopeDialog),o=i.useRef(null),s=Ac(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),t.jsx(Qk,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()))})})),Yk=i.forwardRef(((e,n)=>{const r=Lk(Hk,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(Qk,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),Qk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=Lk(Hk,r),u=i.useRef(null),d=Ac(n,u);return RC(),t.jsxs(t.Fragment,{children:[t.jsx(EC,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(bC,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rE(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(aE,{titleId:c.titleId}),t.jsx(lE,{contentRef:u,descriptionId:c.descriptionId})]})]})})),Xk="DialogTitle",Jk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Xk,r);return t.jsx(fC.h2,{id:i.titleId,...o,ref:n})}));Jk.displayName=Xk;var Zk="DialogDescription",eE=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Zk,r);return t.jsx(fC.p,{id:i.descriptionId,...o,ref:n})}));eE.displayName=Zk;var tE="DialogClose",nE=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(tE,r);return t.jsx(fC.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})}));function rE(e){return e?"open":"closed"}nE.displayName=tE;var oE="DialogTitleWarning",[iE,sE]=function(e,n){const r=i.createContext(n),o=e=>{const{children:n,...o}=e,s=i.useMemo((()=>o),Object.values(o));return t.jsx(r.Provider,{value:s,children:n})};return o.displayName=e+"Provider",[o,function(t){const o=i.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(oE,{contentName:Hk,titleName:Xk,docsSlug:"dialog"}),aE=({titleId:e})=>{const t=sE(oE);return i.useEffect((()=>{if(e){document.getElementById(e)}}),[`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`,e]),null},lE=({contentRef:e,descriptionId:t})=>{const n=sE("DialogDescriptionWarning");return i.useEffect((()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)}}),[`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`,e,t]),null},cE=Ik,uE=Uk,dE=Bk,hE=Wk,fE=Jk,pE=eE,mE=nE,gE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?rw:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{}),vE=i.forwardRef(((e,n)=>t.jsx(gE.span,{...e,ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));function yE(...e){return _h(Zu(e))}vE.displayName="VisuallyHidden";const bE=cE,xE=({...e})=>t.jsx(uE,{children:t.jsx("div",{"data-reach-root":!0,children:e.children})}),wE=i.forwardRef((({className:e,...n},r)=>t.jsx(dE,{ref:r,className:yE("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));wE.displayName=dE.displayName;const SE=i.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(xE,{children:[t.jsx(wE,{}),t.jsxs(hE,{ref:i,className:yE("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),onInteractOutside:e=>{e.composedPath().some((e=>"classList"in e&&Array.from(e.classList).includes("pac-item")))&&e.preventDefault()},...o,children:[n,!r&&t.jsxs(mE,{className:"absolute right-6 top-6 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(Fd,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));SE.displayName=hE.displayName;const CE=i.forwardRef((({className:e,...n},r)=>t.jsx(fE,{ref:r,className:yE("text-lg font-semibold leading-none tracking-tight",e),...n})));CE.displayName=fE.displayName;const kE=i.forwardRef((({className:e,...n},r)=>t.jsx(pE,{ref:r,className:yE("text-sm text-muted-foreground",e),...n})));kE.displayName=pE.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsx(vE,{ref:o,className:yE(e),...r,children:n}))).displayName="DialogVisuallyHidden";const EE=async e=>{const t=new URLSearchParams;e?.cursor&&t.append("cursor",e.cursor),e?.limit&&t.append("limit",e.limit.toString()),e?.search&&t.append("search",e.search);return(await Ja(`${Ux}${t.toString()?`?${t.toString()}`:""}`)).data},jE=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(Ux,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=ue({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await Ja(`${Ux}/conditions`,{method:"GET"})).data)()});return{createSegment:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess,segmentsConditions:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchSegmentsConditions:n.refetch}},TE=e=>{const t=ne(),n=ue({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await Ja(`${Ux}/count`,{method:"POST",body:JSON.stringify(e)})).data)(e)});return{data:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchCount:()=>{t.invalidateQueries({queryKey:["automations","recipients","count",e]})}}},PE=e=>{const t=ue({queryKey:["segments",e],queryFn:()=>(async e=>e?(await Ja(`${Ux}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},NE=e=>{const t=ne(),n=de({mutationFn:t=>(async(e,t)=>t?(await Ja(`${Ux}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data:null)(t,e),onSuccess:()=>{t.invalidateQueries({queryKey:["segments",e]})}});return{updateSegment:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}};var _E=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e))(_E||{}),DE=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(DE||{}),ME=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e))(ME||{});const OE=({onClose:e,setClickedCreate:n,isDisabled:r,createButtonText:o})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx(lw,{className:"px-4 py-2",onClick:()=>e?.(!1),variant:"destructive",children:"Cancel"}),t.jsx(lw,{className:"px-4 py-2",onClick:()=>{n(!0)},disabled:r,children:o})]})}),RE="reach-styles-module__container___6PQqs",AE=nd(["reach-styles-module__base___WFahB"],{variants:{variant:{default:"reach-styles-module__default___zeGU1",secondary:"reach-styles-module__secondary___VQ4iH",destructive:"reach-styles-module__destructive___RLaRD",outline:"reach-styles-module__outline___L2VtW",google:"reach-styles-module__google___HcEij",date:"reach-styles-module__date___-6BC4"},size:{default:"reach-styles-module__sizeDefault___iGTp4",sm:"reach-styles-module__sizeSm___6T2oK"},iconOnly:{true:"reach-styles-module__iconOnly___8vUSp",false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:"reach-styles-module__iconOnlySm___9ZKv9"}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}}),LE=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:Dh(AE({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));LE.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(RE,e),...n}))).displayName="BadgeContainer";var IE=.999,FE=/[\\\/_+.#"@\[\(\{&]/,$E=/[\\\/_+.#"@\[\(\{&]/g,qE=/[\s-]/,zE=/[\s-]/g;function UE(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?1:.99;var a=`${o},${i}`;if(void 0!==s[a])return s[a];for(var l,c,u,d,h=r.charAt(i),f=n.indexOf(h,o),p=0;f>=0;)(l=UE(e,t,n,r,f+1,i+1,s))>p&&(f===o?l*=1:FE.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match($E))&&o>0&&(l*=Math.pow(IE,u.length))):qE.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(zE))&&o>0&&(l*=Math.pow(IE,d.length))):(l*=.17,o>0&&(l*=Math.pow(IE,f-o))),e.charAt(f)!==t.charAt(i)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(.1*(c=UE(e,t,n,r,f+1,i+2,s))>l&&(l=.1*c)),l>p&&(p=l),f=n.indexOf(h,f+1);return s[a]=p,p}function VE(e){return e.toLowerCase().replace(zE," ")}function BE(e,t,n){return UE(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,VE(e),VE(t),0,0,{})}function KE(){return KE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KE.apply(null,arguments)}function HE(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function WE(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function GE(...e){return n.useCallback(WE(...e),e)}function YE(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=r.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return n.useMemo((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return r.scopeName=t.scopeName,r}const QE=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{},XE=i["useId".toString()]||(()=>{});let JE=0;function ZE(e){const[t,n]=i.useState(XE());return QE((()=>{n((e=>null!=e?e:String(JE++)))}),[e]),e||(t?`radix-${t}`:"")}function ej(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function tj({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,i]=function({defaultProp:e,onChange:t}){const r=n.useState(e),[o]=r,i=n.useRef(o),s=ej(t);return n.useEffect((()=>{i.current!==o&&(s(o),i.current=o)}),[o,i,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,a=s?e:o,l=ej(r);return[a,n.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else i(t)}),[s,e,i,l])]}const nj=n.forwardRef(((e,t)=>{const{children:r,...o}=e,i=n.Children.toArray(r),s=i.find(ij);if(s){const e=s.props.children,r=i.map((t=>t===s?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t));return n.createElement(rj,KE({},o,{ref:t}),n.isValidElement(e)?n.cloneElement(e,void 0,r):null)}return n.createElement(rj,KE({},o,{ref:t}),r)}));nj.displayName="Slot";const rj=n.forwardRef(((e,t)=>{const{children:r,...o}=e;return n.isValidElement(r)?n.cloneElement(r,{...sj(o,r.props),ref:t?WE(t,r.ref):r.ref}):n.Children.count(r)>1?n.Children.only(null):null}));rj.displayName="SlotClone";const oj=({children:e})=>n.createElement(n.Fragment,null,e);function ij(e){return n.isValidElement(e)&&e.type===oj}function sj(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const aj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const r=n.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?nj:t;return n.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),n.createElement(s,KE({},i,{ref:r}))}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function lj(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const cj="dismissableLayer.update",uj="dismissableLayer.pointerDownOutside",dj="dismissableLayer.focusOutside";let hj;const fj=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pj=n.forwardRef(((e,t)=>{var r;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=n.useContext(fj),[h,f]=n.useState(null),p=null!==(r=null==h?void 0:h.ownerDocument)&&void 0!==r?r:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,m]=n.useState({}),g=GE(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=lj(e),o=n.useRef(!1),i=n.useRef((()=>{}));return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let n=function(){gj(uj,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);o.current=!1},n=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}}),[t,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=lj(e),o=n.useRef(!1);return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){gj(dj,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=lj(e);n.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[r,t])}((e=>{x===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),n.useEffect((()=>{if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(hj=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),mj(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=hj)}}),[h,p,o,d]),n.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),mj())}),[h,d]),n.useEffect((()=>{const e=()=>m({});return document.addEventListener(cj,e),()=>document.removeEventListener(cj,e)}),[]),n.createElement(aj.div,KE({},u,{ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:HE(e.onFocusCapture,k.onFocusCapture),onBlurCapture:HE(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:HE(e.onPointerDownCapture,C.onPointerDownCapture)}))}));function mj(){const e=new CustomEvent(cj);document.dispatchEvent(e)}function gj(e,t,n,{discrete:o}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync((()=>e.dispatchEvent(t)))}(i,s):i.dispatchEvent(s)}function vj(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const yj="focusScope.autoFocusOnMount",bj="focusScope.autoFocusOnUnmount",xj={bubbles:!1,cancelable:!0},wj=n.forwardRef(((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[l,c]=n.useState(null),u=vj(i),d=vj(s),h=n.useRef(null),f=GE(t,(e=>c(e))),p=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect((()=>{if(o){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:Ej(h.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Ej(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Ej(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,l,p.paused]),n.useEffect((()=>{if(l){jj.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(yj,xj);l.addEventListener(yj,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ej(r,{select:t}),document.activeElement!==n)return}((e=Sj(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Ej(l))}return()=>{l.removeEventListener(yj,u),setTimeout((()=>{const e=new CustomEvent(bj,xj);l.addEventListener(bj,d),l.dispatchEvent(e),e.defaultPrevented||Ej(null!=t?t:document.body,{select:!0}),l.removeEventListener(bj,d),jj.remove(p)}),0)}}var e}),[l,u,d,p]);const m=n.useCallback((e=>{if(!r&&!o)return;if(p.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=Sj(e),n=Cj(t,e),r=Cj(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&Ej(i,{select:!0})):(e.preventDefault(),r&&Ej(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,p.paused]);return n.createElement(aj.div,KE({tabIndex:-1},a,{ref:f,onKeyDown:m}))}));function Sj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function Cj(e,t){for(const n of e)if(!kj(n,{upTo:t}))return n}function kj(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Ej(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const jj=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Tj(e,t),e.unshift(t)},remove(t){var n;e=Tj(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Tj(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const Pj=n.forwardRef(((e,t)=>{var o;const{container:i=(null===globalThis||void 0===globalThis||null===(o=globalThis.document)||void 0===o?void 0:o.body),...s}=e;return i?r.createPortal(n.createElement(aj.div,KE({},s,{ref:t})),i):null})),Nj=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{};const _j=e=>{const{present:t,children:o}=e,i=function(e){const[t,o]=n.useState(),i=n.useRef({}),s=n.useRef(e),a=n.useRef("none"),l=e?"mounted":"unmounted",[c,u]=function(e,t){return n.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect((()=>{const e=Dj(i.current);a.current="mounted"===c?e:"none"}),[c]),Nj((()=>{const t=i.current,n=s.current;if(n!==e){const r=a.current,o=Dj(t);if(e)u("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))u("UNMOUNT");else{u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=e}}),[e,u]),Nj((()=>{if(t){const e=e=>{const n=Dj(i.current).includes(e.animationName);e.target===t&&n&&r.flushSync((()=>u("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=Dj(i.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback((e=>{e&&(i.current=getComputedStyle(e)),o(e)}),[])}}(t),s="function"==typeof o?o({present:i.isPresent}):n.Children.only(o),a=GE(i.ref,s.ref);return"function"==typeof o||i.isPresent?n.cloneElement(s,{ref:a}):null};function Dj(e){return(null==e?void 0:e.animationName)||"none"}_j.displayName="Presence";let Mj=0;function Oj(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Rj=HC(),Aj=function(){},Lj=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:Aj,onWheelCapture:Aj,onTouchMoveCapture:Aj}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=IC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,w=BC([n,t]),S=LC(LC({},b),o);return i.createElement(i.Fragment,null,d&&i.createElement(x,{sideCar:Rj,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n}),a?i.cloneElement(i.Children.only(l),LC(LC({},S),{ref:w})):i.createElement(y,LC({},S,{className:c,ref:w}),l))}));Lj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Lj.classNames={fullWidth:qC,zeroRight:$C};var Ij=!1;if("undefined"!=typeof window)try{var Fj=Object.defineProperty({},"passive",{get:function(){return Ij=!0,!0}});window.addEventListener("test",Fj,Fj),window.removeEventListener("test",Fj,Fj)}catch(oQ){Ij=!1}var $j=!!Ij&&{passive:!1},qj=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},zj=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Uj(e,n)){var r=Vj(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Uj=function(e,t){return"v"===e?function(e){return qj(e,"overflowY")}(t):function(e){return qj(e,"overflowX")}(t)},Vj=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Bj=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kj=function(e){return[e.deltaX,e.deltaY]},Hj=function(e){return e&&"current"in e?e.current:e},Wj=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Gj=0,Yj=[];const Qj=GC(Rj,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(Gj++)[0],s=i.useState((function(){return ek()}))[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=FC([e.lockRef.current],(e.shards||[]).map(Hj),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var o,i=Bj(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=zj(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=zj(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=Vj(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&Uj(e,s)&&(u+=p,d+=f),s=s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return c&&0===u?l=!0:c||0!==d||(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(Yj.length&&Yj[Yj.length-1]===s){var r="deltaY"in n?Kj(n):Bj(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(Hj).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=Bj(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,Kj(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,Bj(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return Yj.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,$j),document.addEventListener("touchmove",c,$j),document.addEventListener("touchstart",d,$j),function(){Yj=Yj.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,$j),document.removeEventListener("touchmove",c,$j),document.removeEventListener("touchstart",d,$j)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:Wj(o)}):null,p?i.createElement(lk,{gapMode:"margin"}):null)}));var Xj=i.forwardRef((function(e,t){return i.createElement(Lj,LC({},e,{ref:t,sideCar:Qj}))}));Xj.classNames=Lj.classNames;const Jj="Dialog",[Zj,eT]=function(e,t=[]){let r=[];const o=()=>{const t=r.map((e=>n.createContext(e)));return function(r){const o=(null==r?void 0:r[e])||t;return n.useMemo((()=>({[`__scope${e}`]:{...r,[e]:o}})),[r,o])}};return o.scopeName=e,[function(t,o){const i=n.createContext(o),s=r.length;function a(t){const{scope:r,children:o,...a}=t,l=(null==r?void 0:r[e][s])||i,c=n.useMemo((()=>a),Object.values(a));return n.createElement(l.Provider,{value:c},o)}return r=[...r,o],a.displayName=t+"Provider",[a,function(r,a){const l=n.useContext((null==a?void 0:a[e][s])||i);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},YE(o,...t)]}(Jj),[tT,nT]=Zj(Jj),rT="DialogPortal",[oT,iT]=Zj(rT,{forceMount:void 0}),sT="DialogOverlay",aT=n.forwardRef(((e,t)=>{const r=iT(sT,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nT(sT,e.__scopeDialog);return s.modal?n.createElement(_j,{present:o||s.open},n.createElement(lT,KE({},i,{ref:t}))):null})),lT=n.forwardRef(((e,t)=>{const{__scopeDialog:r,...o}=e,i=nT(sT,r);return n.createElement(Xj,{as:nj,allowPinchZoom:!0,shards:[i.contentRef]},n.createElement(aj.div,KE({"data-state":mT(i.open)},o,{ref:t,style:{pointerEvents:"auto",...o.style}})))})),cT="DialogContent",uT=n.forwardRef(((e,t)=>{const r=iT(cT,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nT(cT,e.__scopeDialog);return n.createElement(_j,{present:o||s.open},n.createElement(s.modal?dT:hT,KE({},i,{ref:t})))})),dT=n.forwardRef(((e,t)=>{const r=nT(cT,e.__scopeDialog),o=n.useRef(null),i=GE(t,r.contentRef,o);return n.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),n.createElement(fT,KE({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:HE(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=r.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:HE(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:HE(e.onFocusOutside,(e=>e.preventDefault()))}))})),hT=n.forwardRef(((e,t)=>{const r=nT(cT,e.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return n.createElement(fT,KE({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,s;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),t.defaultPrevented)||(o.current||null===(s=r.triggerRef.current)||void 0===s||s.focus(),t.preventDefault());o.current=!1,i.current=!1},onInteractOutside:t=>{var n,s;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));(null===(s=r.triggerRef.current)||void 0===s?void 0:s.contains(t.target))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}}))})),fT=n.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,l=nT(cT,r),c=GE(t,n.useRef(null));return n.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Oj()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Oj()),Mj++,()=>{1===Mj&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Mj--}}),[]),n.createElement(n.Fragment,null,n.createElement(wj,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s},n.createElement(pj,KE({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":mT(l.open)},a,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)})),pT="DialogTitle";function mT(e){return e?"open":"closed"}!function(e,t){const r=n.createContext(t);function o(e){const{children:t,...o}=e,i=n.useMemo((()=>o),Object.values(o));return n.createElement(r.Provider,{value:i},t)}o.displayName=e+"Provider"}("DialogTitleWarning",{contentName:cT,titleName:pT,docsSlug:"dialog"});const gT=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=n.useRef(null),c=n.useRef(null),[u=!1,d]=tj({prop:o,defaultProp:i,onChange:s});return n.createElement(tT,{scope:t,triggerRef:l,contentRef:c,contentId:ZE(),titleId:ZE(),descriptionId:ZE(),open:u,onOpenChange:d,onOpenToggle:n.useCallback((()=>d((e=>!e))),[d]),modal:a},r)},vT=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:i}=e,s=nT(rT,t);return n.createElement(oT,{scope:t,forceMount:r},n.Children.map(o,(e=>n.createElement(_j,{present:r||s.open},n.createElement(Pj,{asChild:!0,container:i},e)))))},yT=aT,bT=uT;var xT='[cmdk-group=""]',wT='[cmdk-group-items=""]',ST='[cmdk-item=""]',CT=`${ST}:not([aria-disabled="true"])`,kT="cmdk-item-select",ET="data-value",jT=(e,t,n)=>BE(e,t,n),TT=i.createContext(void 0),PT=()=>i.useContext(TT),NT=i.createContext(void 0),_T=()=>i.useContext(NT),DT=i.createContext(void 0),MT=i.forwardRef(((e,t)=>{let n=HT((()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}})),r=HT((()=>new Set)),o=HT((()=>new Map)),s=HT((()=>new Map)),a=HT((()=>new Set)),l=BT(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=i.useId(),x=i.useId(),w=i.useId(),S=i.useRef(null),C=QT();KT((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),KT((()=>{C(6,_)}),[]);let k=i.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)N(),T(),C(1,P);else if("value"===e&&(r||C(5,_),void 0!==(null==(o=l.current)?void 0:o.value))){return void(null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:""))}k.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),E=i.useMemo((()=>({value:(e,t,r)=>{var o;t!==(null==(o=s.current.get(e))?void 0:o.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,j(t,r)),C(2,(()=>{T(),k.emit()})))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{N(),T(),n.current.value||P(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{N(),(null==t?void 0:t.getAttribute("id"))===e&&P(),k.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:g,listId:b,inputId:w,labelId:x,listInnerRef:S})),[]);function j(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:jT;return e?i(e,n.current.search,t):0}function T(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach((n=>{let r=o.current.get(n),i=0;r.forEach((t=>{let n=e.get(t);i=Math.max(n,i)})),t.push([n,i])}));let r=S.current;M().sort(((t,n)=>{var r,o;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(wT);t?t.appendChild(e.parentElement===t?e:e.closest(`${wT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${wT} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=S.current.querySelector(`${xT}[${ET}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)}))}function P(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(ET);k.setState("value",t||void 0)}function N(){var e,t,i,a;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=j(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(i=s.current.get(o))?void 0:i.keywords)?a:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[r,s]of o.current)for(let e of s)if(n.current.filtered.items.get(e)>0){n.current.filtered.groups.add(r);break}n.current.filtered.count=c}function _(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(xT))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${ST}[aria-selected="true"]`)}function M(){var e;return Array.from(null==(e=S.current)?void 0:e.querySelectorAll(CT))}function O(e){let t=M()[e];t&&k.setState("value",t.getAttribute(ET))}function R(e){var t;let n=D(),r=M(),o=r.findIndex((e=>e===n)),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&k.setState("value",i.getAttribute(ET))}function A(e){let t,n=D(),r=null==n?void 0:n.closest(xT);for(;r&&!t;)r=e>0?UT(r,xT):VT(r,xT),t=null==r?void 0:r.querySelector(CT);t?k.setState("value",t.getAttribute(ET)):R(e)}let L=()=>O(M().length-1),I=e=>{e.preventDefault(),e.metaKey?L():e.altKey?A(1):R(1)},F=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?A(-1):R(-1)};return i.createElement(aj.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=y.onKeyDown)||t.call(y,e),!e.defaultPrevented)switch(e.key){case"n":case"j":v&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":v&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),L();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=D();if(t){let e=new Event(kT);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:JT},c),XT(e,(e=>i.createElement(NT.Provider,{value:k},i.createElement(TT.Provider,{value:E},e)))))})),OT=i.forwardRef(((e,t)=>{var n,r;let o=i.useId(),s=i.useRef(null),a=i.useContext(DT),l=PT(),c=BT(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;KT((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=YT(o,s,[e.value,e.children,s],e.keywords),h=_T(),f=GT((e=>e.value&&e.value===d.current)),p=GT((e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0)));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){h.setState("value",d.current,!0)}if(i.useEffect((()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(kT,m),()=>t.removeEventListener(kT,m)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:x,keywords:w,...S}=e;return i.createElement(aj.div,{ref:WT([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.disablePointerSelection?void 0:g,onClick:v?void 0:m},e.children)})),RT=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=i.useId(),l=i.useRef(null),c=i.useRef(null),u=i.useId(),d=PT(),h=GT((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));KT((()=>d.group(a)),[]),YT(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(aj.div,{ref:WT([l,t]),...s,"cmdk-group":"",role:"presentation",hidden:!h||void 0},n&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),XT(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement(DT.Provider,{value:f},e)))))})),AT=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=GT((e=>!e.search));return n||s?i.createElement(aj.div,{ref:WT([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),LT=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=_T(),a=GT((e=>e.search)),l=GT((e=>e.value)),c=PT(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${ST}[${ET}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return i.useEffect((()=>{null!=e.value&&s.setState("search",e.value)}),[e.value]),i.createElement(aj.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||s.setState("search",e.target.value),null==n||n(e.target.value)}})})),IT=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=PT();return i.useEffect((()=>{if(a.current&&s.current){let e,t=a.current,n=s.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{n.style.setProperty("--cmdk-list-height",t.offsetHeight.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),i.createElement(aj.div,{ref:WT([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},XT(e,(e=>i.createElement("div",{ref:WT([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),FT=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(gT,{open:n,onOpenChange:r},i.createElement(vT,{container:a},i.createElement(yT,{"cmdk-overlay":"",className:o}),i.createElement(bT,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(MT,{ref:t,...l}))))})),$T=i.forwardRef(((e,t)=>GT((e=>0===e.filtered.count))?i.createElement(aj.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),qT=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(aj.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},XT(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),zT=Object.assign(MT,{List:IT,Item:OT,Input:LT,Group:RT,Separator:AT,Dialog:FT,Empty:$T,Loading:qT});function UT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function VT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function BT(e){let t=i.useRef(e);return KT((()=>{t.current=e})),t}var KT="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function HT(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function WT(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function GT(e){let t=_T(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function YT(e,t,n,r=[]){let o=i.useRef(),s=PT();return KT((()=>{var i;let a=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=r.map((e=>e.trim()));s.value(e,a,l),null==(i=t.current)||i.setAttribute(ET,a),o.current=a})),o}var QT=()=>{let[e,t]=i.useState(),n=HT((()=>new Map));return KT((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function XT({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var JT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ZT=i.forwardRef((({className:e,...n},r)=>t.jsx(zT,{ref:r,className:Dh("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));ZT.displayName=zT.displayName;const eP=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(Nd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(zT.Input,{ref:o,className:Dh("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})));eP.displayName=zT.Input.displayName;const tP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.List,{ref:r,className:Dh("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));tP.displayName=zT.List.displayName;const nP=i.forwardRef(((e,n)=>t.jsx(zT.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));nP.displayName=zT.Empty.displayName;const rP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.Group,{ref:r,className:Dh("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n})));rP.displayName=zT.Group.displayName;const oP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.Separator,{ref:r,className:Dh("-mx-1 h-px bg-border",e),...n})));oP.displayName=zT.Separator.displayName;const iP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.Item,{ref:r,className:Dh("relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n})));iP.displayName=zT.Item.displayName;var sP="focusScope.autoFocusOnMount",aP="focusScope.autoFocusOnUnmount",lP={bubbles:!1,cancelable:!0},cP=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:fP(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||fP(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&fP(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){pP.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(sP,lP);c.addEventListener(sP,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fP(r,{select:t}),document.activeElement!==n)return}((e=uP(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&fP(c))}return()=>{c.removeEventListener(sP,d),setTimeout((()=>{const e=new CustomEvent(aP,lP);c.addEventListener(aP,h),c.dispatchEvent(e),e.defaultPrevented||fP(t??document.body,{select:!0}),c.removeEventListener(aP,h),pP.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=uP(e),n=dP(t,e),r=dP(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&fP(i,{select:!0})):(e.preventDefault(),r&&fP(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(Bc.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function uP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function dP(e,t){for(const n of e)if(!hP(n,{upTo:t}))return n}function hP(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function fP(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}cP.displayName="FocusScope";var pP=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=mP(e,t),e.unshift(t)},remove(t){e=mP(e,t),e[0]?.resume()}}}();function mP(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const gP=["top","right","bottom","left"],vP=Math.min,yP=Math.max,bP=Math.round,xP=Math.floor,wP=e=>({x:e,y:e}),SP={left:"right",right:"left",bottom:"top",top:"bottom"},CP={start:"end",end:"start"};function kP(e,t,n){return yP(e,vP(t,n))}function EP(e,t){return"function"==typeof e?e(t):e}function jP(e){return e.split("-")[0]}function TP(e){return e.split("-")[1]}function PP(e){return"x"===e?"y":"x"}function NP(e){return"y"===e?"height":"width"}function _P(e){return["top","bottom"].includes(jP(e))?"y":"x"}function DP(e){return PP(_P(e))}function MP(e){return e.replace(/start|end/g,(e=>CP[e]))}function OP(e){return e.replace(/left|right|bottom|top/g,(e=>SP[e]))}function RP(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function AP(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 LP(e,t,n){let{reference:r,floating:o}=e;const i=_P(t),s=DP(t),a=NP(s),l=jP(t),c="y"===i,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 f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(TP(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function IP(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=EP(t,e),p=RP(f),m=a[h?"floating"===d?"reference":"floating":d],g=AP(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=AP(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function FP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $P(e){return gP.some((t=>e[t]>=0))}function qP(){return"undefined"!=typeof window}function zP(e){return BP(e)?(e.nodeName||"").toLowerCase():"#document"}function UP(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function VP(e){var t;return null==(t=(BP(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function BP(e){return!!qP()&&(e instanceof Node||e instanceof UP(e).Node)}function KP(e){return!!qP()&&(e instanceof Element||e instanceof UP(e).Element)}function HP(e){return!!qP()&&(e instanceof HTMLElement||e instanceof UP(e).HTMLElement)}function WP(e){return!(!qP()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof UP(e).ShadowRoot)}function GP(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=eN(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function YP(e){return["table","td","th"].includes(zP(e))}function QP(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(nQ){return!1}}))}function XP(e){const t=JP(),n=KP(e)?eN(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function JP(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ZP(e){return["html","body","#document"].includes(zP(e))}function eN(e){return UP(e).getComputedStyle(e)}function tN(e){return KP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nN(e){if("html"===zP(e))return e;const t=e.assignedSlot||e.parentNode||WP(e)&&e.host||VP(e);return WP(t)?t.host:t}function rN(e){const t=nN(e);return ZP(t)?e.ownerDocument?e.ownerDocument.body:e.body:HP(t)&&GP(t)?t:rN(t)}function oN(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=rN(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=UP(o);if(i){const e=iN(s);return t.concat(s,s.visualViewport||[],GP(o)?o:[],e&&n?oN(e):[])}return t.concat(o,oN(o,[],n))}function iN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sN(e){const t=eN(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=HP(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=bP(n)!==i||bP(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function aN(e){return KP(e)?e:e.contextElement}function lN(e){const t=aN(e);if(!HP(t))return wP(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=sN(t);let s=(i?bP(n.width):n.width)/r,a=(i?bP(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const cN=wP(0);function uN(e){const t=UP(e);return JP()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:cN}function dN(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=aN(e);let s=wP(1);t&&(r?KP(r)&&(s=lN(r)):s=lN(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==UP(e))&&t}(i,n,r)?uN(i):wP(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=UP(i),t=r&&KP(r)?UP(r):r;let n=e,o=iN(n);for(;o&&r&&t!==n;){const e=lN(o),t=o.getBoundingClientRect(),r=eN(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=UP(o),o=iN(n)}}return AP({width:u,height:d,x:l,y:c})}function hN(e,t){const n=tN(e).scrollLeft;return t?t.left+n:dN(VP(e)).left+n}function fN(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:hN(e,r)),y:r.top+t.scrollTop}}function pN(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=UP(e),r=VP(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=JP();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=VP(e),n=tN(e),r=e.ownerDocument.body,o=yP(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=yP(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+hN(e);const a=-n.scrollTop;return"rtl"===eN(r).direction&&(s+=yP(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(VP(e));else if(KP(t))r=function(e,t){const n=dN(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=HP(e)?lN(e):wP(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=uN(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return AP(r)}function mN(e,t){const n=nN(e);return!(n===t||!KP(n)||ZP(n))&&("fixed"===eN(n).position||mN(n,t))}function gN(e,t,n){const r=HP(t),o=VP(t),i="fixed"===n,s=dN(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=wP(0);if(r||!r&&!i)if(("body"!==zP(t)||GP(o))&&(a=tN(t)),r){const e=dN(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=hN(o));const c=!o||r||i?wP(0):fN(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function vN(e){return"static"===eN(e).position}function yN(e,t){if(!HP(e)||"fixed"===eN(e).position)return null;if(t)return t(e);let n=e.offsetParent;return VP(e)===n&&(n=n.ownerDocument.body),n}function bN(e,t){const n=UP(e);if(QP(e))return n;if(!HP(e)){let t=nN(e);for(;t&&!ZP(t);){if(KP(t)&&!vN(t))return t;t=nN(t)}return n}let r=yN(e,t);for(;r&&YP(r)&&vN(r);)r=yN(r,t);return r&&ZP(r)&&vN(r)&&!XP(r)?n:r||function(e){let t=nN(e);for(;HP(t)&&!ZP(t);){if(XP(t))return t;if(QP(t))return null;t=nN(t)}return null}(e)||n}const xN={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=VP(r),a=!!t&&QP(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=wP(1);const u=wP(0),d=HP(r);if((d||!d&&!i)&&(("body"!==zP(r)||GP(s))&&(l=tN(r)),HP(r))){const e=dN(r);c=lN(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?wP(0):fN(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:VP,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?QP(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=oN(e,[],!1).filter((e=>KP(e)&&"body"!==zP(e))),o=null;const i="fixed"===eN(e).position;let s=i?nN(e):e;for(;KP(s)&&!ZP(s);){const t=eN(s),n=XP(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||GP(s)&&!n&&mN(e,s))?r=r.filter((e=>e!==s)):o=t,s=nN(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=pN(t,n,o);return e.top=yP(r.top,e.top),e.right=vP(r.right,e.right),e.bottom=vP(r.bottom,e.bottom),e.left=yP(r.left,e.left),e}),pN(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:bN,getElementRects:async function(e){const t=this.getOffsetParent||bN,n=this.getDimensions,r=await n(e.floating);return{reference:gN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=sN(e);return{width:t,height:n}},getScale:lN,isElement:KP,isRTL:function(e){return"rtl"===eN(e).direction}};function wN(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=aN(e),u=o||i?[...c?oN(c):[],...oN(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=VP(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-xP(u)+"px "+-xP(o.clientWidth-(c+d))+"px "+-xP(o.clientHeight-(u+h))+"px "+-xP(c)+"px",threshold:yP(0,vP(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(nQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?dN(e):null;return l&&function t(){const r=dN(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const SN=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=jP(n),a=TP(n),l="y"===_P(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=EP(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},CN=function(e){return void 0===e&&(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:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=EP(e,t),c={x:n,y:r},u=await IP(t,l),d=_P(jP(o)),h=PP(d);let f=c[h],p=c[d];if(i){f=kP(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=kP(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[d]:s}}}}}},kN=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=EP(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=jP(o),y=_P(a),b=jP(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[OP(a)]:function(e){const t=OP(e);return[MP(e),t,MP(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=TP(e);let i=function(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[]}}(jP(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(MP)))),i}(a,m,p,x));const C=[a,...w],k=await IP(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=TP(e),o=DP(e),i=NP(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=OP(s)),[s,OP(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=j.filter((e=>{if(S){const t=_P(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},EN=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=EP(e,t),u=await IP(t,c),d=jP(o),h=TP(o),f="y"===_P(o),{width:p,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g="end"===h?"top":"bottom");const y=m-u.top-u.bottom,b=p-u.left-u.right;let x=vP(m-u[g],y),w=vP(p-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),!t.middlewareData.shift&&!h){const e=yP(u.left,0),t=yP(u.right,0),n=yP(u.top,0),r=yP(u.bottom,0);f?w=p-2*(0!==e||0!==t?e+t:yP(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:yP(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const S=await s.getDimensions(a.floating);return p!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},jN=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=EP(e,t);switch(r){case"referenceHidden":{const e=FP(await IP(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:$P(e)}}}case"escaped":{const e=FP(await IP(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:$P(e)}}}default:return{}}}}},TN=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=EP(e,t)||{};if(null==c)return{};const d=RP(u),h={x:n,y:r},f=DP(o),p=NP(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=vP(d[v],E),T=vP(d[y],E),P=j,N=C-m[p]-T,_=C/2-m[p]/2+k,D=kP(P,_,N),M=!l.arrow&&null!=TP(o)&&_!==D&&i.reference[p]/2-(_<P?j:T)-m[p]/2<0,O=M?_<P?_-P:_-N:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:_-D-O,...M&&{alignmentOffset:O}},reset:M}}}),PN=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=EP(e,t),u={x:n,y:r},d=_P(o),h=PP(d);let f=u[h],p=u[d];const m=EP(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===h?"height":"width",t=i.reference[h]-i.floating[e]+g.mainAxis,n=i.reference[h]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===h?"width":"height",t=["top","left"].includes(jP(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[h]:f,[d]:p}}}},NN=(e,t,n)=>{const r={platform:xN,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=LP(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=LP(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var _N="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function DN(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!DN(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!DN(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function MN(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ON(e,t){const n=MN(e);return Math.round(t*n)/n}function RN(e){const t=i.useRef(e);return _N((()=>{t.current=e})),t}const AN=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?TN({element:n.current,padding:r}).fn(t):{}:n?TN({element:n,padding:r}).fn(t):{}}}),LN=(e,t)=>({...CN(e),options:[e,t]}),IN=(e,t)=>({...PN(e),options:[e,t]}),FN=(e,t)=>({...kN(e),options:[e,t]}),$N=(e,t)=>({...EN(e),options:[e,t]}),qN=(e,t)=>({...jN(e),options:[e,t]}),zN=(e,t)=>({...AN(e),options:[e,t]});var UN=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(Bc.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));UN.displayName="Arrow";var VN=UN;var BN="Popper",[KN,HN]=Lc(BN),[WN,GN]=KN(BN),YN=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(WN,{scope:n,anchor:o,onAnchorChange:s,children:r})};YN.displayName=BN;var QN="PopperAnchor",XN=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=GN(QN,r),l=i.useRef(null),c=Ac(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(Bc.div,{...s,ref:c})}));XN.displayName=QN;var JN="PopperContent",[ZN,e_]=KN(JN),t_=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,b=GN(JN,r),[x,w]=i.useState(null),S=Ac(n,(e=>w(e))),[C,k]=i.useState(null),E=function(e){const[t,n]=i.useState(void 0);return iu((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(C),j=E?.width??0,T=E?.height??0,P=o+("center"!==l?"-"+l:""),N="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(h)?h:[h],D=_.length>0,M={padding:N,boundary:_.filter(i_),altBoundary:D},{refs:O,floatingStyles:R,placement:A,isPositioned:L,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);DN(p,r)||m(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),x=i.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),w=i.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),S=a||g,C=l||y,k=i.useRef(null),E=i.useRef(null),j=i.useRef(h),T=null!=u,P=RN(u),N=RN(o),_=RN(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};N.current&&(e.platform=N.current),NN(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==_.current};M.current&&!DN(j.current,t)&&(j.current=t,s.flushSync((()=>{f(t)})))}))}),[p,t,n,N,_]);_N((()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);_N((()=>(M.current=!0,()=>{M.current=!1})),[]),_N((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(P.current)return P.current(S,C,D);D()}}),[S,C,D,P,T]);const O=i.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),R=i.useMemo((()=>({reference:S,floating:C})),[S,C]),A=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=ON(R.floating,h.x),r=ON(R.floating,h.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...MN(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,R.floating,h.x,h.y]);return i.useMemo((()=>({...h,update:D,refs:O,elements:R,floatingStyles:A})),[h,D,O,R,A])}({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>wN(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[(F={mainAxis:a+T,alignmentAxis:c},{...SN(F),options:[F,$]}),d&&LN({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?IN():void 0,...M}),d&&FN({...M}),$N({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&zN({element:C,padding:u}),s_({arrowWidth:j,arrowHeight:T}),m&&qN({strategy:"referenceHidden",...M})]});var F,$;const[q,z]=a_(A),U=Hc(v);iu((()=>{L&&U?.()}),[L,U]);const V=I.arrow?.x,B=I.arrow?.y,K=0!==I.arrow?.centerOffset,[H,W]=i.useState();return iu((()=>{x&&W(window.getComputedStyle(x).zIndex)}),[x]),t.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:L?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(ZN,{scope:r,placedSide:q,onArrowChange:k,arrowX:V,arrowY:B,shouldHideArrow:K,children:t.jsx(Bc.div,{"data-side":q,"data-align":z,...y,ref:S,style:{...y.style,animation:L?void 0:"none"}})})})}));t_.displayName=JN;var n_="PopperArrow",r_={top:"bottom",right:"left",bottom:"top",left:"right"},o_=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=e_(n_,r),s=r_[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(VN,{...o,ref:n,style:{...o.style,display:"block"}})})}));function i_(e){return null!==e}o_.displayName=n_;var s_=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=a_(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+a/2;let f="",p="";return"bottom"===l?(f=i?u:`${d}px`,p=-a+"px"):"top"===l?(f=i?u:`${d}px`,p=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",p=i?u:`${h}px`):"left"===l&&(f=`${r.floating.width+a}px`,p=i?u:`${h}px`),{data:{x:f,y:p}}}});function a_(e){const[t,n="center"]=e.split("-");return[t,n]}var l_=YN,c_=XN,u_=t_,d_=o_,h_="Popover",[f_,p_]=Lc(h_,[HN]),m_=HN(),[g_,v_]=f_(h_),y_=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=m_(n),u=i.useRef(null),[d,h]=i.useState(!1),[f=!1,p]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(l_,{...c,children:t.jsx(g_,{scope:n,contentId:lC(),triggerRef:u,open:f,onOpenChange:p,onOpenToggle:i.useCallback((()=>p((e=>!e))),[p]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback((()=>h(!0)),[]),onCustomAnchorRemove:i.useCallback((()=>h(!1)),[]),modal:l,children:r})})};y_.displayName=h_;var b_="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=v_(b_,r),a=m_(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(c_,{...a,...o,ref:n})})).displayName=b_;var x_="PopoverTrigger",w_=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=v_(x_,r),s=m_(r),a=Ac(n,i.triggerRef),l=t.jsx(Bc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":M_(i.open),...o,ref:a,onClick:Mc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(c_,{asChild:!0,...s,children:l})}));w_.displayName=x_;var S_="PopoverPortal",[C_,k_]=f_(S_,{forceMount:void 0}),E_=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=v_(S_,n);return t.jsx(C_,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};E_.displayName=S_;var j_="PopoverContent",T_=i.forwardRef(((e,n)=>{const r=k_(j_,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=v_(j_,e.__scopePopover);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?P_:N_,{...i,ref:n})})}));T_.displayName=j_;var P_=i.forwardRef(((e,n)=>{const r=v_(j_,e.__scopePopover),o=i.useRef(null),s=Ac(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),t.jsx(kk,{as:Fc,allowPinchZoom:!0,children:t.jsx(__,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),N_=i.forwardRef(((e,n)=>{const r=v_(j_,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(__,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),__=i.forwardRef(((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,f=v_(j_,r),p=m_(r);return RC(),t.jsx(cP,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(u_,{"data-state":M_(f.open),role:"dialog",id:f.contentId,...p,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),D_="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=v_(D_,r);return t.jsx(Bc.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=D_;function M_(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=m_(r);return t.jsx(d_,{...i,...o,ref:n})})).displayName="PopoverArrow";var O_=E_,R_=T_;const A_=y_,L_=w_,I_=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(O_,{children:t.jsx(R_,{ref:i,align:n,sideOffset:r,className:Dh("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})})));I_.displayName=R_.displayName;var F_=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(z_);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx($_,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx($_,{...o,ref:n,children:r})}));F_.displayName="Slot";var $_=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));$_.displayName="SlotClone";var q_=({children:e})=>t.jsx(t.Fragment,{children:e});function z_(e){return i.isValidElement(e)&&e.type===q_}var U_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?F_:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{}),V_="horizontal",B_=["horizontal","vertical"],K_=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=V_,...i}=e,s=function(e){return B_.includes(e)}(o)?o:V_;return t.jsx(U_.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));K_.displayName="Separator";var H_=K_;const W_=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(H_,{ref:i,decorative:r,orientation:n,className:Dh("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));W_.displayName=H_.displayName;const G_=nd("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),Y_=i.forwardRef((({options:e,onValueChange:n,variant:r,placeholder:o="Select options",animation:s=0,maxCount:a=3,modalPopover:l=!0,className:c,extraCommandItems:u,searchPlaceholder:d="Search...",handleSearchInput:h,emptyMessage:f="No results found.",searchIcon:p=t.jsx(Nd,{className:"h-4 w-4"}),selectedValues:m,setSelectedValues:g,...v},y)=>{const[b,x]=i.useState(!1),[w,S]=i.useState(!1),C=e=>{const t=m.includes(e)?m.filter((t=>t!==e)):[...m,e];g(t),n(t)},k=()=>{g([]),n([])};return t.jsxs(A_,{open:b,onOpenChange:x,modal:l,children:[t.jsx(L_,{asChild:!0,children:t.jsx("button",{type:"button",ref:y,...v,onClick:()=>{x((e=>!e))},className:Dh("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",c),children:t.jsxs("div",m.length>0?{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[m.slice(0,a).map((n=>{const o=e.find((e=>e.value===n)),i=o?.icon;return t.jsxs(LE,{className:Dh(w?"animate-bounce":"",G_({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(LE,{className:Dh("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",G_({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=m.slice(0,a);g(e),n(e)})()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Fd,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(W_,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(ud,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}:{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:o}),t.jsx(ud,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(I_,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),children:t.jsxs(ZT,{children:[t.jsx(eP,{searchIcon:p,placeholder:d,onKeyDown:e=>{if("Enter"===e.key)x(!0),h&&(h(e.currentTarget.value),x(!1));else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...m];e.pop(),g(e),n(e)}}}),t.jsxs(tP,{children:[t.jsx(nP,{children:f}),t.jsxs(rP,{children:[t.jsxs(iP,{onSelect:()=>{if(m.length===e.length)k();else{const t=e.map((e=>e.value));g(t),n(t)}},className:"cursor-pointer",children:[t.jsx("div",{className:Dh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(iP,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:Dh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",n?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),e.icon&&t.jsx(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:e.label})]},e.value)}))]}),t.jsx(oP,{}),t.jsx(rP,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(iP,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(W_,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(iP,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(Id,{className:Dh("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function Q_(e,[t,n]){return Math.min(n,Math.max(t,e))}Y_.displayName="MultiSelect";var X_=i.createContext(void 0);function J_(e){const t=i.useContext(X_);return e||t||"ltr"}var Z_=[" ","Enter","ArrowUp","ArrowDown"],eD=[" ","Enter"],tD="Select",[nD,rD,oD]=Vc(tD),[iD,sD]=Lc(tD,[oD,HN]),aD=HN(),[lD,cD]=iD(tD),[uD,dD]=iD(tD),hD=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:p,required:m,form:g}=e,v=aD(n),[y,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=J_(d),[E=!1,j]=cu({prop:o,defaultProp:s,onChange:a}),[T,P]=cu({prop:l,defaultProp:c,onChange:u}),N=i.useRef(null),_=!y||(g||!!y.closest("form")),[D,M]=i.useState(new Set),O=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(l_,{...v,children:t.jsxs(lD,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:lC(),value:T,onValueChange:P,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:N,disabled:p,children:[t.jsx(nD.Provider,{scope:n,children:t.jsx(uD,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback((e=>{M((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:i.useCallback((e=>{M((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),_?t.jsxs(JD,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:T,onChange:e=>P(e.target.value),disabled:p,form:g,children:[void 0===T?t.jsx("option",{value:""}):null,Array.from(D)]},O):null]})})};hD.displayName=tD;var fD="SelectTrigger",pD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=aD(r),l=cD(fD,r),c=l.disabled||o,u=Ac(n,l.onTriggerChange),d=rD(r),h=i.useRef("touch"),[f,p,m]=ZD((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=eM(t,e,n);void 0!==r&&l.onValueChange(r.value)})),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(c_,{asChild:!0,...a,children:t.jsx(Bc.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":XD(l.value)?"":void 0,...s,ref:u,onClick:Mc(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==h.current&&g(e)})),onPointerDown:Mc(s.onPointerDown,(e=>{h.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())})),onKeyDown:Mc(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Z_.includes(e.key)&&(g(),e.preventDefault())}))})})}));pD.displayName=fD;var mD="SelectValue",gD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=cD(mD,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Ac(n,c.onValueNodeChange);return iu((()=>{u(d)}),[u,d]),t.jsx(Bc.span,{...l,ref:h,style:{pointerEvents:"none"},children:XD(c.value)?t.jsx(t.Fragment,{children:a}):s})}));gD.displayName=mD;var vD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(Bc.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));vD.displayName="SelectIcon";var yD=e=>t.jsx(su,{asChild:!0,...e});yD.displayName="SelectPortal";var bD="SelectContent",xD=i.forwardRef(((e,n)=>{const r=cD(bD,e.__scopeSelect),[o,a]=i.useState();if(iu((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx(SD,{scope:e.__scopeSelect,children:t.jsx(nD.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(kD,{...e,ref:n})}));xD.displayName=bD;var wD=10,[SD,CD]=iD(bD),kD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=cD(bD,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=Ac(n,(e=>S(e))),[j,T]=i.useState(null),[P,N]=i.useState(null),_=rD(r),[D,M]=i.useState(!1),O=i.useRef(!1);i.useEffect((()=>{if(w)return Dk(w)}),[w]),RC();const R=i.useCallback((e=>{const[t,...n]=_().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&C&&(C.scrollTop=0),i===r&&C&&(C.scrollTop=C.scrollHeight),i?.focus(),document.activeElement!==o)return}}),[_,C]),A=i.useCallback((()=>R([j,w])),[R,j,w]);i.useEffect((()=>{D&&A()}),[D,A]);const{onOpenChange:L,triggerPointerDownPosRef:I}=x;i.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,L,I]),i.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[F,$]=ZD((e=>{const t=_().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=eM(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),q=i.useCallback(((e,t,n)=>{const r=!O.current&&!n;(void 0!==x.value&&x.value===t||r)&&(T(e),r&&(O.current=!0))}),[x.value]),z=i.useCallback((()=>w?.focus()),[w]),U=i.useCallback(((e,t,n)=>{(void 0!==x.value&&x.value===t||!O.current&&!n)&&N(e)}),[x.value]),V="popper"===o?jD:ED,B=V===jD?{side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return t.jsx(SD,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:j,onItemLeave:z,itemTextRefCallback:U,focusSelectedItem:A,selectedItemText:P,position:o,isPositioned:D,searchRef:F,children:t.jsx(kk,{as:Fc,allowPinchZoom:!0,children:t.jsx(cP,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Mc(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...B,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Mc(b.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=t.indexOf(e.target);t=t.slice(n+1)}setTimeout((()=>R(t))),e.preventDefault()}}))})})})})})}));kD.displayName="SelectContentImpl";var ED=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=cD(bD,r),l=CD(bD,r),[c,u]=i.useState(null),[d,h]=i.useState(null),f=Ac(n,(e=>h(e))),p=rD(r),m=i.useRef(!1),g=i.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback((()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&y&&b){const e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-wD,l=Q_(o,[wD,Math.max(wD,a-s)]);c.style.minWidth=i+"px",c.style.left=l+"px"}else{const o=window.innerWidth-n.right-(t.right-r.right),i=window.innerWidth-e.right-o,s=e.width+i,a=Math.max(s,t.width),l=window.innerWidth-wD,u=Q_(o,[wD,Math.max(wD,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=p(),s=window.innerHeight-2*wD,l=v.scrollHeight,u=window.getComputedStyle(d),h=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=h+f+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*y.offsetHeight,x),S=window.getComputedStyle(v),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),E=e.top+e.height/2-wD,j=s-E,T=y.offsetHeight/2,P=h+f+(y.offsetTop+T),N=x-P;if(P<=E){const e=i.length>0&&y===i[i.length-1].ref.current;c.style.bottom="0px";const t=Math.max(j,T+(e?k:0)+(d.clientHeight-v.offsetTop-v.offsetHeight)+g);c.style.height=P+t+"px"}else{const e=i.length>0&&y===i[0].ref.current;c.style.top="0px";const t=Math.max(E,h+v.offsetTop+(e?C:0)+T);c.style.height=t+N+"px",v.scrollTop=P-E+v.offsetTop}c.style.margin=`${wD}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>m.current=!0))}}),[p,a.trigger,a.valueNode,c,d,v,y,b,a.dir,o]);iu((()=>w()),[w]);const[S,C]=i.useState();iu((()=>{d&&C(window.getComputedStyle(d).zIndex)}),[d]);const k=i.useCallback((e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)}),[w,x]);return t.jsx(TD,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t.jsx(Bc.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));ED.displayName="SelectItemAlignedPosition";var jD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=wD,...s}=e,a=aD(r);return t.jsx(u_,{...a,...s,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));jD.displayName="SelectPopperPosition";var[TD,PD]=iD(bD,{}),ND="SelectViewport",_D=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=CD(ND,r),l=PD(ND,r),c=Ac(n,a.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(nD.Slot,{scope:r,children:t.jsx(Bc.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Mc(s.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*wD,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),s=Math.max(o,i);if(s<r){const o=s+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop}))})})]})}));_D.displayName=ND;var DD="SelectGroup",[MD,OD]=iD(DD);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=lC();return t.jsx(MD,{scope:r,id:i,children:t.jsx(Bc.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=DD;var RD="SelectLabel",AD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=OD(RD,r);return t.jsx(Bc.div,{id:i.id,...o,ref:n})}));AD.displayName=RD;var LD="SelectItem",[ID,FD]=iD(LD),$D=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=cD(LD,r),u=CD(LD,r),d=c.value===o,[h,f]=i.useState(a??""),[p,m]=i.useState(!1),g=Ac(n,(e=>u.itemRefCallback?.(e,o,s))),v=lC(),y=i.useRef("touch"),b=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(ID,{scope:r,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(nD.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:t.jsx(Bc.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:Mc(l.onFocus,(()=>m(!0))),onBlur:Mc(l.onBlur,(()=>m(!1))),onClick:Mc(l.onClick,(()=>{"mouse"!==y.current&&b()})),onPointerUp:Mc(l.onPointerUp,(()=>{"mouse"===y.current&&b()})),onPointerDown:Mc(l.onPointerDown,(e=>{y.current=e.pointerType})),onPointerMove:Mc(l.onPointerMove,(e=>{y.current=e.pointerType,s?u.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Mc(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:Mc(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(eD.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));$D.displayName=LD;var qD="SelectItemText",zD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=cD(qD,r),u=CD(qD,r),d=FD(qD,r),h=dD(qD,r),[f,p]=i.useState(null),m=Ac(n,(e=>p(e)),d.onItemTextChange,(e=>u.itemTextRefCallback?.(e,d.value,d.disabled))),g=f?.textContent,v=i.useMemo((()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value)),[d.disabled,d.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=h;return iu((()=>(y(v),()=>b(v))),[y,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(Bc.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));zD.displayName=qD;var UD="SelectItemIndicator",VD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return FD(UD,r).isSelected?t.jsx(Bc.span,{"aria-hidden":!0,...o,ref:n}):null}));VD.displayName=UD;var BD="SelectScrollUpButton",KD=i.forwardRef(((e,n)=>{const r=CD(BD,e.__scopeSelect),o=PD(BD,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){a(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(GD,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));KD.displayName=BD;var HD="SelectScrollDownButton",WD=i.forwardRef(((e,n)=>{const r=CD(HD,e.__scopeSelect),o=PD(HD,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(GD,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));WD.displayName=HD;var GD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=CD("SelectScrollButton",r),l=i.useRef(null),c=rD(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),iu((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(Bc.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Mc(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:Mc(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:Mc(s.onPointerLeave,(()=>{u()}))})})),YD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(Bc.div,{"aria-hidden":!0,...o,ref:n})}));YD.displayName="SelectSeparator";var QD="SelectArrow";function XD(e){return""===e||void 0===e}i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=aD(r),s=cD(QD,r),a=CD(QD,r);return s.open&&"popper"===a.position?t.jsx(d_,{...i,...o,ref:n}):null})).displayName=QD;var JD=i.forwardRef(((e,n)=>{const{value:r,...o}=e,s=i.useRef(null),a=Ac(n,s),l=function(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(r);return i.useEffect((()=>{const e=s.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[l,r]),t.jsx(uu,{asChild:!0,children:t.jsx("select",{...o,ref:a,defaultValue:r})})}));function ZD(e){const t=Hc(e),n=i.useRef(""),r=i.useRef(0),o=i.useCallback((e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout((()=>e("")),1e3))}(o)}),[t]),s=i.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return i.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,s]}function eM(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(s=e,a=Math.max(o,0),s.map(((e,t)=>s[(a+t)%s.length])));var s,a;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}JD.displayName="BubbleSelect";var tM=pD,nM=vD,rM=yD,oM=xD,iM=_D,sM=AD,aM=$D,lM=zD,cM=VD,uM=KD,dM=WD,hM=YD;const fM=hD,pM=gD,mM=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(tM,{ref:o,className:Dh("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(nM,{asChild:!0,children:t.jsx(ud,{className:"h-4 w-4 opacity-50"})})]})));mM.displayName=tM.displayName;const gM=i.forwardRef((({className:e,...n},r)=>t.jsx(uM,{ref:r,className:Dh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(fd,{className:"h-4 w-4"})})));gM.displayName=uM.displayName;const vM=i.forwardRef((({className:e,...n},r)=>t.jsx(dM,{ref:r,className:Dh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ud,{className:"h-4 w-4"})})));vM.displayName=dM.displayName;const yM=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(rM,{children:t.jsxs(oM,{ref:i,className:Dh("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[t.jsx(gM,{}),t.jsx(iM,{className:Dh("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(vM,{})]})})));yM.displayName=oM.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(sM,{ref:r,className:Dh("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=sM.displayName;const bM=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(aM,{ref:o,className:Dh("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(cM,{children:t.jsx(cd,{className:"h-4 w-4"})})}),t.jsx(lM,{children:n})]})));bM.displayName=aM.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(hM,{ref:r,className:Dh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=hM.displayName;const xM=({condition:e,conditionNameToMetadata:r,buildInFieldToHumanReadable:o,updateCondition:i,deleteCondition:s,conditionState:a,index:l,iconDefinitions:c,operatorToHumanReadable:u})=>{const{toast:d}=Dc();n.useEffect((()=>{"exists"===e.operator&&i(l,"value",[])}),[e.operator]);const h="exists"!==e.operator,f=e.value.map((e=>String(e)));return t.jsx("div",{children:t.jsxs(Fx.div,{initial:{opacity:0,height:0,scale:.8},animate:{opacity:1,height:"auto",scale:1},exit:{opacity:0,height:0,scale:.8},transition:{duration:.2},className:`grid ${a.length>1?"grid-cols-[1fr_1fr_1fr_auto]":"grid-cols-[1fr_1fr_1fr]"} gap-4`,children:[t.jsxs(fM,{onValueChange:e=>i(l,"field",e),value:e.field,children:[t.jsx(mM,{children:t.jsx(pM,{placeholder:"Select field",children:o[e.field]??e.field})}),t.jsx(yM,{children:Object.keys(r).map((e=>t.jsx(bM,{value:e,children:o[e]??e},e)))})]}),t.jsxs(fM,{onValueChange:e=>i(l,"operator",e),value:e.operator,children:[t.jsx(mM,{children:t.jsx(pM,{})}),t.jsx(yM,{children:(r[e.field]?.operators||[]).map((e=>t.jsx(bM,{value:e,children:u[e]??e},e)))})]}),t.jsx(Fx.div,{className:"w-full",initial:!1,animate:{opacity:h?1:0,height:h?"auto":0},transition:{type:"spring",damping:25,stiffness:200},children:t.jsx("div",{className:"w-full border rounded-lg overflow-hidden "+(h?"":"hidden"),children:t.jsx(Y_,{selectedValues:f,setSelectedValues:e=>{i(l,"value",[...new Set(e)])},options:[...Array.from(new Set([...f,...r[e.field]?.options??[]])).map((e=>({label:e,value:e})))],defaultValue:f,onValueChange:e=>i(l,"value",e),searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:t=>{if(t.length>0){const n=r[e.field];if(!n)return void d({title:"Error",description:"Invalid field selected",variant:"destructive"});const o=(e=>{const{value:t,type:n}=e;switch(n){case _E.String:return t.length>0;case _E.Number:return!isNaN(Number(t));case _E.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case _E.Boolean:return"true"===t||"false"===t;case _E.Date:case _E.DateTime:return!isNaN(new Date(t).getTime());default:throw gw(n,_E)}})({value:t,type:n.type});o?i(l,"value",[...new Set([...f,t])]):d({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${n.type} type`,variant:"destructive"})}},searchIcon:t.jsx(c.PlusIcon,{className:"h-4 w-4"})})})}),a.length>1&&t.jsx(Fx.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>s(l),className:"p-2 hover:text-red-600","aria-label":"Delete condition",children:t.jsx(c.CloseButton,{})})]})})},wM={email:"Email",phone:"Phone",first_name:"First Name",last_name:"Last Name"},SM={[ME.EQUALS]:"Equals",[ME.NOT_EQUALS]:"Not Equals",[ME.GREATER_THAN]:"Greater Than",[ME.LESS_THAN]:"Less Than",[ME.EXISTS]:"Exists"},CM=({conditionNameToMetadata:e,setConditionState:n,conditionState:r,iconDefinitions:o})=>{const i=(e,t,o)=>{const i=[...r];i[e]={...i[e],[t]:o},n(i)},s=e=>{const t=r.filter(((t,n)=>n!==e));n(t)};return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Zh,{mode:"popLayout",children:r.map(((n,a)=>t.jsxs("div",{children:[t.jsx("div",{children:t.jsx(xM,{condition:n,conditionNameToMetadata:e,buildInFieldToHumanReadable:wM,updateCondition:i,deleteCondition:s,conditionState:r,index:a,iconDefinitions:o,operatorToHumanReadable:SM})}),a<r.length-1&&t.jsxs("div",{className:"flex items-center my-2",children:[t.jsx("div",{className:"h-px flex-1 bg-gray-200"}),t.jsx("span",{className:"px-4 text-sm font-medium text-gray-400",children:"AND"}),t.jsx("div",{className:"h-px flex-1 bg-gray-200"})]})]},a)))}),t.jsx("div",{children:t.jsxs(Fx.button,{whileHover:Object.keys(e).length>0?{scale:1.02}:void 0,whileTap:Object.keys(e).length>0?{scale:.98}:void 0,onClick:()=>{const t=Object.keys(e)[0],o={field:t,operator:e[t].operators[0],value:[]};n([...r,o])},disabled:0===Object.keys(e).length,className:Dh("flex items-center px-4 py-2",0===Object.keys(e).length&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{className:"mr-2",children:"+"}),0===Object.keys(e).length?"No Conditions Available":"Add Condition"]})})]})},kM=({nameAndDescriptionState:e,setNameAndDescriptionState:n})=>t.jsx("div",{children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium mb-2",children:"Name"}),t.jsx("input",{type:"text",placeholder:"Segment Name",className:"w-full p-2 border rounded-lg",value:e.name,onChange:t=>n({...e,name:t.target.value})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium mb-2",children:"Description"}),t.jsx("input",{type:"text",placeholder:"Description",className:"w-full p-2 border rounded-lg",value:e.description,onChange:t=>n({...e,description:t.target.value})})]})]})}),EM="relative rounded-lg",jM=({onClose:e,iconDefinitions:r,segmentId:o})=>{const i=nw(r),s=o||void 0,{toast:a}=Dc(),{segment:l}=PE(s),{updateSegment:c}=NE(s),{segmentsConditions:u,isLoading:d,createSegment:h,isCreating:f}=jE(),[p,m]=n.useState(!1),g=nw(i),[v,y]=n.useState([]),[b,x]=n.useState({name:"",description:""}),[w,S]=n.useState({}),C=b.name&&b.description&&v.some((e=>e.field&&e.operator&&("exists"===e.operator||e.value.length>0)));n.useEffect((()=>{u&&(s&&l?(x({name:l.name,description:l.description}),y(l.conditions)):y([{field:u.conditions[0].field,operator:u.conditions[0].operators[0],value:[]}]),S(u.conditions.reduce(((e,t)=>(e[t.field]={operators:t.operators,type:t.type,options:t.options},e)),{})))}),[u,l,s]);return d?t.jsx("div",{className:EM,children:t.jsx(zx,{text:["Fetching Segment data","Finishing up"]})}):f||p?t.jsx("div",{className:EM,children:t.jsx(zx,{text:s&&l?["Updating Segment","Finishing up"]:["Creating Segment","Finishing up"]})}):t.jsxs("div",{className:EM,children:[t.jsx("div",{className:"relative w-full flex justify-end mb-4",children:t.jsx(lw,{onClick:()=>e?.(!1),className:"w-4 h-4 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors duration-200","aria-label":"Close",variant:"ghost",children:t.jsx(g.CloseButton,{})})}),t.jsxs("div",{className:"space-y-6",children:[t.jsx(kM,{nameAndDescriptionState:b,setNameAndDescriptionState:x}),t.jsx(CM,{conditionNameToMetadata:w,conditionState:v,setConditionState:y,iconDefinitions:g}),t.jsx(OE,{onClose:e,isDisabled:!C,setClickedCreate:()=>{if(!b.name||!b.description)return void a({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:n}=(e=>{for(const t of e){if(!t.field||!t.operator)return{valid:!1,error:"Please ensure all fields are filled out"};if(t.operator!==ME.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===ME.EXISTS&&t.value.length>0)return{valid:!1,error:"EXISTS operator can only be used with an empty array"}}return{valid:!0,error:void 0}})(v);if(!t)return void a({title:"Conditions are invalid",description:n??"Please ensure all fields are filled out",variant:"destructive"});m(!0);const r={name:b.name,description:b.description,conditions:v.map((e=>({...e,value:e.value.map(String)})))};l?c(r,{onSuccess:t=>{e?.(t?.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{y([]),x({name:"",description:""})}}):h(r,{onSuccess:t=>{e?.(t.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{y([]),x({name:"",description:""})}})},createButtonText:l?"Update":"Create"})]})]})};var TM,PM="dismissableLayer.update",NM="dismissableLayer.pointerDownOutside",_M="dismissableLayer.focusOutside",DM=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),MM=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(DM),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){RM(NM,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){RM(_M,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(TM=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),OM(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=TM)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),OM())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(PM,e),()=>document.removeEventListener(PM,e)}),[]),t.jsx(Bc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));MM.displayName="DismissableLayer";function OM(){const e=new CustomEvent(PM);document.dispatchEvent(e)}function RM(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(DM),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Bc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var[AM,LM]=Lc("Tooltip",[HN]),IM=HN(),FM="TooltipProvider",$M=700,qM="tooltip.open",[zM,UM]=AM(FM),VM=e=>{const{__scopeTooltip:n,delayDuration:r=$M,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:a}=e,[l,c]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect((()=>{const e=d.current;return()=>window.clearTimeout(e)}),[]),t.jsx(zM,{scope:n,isOpenDelayed:l,delayDuration:r,onOpen:i.useCallback((()=>{window.clearTimeout(d.current),c(!1)}),[]),onClose:i.useCallback((()=>{window.clearTimeout(d.current),d.current=window.setTimeout((()=>c(!0)),o)}),[o]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback((e=>{u.current=e}),[]),disableHoverableContent:s,children:a})};VM.displayName=FM;var BM="Tooltip",[KM,HM]=AM(BM),WM=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=UM(BM,e.__scopeTooltip),d=IM(n),[h,f]=i.useState(null),p=lC(),m=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b=!1,x]=cu({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(qM))):u.onClose(),a?.(e)}}),w=i.useMemo((()=>b?y.current?"delayed-open":"instant-open":"closed"),[b]),S=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)}),[x]),C=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,x(!1)}),[x]),k=i.useCallback((()=>{window.clearTimeout(m.current),m.current=window.setTimeout((()=>{y.current=!0,x(!0),m.current=0}),v)}),[v,x]);return i.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),t.jsx(l_,{...d,children:t.jsx(KM,{scope:n,contentId:p,open:b,stateAttribute:w,trigger:h,onTriggerChange:f,onTriggerEnter:i.useCallback((()=>{u.isOpenDelayed?k():S()}),[u.isOpenDelayed,k,S]),onTriggerLeave:i.useCallback((()=>{g?C():(window.clearTimeout(m.current),m.current=0)}),[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:r})})};WM.displayName=BM;var GM="TooltipTrigger",YM=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=HM(GM,r),a=UM(GM,r),l=IM(r),c=Ac(n,i.useRef(null),s.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),h=i.useCallback((()=>u.current=!1),[]);return i.useEffect((()=>()=>document.removeEventListener("pointerup",h)),[h]),t.jsx(c_,{asChild:!0,...l,children:t.jsx(Bc.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:Mc(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:Mc(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:Mc(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})})),onFocus:Mc(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:Mc(e.onBlur,s.onClose),onClick:Mc(e.onClick,s.onClose)})})}));YM.displayName=GM;var QM="TooltipPortal",[XM,JM]=AM(QM,{forceMount:void 0}),ZM=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=HM(QM,n);return t.jsx(XM,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};ZM.displayName=QM;var eO="TooltipContent",tO=i.forwardRef(((e,n)=>{const r=JM(eO,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=HM(eO,e.__scopeTooltip);return t.jsx(au,{present:o||a.open,children:t.jsx(a.disableHoverableContent?iO:nO,{side:i,...s,ref:n})})})),nO=i.forwardRef(((e,n)=>{const r=HM(eO,e.__scopeTooltip),o=UM(eO,e.__scopeTooltip),s=i.useRef(null),a=Ac(n,s),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,h=s.current,{onPointerInTransitChange:f}=o,p=i.useCallback((()=>{c(null),f(!1)}),[f]),m=i.useCallback(((e,t)=>{const n={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(n,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(n,e.currentTarget.getBoundingClientRect())),o=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(o),f(!0)}),[f]);return i.useEffect((()=>()=>p()),[p]),i.useEffect((()=>{if(u&&h){const e=e=>m(e,h),t=e=>m(e,u);return u.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}}),[u,h,m,p]),i.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||h?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,l);r?p():o&&(p(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,h,l,d,p]),t.jsx(iO,{...e,ref:a})})),[rO,oO]=AM(BM,{isInside:!1}),iO=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=HM(eO,r),d=IM(r),{onClose:h}=u;return i.useEffect((()=>(document.addEventListener(qM,h),()=>document.removeEventListener(qM,h))),[h]),i.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,h]),t.jsx(MM,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:t.jsxs(u_,{"data-state":u.stateAttribute,...d,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(qc,{children:o}),t.jsx(rO,{scope:r,isInside:!0,children:t.jsx(du,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));tO.displayName=eO;var sO="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=IM(r);return oO(sO,r).isInside?null:t.jsx(d_,{...i,...o,ref:n})})).displayName=sO;var aO=ZM,lO=tO;const cO=VM,uO=WM,dO=YM,hO=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(aO,{children:t.jsx(lO,{ref:o,sideOffset:n,className:Dh("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));hO.displayName=lO.displayName;const fO=({title:e,alertText:n,Icon:r=bd,onClick:o})=>t.jsx(cO,{children:t.jsxs(uO,{children:[t.jsx(dO,{asChild:!0,children:t.jsx(r,{className:"h-4 w-4 cursor-pointer transition-colors",onClick:o})}),t.jsx(hO,{className:"text-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-[300px]",children:[n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-amber-500/10 p-2 rounded-full",children:t.jsx("svg",{className:"w-5 h-5 text-amber-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),t.jsx("p",{className:"font-semibold text-amber-500",children:n})]}),t.jsx("p",{className:"text-[13px] leading-relaxed text-primary-foreground/90",children:e})]})})]})}),pO="flex flex-col items-center justify-center h-full",mO=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=Jx(e);if(a||!s)return t.jsx("div",{className:pO,children:t.jsx(zx,{text:["Fetching Statistics","Finishing up"]})});const l=()=>{const e="flex items-center bg-white rounded-lg p-4 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md";return t.jsxs("div",{className:"grid gap-4 p-4 transition-all duration-300 "+("email"===o?"grid-cols-3":"grid-cols-1 max-w-md mx-auto"),children:[t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.MessagesSent,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("p",{className:"text-sm font-medium text-gray-500",children:["email"===o?"Emails":"SMS"," Sent"]}),t.jsx(fO,{title:`Total number of ${"email"===o?"emails":"SMS messages"} that were successfully sent in this campaign`})]}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s[o].numberSent})]})]})}),"email"===o&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.OpenRate,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Open Rate"}),t.jsx(fO,{title:"Percentage of recipients who opened the email out of total emails delivered"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.openPercentage.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.TotalBounceRate,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Total Bounce Rate"}),t.jsx(fO,{title:"Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[(s.email.softBounceRate+s.email.hardBounceRate).toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.LinksClicked,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Links Clicked"}),t.jsx(fO,{title:"Total number of times recipients clicked on links within the email"})]}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.email.linksClicked})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.SpamComplies,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Spam Complaints"}),t.jsx(fO,{title:"Percentage of recipients who marked this email as spam"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.spamComplaintRate.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.UnsubscribeRate,{className:"w-6 h-6"})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Unsubscribe Rate"}),t.jsx(fO,{title:"Percentage of recipients who unsubscribed after receiving this email"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.unsubscribedRate.toFixed(2),"%"]})]})]})})]})]})};return t.jsx("div",{className:"space-y-6",children:t.jsx(iC,{tabs:[{id:"email",label:"Email Stats",content:t.jsx("div",{children:t.jsx("div",{children:t.jsx(l,{})})})},{id:"sms",label:"SMS Stats",content:t.jsx("div",{children:t.jsx("div",{children:t.jsx(l,{})})})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"center"})})};function gO(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function vO(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const yO=6048e5,bO=43200;let xO={};function wO(){return xO}function SO(e,t){const n=wO(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=gO(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function CO(e){return SO(e,{weekStartsOn:1})}function kO(e){const t=gO(e),n=t.getFullYear(),r=vO(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=CO(r),i=vO(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=CO(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function EO(e){const t=gO(e);return t.setHours(0,0,0,0),t}function jO(e){const t=gO(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function TO(e,t){return function(e,t){return vO(e,+gO(e)+t)}(e,6e4*t)}function PO(e,t){const n=gO(e),r=gO(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function NO(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=gO(e);return!isNaN(Number(n))}function _O(e){const t=gO(e);return+function(e){const t=gO(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=gO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function DO(e,t){const n=gO(e),r=gO(t),o=PO(n,r),i=Math.abs(function(e,t){const n=gO(e),r=gO(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(n,r));let s;if(i<1)s=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*i);let t=PO(n,r)===-o;_O(gO(e))&&1===i&&1===PO(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function MO(e,t,n){const r=function(e,t){return+gO(e)-+gO(t)}(e,t)/1e3;return(o=n?.roundingMethod,e=>{const t=(o?Math[o]:Math.trunc)(e);return 0===t?0:t})(r);var o}const OO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function RO(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const AO={date:RO({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:RO({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:RO({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},LO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function IO(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function FO(e){return(t,n={})=>{const r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;const i=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],a=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,(e=>e.test(i)));let l;l=e.valueCallback?e.valueCallback(a):a,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(i.length)}}}var $O;const qO={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=OO[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:AO,formatRelative:(e,t,n,r)=>LO[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:IO({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:IO({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:IO({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:IO({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:IO({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:($O={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match($O.matchPattern);if(!n)return null;const r=n[0],o=e.match($O.parsePattern);if(!o)return null;let i=$O.valueCallback?$O.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:FO({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:FO({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:FO({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:FO({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:FO({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function zO(e){const t=gO(e),n=function(e,t){const n=EO(e),r=EO(t),o=+n-jO(n),i=+r-jO(r);return Math.round((o-i)/864e5)}(t,function(e){const t=gO(e),n=vO(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function UO(e){const t=gO(e),n=+CO(t)-+function(e){const t=kO(e),n=vO(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),CO(n)}(t);return Math.round(n/yO)+1}function VO(e,t){const n=gO(e),r=n.getFullYear(),o=wO(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=vO(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=SO(s,t),l=vO(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=SO(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function BO(e,t){const n=gO(e),r=+SO(n,t)-+function(e,t){const n=wO(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=VO(e,t),i=vO(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),SO(i,t)}(n,t);return Math.round(r/yO)+1}function KO(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const HO={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return KO("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):KO(n+1,2)},d:(e,t)=>KO(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>KO(e.getHours()%12||12,t.length),H:(e,t)=>KO(e.getHours(),t.length),m:(e,t)=>KO(e.getMinutes(),t.length),s:(e,t)=>KO(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return KO(Math.trunc(r*Math.pow(10,n-3)),t.length)}},WO="midnight",GO="noon",YO="morning",QO="afternoon",XO="evening",JO="night",ZO={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return HO.y(e,t)},Y:function(e,t,n,r){const o=VO(e,r),i=o>0?o:1-o;if("YY"===t){return KO(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):KO(i,t.length)},R:function(e,t){return KO(kO(e),t.length)},u:function(e,t){return KO(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return KO(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return KO(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return HO.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return KO(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=BO(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):KO(o,t.length)},I:function(e,t,n){const r=UO(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):KO(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):HO.d(e,t)},D:function(e,t,n){const r=zO(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):KO(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return KO(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return KO(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return KO(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?GO:0===r?WO:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?XO:r>=12?QO:r>=4?YO:JO,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return HO.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):HO.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):KO(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):KO(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):HO.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):HO.s(e,t)},S:function(e,t){return HO.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return tR(r);case"XXXX":case"XX":return nR(r);default:return nR(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tR(r);case"xxxx":case"xx":return nR(r);default:return nR(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eR(r,":");default:return"GMT"+nR(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eR(r,":");default:return"GMT"+nR(r,":")}},t:function(e,t,n){return KO(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return KO(e.getTime(),t.length)}};function eR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+KO(i,2)}function tR(e,t){if(e%60==0){return(e>0?"-":"+")+KO(Math.abs(e)/60,2)}return nR(e,t)}function nR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+KO(Math.trunc(r/60),2)+t+KO(r%60,2)}const rR=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},oR=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},iR={p:oR,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return rR(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",rR(r,t)).replace("{{time}}",oR(o,t))}},sR=/^D+$/,aR=/^Y+$/,lR=["D","DD","YY","YYYY"];const cR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dR=/^'([^]*?)'?$/,hR=/''/g,fR=/[a-zA-Z]/;function pR(e,t,n){const r=wO(),o=r.locale??qO,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=gO(e);if(!NO(a))throw new RangeError("Invalid time value");let l=t.match(uR).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,iR[t])(e,o.formatLong)}return e})).join("").match(cR).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:mR(e)};if(ZO[t])return{isToken:!0,value:e};if(t.match(fR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return aR.test(e)}(r)||function(e){return sR.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(lR.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,ZO[r[0]])(a,r,o.localize,c)})).join("")}function mR(e){const t=e.match(dR);return t?t[1].replace(hR,"'"):e}function gR(e,t){return function(e,t,n){const r=wO(),o=n?.locale??r.locale??qO,i=PO(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:i});let a,l;i>0?(a=gO(t),l=gO(e)):(a=gO(e),l=gO(t));const c=MO(l,a),u=(jO(l)-jO(a))/1e3,d=Math.round((c-u)/60);let h;if(d<2)return n?.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,s):c<10?o.formatDistance("lessThanXSeconds",10,s):c<20?o.formatDistance("lessThanXSeconds",20,s):c<40?o.formatDistance("halfAMinute",0,s):o.formatDistance(c<60?"lessThanXMinutes":"xMinutes",1,s):0===d?o.formatDistance("lessThanXMinutes",1,s):o.formatDistance("xMinutes",d,s);if(d<45)return o.formatDistance("xMinutes",d,s);if(d<90)return o.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return o.formatDistance("aboutXHours",e,s)}if(d<2520)return o.formatDistance("xDays",1,s);if(d<bO){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/bO),o.formatDistance("aboutXMonths",h,s);if(h=DO(l,a),h<12){const e=Math.round(d/bO);return o.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/12);return e<3?o.formatDistance("aboutXYears",t,s):e<9?o.formatDistance("overXYears",t,s):o.formatDistance("almostXYears",t+1,s)}}(e,function(e){return vO(e,Date.now())}(e),t)}const vR=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Dh("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...r})));vR.displayName="Input";const yR=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Dh("w-full caption-bottom text-sm",e),...n})})));yR.displayName="Table";const bR=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Dh("[&_tr]:border-b",e),...n})));bR.displayName="TableHeader";const xR=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Dh("[&_tr:last-child]:border-0",e),...n})));xR.displayName="TableBody";const wR=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Dh("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));wR.displayName="TableRow";const SR=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Dh("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));SR.displayName="TableHead";const CR=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Dh("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));CR.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:Dh("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const kR=({columns:e,fetchData:r,itemsPerPage:o=10,emptyState:i={title:"No Items Found",description:"No items are currently available."},className:s,onRowClick:a})=>{const[l,c]=n.useState([]),[u,d]=n.useState(!1),[h,f]=n.useState(),[p,m]=n.useState(!0),[g,v]=n.useState(null),y=n.useCallback((async e=>{try{d(!0),v(null);const t=await r({cursor:e,limit:o});c(e?e=>[...e,...t.items]:t.items),m(!!t.cursor),f(t.cursor)}catch(oQ){v(oQ instanceof Error?oQ.message:"An error occurred")}finally{d(!1)}}),[r,o]);return n.useEffect((()=>{c([]),f(void 0),m(!0),y()}),[y]),g?t.jsx("div",{className:"flex items-center justify-center p-8 text-center text-red-600",children:t.jsx("p",{children:g})}):t.jsxs("div",u||0!==l.length?{className:Dh(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(yR,{children:[t.jsx(bR,{children:t.jsx(wR,{children:e.map((e=>t.jsx(SR,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(xR,{children:l.map(((n,r)=>t.jsx(wR,{onClick:()=>a?.(n),className:a?"cursor-pointer hover:bg-gray-50/50 transition-colors":"hover:bg-gray-50/50 transition-colors",children:e.map((e=>t.jsx(CR,{style:{width:e.width},children:e.cell?e.cell(n[e.accessorKey],n):n[e.accessorKey]||t.jsx("span",{className:"text-gray-400",children:"Not provided"})},String(e.accessorKey))))},r)))})]})}),p&&t.jsx("div",{className:"mt-4 flex justify-center",children:t.jsx("button",{onClick:()=>y(h),disabled:u,className:"rounded-lg bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 disabled:opacity-50",children:u?"Loading...":"Load More"})})]}:{className:"flex flex-col items-center justify-center p-8 text-center",children:[i.icon&&t.jsx("div",{className:"mb-4",children:i.icon}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:i.title}),t.jsx("p",{className:"text-gray-500",children:i.description})]})},ER=({status:e})=>{switch(e){case ew.DRAFT:return t.jsx(LE,{variant:"secondary",children:"Draft"});case ew.ACTIVE:return t.jsx(LE,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case ew.RUNNING:return t.jsx(LE,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case ew.COMPLETED:return t.jsx(LE,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case ew.FAILED:return t.jsx(LE,{variant:"destructive",children:"Failed"});case ew.DEACTIVATED:return t.jsx(LE,{variant:"destructive",children:"Cancelled"});default:gw(e,ew)}},jR=({onViewAutomation:e})=>{const[r,o]=n.useState(""),[i,s]=n.useState("all"),a=e=>t.jsx(ER,{status:e}),l=e=>{let n="bg-gray-400";switch(e){case ew.ACTIVE:n="bg-green-500";break;case ew.DRAFT:n="bg-gray-400";break;case ew.DEACTIVATED:n="bg-red-500";break;case ew.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})},c=n=>t.jsx(kR,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[l(n.status),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),a(n.status)]})]})},{header:"Stats",accessorKey:"emailsSent",width:"25%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(tw.EmailIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.emailsSent||0})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(tw.SmsIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.smsSent||0})]})]})},{header:"Modified",accessorKey:"updated_at",width:"25%",cell:(e,n)=>{const r=e||n.created_at;return t.jsx("div",{className:"text-gray-600",children:r?gR(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:e,limit:t})=>{const o=await(async e=>{const t=new URLSearchParams;return e.cursor&&t.append("cursor",e.cursor),e.limit&&t.append("limit",e.limit.toString()),e.status&&t.append("status",e.status),e.search&&t.append("search",e.search),(await Ja(`${Vx}?${t.toString()}`,{method:"GET"})).data})({cursor:e,limit:t,status:n,search:r||void 0});return{items:o.automations,cursor:o.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-document-text h-12 w-12 text-gray-400"}),title:"No Automations Found",description:"Create your first automation to get started."},onRowClick:t=>{e(t.id)},className:"rounded-lg bg-white"}),u=[{id:"all",label:"All",content:c()},{id:"active",label:"Active",content:c("active")},{id:"draft",label:"Drafts",content:c("draft")}];return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative w-[400px]",children:[t.jsx(vR,{placeholder:"Search automations...",value:r,onChange:e=>o(e.target.value),className:"pl-9 bg-gray-50 border-0 focus-visible:ring-2"}),t.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:t.jsx("div",{className:"i-heroicons-magnifying-glass h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx("div",{className:"i-heroicons-funnel h-5 w-5 text-gray-500"})})]}),t.jsx(iC,{tabs:u,activeTab:i,onTabChange:s})]})},TR=({onSelectSegment:e})=>{const[r,o]=n.useState(""),{toast:i}=Dc(),s=e=>{const n={[DE.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[DE.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[DE.CUSTOM];return t.jsx(LE,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative w-[400px]",children:[t.jsx(vR,{placeholder:"Search segments...",value:r,onChange:e=>o(e.target.value),className:"pl-9 bg-gray-50 border-0 focus-visible:ring-2"}),t.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:t.jsx("div",{className:"i-heroicons-magnifying-glass h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx("div",{className:"i-heroicons-funnel h-5 w-5 text-gray-500"})})]}),t.jsx(kR,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),s(n.type)]}),t.jsx("span",{className:"text-sm text-gray-500 truncate max-w-[300px]",children:n.description})]})})},{header:"Users",accessorKey:"user_count",width:"25%",cell:e=>t.jsxs("div",{className:"text-gray-600",children:[e.toLocaleString()," ",1===e?"user":"users"]})},{header:"Modified",accessorKey:"user_count_updated_at",width:"25%",cell:e=>t.jsx("div",{className:"text-gray-600",children:e?gR(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:e,limit:t})=>{const n=await EE({cursor:e,limit:t,search:r||void 0});return{items:n.segments,cursor:n.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-user-group h-12 w-12 text-gray-400"}),title:"No Segments Found",description:"Create your first segment to get started."},onRowClick:t=>{t.type===DE.CUSTOM?e(t.id):i({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},PR=({iconDefinitionsPassed:e})=>{const r=xS(),{toast:o}=Dc(),[i,s]=n.useState(!1),[a,l]=n.useState("automations"),[c,u]=n.useState(!1),[d,h]=n.useState(null),f=nw(e),p=[{id:"automations",label:"Automations",content:t.jsx(jR,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)}})},{id:"segments",label:"Segments",content:t.jsx(TR,{onSelectSegment:e=>{h(e),u(!0)}})}];return t.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[t.jsx(bE,{open:i,onOpenChange:s,children:t.jsx(SE,{hideCloseButton:!0,children:t.jsx(Sw,{iconDefinitions:f,onClose:e=>{"error"===e?(o({title:"Error creating automation",description:"Please try again",variant:"destructive"}),s(!1)):!1===e?s(!1):r(`/automations/view-modal/${e}?autoOpenEditPopup=true&showBackButton=true`)}})})}),t.jsx(bE,{open:c,onOpenChange:u,children:t.jsx(SE,{hideCloseButton:!0,children:t.jsx(jM,{iconDefinitions:f,segmentId:d??void 0,onClose:e=>{"error"===e?(o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),u(!1),h(null)):!1===e?(u(!1),h(null)):(o({title:"Segment created!"}),h(null))}})})}),t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx("div",{className:"bg-white rounded-2xl w-full p-6 relative",children:t.jsx(mO,{iconDefinitions:f})}),t.jsx("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl",children:t.jsx(iC,{tabs:p,activeTab:a,onTabChange:e=>l(e),actionButton:{onClick:()=>{"automations"===a?s(!0):u(!0)},label:"Create New "+("automations"===a?"Automation":"Segment")}})})]})]})};var NR="rovingFocusGroup.onEntryFocus",_R={bubbles:!1,cancelable:!0},DR="RovingFocusGroup",[MR,OR,RR]=Vc(DR),[AR,LR]=Lc(DR,[RR]),[IR,FR]=AR(DR),$R=i.forwardRef(((e,n)=>t.jsx(MR.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(MR.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(qR,{...e,ref:n})})})));$R.displayName=DR;var qR=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,p=i.useRef(null),m=Ac(n,p),g=J_(a),[v=null,y]=cu({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=Hc(d),S=OR(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=p.current;if(e)return e.addEventListener(NR,w),()=>e.removeEventListener(NR,w)}),[w]),t.jsx(IR,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:i.useCallback((e=>y(e)),[y]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>E((e=>e-1))),[]),children:t.jsx(Bc.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:Mc(e.onMouseDown,(()=>{C.current=!0})),onFocus:Mc(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(NR,_R);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));BR([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}C.current=!1})),onBlur:Mc(e.onBlur,(()=>x(!1)))})})})),zR="RovingFocusGroupItem",UR=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=lC(),u=a||c,d=FR(zR,r),h=d.currentTabStopId===u,f=OR(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return p(),()=>m()}),[o,p,m]),t.jsx(MR.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(Bc.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:Mc(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:Mc(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:VR[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>BR(o)))}var n,r}))})})}));UR.displayName=zR;var VR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function BR(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var KR=$R,HR=UR,WR="Tabs",[GR,YR]=Lc(WR,[LR]),QR=LR(),[XR,JR]=GR(WR),ZR=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=J_(l),[h,f]=cu({prop:o,onChange:i,defaultProp:s});return t.jsx(XR,{scope:r,baseId:lC(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(Bc.div,{dir:d,"data-orientation":a,...u,ref:n})})}));ZR.displayName=WR;var eA="TabsList",tA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=JR(eA,r),a=QR(r);return t.jsx(KR,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(Bc.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));tA.displayName=eA;var nA="TabsTrigger",rA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=JR(nA,r),l=QR(r),c=sA(a.baseId,o),u=aA(a.baseId,o),d=o===a.value;return t.jsx(HR,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(Bc.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:Mc(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:Mc(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));rA.displayName=nA;var oA="TabsContent",iA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=e,c=JR(oA,r),u=sA(c.baseId,o),d=aA(c.baseId,o),h=o===c.value,f=i.useRef(h);return i.useEffect((()=>{const e=requestAnimationFrame((()=>f.current=!1));return()=>cancelAnimationFrame(e)}),[]),t.jsx(au,{present:s||h,children:({present:r})=>t.jsx(Bc.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:r&&a})})}));function sA(e,t){return`${e}-trigger-${t}`}function aA(e,t){return`${e}-content-${t}`}iA.displayName=oA;var lA=tA,cA=rA,uA=iA;const dA=ZR,hA=i.forwardRef((({className:e,...n},r)=>t.jsx(lA,{ref:r,className:Dh("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));hA.displayName=lA.displayName;const fA=i.forwardRef((({className:e,...n},r)=>t.jsx(cA,{ref:r,className:Dh("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...n})));fA.displayName=cA.displayName;const pA=i.forwardRef((({className:e,...n},r)=>t.jsx(uA,{ref:r,className:Dh("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));pA.displayName=uA.displayName;const mA=()=>{const e=ue({queryKey:["channel-senders"],queryFn:()=>(async()=>(await Ja(`${Bx}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},gA=()=>{const e=ne(),t=de({mutationFn:e=>(async(e,t)=>(await Ja(`${Bx}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data)(e.toUpdate,e.id),onSuccess:()=>{e.invalidateQueries({queryKey:["channel-senders"]})}});return{updateChannelSender:t.mutate,isUpdating:t.isPending,updateError:t.error}},vA=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(`${Kx}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},yA=(e,t)=>{const n=ne(),r=de({mutationFn:e=>(async e=>(await Ja(`${Kx}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(Wx(e,{action:[...t.action_data||[],{action_type:"send_communication",action_metadata:{action_type:"send_communication",communication_group_id:r.id}}]}),n.invalidateQueries({queryKey:["automations"]}),n.invalidateQueries({queryKey:["communicationGroups"]}),r)});return{createCommunicationForAutomation:r.mutate,isCreating:r.isPending}},bA=()=>{const e=ne(),t=de({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await Ja(`${Kx}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data)(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{updateCommunicationGroup:t.mutate,isUpdating:t.isPending,updateError:t.error,isUpdateSuccess:t.isSuccess}},xA=()=>{const e=ue({queryKey:["merge-fields"],queryFn:()=>(async()=>(await Ja(`${Kx}/merge-fields`)).data)()});return{getMergeFields:e.data,isGetting:e.isPending,getError:e.error,isGetSuccess:e.isSuccess}},wA=()=>{const e=de({mutationFn:({id:e,params:t})=>(async(e,t)=>(await Ja(`${Kx}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}},SA=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",CA=({type:e})=>t.jsxs("div",{className:"w-full h-full min-h-[300px] flex flex-col items-center justify-center bg-gradient-to-b from-gray-50 to-white p-8",children:[t.jsx("div",{className:"mb-4 text-gray-300",children:t.jsx("svg",{className:"w-16 h-16",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"})})}),t.jsxs("p",{className:"text-gray-400 font-medium text-lg text-center mb-2",children:["No ","email"===e?"Email":"SMS"," Preview Available"]}),t.jsxs("p",{className:"text-gray-400 text-sm text-center",children:["Edit your ","email"===e?"Email":"SMS"," template to see a preview here"]})]}),kA=({html:e,height:n,width:r})=>t.jsx("div",{className:"w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(CA,{type:"email"})}),EA=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",children:[t.jsxs("div",{className:"bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e?`${e} <${s}>`:s})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Subject:"}),t.jsx("span",{className:"text-gray-800 font-medium",children:r})]}),o&&t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Preview Text:"}),t.jsx("span",{className:"text-gray-600 italic",children:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(kA,{html:i,height:a.height,width:a.width})})]})},jA=({fromPhone:e,body:n})=>t.jsxs("div",{className:"max-w-sm mx-auto",children:[t.jsx("div",{className:"bg-gray-50 p-5 rounded-lg border border-gray-100 mb-6",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e})]})}),t.jsx("div",{className:"border-4 border-gray-800 rounded-3xl p-1 bg-gray-800 shadow-xl mx-auto max-w-xs",children:t.jsx("div",{className:"bg-gray-100 rounded-2xl p-4 h-[400px] overflow-y-auto",children:t.jsx("div",{className:"flex justify-end mb-4",children:t.jsx("div",{className:"bg-green-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm whitespace-pre-wrap",children:n})})})})]}),TA=({emailPreview:e,smsPreview:r,iconDefinitions:o})=>{const[i,s]=n.useState("email");return n.useEffect((()=>{e?s("email"):r&&s("sms")}),[e,r]),t.jsx(Fx.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"w-full",children:t.jsxs("div",{className:"bg-gray-200 rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[e&&t.jsxs(lw,{onClick:()=>s("email"),className:"flex-1 py-4 px-6 text-center relative rounded-none transition-colors duration-200 "+("email"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.EmailIcon,{className:"w-5 h-5 transition-colors duration-200 "+("email"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"Email Preview"})]}),"email"===i&&t.jsx(Fx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),r&&t.jsxs(lw,{onClick:()=>s("sms"),className:"flex-1 py-4 px-6 text-center relative rounded-none transition-colors duration-200 "+("sms"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.SmsIcon,{className:"w-5 h-5 transition-colors duration-200 "+("sms"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===i&&t.jsx(Fx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(Zh,{mode:"wait",children:["email"===i&&e&&t.jsx(Fx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(EA,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(Fx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(jA,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},PA=({automationId:e,iconDefinitions:r})=>{const{automation:o,isFetching:i}=Gx(e),{getCommunicationGroup:s}=vA(),{channelSenders:a}=mA(),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(!1),p=n.useMemo((()=>{const e=o?.action_data?.map((e=>e.action_metadata.communication_group_id));if(e&&0!==e.length&&!(e.length>1))return e[0]}),[o]);return n.useEffect((()=>{const e=p;e&&a?(f(!0),s(e,{onSuccess:e=>{try{const t=e.email_channel_sender_id,n=a.channel_senders.find((e=>e.id===t));n&&e.email_html_body&&c({emailHtml:e.email_html_body,emailSubject:e.email_subject,emailBaseDomain:n.channel_sender_metadata.baseDomain,emailFromName:n.channel_sender_metadata.emailFromName,emailFromEmail:`${n.channel_sender_metadata.userPart}@${n.channel_sender_metadata.baseDomain}`,emailPreviewText:e.email_preview_text});const r=e.sms_channel_sender_id,o=a.channel_senders.find((e=>e.id===r));o&&(o.channel_sender_metadata.from||o.channel_sender_metadata.messageServiceSid)&&e.sms_message_body&&d({fromPhone:SA(o.channel_sender_metadata),smsBody:e.sms_message_body,companyName:e.text_message_company_name})}finally{f(!1)}}})):f(!1)}),[o,s,p,a,i]),t.jsx("div",h||i?{className:"min-h-[500px] flex items-center justify-center",children:t.jsx(zx,{text:["Fetching Automation","Finishing up"]})}:{className:"p-6 bg-white",children:t.jsxs("div",l||u?{className:"space-y-4",children:[t.jsx(TA,{iconDefinitions:r,emailPreview:l&&l.emailFromEmail&&l.emailSubject&&l.emailHtml?{fromEmail:l?.emailFromEmail,fromName:l?.emailFromName??null,subject:l?.emailSubject,previewText:l?.emailPreviewText??null,body:l?.emailHtml}:null,smsPreview:u&&u.fromPhone&&u.smsBody?{fromPhone:u?.fromPhone,body:u?.smsBody,companyName:u?.companyName}:null}),t.jsx("div",{className:"text-center text-sm text-gray-500",children:t.jsx("p",{children:"These previews show exactly how your messages will appear to your customers"})})]}:{className:"py-12 flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-6",children:t.jsx("svg",{className:"w-16 h-16 text-gray-300",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Automation Content Missing"}),t.jsx("p",{className:"text-gray-500 max-w-md",children:"Complete your automation setup to preview the content here. We'll guide you through each step. Start by clicking Actions in the top right, and then click Edit!"})]})})},NA=({automationId:e,iconDefinitions:n})=>{const{recipients:r,isLoading:o,fetchError:i}=Yx(e),{isLoading:s}=Jx(e);if(o||s)return t.jsx("div",{className:pO,children:t.jsx(zx,{text:["Fetching Recipients","Finishing up"]})});if(i)return t.jsxs("div",{children:["Error: ",i.message]});if(!r||0===r.recipients.length)return t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-4",children:t.jsx(tw.UserIcon,{className:"h-12 w-12 text-gray-400"})}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:"No Recipients Found"}),t.jsx("p",{className:"text-gray-500",children:"This automation currently has no assigned recipients. Please update the include or exclude segments to add recipients."})]});const a="30%",l="35%",c="35%";return t.jsxs("div",{className:"relative",children:[t.jsx("div",{children:t.jsx(mO,{automationId:e,iconDefinitions:n})}),t.jsx(W_,{className:"my-4"}),t.jsxs(yR,{children:[t.jsx(bR,{children:t.jsxs(wR,{children:[t.jsx(SR,{style:{width:a},children:"Name"}),t.jsx(SR,{style:{width:l},children:"Email"}),t.jsx(SR,{style:{width:c},children:"Phone"})]})}),t.jsx(xR,{children:r.recipients.map((e=>t.jsxs(wR,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(CR,{style:{width:a},children:e.first_name||e.last_name?`${e.first_name||""} ${e.last_name||""}`.trim():t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CR,{style:{width:l},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CR,{style:{width:c},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};var _A,DA="dismissableLayer.update",MA="dismissableLayer.pointerDownOutside",OA="dismissableLayer.focusOutside",RA=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),AA=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(RA),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){IA(MA,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){IA(OA,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(_A=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),LA(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_A)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),LA())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(DA,e),()=>document.removeEventListener(DA,e)}),[]),t.jsx(Bc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));AA.displayName="DismissableLayer";function LA(){const e=new CustomEvent(DA);document.dispatchEvent(e)}function IA(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(RA),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Bc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var FA=["Enter"," "],$A=["ArrowUp","PageDown","End"],qA=["ArrowDown","PageUp","Home",...$A],zA={ltr:[...FA,"ArrowRight"],rtl:[...FA,"ArrowLeft"]},UA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},VA="Menu",[BA,KA,HA]=Vc(VA),[WA,GA]=Lc(VA,[HA,HN,LR]),YA=HN(),QA=LR(),[XA,JA]=WA(VA),[ZA,eL]=WA(VA),tL=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=YA(n),[u,d]=i.useState(null),h=i.useRef(!1),f=Hc(a),p=J_(s);return i.useEffect((()=>{const e=()=>{h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>h.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(l_,{...c,children:t.jsx(XA,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(ZA,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:h,dir:p,modal:l,children:o})})})};tL.displayName=VA;var nL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YA(r);return t.jsx(c_,{...i,...o,ref:n})}));nL.displayName="MenuAnchor";var rL="MenuPortal",[oL,iL]=WA(rL,{forceMount:void 0}),sL=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=JA(rL,n);return t.jsx(oL,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};sL.displayName=rL;var aL="MenuContent",[lL,cL]=WA(aL),uL=i.forwardRef(((e,n)=>{const r=iL(aL,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=JA(aL,e.__scopeMenu),a=eL(aL,e.__scopeMenu);return t.jsx(BA.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||s.open,children:t.jsx(BA.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?dL:hL,{...i,ref:n})})})})})),dL=i.forwardRef(((e,n)=>{const r=JA(aL,e.__scopeMenu),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),t.jsx(fL,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),hL=i.forwardRef(((e,n)=>{const r=JA(aL,e.__scopeMenu);return t.jsx(fL,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),fL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...v}=e,y=JA(aL,r),b=eL(aL,r),x=YA(r),w=QA(r),S=KA(r),[C,k]=i.useState(null),E=i.useRef(null),j=Ac(n,E,y.onContentChange),T=i.useRef(0),P=i.useRef(""),N=i.useRef(0),_=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),O=g?kk:i.Fragment,R=g?{as:Fc,allowPinchZoom:!0}:void 0,A=e=>{const t=P.current+e,n=S().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),s=n.find((e=>e.textValue===i))?.ref.current;!function e(t){P.current=t,window.clearTimeout(T.current),""!==t&&(T.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))};i.useEffect((()=>()=>window.clearTimeout(T.current)),[]),RC();const L=i.useCallback((e=>D.current===_.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,t)}(e,_.current?.area)),[]);return t.jsx(lL,{scope:r,searchRef:P,onItemEnter:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),onItemLeave:i.useCallback((e=>{L(e)||(E.current?.focus(),k(null))}),[L]),onTriggerLeave:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),pointerGraceTimerRef:N,onPointerGraceIntentChange:i.useCallback((e=>{_.current=e}),[]),children:t.jsx(O,{...R,children:t.jsx(cP,{asChild:!0,trapped:s,onMountAutoFocus:Mc(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(AA,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:t.jsx(KR,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Mc(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(u_,{role:"menu","aria-orientation":"vertical","data-state":$L(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Mc(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&A(e.key));if(e.target!==E.current)return;if(!qA.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));$A.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:Mc(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),P.current="")})),onPointerMove:Mc(e.onPointerMove,UL((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));uL.displayName=aL;var pL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Bc.div,{role:"group",...o,ref:n})}));pL.displayName="MenuGroup";var mL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Bc.div,{...o,ref:n})}));mL.displayName="MenuLabel";var gL="MenuItem",vL="menu.itemSelect",yL=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=eL(gL,e.__scopeMenu),c=cL(gL,e.__scopeMenu),u=Ac(n,a),d=i.useRef(!1);return t.jsx(bL,{...s,ref:u,disabled:r,onClick:Mc(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(vL,{bubbles:!0,cancelable:!0});e.addEventListener(vL,(e=>o?.(e)),{once:!0}),Kc(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Mc(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:Mc(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||FA.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));yL.displayName=gL;var bL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=cL(gL,r),c=QA(r),u=i.useRef(null),d=Ac(n,u),[h,f]=i.useState(!1),[p,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[a.children]),t.jsx(BA.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:t.jsx(HR,{asChild:!0,...c,focusable:!o,children:t.jsx(Bc.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Mc(e.onPointerMove,UL((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Mc(e.onPointerLeave,UL((e=>l.onItemLeave(e)))),onFocus:Mc(e.onFocus,(()=>f(!0))),onBlur:Mc(e.onBlur,(()=>f(!1)))})})})})),xL=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(PL,{scope:e.__scopeMenu,checked:r,children:t.jsx(yL,{role:"menuitemcheckbox","aria-checked":qL(r)?"mixed":r,...i,ref:n,"data-state":zL(r),onSelect:Mc(i.onSelect,(()=>o?.(!!qL(r)||!r)),{checkForDefaultPrevented:!1})})})}));xL.displayName="MenuCheckboxItem";var wL="MenuRadioGroup",[SL,CL]=WA(wL,{value:void 0,onValueChange:()=>{}}),kL=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=Hc(o);return t.jsx(SL,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(pL,{...i,ref:n})})}));kL.displayName=wL;var EL="MenuRadioItem",jL=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=CL(EL,e.__scopeMenu),s=r===i.value;return t.jsx(PL,{scope:e.__scopeMenu,checked:s,children:t.jsx(yL,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":zL(s),onSelect:Mc(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));jL.displayName=EL;var TL="MenuItemIndicator",[PL,NL]=WA(TL,{checked:!1}),_L=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=NL(TL,r);return t.jsx(au,{present:o||qL(s.checked)||!0===s.checked,children:t.jsx(Bc.span,{...i,ref:n,"data-state":zL(s.checked)})})}));_L.displayName=TL;var DL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Bc.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));DL.displayName="MenuSeparator";var ML=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YA(r);return t.jsx(d_,{...i,...o,ref:n})}));ML.displayName="MenuArrow";var[OL,RL]=WA("MenuSub"),AL="MenuSubTrigger",LL=i.forwardRef(((e,n)=>{const r=JA(AL,e.__scopeMenu),o=eL(AL,e.__scopeMenu),s=RL(AL,e.__scopeMenu),a=cL(AL,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},h=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>h),[h]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(nL,{asChild:!0,...d,children:t.jsx(bL,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":$L(r.open),...e,ref:Rc(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Mc(e.onPointerMove,UL((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(a.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),h()}),100))}))),onPointerLeave:Mc(e.onPointerLeave,UL((e=>{h();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],s=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:Mc(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||zA[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));LL.displayName=AL;var IL="MenuSubContent",FL=i.forwardRef(((e,n)=>{const r=iL(aL,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=JA(aL,e.__scopeMenu),l=eL(aL,e.__scopeMenu),c=RL(IL,e.__scopeMenu),u=i.useRef(null),d=Ac(n,u);return t.jsx(BA.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||a.open,children:t.jsx(BA.Slot,{scope:e.__scopeMenu,children:t.jsx(fL,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Mc(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Mc(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:Mc(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=UA[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function $L(e){return e?"open":"closed"}function qL(e){return"indeterminate"===e}function zL(e){return qL(e)?"indeterminate":e?"checked":"unchecked"}function UL(e){return t=>"mouse"===t.pointerType?e(t):void 0}FL.displayName=IL;var VL=tL,BL=nL,KL=sL,HL=uL,WL=pL,GL=mL,YL=yL,QL=xL,XL=kL,JL=jL,ZL=_L,eI=DL,tI=ML,nI=LL,rI=FL,oI="DropdownMenu",[iI,sI]=Lc(oI,[GA]),aI=GA(),[lI,cI]=iI(oI),uI=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=aI(n),d=i.useRef(null),[h=!1,f]=cu({prop:s,defaultProp:a,onChange:l});return t.jsx(lI,{scope:n,triggerId:lC(),triggerRef:d,contentId:lC(),open:h,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(VL,{...u,open:h,onOpenChange:f,dir:o,modal:c,children:r})})};uI.displayName=oI;var dI="DropdownMenuTrigger",hI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=cI(dI,r),a=aI(r);return t.jsx(BL,{asChild:!0,...a,children:t.jsx(Bc.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:Rc(n,s.triggerRef),onPointerDown:Mc(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:Mc(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));hI.displayName=dI;var fI=e=>{const{__scopeDropdownMenu:n,...r}=e,o=aI(n);return t.jsx(KL,{...o,...r})};fI.displayName="DropdownMenuPortal";var pI="DropdownMenuContent",mI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=cI(pI,r),a=aI(r),l=i.useRef(!1);return t.jsx(HL,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:Mc(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;s.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));mI.displayName=pI;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(WL,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var gI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(GL,{...i,...o,ref:n})}));gI.displayName="DropdownMenuLabel";var vI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(YL,{...i,...o,ref:n})}));vI.displayName="DropdownMenuItem";var yI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(QL,{...i,...o,ref:n})}));yI.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(XL,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var bI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(JL,{...i,...o,ref:n})}));bI.displayName="DropdownMenuRadioItem";var xI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(ZL,{...i,...o,ref:n})}));xI.displayName="DropdownMenuItemIndicator";var wI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(eI,{...i,...o,ref:n})}));wI.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(tI,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var SI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(nI,{...i,...o,ref:n})}));SI.displayName="DropdownMenuSubTrigger";var CI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(rI,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));CI.displayName="DropdownMenuSubContent";var kI=fI,EI=mI,jI=gI,TI=vI,PI=yI,NI=bI,_I=xI,DI=wI,MI=SI,OI=CI;const RI=uI,AI=hI;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(MI,{ref:i,className:Dh("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(hd,{className:"ml-auto"})]}))).displayName=MI.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(OI,{ref:r,className:Dh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=OI.displayName;const LI=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(kI,{children:t.jsx(EI,{ref:o,sideOffset:n,className:Dh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));LI.displayName=EI.displayName;const II=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(TI,{ref:o,className:Dh("relative flex cursor-default select-none items-center gap-2 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 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));II.displayName=TI.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(PI,{ref:i,className:Dh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(_I,{children:t.jsx(cd,{className:"h-4 w-4"})})}),n]}))).displayName=PI.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(NI,{ref:o,className:Dh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(_I,{children:t.jsx(vd,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=NI.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(jI,{ref:o,className:Dh("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=jI.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(DI,{ref:r,className:Dh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=DI.displayName;const FI="reach-styles-module__stepIndicatorContainer___FoKXB",$I="reach-styles-module__iconContainer___Ki-1n",qI="reach-styles-module__checkIcon___-krUS",zI="reach-styles-module__minusIcon___r5cKs",UI="reach-styles-module__minusIconActive___-4JHM",VI="reach-styles-module__minusIconInactive___JtvVB",BI="reach-styles-module__label___tiCMA",KI="reach-styles-module__labelActive___EXydD",HI="reach-styles-module__labelInactive___g-J3r",WI=({label:e,isCompleted:n,isActive:r})=>t.jsxs("div",{className:FI,children:[t.jsx("div",n?{className:$I,children:t.jsx(cd,{className:qI})}:{className:$I,children:t.jsx(jd,{className:Dh(zI,r?UI:VI)})}),t.jsx("span",{className:Dh(BI,r?KI:HI),children:e})]}),GI=({iconDefinitions:e,handleBack:n,handleNext:r,backText:o,nextText:i,backDisabled:s,nextDisabled:a,hideBack:l,thirdOptionText:c,thirdOptionOnClick:u})=>t.jsxs("div",{className:"flex gap-4",children:[!l&&t.jsxs(lw,{onClick:n,disabled:s,variant:"secondary",className:Dh("flex items-center gap-2",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:o})]}),c&&u&&t.jsx(lw,{onClick:u,variant:"secondary",className:Dh("flex items-center gap-2"),children:t.jsx("span",{children:c})}),t.jsxs(lw,{onClick:r,disabled:a,className:Dh("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),YI="reach-styles-module__header___-izE2",QI="reach-styles-module__title___n1hA9",XI="reach-styles-module__description___EvXM-",JI="reach-styles-module__content___okv68",ZI="reach-styles-module__footer___YA4U4",eF=nd("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),tF=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:Dh(eF({variant:n}),e),...r})));tF.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(YI,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(QI,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(XI,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(JI,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(ZI,e),...n}))).displayName="CardFooter";const nF=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},rF=()=>{const e=ue({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await Ja("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var oF=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(oF||{}),iF=i.forwardRef(((e,n)=>t.jsx(Bc.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));iF.displayName="Label";var sF=iF;const aF=nd("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lF=i.forwardRef((({className:e,...n},r)=>t.jsx(sF,{ref:r,className:Dh(aF(),e),...n})));lF.displayName=sF.displayName;const cF=()=>t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Email Editor Help Center"}),t.jsx("p",{className:"text-gray-500",children:"Learn how to use our email editor's powerful features"})]}),t.jsx("div",{className:"space-y-8",children:t.jsxs("div",{className:"bg-white rounded-xl border shadow-sm p-6",children:[t.jsx("h3",{className:"text-lg font-medium mb-4",children:"Using Dynamic Content"}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-50",children:[t.jsx("img",{src:"https://reach-static-assets.s3.us-east-2.amazonaws.com/email-sms/merge-tags-demo.gif",alt:"Merge Tags Demo",className:"w-full shadow-lg"}),t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4",children:t.jsx("p",{className:"text-white text-sm",children:"Demonstration: Adding merge tags to personalize your emails"})})]}),t.jsx(dw,{onClick:()=>{},title:"Dynamic Content",subtitle:"Dynamic content is a way to insert dynamic content into your email such as the customer's name, email, or other details.",icon:t.jsx(Cd,{}),selected:!0})]})]})})]}),uF=({type:e})=>t.jsxs("div",{className:"flex items-start space-x-2 text-sm text-gray-600",children:[t.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),t.jsxs("span",{children:["Please configure at least one ",e," sender before editing the template"]})]}),dF={all:["stripo"],token:()=>[...dF.all,"token"],editorData:()=>[...dF.all,"editorData"],templates:()=>[...dF.all,"templates"],demoTemplate:()=>[...dF.templates(),"demo"]},hF=async()=>(await Ja(`${Hx}/editor-data`)).data,fF=e=>ue({queryKey:["stripo","templates",e],queryFn:()=>(async e=>(await Ja(`${Hx}/template/${e}`)).data)(e),...Wa}),pF=({containerRef:e,stripoDialogDimensions:n,showSaving:r})=>t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[t.jsx("div",{id:"externalSystemContainer",className:"flex items-center px-4 py-2"}),r&&t.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/50 flex items-center justify-center z-50",children:t.jsx(zx,{textColor:"white",color:"white",text:["Saving..."]})}),t.jsx("div",{id:"stripoEditorContainer",ref:e,style:{width:n.width-75,height:n.height-75},className:"overflow-auto z-10"})]}),mF="UiEditorScript",gF=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{forceRecreate:!0,metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await Ja(`${Hx}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(mF))r();else{const e=document.createElement("script");e.id=mF,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),vF=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a})=>{const l=n.useRef(!1),c=n.useRef(null),{data:u,isLoading:d}=fF(e.id),{data:h,isLoading:f}=(()=>{const e=ne();return{...ue({queryKey:dF.editorData(),queryFn:hF,...Wa}),invalidateEditorData:()=>e.invalidateQueries({queryKey:dF.editorData()})}})(),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateCommunicationGroup:y}=bA();return n.useEffect((()=>{if(o&&window.UIEditor&&u?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(u.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(y({groupId:u.communicationGroupId,params:{email_html_body:t}}),v(!0))},minimize:!0,mergeTags:[],forseAmp:!1,resetDataSavedFlag:!1,disableLineHeightsReplace:!0});window.StripoEditorApi.actionsApi.save((function(e){e||m(!0)}))}}),[o,c,i,r,u,y,a]),n.useEffect((()=>{(async()=>{p&&g&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),m(!1),v(!1),r(!1))})()}),[p,g,r,i]),n.useEffect((()=>{h?.businessId&&c.current&&u&&(l.current||(gF({emailId:u.communicationGroupId,html:u.html||"<div></div>",css:u.css||"",container:c.current,businessId:h.businessId,mergeFields:h.mergeFields||[]}).catch((e=>{})),l.current=!0))}),[h,u]),t.jsx("div",d||f||!h||!u?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(zx,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(pF,{containerRef:c,stripoDialogDimensions:s,showSaving:o})})},yF=({automation:e})=>{const r=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[o,i]=n.useState(r()??null),[s,a]=n.useState(!1),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(null),[p,m]=n.useState(null),[g,v]=n.useState(!1),[y,b]=n.useState(!1),[x,w]=n.useState(null),[S,C]=n.useState(null),[k,E]=n.useState(null),[j,T]=n.useState(!1),{refetchAutomation:P}=Gx(e.id),[N,_]=n.useState(!1),D=nF(x,500),M=nF(S,500),{channelSenders:O}=mA(),{channelAccounts:R}=rF(),{getCommunicationGroup:A}=vA(),{createCommunicationForAutomation:L}=yA(e.id,e),{updateCommunicationGroup:I}=bA(),{updateChannelSender:F}=gA(),{updateAutomation:$}=Xx(e.id),[q,z]=n.useState({width:0,height:0}),[U,V]=n.useState({width:0,height:0}),B=n.useRef(null),K=e=>{c(e.email_channel_sender_id),d(e.email_subject),f(e.email_preview_text),m(e.email_html_body)};if(n.useEffect((()=>{const e=()=>{B.current&&requestAnimationFrame((()=>{V({width:B.current?B.current.offsetWidth-100:0,height:B.current?B.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[B]),n.useEffect((()=>{const e=()=>{z({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>{l&&u&&p&&!s&&(a(!0),o?I({groupId:o,params:{email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}}}):L({email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}},{onSuccess:e=>{i(e.id)}}),a(!1))}),[l,u,h,p,e.action_data,I,$,r,o,s,L]),n.useEffect((()=>{o&&A(o,{onSuccess:e=>{K(e)}})}),[r,A,e.action_data,e,o,O?.channel_senders]),n.useEffect((()=>{if(void 0!==O&&!1===j){if(!o){const e=O?.channel_senders?.filter((e=>e.channel_sender_metadata.userPart));if(e?.[0]){const t=e[0];c(t.id),t&&(w(t.channel_sender_metadata.emailFromName),C(t.channel_sender_metadata.emailReplyTo))}}T(!0)}}),[j,O?.channel_senders,o,O]),n.useEffect((()=>{if(l){const e=O?.channel_senders?.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),C(e.channel_sender_metadata.emailReplyTo))}}),[l,O]),n.useEffect((()=>{if(D){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:D}}})}}),[D,O?.channel_senders,l,F]),n.useEffect((()=>{if(M){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M))return void E("Please enter a valid email address");E(null)}if(M){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:M}}})}}),[M,O?.channel_senders,l,F,S]),n.useEffect((()=>{!1===g&&o&&(A(o,{onSuccess:e=>{K(e),B.current&&V({width:B.current.offsetWidth,height:B.current.offsetHeight})}}),P())}),[g,o,A,P,O?.channel_senders]),!R||!O)return t.jsx("div",{children:t.jsx(zx,{text:["Loading..."]})});const H=O.channel_senders?.filter((e=>e.channel_sender_metadata.userPart)),W=H?.map((e=>{const t=R.channel_accounts?.find((t=>t.id===e.channel_account_id));if(!t)return null;switch(t.channel_account_metadata.type){case oF.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`};case oF.TWILLIO:return null;default:throw gw(t.channel_account_metadata.type,oF)}})).filter((e=>null!==e));return t.jsxs("div",{className:"relative",children:[t.jsx(bE,{open:N,onOpenChange:_,children:t.jsxs(SE,{className:"min-w-[50vw] min-h-[50vh]",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Email Preview Help"}),t.jsx(kE,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(cF,{})]})}),t.jsx(bE,{open:g,onOpenChange:v,children:t.jsxs(SE,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Email Editor"}),t.jsx(kE,{children:"Learn more about the email editor and how to use it to create your email."})]}),t.jsxs("div",{className:"w-full h-full",children:[t.jsxs("div",{className:"flex justify-between items-center p-1 border-b",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Email Editor"}),t.jsx(fO,{title:"Click to learn more about email template ",onClick:()=>_(!0)})]}),t.jsx("button",{onClick:()=>b(!0),className:"text-sm bg-black text-white px-3 py-1 rounded",children:"Save"})]}),t.jsx("div",{className:" w-full",children:t.jsx(vF,{showStripoEditor:g,automation:e,setShowStripoEditor:v,saveClicked:y,setSaveClicked:b,stripoDialogDimensions:q,setCommunicationGroupId:i})})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(lF,{children:"From Email"}),t.jsxs(fM,{onValueChange:e=>{c(e)},value:l??void 0,children:[t.jsx(mM,{children:t.jsx(pM,{placeholder:"Select email",children:l?W?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(yM,{children:W?.map((e=>t.jsx(bM,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(lF,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(fO,{title:"This will be the friendly name of the sender that the customer will see in the inbox",alertText:"Changes to the sender name will be applied across all emails using this address"})]})}),t.jsx(vR,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:!l})]}),t.jsxs("div",{children:[t.jsx(lF,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(fO,{title:"This will be the email address that customer can reply to on the email",alertText:"Changes to the reply to email will be applied across all emails using this address"})]})}),t.jsx(vR,{placeholder:"Enter reply to email",value:S??"",onChange:e=>C(e.target.value),disabled:!l}),k&&t.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]}),t.jsxs("div",{children:[t.jsx(lF,{children:"Subject"}),t.jsx(vR,{placeholder:"Enter email subject",value:u??"",onChange:e=>d(e.target.value)})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(lF,{children:"Preview Text"}),t.jsx(fO,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(vR,{placeholder:"Enter preview text",value:h??"",onChange:e=>f(e.target.value)})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 h-full flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsxs("div",{children:[t.jsx(lw,{onClick:()=>v(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(W?.length??0),children:"Edit"}),0===(W?.length??0)&&t.jsx("div",{className:"relative inline-block",children:t.jsx("div",{className:"absolute right-0 top-full mt-2 w-64 p-3 bg-white border rounded-lg shadow-lg z-10",children:t.jsx(uF,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 h-full w-full",ref:B,children:t.jsx(kA,{html:p??"",height:U.height,width:U.width})})]})]})]})},bF=async()=>(await Ja("/businesses/me")).data,xF=i.forwardRef((({className:e,...n},r)=>t.jsx("textarea",{className:Dh("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n})));xF.displayName="Textarea";const wF=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(!1),s=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[a,l]=n.useState(""),[c,u]=n.useState(null),[d,h]=n.useState(!1),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(s()??null),[b,x]=n.useState(!1),[w,S]=n.useState(!1),{channelSenders:C}=mA(),{data:k,isLoading:E}={...ue({queryKey:["me"],queryFn:bF,...Wa})},{channelAccounts:j}=rF(),{createCommunicationForAutomation:T}=yA(e.id,e),{updateCommunicationGroup:P}=bA(),{getCommunicationGroup:N}=vA(),{getMergeFields:_,isGetting:D}=xA(),M=n.useRef(null),O=nF(m,1e3),R=nF(c,1e3),A=nF(f,1e3),L=e=>I?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??I?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{null===R||null===O||o||(i(!0),v?P({groupId:v,params:{sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A}}):T({sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A},{onSuccess:e=>{y(e.id)}}),i(!1))}),[R,O,A,o,v,P,T]),n.useEffect((()=>{v&&N(v,{onSuccess:e=>{u(e.sms_channel_sender_id),g(e.sms_message_body),e.text_message_company_name&&p(e.text_message_company_name)}})}),[e.action_data,v,N,k]);if(n.useEffect((()=>{if(void 0!==C&&!1===b){const e=C.channel_senders?.filter((e=>e.channel_sender_metadata.from));e?.[0]&&u(e[0].id),x(!0)}}),[C,b]),n.useEffect((()=>{f||!k?.name||d||(h(!0),p(k.name))}),[f,k?.name,d]),!j||!C||D||E)return t.jsx("div",{children:t.jsx(zx,{text:["Loading..."]})});const I=C.channel_senders?.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(bE,{open:w,onOpenChange:S,children:t.jsxs(SE,{children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"SMS Editor"}),t.jsx(kE,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx(xF,{ref:M,className:"min-h-[300px]",placeholder:"Text message content...",value:m??"",onChange:e=>{g(e.target.value)},maxLength:1600-(f?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(fM,{value:a,onValueChange:e=>{const t=M.current,n=m||"",r=t?.selectionStart??n.length,o=t?.selectionEnd??n.length,i=n.slice(0,r)+e+n.slice(o);g(i),l(""),setTimeout((()=>{const n=r+e.length;t?.focus(),t?.setSelectionRange(n,n)}),0)},children:[t.jsx(mM,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(yM,{children:_?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(bM,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(fO,{title:"Dynamic content is a way to insert dynamic content into your messages such as the customer's name, email, or other details."})]}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(m&&m.length>1400?m.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[m?m.length:0,"/",1600-(f?.length||0)," ","characters"]})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(lF,{children:"From Number"}),t.jsxs(fM,{onValueChange:e=>{u(e)},value:c??void 0,children:[t.jsx(mM,{children:t.jsx(pM,{placeholder:"Select number",children:c?L(c):"Select number"})}),t.jsx(yM,{children:I?.map((e=>t.jsx(bM,{value:e.id,children:e.channel_sender_metadata.friendlyName??e.channel_sender_metadata.from??"Select number"},e.id)))})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(lF,{children:"Company Name"}),t.jsx(fO,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(vR,{placeholder:"Enter company name",value:f??"",onChange:e=>{p(e.target.value??null)},disabled:!c})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsx("div",{children:t.jsx(lw,{onClick:()=>S(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(I?.length??0),children:"Edit"})})]}),t.jsx("div",{children:c?t.jsx(t.Fragment,{children:c&&m?t.jsx(jA,{fromPhone:L(c),body:f?`${f}:\n${m}`:m}):t.jsx(CA,{type:"sms"})}):t.jsx(uF,{type:"sms"})})]})]})]})},SF=({selectedChannels:e,setSelectedChannels:n,expandedChannels:r,setExpandedChannels:o,iconDefinitions:i})=>{const{toast:s}=Dc(),a="flex items-center gap-2 px-3 py-1.5 rounded-md transition-all duration-200";return t.jsxs("div",{className:"",children:[t.jsx("h3",{className:"text-xl",children:"Message Types"}),t.jsx("p",{className:"text-gray-600 mb-2",children:"Select the channels you want to use in this automation"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(lw,{variant:e.includes("email")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("email")?e.includes("sms")?n(["sms"]):s({title:"Cant Remove Email",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"email"]),o([...r||[],"email"]))},children:[t.jsx("span",{children:t.jsx(i.EmailIcon,{size:15})}),"Email"]}),t.jsxs(lw,{variant:e.includes("sms")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("sms")?e.includes("email")?n(["email"]):s({title:"Cant Remove SMS",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"sms"]),o([...r||[],"sms"]))},children:[t.jsx("span",{children:t.jsx(i.SmsIcon,{size:15})}),"SMS"]})]})]})},CF=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(null),[s,a]=n.useState(null),{getCommunicationGroup:l}=vA(),{updateCommunicationGroup:c}=bA(),u=n.useMemo((()=>{const t=e.action_data?.map((e=>e.action_metadata.communication_group_id));if(t&&0!==t.length&&!(t.length>1))return t[0]}),[e]);n.useEffect((()=>{const e=u;if(!e)return i(["email"]),void a(["email"]);l(e,{onSuccess:e=>{const t=[];e.email_channel_sender_id&&t.push("email"),e.sms_channel_sender_id&&t.push("sms"),i(t),a(t)}})}),[e,l,u]),n.useEffect((()=>{const e=u;e&&o&&(o.includes("email")||c({groupId:e,params:{email_channel_sender_id:null}}),o.includes("sms")||c({groupId:e,params:{sms_channel_sender_id:null}}))}),[o,u,c]);const d=e=>{a((t=>t?.includes(e)?t?.filter((t=>t!==e)):[...t||[],e]))};return o&&s?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(tF,{className:"p-4 rounded-xl shadow-none",children:t.jsx(SF,{selectedChannels:o,setSelectedChannels:i,expandedChannels:s,setExpandedChannels:a,iconDefinitions:r})}),o.includes("email")&&t.jsxs(tF,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("email"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(Fx.div,{animate:{rotate:s?.includes("email")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"Email Campaign"})]}),t.jsx(Zh,{children:s?.includes("email")&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(yF,{automation:e})})})})]}),o.includes("sms")&&t.jsxs(tF,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("sms"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(Fx.div,{animate:{rotate:s?.includes("sms")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"SMS Campaign"})]}),t.jsx(Zh,{children:s?.includes("sms")&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(wF,{automation:e,iconDefinitions:r})})})})]})]}):t.jsx("div",{className:"py-4 flex justify-center items-center",children:t.jsx(zx,{text:["Loading..."]})})},kF=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=TE({include_segments:r,exclude_segments:o});n.useEffect((()=>{c()}),[r,o]);const u=n.useMemo((()=>a?.recipients?a.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[a?.recipients]);return t.jsxs("div",{className:"w-full p-4",children:[t.jsxs("div",{className:"mb-4 md:mb-6",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:i}),s&&t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[30rem]:grid-cols-3 gap-2 md:gap-3 mb-4 md:mb-6",children:[t.jsx(Fx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block bg-blue-100/50 rounded-xl p-2.5",children:t.jsx(e.UserIcon,{className:"w-5 h-5 text-blue-600"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Total Matches"}),t.jsx("p",{className:"text-xl font-semibold text-gray-900 truncate",children:l?t.jsx("span",{className:"animate-pulse",children:"..."}):a?.count?.toLocaleString()??0})]})]})}),t.jsx(Fx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(Fx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-blue-100/50 text-blue-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.emails/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Email Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.emails}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(Fx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(Fx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-green-100/50 text-green-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.phones/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Phone Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.phones}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.phones?"contact":"contacts"})]})]})]})})]})}),!l&&a?.recipients&&t.jsx("div",{className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl border border-gray-100 overflow-hidden",children:t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-gray-100/90 backdrop-blur-sm",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Name"}),t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Contact"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-200/50",children:a.recipients.map(((e,n)=>t.jsxs("tr",{className:"hover:bg-white/50 transition-colors",children:[t.jsxs("td",{className:"px-3 sm:px-4 py-3 text-sm text-gray-900",children:[e.first_name," ",e.last_name]}),t.jsx("td",{className:"px-3 sm:px-4 py-3",children:t.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[e.email&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg",children:"Email"}),e.phone&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg",children:"Phone"})]})})]},n)))})]})})})]})};function EF(e){return(EF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jF(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function TF(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function PF(e){TF(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===EF(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function NF(e,t){TF(2,arguments);var n=PF(e),r=jF(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function _F(e,t){TF(2,arguments);var n=PF(e),r=jF(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var DF={};function MF(){return DF}function OF(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=PF(e),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function RF(e){return TF(1,arguments),OF(e,{weekStartsOn:1})}function AF(e){TF(1,arguments);var t=function(e){TF(1,arguments);var t=PF(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=RF(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=RF(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),RF(n)}function LF(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function IF(e){TF(1,arguments);var t=PF(e);return t.setHours(0,0,0,0),t}function FF(e,t){TF(2,arguments);var n=IF(e),r=IF(t),o=n.getTime()-LF(n),i=r.getTime()-LF(r);return Math.round((o-i)/864e5)}function $F(e,t){return TF(2,arguments),NF(e,7*jF(t))}function qF(e,t){return TF(2,arguments),_F(e,12*jF(t))}function zF(e,t){TF(2,arguments);var n=IF(e),r=IF(t);return n.getTime()===r.getTime()}function UF(e){return TF(1,arguments),e instanceof Date||"object"===EF(e)&&"[object Date]"===Object.prototype.toString.call(e)}function VF(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function BF(e){TF(1,arguments);var t=PF(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function KF(e){TF(1,arguments);var t=PF(e);return t.setDate(1),t.setHours(0,0,0,0),t}function HF(e){TF(1,arguments);var t=PF(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function WF(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=PF(e),f=h.getDay(),p=6+(f<d?-7:0)-(f-d);return h.setDate(h.getDate()+p),h.setHours(23,59,59,999),h}function GF(e){return TF(1,arguments),WF(e,{weekStartsOn:1})}function YF(e,t){return TF(2,arguments),function(e,t){TF(2,arguments);var n=PF(e).getTime(),r=jF(t);return new Date(n+r)}(e,-jF(t))}function QF(e){TF(1,arguments);var t=PF(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function XF(e){TF(1,arguments);var t=PF(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=QF(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=QF(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function JF(e){TF(1,arguments);var t=PF(e),n=QF(t).getTime()-function(e){TF(1,arguments);var t=XF(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),QF(n)}(t).getTime();return Math.round(n/6048e5)+1}function ZF(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=PF(e),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function e$(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=PF(e),d=u.getUTCFullYear(),h=MF(),f=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var m=ZF(p,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var v=ZF(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function t$(e,t){TF(1,arguments);var n=PF(e),r=ZF(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=e$(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),ZF(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function n$(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var r$=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return n$("yy"===t?r%100:r,t.length)},o$=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):n$(n+1,2)},i$=function(e,t){return n$(e.getUTCDate(),t.length)},s$=function(e,t){return n$(e.getUTCHours()%12||12,t.length)},a$=function(e,t){return n$(e.getUTCHours(),t.length)},l$=function(e,t){return n$(e.getUTCMinutes(),t.length)},c$=function(e,t){return n$(e.getUTCSeconds(),t.length)},u$=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return n$(Math.floor(r*Math.pow(10,n-3)),t.length)},d$="midnight",h$="noon",f$="morning",p$="afternoon",m$="evening",g$="night",v$={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return r$(e,t)},Y:function(e,t,n,r){var o=e$(e,r),i=o>0?o:1-o;return"YY"===t?n$(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):n$(i,t.length)},R:function(e,t){return n$(XF(e),t.length)},u:function(e,t){return n$(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return n$(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return n$(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return o$(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return n$(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=t$(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):n$(o,t.length)},I:function(e,t,n){var r=JF(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):n$(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):i$(e,t)},D:function(e,t,n){var r=function(e){TF(1,arguments);var t=PF(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime();return Math.floor((n-r)/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):n$(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return n$(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return n$(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return n$(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?h$:0===o?d$:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?m$:o>=12?p$:o>=4?f$:g$,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return s$(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):a$(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):n$(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):n$(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):l$(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):c$(e,t)},S:function(e,t){return u$(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return b$(o);case"XXXX":case"XX":return x$(o);default:return x$(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return b$(o);case"xxxx":case"xx":return x$(o);default:return x$(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+y$(o,":");default:return"GMT"+x$(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+y$(o,":");default:return"GMT"+x$(o,":")}},t:function(e,t,n,r){return n$(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return n$((r._originalDate||e).getTime(),t.length)}};function y$(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var s=t;return n+String(o)+s+n$(i,2)}function b$(e,t){return e%60==0?(e>0?"-":"+")+n$(Math.abs(e)/60,2):x$(e,t)}function x$(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+n$(Math.floor(o/60),2)+n+n$(o%60,2)}var w$=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},S$=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},C$={p:S$,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return w$(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",w$(o,t)).replace("{{time}}",S$(i,t))}},k$=["D","DD"],E$=["YY","YYYY"];function j$(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var T$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function P$(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var N$={date:P$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:P$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:P$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},_$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function D$(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var M$={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:D$({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:D$({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:D$({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:D$({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:D$({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function O$(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;var i,s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(a,(function(e){return e.test(s)}));return i=e.valueCallback?e.valueCallback(l):l,{value:i=n.valueCallback?n.valueCallback(i):i,rest:t.slice(s.length)}}}var R$={ordinalNumber:function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:O$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:O$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:O$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:O$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:O$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},A$={code:"en-US",formatDistance:function(e,t,n){var r,o=T$[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:N$,formatRelative:function(e,t,n,r){return _$[e]},localize:M$,match:R$,options:{weekStartsOn:0,firstWeekContainsDate:1}},L$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,I$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,F$=/^'([^]*?)'?$/,$$=/''/g,q$=/[a-zA-Z]/;function z$(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x;TF(2,arguments);var w=String(t),S=MF(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:A$,k=jF(null!==(i=null!==(s=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:S.firstWeekContainsDate)&&void 0!==s?s:null===(d=S.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=jF(null!==(f=null!==(p=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:S.weekStartsOn)&&void 0!==p?p:null===(b=S.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var j=PF(e);if(!function(e){if(TF(1,arguments),!UF(e)&&"number"!=typeof e)return!1;var t=PF(e);return!isNaN(Number(t))}(j))throw new RangeError("Invalid time value");var T=YF(j,LF(j)),P={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:j};return w.match(I$).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,C$[t])(e,C.formatLong):e})).join("").match(L$).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(F$);if(!t)return e;return t[1].replace($$,"'")}(r);var i=v$[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===E$.indexOf(r)||j$(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==k$.indexOf(e)}(r)||j$(r,t,String(e)),i(T,r,C.localize,P);if(o.match(q$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function U$(e){return TF(1,arguments),Math.floor(function(e){return TF(1,arguments),PF(e).getTime()}(e)/1e3)}function V$(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=function(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=PF(e),d=u.getFullYear(),h=MF(),f=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var m=OF(p,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var v=OF(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(h,0,d),f.setHours(0,0,0,0),OF(f,t)}function B$(e,t){return TF(1,arguments),function(e,t,n){TF(2,arguments);var r=OF(e,n),o=OF(t,n),i=r.getTime()-LF(r),s=o.getTime()-LF(o);return Math.round((i-s)/6048e5)}(function(e){TF(1,arguments);var t=PF(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),KF(e),t)+1}function K$(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getTime()>r.getTime()}function H$(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getTime()<r.getTime()}function W$(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function G$(e,t){return TF(2,arguments),NF(e,-jF(t))}function Y$(e,t){TF(2,arguments);var n=PF(e),r=jF(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=function(e){TF(1,arguments);var t=PF(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return n.setMonth(r,Math.min(i,a)),n}function Q$(e,t){TF(2,arguments);var n=PF(e),r=jF(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var X$=function(){return X$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},X$.apply(this,arguments)};function J$(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Z$(e){return"multiple"===e.mode}function eq(e){return"range"===e.mode}function tq(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var nq={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var rq=Object.freeze({__proto__:null,formatCaption:function(e,t){return z$(e,"LLLL y",t)},formatDay:function(e,t){return z$(e,"d",t)},formatMonthCaption:function(e,t){return z$(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return z$(e,"cccccc",t)},formatYearCaption:function(e,t){return z$(e,"yyyy",t)}}),oq=Object.freeze({__proto__:null,labelDay:function(e,t,n){return z$(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return z$(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var iq=n.createContext(void 0);function sq(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:nq,formatters:rq,labels:oq,locale:A$,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},s=function(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=KF(r):t&&(i=new Date(t,0,1)),o?s=BF(o):n&&(s=new Date(n,11,31)),{fromDate:i?IF(i):void 0,toDate:s?IF(s):void 0}}(o),a=s.fromDate,l=s.toDate,c=null!==(n=o.captionLayout)&&void 0!==n?n:i.captionLayout;"buttons"===c||a&&l||(c="buttons"),(tq(o)||Z$(o)||eq(o))&&(r=o.onSelect);var u=X$(X$(X$({},i),o),{captionLayout:c,classNames:X$(X$({},i.classNames),o.classNames),components:X$({},o.components),formatters:X$(X$({},i.formatters),o.formatters),fromDate:a,labels:X$(X$({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:X$(X$({},i.modifiers),o.modifiers),modifiersClassNames:X$(X$({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:X$(X$({},i.styles),o.styles),toDate:l});return t.jsx(iq.Provider,{value:u,children:e.children})}function aq(){var e=n.useContext(iq);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function lq(e){var n=aq();return t.jsx("div",{className:n.classNames.caption_label,style:n.styles.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:(0,n.formatters.formatCaption)(e.displayMonth,{locale:n.locale})})}function cq(e){return t.jsx("svg",X$({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function uq(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=aq(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:cq;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:o,children:s}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function dq(e){var n,r=aq(),o=r.fromDate,i=r.toDate,s=r.styles,a=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});var h=[];if(function(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=KF(o),p=o.getMonth();p<=i.getMonth();p++)h.push(Y$(f,p));else for(f=KF(new Date),p=0;p<=11;p++)h.push(Y$(f,p));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:uq;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=Y$(KF(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:a}),children:h.map((function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:a})},e.getMonth())}))})}function hq(e){var n,r=e.displayMonth,o=aq(),i=o.fromDate,s=o.toDate,a=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,h=o.labels.labelYearDropdown,f=[];if(!i)return t.jsx(t.Fragment,{});if(!s)return t.jsx(t.Fragment,{});for(var p=i.getFullYear(),m=s.getFullYear(),g=p;g<=m;g++)f.push(Q$(HF(new Date),g));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:uq;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=Q$(KF(r),Number(t.target.value));e.onChange(n)},value:r.getFullYear(),caption:d(r,{locale:a}),children:f.map((function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:a})},e.getFullYear())}))})}function fq(){var e=aq(),t=function(e){var t=e.month||e.defaultMonth||e.today||new Date,n=e.toDate,r=e.fromDate,o=e.numberOfMonths,i=void 0===o?1:o;return n&&VF(n,t)<0&&(t=_F(n,-1*(i-1))),r&&VF(t,r)<0&&(t=r),KF(t)}(e),r=function(e,t){var r=n.useState(e);return[void 0===t?r[0]:t,r[1]]}(t,e.month),o=r[1];return[r[0],function(t){var n;if(!e.disableNavigation){var r=KF(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var pq=n.createContext(void 0);function mq(e){var n=aq(),r=fq(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=KF(e),i=VF(KF(_F(o,r)),o),s=[],a=0;a<i;a++){var l=_F(o,a);s.push(l)}return n&&(s=s.reverse()),s}(o,n),a=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.numberOfMonths,o=void 0===r?1:r,i=t.pagedNavigation?o:1,s=KF(e);if(!n)return _F(s,i);if(!(VF(n,e)<o))return _F(s,i)}}(o,n),l=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.numberOfMonths,o=t.pagedNavigation?void 0===r?1:r:1,i=KF(e);if(!n)return _F(i,-o);if(!(VF(i,n)<=0))return _F(i,-o)}}(o,n),c=function(e){return s.some((function(t){return W$(e,t)}))};return t.jsx(pq.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&H$(e,t)?i(_F(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function gq(){var e=n.useContext(pq);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function vq(e){var n,r=aq(),o=r.classNames,i=r.styles,s=r.components,a=gq().goToMonth,l=function(t){a(_F(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:lq,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:i.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(dq,{onChange:l,displayMonth:e.displayMonth}),t.jsx(hq,{onChange:l,displayMonth:e.displayMonth})]})}function yq(e){return t.jsx("svg",X$({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function bq(e){return t.jsx("svg",X$({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var xq=n.forwardRef((function(e,n){var r=aq(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=X$(X$({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",X$({},e,{ref:n,type:"button",className:a,style:l}))}));function wq(e){var n,r,o=aq(),i=o.dir,s=o.locale,a=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,h=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var f=u(e.previousMonth,{locale:s}),p=[a.nav_button,a.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:s}),g=[a.nav_button,a.nav_button_next].join(" "),v=null!==(n=null==h?void 0:h.IconRight)&&void 0!==n?n:bq,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:yq;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(xq,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:t.jsx("rtl"===i?v:y,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(xq,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:t.jsx("rtl"===i?y:v,{className:a.nav_icon,style:l.nav_icon})})]})}function Sq(e){var n=aq().numberOfMonths,r=gq(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return W$(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(wq,{displayMonth:e.displayMonth,hideNext:n>1&&(c||!u),hidePrevious:n>1&&(u||!c),nextMonth:i,previousMonth:o,onPreviousClick:function(){o&&s(o)},onNextClick:function(){i&&s(i)}})}function Cq(e){var n,r,o=aq(),i=o.classNames,s=o.styles,a=o.captionLayout,l=o.components,c=null!==(n=null==l?void 0:l.CaptionLabel)&&void 0!==n?n:lq;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(vq,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(vq,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(Sq,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(Sq,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function kq(e){var n=aq(),r=n.footer;return r?t.jsx("tfoot",{className:n.classNames.tfoot,style:n.styles.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:r})})}):t.jsx(t.Fragment,{})}function Eq(){var e=aq(),n=e.classNames,r=e.styles,o=e.showWeekNumber,i=e.locale,s=e.formatters.formatWeekdayName,a=e.labels.labelWeekday,l=function(e,t,n){for(var r=n?RF(new Date):OF(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=NF(r,i);o.push(s)}return o}(i,e.weekStartsOn,e.ISOWeek);return t.jsxs("tr",{style:r.head_row,className:n.head_row,children:[o&&t.jsx("td",{style:r.head_cell,className:n.head_cell}),l.map((function(e,o){return t.jsx("th",{scope:"col",className:n.head_cell,style:r.head_cell,"aria-label":a(e,{locale:i}),children:s(e,{locale:i})},o)}))]})}function jq(){var e,n=aq(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:Eq;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function Tq(e){var n=aq();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var Pq=n.createContext(void 0);function Nq(e){if(!Z$(e.initialProps)){return t.jsx(Pq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(_q,{initialProps:e.initialProps,children:e.children})}function _q(e){var n=e.initialProps,r=e.children,o=n.selected,i=n.min,s=n.max,a={disabled:[]};return o&&a.disabled.push((function(e){var t=s&&o.length>s-1,n=o.some((function(t){return zF(t,e)}));return Boolean(t&&!n)})),t.jsx(Pq.Provider,{value:{selected:o,onDayClick:function(e,t,r){var a,l;if((null===(a=n.onDayClick)||void 0===a||a.call(n,e,t,r),!Boolean(t.selected&&i&&(null==o?void 0:o.length)===i))&&!Boolean(!t.selected&&s&&(null==o?void 0:o.length)===s)){var c=o?J$([],o):[];if(t.selected){var u=c.findIndex((function(t){return zF(e,t)}));c.splice(u,1)}else c.push(e);null===(l=n.onSelect)||void 0===l||l.call(n,c,e,t,r)}},modifiers:a},children:r})}function Dq(){var e=n.useContext(Pq);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var Mq,Oq,Rq=n.createContext(void 0);function Aq(e){if(!eq(e.initialProps)){return t.jsx(Rq.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(Lq,{initialProps:e.initialProps,children:e.children})}function Lq(e){var n=e.initialProps,r=e.children,o=n.selected,i=o||{},s=i.from,a=i.to,l=n.min,c=n.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],a?(u.range_end=[a],zF(s,a)||(u.range_middle=[{after:s,before:a}])):u.range_end=[s]):a&&(u.range_start=[a],u.range_end=[a]),l&&(s&&!a&&u.disabled.push({after:G$(s,l-1),before:NF(s,l-1)}),s&&a&&u.disabled.push({after:s,before:NF(s,l-1)}),!s&&a&&u.disabled.push({after:G$(a,l-1),before:NF(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:NF(s,1-c)}),u.disabled.push({after:NF(s,c-1)})),s&&a){var d=c-(FF(a,s)+1);u.disabled.push({before:G$(s,d)}),u.disabled.push({after:NF(a,d)})}!s&&a&&(u.disabled.push({before:NF(a,1-c)}),u.disabled.push({after:NF(a,c-1)}))}return t.jsx(Rq.Provider,{value:{selected:o,onDayClick:function(e,t,r){var i,s;null===(i=n.onDayClick)||void 0===i||i.call(n,e,t,r);var a=function(e,t){var n=t||{},r=n.from,o=n.to;if(r&&o){if(zF(o,e)&&zF(r,e))return;if(zF(o,e))return{from:o,to:void 0};if(zF(r,e))return;return K$(r,e)?{from:e,to:o}:{from:r,to:e}}return o?K$(e,o)?{from:o,to:e}:{from:e,to:o}:r?H$(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,o);null===(s=n.onSelect)||void 0===s||s.call(n,a,e,t,r)},modifiers:u},children:r})}function Iq(){var e=n.useContext(Rq);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Fq(e){return Array.isArray(e)?J$([],e):void 0!==e?[e]:[]}(Oq=Mq||(Mq={})).Outside="outside",Oq.Disabled="disabled",Oq.Selected="selected",Oq.Hidden="hidden",Oq.Today="today",Oq.RangeStart="range_start",Oq.RangeEnd="range_end",Oq.RangeMiddle="range_middle";var $q=Mq.Selected,qq=Mq.Disabled,zq=Mq.Hidden,Uq=Mq.Today,Vq=Mq.RangeEnd,Bq=Mq.RangeMiddle,Kq=Mq.RangeStart,Hq=Mq.Outside;var Wq=n.createContext(void 0);function Gq(e){var n=aq(),r=function(e,t,n){var r,o=((r={})[$q]=Fq(e.selected),r[qq]=Fq(e.disabled),r[zq]=Fq(e.hidden),r[Uq]=[e.today],r[Vq]=[],r[Bq]=[],r[Kq]=[],r[Hq]=[],r);return e.fromDate&&o[qq].push({before:e.fromDate}),e.toDate&&o[qq].push({after:e.toDate}),Z$(e)?o[qq]=o[qq].concat(t.modifiers[qq]):eq(e)&&(o[qq]=o[qq].concat(n.modifiers[qq]),o[Kq]=n.modifiers[Kq],o[Bq]=n.modifiers[Bq],o[Vq]=n.modifiers[Vq]),o}(n,Dq(),Iq()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=Fq(e[1])})),t}(n.modifiers),i=X$(X$({},r),o);return t.jsx(Wq.Provider,{value:i,children:e.children})}function Yq(){var e=n.useContext(Wq);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Qq(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(UF(t))return zF(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(UF)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return n=e,s=(r=t).to,(i=r.from)&&s?(FF(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),FF(n,i)>=0&&FF(s,n)>=0):s?zF(s,n):!!i&&zF(i,n);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var a=FF(t.before,e)>0,l=FF(t.after,e)<0;return K$(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?FF(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?FF(t.before,e)>0:"function"==typeof t&&t(e)}))}function Xq(e,t,n){var r=Object.keys(t).reduce((function(n,r){return Qq(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!W$(e,n)&&(o.outside=!0),o}function Jq(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=void 0===s?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,h={day:NF,week:$F,month:_F,year:qF,startOfWeek:function(e){return o.ISOWeek?RF(e):OF(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?GF(e):WF(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(TF(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==EF(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=PF(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)})),n||new Date(NaN)}([c,h]):"after"===r&&u&&(h=function(e){var t,n;if(TF(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==EF(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=PF(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=Xq(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:Jq(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:X$(X$({},a),{count:a.count+1})})}var Zq=n.createContext(void 0);function ez(e){var r=gq(),o=Yq(),i=n.useState(),s=i[0],a=i[1],l=n.useState(),c=l[0],u=l[1],d=function(e,t){for(var n,r,o=KF(e[0]),i=BF(e[e.length-1]),s=o;s<=i;){var a=Xq(s,t);if(a.disabled||a.hidden)s=NF(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=NF(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=aq(),m=function(e,t){if(s){var n=Jq(s,{moveBy:e,direction:t,context:p,modifiers:o});zF(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(Zq.Provider,{value:{focusedDay:s,focusTarget:h,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}},children:e.children})}function tz(){var e=n.useContext(Zq);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var nz=n.createContext(void 0);function rz(e){if(!tq(e.initialProps)){return t.jsx(nz.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(oz,{initialProps:e.initialProps,children:e.children})}function oz(e){var n=e.initialProps;return t.jsx(nz.Provider,{value:{selected:n.selected,onDayClick:function(e,t,r){var o,i,s;null===(o=n.onDayClick)||void 0===o||o.call(n,e,t,r),!t.selected||n.required?null===(s=n.onSelect)||void 0===s||s.call(n,e,e,t,r):null===(i=n.onSelect)||void 0===i||i.call(n,void 0,e,t,r)}},children:e.children})}function iz(){var e=n.useContext(nz);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function sz(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(Mq).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function az(e,r,o){var i,s,a,l=aq(),c=tz(),u=function(e,t){return Xq(e,Yq(),t)}(e,r),d=function(e,t){var n=aq(),r=iz(),o=Dq(),i=Iq(),s=tz(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,f=s.focusMonthBefore,p=s.focusMonthAfter,m=s.focusYearBefore,g=s.focusYearAfter,v=s.focusStartOfWeek,y=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;tq(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):Z$(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):eq(n)?null===(c=i.onDayClick)||void 0===c||c.call(i,e,t,s):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,s)},onFocus:function(r){var o;h(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,r)},onBlur:function(r){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,r)},onKeyDown:function(r){var o;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?a():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():a();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():p();break;case"Home":r.preventDefault(),r.stopPropagation(),v();break;case"End":r.preventDefault(),r.stopPropagation(),y()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,r)},onKeyUp:function(r){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,r)},onMouseEnter:function(r){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,r)},onMouseLeave:function(r){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,r)},onPointerEnter:function(r){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,r)},onPointerLeave:function(r){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,r)},onTouchCancel:function(r){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,r)},onTouchEnd:function(r){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,r)},onTouchMove:function(r){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,r)},onTouchStart:function(r){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,r)}}}(e,u),h=function(){var e=aq(),t=iz(),n=Dq(),r=Iq();return tq(e)?t.selected:Z$(e)?n.selected:eq(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&zF(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=sz(l,u).join(" "),m=function(e,t){var n=X$({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=X$(X$({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),g=Boolean(u.outside&&!l.showOutsideDays||u.hidden),v=null!==(a=null===(s=l.components)||void 0===s?void 0:s.DayContent)&&void 0!==a?a:Tq,y={style:m,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&zF(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&zF(c.focusedDay,e),w=X$(X$(X$({},y),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=x||b?0:-1,i)),d);return{isButton:f,isHidden:g,activeModifiers:u,selectedDays:h,buttonProps:w,divProps:y}}function lz(e){var r=n.useRef(null),o=az(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(xq,X$({name:"day",ref:r},o.buttonProps)):t.jsx("div",X$({},o.divProps))}function cz(e){var n=e.number,r=e.dates,o=aq(),i=o.onWeekNumberClick,s=o.styles,a=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(n),{locale:l});if(!i)return t.jsx("span",{className:a.weeknumber,style:s.weeknumber,children:u});var d=c(Number(n),{locale:l});return t.jsx(xq,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function uz(e){var n,r,o,i=aq(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:lz,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:cz;return i.showWeekNumber&&(o=t.jsx("td",{className:a.cell,style:s.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:a.row,style:s.row,children:[o,e.dates.map((function(n){return t.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:t.jsx(c,{displayMonth:e.displayMonth,date:n})},U$(n))}))]})}function dz(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?GF(t):WF(t,n),o=(null==n?void 0:n.ISOWeek)?RF(e):OF(e,n),i=FF(r,o),s=[],a=0;a<=i;a++)s.push(NF(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){TF(1,arguments);var t=PF(e),n=RF(t).getTime()-AF(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){TF(1,arguments);var n=PF(e),r=OF(n,t).getTime()-V$(n,t).getTime();return Math.round(r/6048e5)+1}(t,n),o=e.find((function(e){return e.weekNumber===r}));return o?(o.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)}),[]);return l}function hz(e){var n,r,o,i=aq(),s=i.locale,a=i.classNames,l=i.styles,c=i.hideHead,u=i.components,d=i.weekStartsOn,h=i.firstWeekContainsDate,f=i.ISOWeek,p=function(e,t){var n=dz(KF(e),BF(e),t);if(null==t?void 0:t.useFixedWeeks){var r=B$(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=$F(i,6-r),a=dz($F(i,1),s,t);n.push.apply(n,a)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(i.fixedWeeks),ISOWeek:f,locale:s,weekStartsOn:d,firstWeekContainsDate:h}),m=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:jq,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:uz,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:kq;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(m,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:p.map((function(n){return t.jsx(g,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(v,{displayMonth:e.displayMonth})]})}var fz="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,pz=!1,mz=0;function gz(){return"react-day-picker-".concat(++mz)}function vz(e){var r,o,i=aq(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=gq().displayMonths,d=function(e){var t,r=null!=e?e:pz?gz():null,o=n.useState(r),i=o[0],s=o[1];return fz((function(){null===i&&s(gz())}),[]),n.useEffect((function(){!1===pz&&(pz=!0)}),[]),null!==(t=null!=e?e:i)&&void 0!==t?t:void 0}(i.id?"".concat(i.id,"-").concat(e.displayIndex):void 0),h=i.id?"".concat(i.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],p=l.month,m=0===e.displayIndex,g=e.displayIndex===u.length-1,v=!m&&!g;"rtl"===s&&(g=(r=[m,g])[0],m=r[1]),m&&(f.push(a.caption_start),p=X$(X$({},p),l.caption_start)),g&&(f.push(a.caption_end),p=X$(X$({},p),l.caption_end)),v&&(f.push(a.caption_between),p=X$(X$({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:Cq;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(hz,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function yz(e){var n=aq();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function bz(e){var r,o,i=e.initialProps,s=aq(),a=tz(),l=gq(),c=n.useState(!1),u=c[0],d=c[1];n.useEffect((function(){s.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),d(!0)))}),[s.initialFocus,u,a.focus,a.focusTarget,a]);var h=[s.classNames.root,s.className];s.numberOfMonths>1&&h.push(s.classNames.multiple_months),s.showWeekNumber&&h.push(s.classNames.with_weeknumber);var f=X$(X$({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return X$(X$({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:yz;return t.jsx("div",X$({className:h.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},p,{children:t.jsx(m,{children:l.displayMonths.map((function(e,n){return t.jsx(vz,{displayIndex:n,displayMonth:e},n)}))})}))}function xz(e){var n=e.children,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children"]);return t.jsx(sq,{initialProps:r,children:t.jsx(mq,{children:t.jsx(rz,{initialProps:r,children:t.jsx(Nq,{initialProps:r,children:t.jsx(Aq,{initialProps:r,children:t.jsx(Gq,{children:t.jsx(ez,{children:n})})})})})})})}function wz(e){return t.jsx(xz,X$({},e,{children:t.jsx(bz,{initialProps:e})}))}function Sz({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(wz,{showOutsideDays:r,className:Dh("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Dh(aw({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:Dh("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===o.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:Dh(aw({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:()=>t.jsx(dd,{className:"h-4 w-4"}),IconRight:()=>t.jsx(hd,{className:"h-4 w-4"})},...o})}Sz.displayName="Calendar";const Cz=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(A_,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(L_,{asChild:!0,children:t.jsxs(lw,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(pd,{className:"opacity-50"})]})}),t.jsx(I_,{className:"w-[200px] p-0",children:t.jsxs(ZT,{children:[t.jsx(eP,{placeholder:r,className:"h-9"}),t.jsxs(tP,{children:[t.jsx(nP,{children:o}),t.jsx(rP,{children:e.map((e=>t.jsxs(iP,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(cd,{className:Dh("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},kz=({automation:e})=>{const r=()=>e.trigger_metadata?.scheduled_at?new Date(e.trigger_metadata.scheduled_at):TO(new Date,15),[o,s]=i.useState(r()),[a,l]=i.useState(r()<new Date?"Please select a time in the future":null),[c,u]=i.useState(pR(o,"HH:mm")),{updateAutomation:d}=Xx(e.id),[h,f]=i.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),p=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=TO(new Date,15);new Date(e.toLocaleString("en-US",{timeZone:h}))<new Date(t.toLocaleString("en-US",{timeZone:h}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(e))};return n.useEffect((()=>{const e=new Date(o.toLocaleString("en-US",{timeZone:h})),t=-e.getTimezoneOffset(),n=Math.floor(Math.abs(t)/60).toString().padStart(2,"0"),r=(Math.abs(t)%60).toString().padStart(2,"0"),i=t>=0?"+":"-",s=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:00${i}${n}:${r}`;d({trigger:{trigger_type:Zx.ONE_TIME,scheduled_at:s,timezone:h}})}),[o,h,d]),t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full ",children:[t.jsxs(A_,{children:[t.jsx(L_,{asChild:!0,children:t.jsxs(lw,{variant:"outline",className:Dh("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(ld,{className:"mr-2 h-4 w-4"}),o?pR(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(I_,{className:"w-auto p-0",children:t.jsx(Sz,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=c.split(":").map(Number);e.setHours(t,n),m(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:c,onChange:e=>{if(u(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),m(r)}},className:Dh("flex h-9 w-full sm:w-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"border-red-500")}),t.jsx(Cz,{data:p,placeholder:"Select timezone...",searchPlaceholder:"Search timezone...",noResultsMessage:"No timezone found",value:h,setValue:e=>{const t=new Date(o.toLocaleString("en-US",{timeZone:e})),n=TO(new Date,15);t<new Date(n.toLocaleString("en-US",{timeZone:e}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(t),f(e))}})]}),a&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),a]})]})},Ez=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(Fx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(dw,{selected:"sendNow"===i,title:"Send Now",subtitle:"Campaign will begin sending in 5 minutes",icon:t.jsx(e.SendButton,{}),onClick:()=>{s("sendNow"),o({trigger:{trigger_type:Zx.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(dw,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(Zh,{children:"schedule"===i&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mt-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center",children:t.jsx(kz,{automation:r})})})})]}),r.trigger_metadata.scheduled_at&&t.jsxs(Fx.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.6,ease:[.23,1,.32,1],delay:.1},className:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(Fx.p,{initial:{opacity:0},animate:{opacity:.8},transition:{delay:.3,duration:.4},className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx(Fx.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.4},className:"text-md font-bold text-gray-800",children:new Date(r.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short",timeZone:r.trigger_metadata.timezone||void 0})})]})]})})})},jz=({automation:e,iconDefinitions:r,loading:o})=>{const i=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),{updateAutomation:s}=Xx(e.id),[a,l]=n.useState(!1),c=i(),{getCommunicationGroup:u}=vA(),{channelSenders:d}=mA(),{channelAccounts:h}=rF(),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(null),[b,x]=n.useState(null);return n.useEffect((()=>{d&&y(d),h&&x(h)}),[d,h]),n.useEffect((()=>{c?u(c,{onSuccess:e=>{const t=e.email_channel_sender_id,n=e.sms_channel_sender_id,r=v?.channel_senders.find((e=>e.id===t)),o=v?.channel_senders.find((e=>e.id===n));if(r&&e.email_subject&&e.email_html_body){const t=r.channel_sender_metadata?.userPart,n=b?.channel_accounts.find((e=>e.id===r.channel_account_id));if(n)switch(n.channel_account_metadata.type){case oF.REACH_MANAGED:p({fromEmail:`${t}@${n.channel_account_metadata.baseDomain}.embedreach.com`,fromName:r.channel_sender_metadata.emailFromName,subject:e.email_subject,previewText:e.email_preview_text,body:e.email_html_body});break;case oF.TWILLIO:break;default:throw gw(n.channel_account_metadata.type,oF)}}if(o){const t=v?.channel_senders.find((e=>e.id===n));t&&e.sms_message_body&&(t.channel_sender_metadata?.from||t.channel_sender_metadata?.messageServiceSid)&&g({fromPhone:SA(t.channel_sender_metadata),body:e.sms_message_body,companyName:e.text_message_company_name})}l(!0)},onError:()=>{l(!0)}}):l(!0)}),[b?.channel_accounts,v?.channel_senders,c,u]),o||!a?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(zx,{text:["Loading..."]})}):f||m?t.jsxs("div",{className:"max-w-8xl mx-auto p-6 gap-4 grid",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsx(TA,{emailPreview:f,smsPreview:m,iconDefinitions:r}),t.jsx(kF,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),t.jsx(tF,{className:"p-4 shadow-sm border-none",children:t.jsx(Ez,{automation:e,iconDefinitions:r,updateAutomation:s})})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},Tz=({iconDefinitions:e,onSelectionChange:r,defaultValue:o="all"})=>{const[i,s]=n.useState(o),a=e=>{s(e),r?.(e)};return t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx(dw,{onClick:()=>a("all"),title:"All patrons",subtitle:"Send to everyone",icon:t.jsx(e.UsersIcon,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"all"===i}),t.jsx(dw,{onClick:()=>a("segments"),title:"Select patrons",subtitle:"Choose from segments",icon:t.jsx(e.UserEdit,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"segments"===i})]})},Pz=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(Y_,{selectedValues:l,setSelectedValues:c,options:u,defaultValue:e,onValueChange:t=>{const n=t.filter((t=>!e.includes(t))),r=e.filter((e=>!t.includes(e)));n.forEach(o),r.forEach(i)},placeholder:"Select segments",maxCount:5,extraCommandItems:[e=>t.jsxs(iP,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Nz=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Pz,{segments:r,allSegments:l?.segments||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(lw,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(Fx.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(Zh,{children:u&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{},children:t.jsx(Pz,{segments:o,allSegments:l?.segments||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},_z=({iconDefinitions:e,automation:r})=>{const{toast:o}=Dc(),[i,s]=n.useState(!1),[a,l]=n.useState(!1),{segments:c,isLoading:u,refetchSegments:d}=(()=>{const e=ue({queryKey:["segments"],queryFn:()=>EE()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:h}=Xx(r.id),[f,p]=n.useState(r.includeSegmentIds||[]),[m,g]=n.useState(r.excludeSegmentIds||[]),v=1===f.length&&0===m.length&&void 0!==c?.segments?.find((e=>e.type===DE.ALL_USERS&&e.id===f[0])),[y,b]=n.useState(v?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(f)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(m))&&h({include_segments:f,exclude_segments:m})}),[f,m,r.includeSegmentIds,r.excludeSegmentIds,h]);const x=n.useCallback((()=>c?.segments?.find((e=>e.type===DE.ALL_USERS))),[c]);return n.useEffect((()=>{if("all"===y&&c){const e=x();e&&p([e.id]),g([])}}),[y,c,x]),n.useEffect((()=>{if(!a&&c){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){b("all");const e=x();return e&&h({include_segments:[e.id],exclude_segments:[]}),void l(!0)}b(v?"all":"segments"),l(!0)}}),[y,f.length,m.length,c,a,v,x,h,r.includeSegmentIds,r.excludeSegmentIds]),!u&&c&&a?t.jsxs("div",{className:"p-3 w-full h-full flex items-center justify-center",children:[t.jsx(bE,{open:i,modal:!0,onOpenChange:s,children:t.jsxs(SE,{hideCloseButton:!0,children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Create Segment"}),t.jsx(kE,{children:"Create a new segment to use in your automation."})]}),t.jsx(jM,{iconDefinitions:e,onClose:e=>{var t;"error"===e?(o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),s(!1)):!1===e?s(!1):e&&(t=e,d(),p((e=>[...e,t])),s(!1))}})]})}),t.jsx("div",{className:" w-full",children:t.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[t.jsxs(Fx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" flex flex-col items-center justify-center",children:[t.jsx(Tz,{iconDefinitions:e,onSelectionChange:e=>{b(e)},defaultValue:y}),t.jsx(Zh,{mode:"wait",children:"segments"===y&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:"easeInOut"},className:"mt-4 w-full",children:t.jsx(Nz,{iconDefinitions:e,includedSegments:f,excludedSegments:m,handleAddSegment:(e,t)=>{"include"===t?p((t=>[...t,e])):g((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?p((t=>t.filter((t=>t!==e)))):g((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:s,segments:c,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(Fx.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:" rounded-lg p-8 flex flex-col justify-start h-full shadow-sm",children:t.jsx(kF,{iconDefinitions:e,includeSegments:f,excludeSegments:m,title:"Estimated Matches",subtitle:"The number of recipients will update in real-time as you add or remove lists."})})]})})]}):t.jsx("div",{children:t.jsx(zx,{text:["Fetching segments","Finishing up"]})})},Dz=({title:e,subtitle:n,content:r})=>t.jsxs("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl bg-gray-100 ",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold",children:e}),n&&t.jsx("p",{className:"text-gray-600 mt-1",children:n})]}),t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 relative",children:r})]}),Mz=({automationId:e,iconDefinitions:r,logoUrl:o,setOpenEditAutomationPopup:i})=>{const{toast:s}=Dc(),[a,l]=n.useState(0),{automation:c}=Gx(e),[u,d]=n.useState(!1),{updateAutomation:h}=Xx(e),{getCommunicationGroup:f}=vA();if(!c)return t.jsx("div",{children:t.jsx(zx,{text:["Fetching Automation data","Finishing up"]})});const p=[{id:"audience",title:"Choose Audience",isValid:()=>!!(c&&c.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>!!c.action_data?.length&&null!==c.action_data?.find((e=>"send_communication"===e.action_type))?.action_metadata.communication_group_id},{id:"preview",title:"Preview and Schedule",isValid:()=>!1}];return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("div",{className:"w-full px-6 py-4 border-b border-gray-200 flex items-center gap-4",children:t.jsx("div",{className:"flex-shrink-0",children:o&&t.jsx("img",{src:o,alt:"Logo",className:"w-6 h-6"})})}),t.jsxs("div",{className:"flex-1 flex flex-col px-6 pt-0",children:[t.jsxs("div",{className:"flex gap-8 flex-1",children:[t.jsxs("nav",{className:"hidden lg:block space-y-0 w-50 self-start",children:[t.jsx("div",{className:"mb-5 mt-4",children:t.jsxs("button",{onClick:()=>i(!1),className:"flex items-center gap-1 px-2 py-1.5 bg-gray-100 rounded-full text-gray-700 hover:bg-gray-200 text-sm",children:[t.jsx("span",{children:"←"})," Go back"]})}),t.jsxs("div",{className:"pb-4",children:[t.jsx("h1",{className:"text-xl font-bold mb-2",children:"Automations"}),t.jsx("p",{className:"text-gray-600 text-sm",children:"Configure your automations"})]}),p.map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n===a?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n<a?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(WI,{label:e.title,isActive:n===a,isCompleted:e.isValid()})},e.id)))]}),t.jsx("div",{className:"hidden lg:block h-[100%] w-px bg-gray-200 dark:bg-gray-700"}),t.jsx("div",{className:"flex-1 relative",children:t.jsx("div",{className:"h-[calc(100vh-10rem)] overflow-y-auto overflow-visible",children:t.jsx("div",{className:"min-h-full flex items-center justify-center",children:t.jsxs(Zh,{mode:"wait",children:[0===a&&t.jsx($x,{className:"w-full max-w-8xl py-8",children:t.jsx(Dz,{title:"Choose Audience",content:t.jsx(_z,{iconDefinitions:r,automation:c})})},"audience"),1===a&&t.jsx($x,{className:"w-full max-w-8xl py-8",children:t.jsx(Dz,{title:"Edit Content",content:t.jsx(CF,{automation:c,iconDefinitions:r})})},"content"),2===a&&t.jsx($x,{className:"w-full max-w-8xl py-8",children:t.jsx(Dz,{title:"Preview and Schedule",content:t.jsx(jz,{automation:c,iconDefinitions:r,loading:u})})},"preview")]})})})})]}),t.jsx("div",{className:"absolute bottom-5 right-5 z-5 bg-white/30 backdrop-blur-xl p-2 rounded-xl border border-gray-200/50 shadow-lg",children:t.jsx(GI,{iconDefinitions:r,handleBack:()=>{l(a-1)},handleNext:async()=>{const{canMove:e,errorMessage:t}=await(async()=>{if(0===a)return{canMove:c.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(1===a){const e=c.action_data?.find((e=>"send_communication"===e.action_type));if(!e)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};const t=e.action_metadata.communication_group_id,n=await new Promise(((e,n)=>{f(t,{onSuccess:t=>{e(t)},onError:()=>{n("Error fetching communication group")}})}));if(!n||!n.sms_channel_sender_id&&!n.email_channel_sender_id)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(n.email_channel_sender_id&&(!n.email_html_body||!n.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(n.sms_channel_sender_id&&!n.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}return{canMove:!0,errorMessage:null}})();e?2===a?(d(!0),h({status:ew.ACTIVE}),i(!1),s({title:"Automation scheduled!"})):l(a+1):s({title:"Oops!",description:t??"Please fill out all required fields",variant:"destructive"})},hideBack:0===a,backText:0===a?"Cancel":"Back",nextText:2===a?"Schedule":"Next",backDisabled:0===a,nextDisabled:2===a&&!(c.trigger_metadata.scheduled_at&&new Date(c.trigger_metadata.scheduled_at)>new Date&&Boolean(c.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:2===a?"Save as Draft":void 0,thirdOptionOnClick:()=>{h({status:ew.DRAFT}),i(!1),s({title:"Automation saved as draft",description:"You can continue editing it later"})}})})]})]})},Oz=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),Rz=e=>{if(!/^[0-9\s()+.-]+$/.test(e))return!1;const t=e.replace(/\D/g,"");return e.startsWith("+")?t.length>=10&&t.length<=15:10===t.length||!(11!==t.length||!t.startsWith("1"))},Az=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),{getCommunicationGroup:u}=vA(),[d,h]=n.useState(null),[f,p]=n.useState(!1),{sendTestCommunication:m,sendError:g,isSendSuccess:v}=wA(),{toast:y}=Dc(),b=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;return n?new Promise(((e,t)=>{u(n,{onSuccess:n=>{switch(r){case"email":e(n.email_channel_sender_id);break;case"sms":e(n.sms_channel_sender_id);break;default:t(new Error(`Unsupported type: ${r}`))}},onError:e=>{t(e||new Error("Error fetching communication group"))}})})):Promise.resolve(null)}),[e.action_data,u,r]);n.useEffect((()=>{(async()=>{try{const e=await b();h(e)}catch(e){h(null)}finally{p(!0)}})()}),[b]),n.useEffect((()=>{v&&(y({title:"Success",description:`Preview ${"email"===r?"email":"SMS"} sent successfully!`}),o(!1))}),[v,r,o,y]),n.useEffect((()=>{g&&(y({title:"Error",description:`Failed to send preview: ${g.message}`,variant:"destructive"}),o(!1))}),[g,y,o]);return f?d?t.jsxs("div",{className:"",children:[t.jsxs("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:["Send Preview ","email"===r?"Email":"SMS"]}),t.jsx(vR,{type:"email"===r?"email":"tel",placeholder:"email"===r?"Enter email address":"Enter phone number",value:s,onChange:e=>{a(e.target.value),c("")},className:"w-full px-3 py-3 border border-gray-300 rounded-lg text-base mb-4 \n focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n placeholder-gray-400"}),l&&t.jsx("p",{className:"text-red-500 text-sm mb-4 -mt-2",children:l}),t.jsx(lw,{onClick:()=>{if(!("email"===r?Oz(s):Rz(s)))return void c("Please enter a valid "+("email"===r?"email address":"phone number"));if(!d)return void c("No sender found, please update the automation first!");const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;if(!n)return Promise.resolve(null);m({id:n,params:"email"===r?{email_address:s}:{phone_number:s}})},disabled:!s,className:"w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium\n hover:bg-blue-700 transition-colors duration-200\n disabled:bg-gray-400 disabled:cursor-not-allowed",children:"Send Preview"})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsxs("div",{className:"text-center flex flex-col justify-center items-center gap-2",children:[t.jsx(i.AlertCircleIcon,{className:"h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No sender found"}),t.jsx("p",{className:"text-gray-500",children:"Please update the automation to include a sender for this type"})]})}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(zx,{text:["Fetching sender id","Finishing up"]})})},Lz=({automation:e,iconDefinitions:r,autoOpenEditPopup:o,showBackButton:i=!1,logoUrl:s})=>{const a=xS(),[l,c]=n.useState(!1),[u,d]=n.useState(!1),[h,f]=n.useState(!1),[p,m]=n.useState(!1),{updateAutomation:g}=Xx(e.id),{invalidateAutomation:v}=Gx(e.id);n.useEffect((()=>{o&&c(!0)}),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(bE,{open:l,onOpenChange:e=>{c(e),!1===e&&v()},children:t.jsxs(SE,{className:"max-w-screen min-h-screen max-h-screen overflow-hidden rounded-none sm:rounded-none",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Edit Automation"}),t.jsx(kE,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(Mz,{automationId:e.id,iconDefinitions:r,setOpenEditAutomationPopup:c,logoUrl:s})]})}),t.jsx(bE,{open:h,onOpenChange:f,children:t.jsxs(SE,{className:"sm:max-w-[425px]",children:[t.jsx(CE,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(kE,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(lw,{variant:"outline",onClick:()=>f(!1),children:"Keep Running"}),t.jsx(lw,{variant:"destructive",onClick:()=>{g({status:ew.DEACTIVATED}),f(!1)},children:"Yes, Cancel Automation"})]})]})}),t.jsx(bE,{open:u,onOpenChange:d,children:t.jsxs(SE,{className:"",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Send Preview SMS"}),t.jsx(kE,{children:"Send a preview SMS to the automation."})]}),t.jsx(Az,{automation:e,type:"sms",setOpenSendPreviewPopup:d,iconDefinitions:r})]})}),t.jsx(bE,{open:p,onOpenChange:m,children:t.jsxs(SE,{className:"",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Send Preview Email"}),t.jsx(kE,{children:"Send a preview email to the automation."})]}),t.jsx(Az,{automation:e,type:"email",setOpenSendPreviewPopup:m,iconDefinitions:r})]})}),t.jsxs("div",{className:"p-6 border-b border-gray-200",children:[i&&t.jsx("div",{className:"flex justify-between items-start mb-4",children:t.jsx("div",{children:t.jsx(lw,{onClick:()=>a(-1),children:"Back"})})}),t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("h1",{className:"text-2xl font-semibold mb-1",children:[e.name," "]}),t.jsx(ER,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(RI,{modal:!1,children:[t.jsx(AI,{asChild:!0,children:t.jsxs(lw,{children:["Actions",t.jsx(r.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(LI,{children:[e.status===ew.DRAFT&&t.jsx(II,{onClick:()=>c(!0),children:"Edit"}),e.status===ew.ACTIVE&&t.jsx(II,{onClick:()=>{g({status:ew.DRAFT})},children:"Convert to Draft"}),e.status!==ew.COMPLETED&&e.status!==ew.FAILED&&e.status!==ew.DEACTIVATED&&t.jsx(II,{onClick:()=>f(!0),children:"Cancel"}),t.jsx(II,{onClick:()=>d(!0),children:"Send Preview SMS"}),t.jsx(II,{onClick:()=>m(!0),children:"Send Preview Email"})]})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Name"}),t.jsx("div",{className:"font-medium",children:e.name})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Date Created"}),t.jsx("div",{className:"font-medium",children:pR(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===Zx.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Type"}),t.jsx("div",{className:"font-medium",children:"One Time"})]})}),t.jsx("div",{children:e.trigger_type===Zx.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Scheduled For"}),t.jsx("div",{className:"font-medium",children:pR(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})},Iz=({iconDefinitions:e,autoOpenEditPopup:n,automationId:r,showBackButton:o=!1,logoUrl:s})=>{const a=nw(e),l=function(){let{matches:e}=i.useContext(pS),t=e[e.length-1];return t?t.params:{}}(),[c]=nC(),u=r||l?.automationId||c.get("automationId"),d=n||c.get("autoOpenEditPopup"),h="true"===c.get("showBackButton")||o,f=nw(a),{automation:p,isFetching:m,isLoading:g,fetchError:v}=Gx(u||"");return u?p||!m&&!g?v?t.jsxs("div",{children:["Error: ",v.message]}):p?t.jsxs("div",{className:pw,children:[t.jsx(Lz,{automation:p,iconDefinitions:f,autoOpenEditPopup:d,showBackButton:h,logoUrl:s}),t.jsx("div",{className:"pt-4",children:t.jsxs(dA,{defaultValue:"content",children:[t.jsxs(hA,{children:[t.jsx(fA,{value:"content",children:"Content"}),t.jsx(fA,{value:"recipients",children:"Recipients"})]}),t.jsx(pA,{value:"recipients",children:t.jsx(NA,{automationId:u,iconDefinitions:f})}),t.jsx(pA,{value:"content",children:t.jsx(PA,{automationId:u,iconDefinitions:f})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:pw,children:t.jsx(zx,{text:["Fetching Automation data","Finishing up"]})}):t.jsx("div",{children:"Invalid automation ID"})};Object.values(Object.assign({}));var Fz=e=>null!=e;var $z=e=>"function"!=typeof e||e.length?e:e(),qz=e=>Array.isArray(e)?e:e?[e]:[];var zz=$e;var Uz,Vz=function(e){const[t,n]=_e(),r=e?.throw?(e,t)=>{throw n(e instanceof Error?e:new Error(t)),e}:(e,t)=>{n(e instanceof Error?e:new Error(t))},o=e?.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=e?.prefix?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=_e(void 0,{equals:!1}),s.set(n,a)),a[0]();const l=o.reduce(((e,t)=>{if(null!==e||!t)return e;try{return t.getItem(`${i}${n}`)}catch(oQ){return r(oQ,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&e?.deserializer?e.deserializer(l,n,e.options):l}});return!1!==e?.sync&&Fe((()=>{const e=e=>{let t=!1;o.forEach((n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(oQ){r(oQ,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}})),t&&e.key&&s.get(e.key)?.[1]()};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),$e((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>t.addEventListener?.("storage",e))),$e((()=>o.forEach((t=>t.removeEventListener?.("storage",e))))))})),[a,(t,n,a)=>{const l=e?.serializer?e.serializer(n,t,a??e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(oQ){r(oQ,`Error setting ${i}${t} to ${l} in ${e.name}`)}}));const u=s.get(t);u&&u[1]()},{clear:()=>o.forEach((e=>{try{e.clear()}catch(oQ){r(oQ,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(oQ){r(oQ,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&e?.deserializer?e.deserializer(r,n,e.options):r;o&&(t[n]=o)}};return o.forEach((e=>{if("function"==typeof e.getAll){let t;try{t=e.getAll()}catch(oQ){r(oQ,`Error getting all values from in ${e.name}`)}for(const e of t)n(e,t[e])}else{let o,i=0;try{for(;o=e.key(i++);)t.hasOwnProperty(o)||n(o,e.getItem(o))}catch(oQ){r(oQ,`Error getting all values from ${e.name}`)}}})),t}}]},Bz=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:"boolean"==typeof r?`; ${n}`:`; ${n}=${r}`}return t},Kz=("function"==typeof(Uz={_cookies:[globalThis.document,"cookie"],getItem:e=>Kz._cookies[0][Kz._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=Kz.getItem(e);Kz._cookies[0][Kz._cookies[1]]=`${e}=${t}${Bz(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:Kz});window.dispatchEvent(o)},removeItem:e=>{Kz._cookies[0][Kz._cookies[1]]=`${e}=deleted${Bz({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return Kz._cookies[0][Kz._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return Kz._cookies[0][Kz._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(Uz.clear=()=>{let e;for(;e=Uz.key(0);)Uz.removeItem(e)}),Uz),Hz=796,Wz="bottom",Gz="system",Yz=Object.keys(Jn)[0],Qz=Object.keys(tr)[0],Xz=Be({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function Jz(){return Ke(Xz)}var Zz=Be(void 0),eU=e=>{const[t,n]=_e(null),r=()=>{const e=t();null!=e&&(e.close(),n(null))},o=(r,o)=>{if(null!=t())return;const i=window.open("","TSQD-Devtools-Panel",`width=${r},height=${o},popup`);if(!i)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");i.document.head.innerHTML="",i.document.body.innerHTML="",function(e=window.document){if(e[Ot]){for(let t of e[Ot].keys())e.removeEventListener(t,Wt);delete e[Ot]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(Jz().shadowDOMTarget||document).styleSheets].forEach((e=>{try{const t=[...e.cssRules].map((e=>e.cssText)).join(""),n=document.createElement("style"),r=e.ownerNode;let o="";r&&"id"in r&&(o=r.id),o&&n.setAttribute("id",o),n.textContent=t,i.document.head.appendChild(n)}catch(nQ){const n=document.createElement("link");if(null==e.href)return;n.rel="stylesheet",n.type=e.type,n.media=e.media.toString(),n.href=e.href,i.document.head.appendChild(n)}})),Lt(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};Oe((()=>{"true"!==(e.localStore.pip_open??"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),Oe((()=>{const e=(Jz().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(Jz().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),$e((()=>{t.disconnect()}))}}));const i=Re((()=>({pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:e.disabled??!1})));return ut(Zz.Provider,{value:i,get children(){return e.children}})},tU=()=>Re((()=>{const e=Ke(Zz);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),nU=Be((()=>"dark"));function rU(){return Ke(nU)}var oU={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},iU=Object.keys(oU).join("|"),sU=new RegExp(iU,"g");var aU=7,lU=6,cU=5,uU=4,dU=3,hU=2,fU=1,pU=0;function mU(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:fU,!n.accessors){const r=gU(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}const o=function(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const o=t[r],i=xU(o),s=yU(e,o);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:i})}return n}(e,n.accessors),i={rankedValue:e,rank:pU,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=gU(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=fU?r=a:r>l&&(r=l),r=Math.min(r,l),r>=c&&r>i.rank&&(i.rank=r,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=c,i.rankedValue=e.itemValue)}return i}function gU(e,t,n){return e=vU(e,n),(t=vU(t,n)).length>e.length?pU:e===t?aU:(e=e.toLowerCase())===(t=t.toLowerCase())?lU:e.startsWith(t)?cU:e.includes(` ${t}`)?uU:e.includes(t)?dU:1===t.length?pU:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?hU:function(e,t){let n=0,r=0;function o(e,t,r){for(let o=r,i=t.length;o<i;o++){if(t[o]===e)return n+=1,o+1}return-1}function i(e){return fU+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return pU;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return pU}return i(r-s)}(e,t)}function vU(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(sU,(e=>oU[e]))),e}function yU(e,t){let n=t;"object"==typeof t&&(n=t.accessor);const r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}var bU={maxRanking:1/0,minRanking:-1/0};function xU(e){return"function"==typeof e?bU:{...bU,...e}}var wU={data:""},SU=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,CU=/\/\*[^]*?\*\/| +/g,kU=/\n+/g,EU=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?EU(s,i):i+"{"+EU(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=EU(s,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=EU.p?EU.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},jU={},TU=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+TU(e[n]);return t}return e};function PU(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=TU(e),s=jU[i]||(jU[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!jU[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=SU.exec(e.replace(CU,""));)t[4]?r.shift():t[3]?(n=t[3].replace(kU," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(kU," ").trim();return r[0]})(e);jU[s]=EU(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&jU.g?jU.g:null;return n&&(jU.g=jU[s]),l=jU[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d})(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":EU(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||wU),t.g,t.o,t.k);var r}function NU(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=NU(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _U(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=NU(e))&&(r&&(r+=" "),r+=t);return r}function DU(e,t){const n=Le(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=_e([],{equals:!1}),[l]=[Ue,ze],c=e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return Re((t=>{const n=s(),a=e();if(Le(l))return l(),t;if(n.length){const e=t.filter((e=>!n.includes(e)));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:c}),e}return Le((()=>{const e=new Set(a),n=a.slice(),s=[],l=[],d=[];for(const t of a)(o.has(t)?d:s).push(t);let h=!s.length;for(let r=0;r<t.length;r++){const o=t[r];e.has(o)||(i.has(o)||(l.push(o),i.add(o)),u(n,o,r)),h&&o!==n[r]&&(h=!1)}return!l.length&&h?t:(r({list:n,added:s,removed:l,unchanged:d,finishRemoved:c}),o=e,n)}))}),t.appear?[]:n.slice())}function MU(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}PU.bind({g:1}),PU.bind({k:1});var OU=e=>e instanceof Element;function RU(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return RU(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=RU(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function AU(e,t=OU,n=OU){const r=Re(e),o=Re((()=>RU(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function LU(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function IU(e,t,n,r){const{onBeforeEnter:o,onEnter:i,onAfterEnter:s}=t;function a(t){t&&t.target!==n||(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),s?.(n))}o?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return r?.();i?.(n,(()=>a()))})),LU((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function FU(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return r?.();function a(t){t&&t.target!==n||(r?.(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),s?.(n))}o?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),i?.(n,(()=>a())),LU((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var $U=e=>{const t=function(e){return Re((()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}}))}(e);return DU(AU((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)IU(s,e,t);const a=[];for(const e of i)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&a.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask((()=>{const e=[];for(const{el:t,rect:n}of a)if(t.isConnected){const r=t.getBoundingClientRect(),o=n.left-r.left,i=n.top-r.top;(o||i)&&(t.style.transform=`translate(${o}px, ${i}px)`,t.style.transitionDuration="0s",e.push(t))}document;for(const t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener("transitionend",e),t.classList.remove(...s.move))};t.classList.add(...s.move),t.style.transform=t.style.transitionDuration="",t.addEventListener("transitionend",e)}}));for(const t of r)FU(s,e,t,(()=>o([t])))}})},qU=Symbol("fallback");function zU(e){for(const t of e)t.dispose()}function UU(e){const{by:t}=e;return Re(function(e,t,n,r={}){const o=new Map;return $e((()=>zU(o.values()))),()=>{const n=e()||[];return Le((()=>{if(!n.length)return zU(o.values()),o.clear(),r.fallback?[Ne((e=>(o.set(qU,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(qU);if(!o.size||s){s?.dispose(),o.delete(qU);for(let r=0;r<n.length;r++){const o=n[r];i(e,o,r,t(o,r))}return e}const a=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);a.delete(l);const c=o.get(l);c?(e[r]=c.mapped,c.setIndex?.(r),c.setItem((()=>s))):i(e,s,r,l)}for(const t of a)o.get(t)?.dispose(),o.delete(t);return e}))};function i(e,t,r,i){Ne((s=>{const[a,l]=_e(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=_e(r);c.setIndex=t,c.mapped=n(a,e)}else c.mapped=n(a);o.set(i,c),e[r]=c.mapped}))}}((()=>e.each),"function"==typeof t?t:e=>e[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function VU(e,t,n,r){const o=()=>{qz($z(e)).forEach((e=>{e&&qz($z(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),zz(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?Oe(o):Me(o)}function BU(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return $e(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}((e=>{for(const n of e){const{contentRect:e,target:o}=n,i=Math.round(e.width),s=Math.round(e.height),a=r.get(o);a&&a.width===i&&a.height===s||(t(e,o,n),r.set(o,{width:i,height:s}))}}),n);Oe((t=>{const n=qz($z(e)).filter(Fz);return function(e,t,n,r){const o=e.length,i=t.length;let s,a,l=0;if(i)if(o){for(;l<i&&t[l]===e[l];l++);for(s of(t=t.slice(l),e=e.slice(l),t))e.includes(s)||r(s);for(a of e)t.includes(a)||n(a)}else for(;l<i;l++)r(t[l]);else for(;l<o;l++)n(e[l])}(n,t,o,i),n}),[])}var KU=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function HU(e){const t={};let n;for(;n=KU.exec(e);)t[n[1]]=n[2];return t}function WU(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=HU(e)}else"string"==typeof t&&(t=HU(t));return{...e,...t}}function GU(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function YU(e){return"[object String]"===Object.prototype.toString.call(e)}function QU(e){return t=>`${e()}-${t}`}function XU(e,t){return!!e&&(e===t||e.contains(t))}function JU(e,t=!1){const{activeElement:n}=ZU(e);if(!n?.nodeName)return null;if(eV(n)&&n.contentDocument)return JU(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=ZU(n).getElementById(e);if(t)return t}}return n}function ZU(e){return e?e.ownerDocument||e:document}function eV(e){return"IFRAME"===e.tagName}var tV=(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))(tV||{});function nV(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function rV(){return nV(/^Mac/i)}function oV(){return nV(/^iPhone/i)||nV(/^iPad/i)||rV()&&navigator.maxTouchPoints>1}function iV(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function sV(e){return t=>{for(const n of e)iV(t,n)}}function aV(e){return rV()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function lV(e){if(e)if(function(){if(null==cV){cV=!1;try{document.createElement("div").focus({get preventScroll(){return cV=!0,!0}})}catch(nQ){}}return cV}())e.focus({preventScroll:!0});else{const t=function(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;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var cV=null;var uV=["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'])"],dV=[...uV,'[tabindex]:not([tabindex="-1"]):not([disabled])'],hV=uV.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",fV=dV.join(':not([hidden]):not([tabindex="-1"]),');function pV(e,t){const n=Array.from(e.querySelectorAll(hV)).filter(mV);return t&&mV(e)&&n.unshift(e),n.forEach(((e,t)=>{if(eV(e)&&e.contentDocument){const r=pV(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function mV(e){return gV(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function gV(e){return e.matches(hV)&&vV(e)}function vV(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||vV(e.parentElement,e))}function yV(e){for(;e&&!bV(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function bV(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function xV(){}function wV(e,t){return mt(e,t)}var SV=new Map,CV=new Set;function kV(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=SV.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),SV.delete(t.target)),0===SV.size)){for(const e of CV)e();CV.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=SV.get(t.target);n||(n=new Set,SV.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function EV(e,t){const n=jV(e,t,"left"),r=jV(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function jV(e,t,n){const r="left"===n?"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}"undefined"!=typeof document&&("loading"!==document.readyState?kV():document.addEventListener("DOMContentLoaded",kV));var TV={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 PV(e){return t=>(e(t),()=>e(void 0))}function NV(e,t){const[n,r]=_e(_V(t?.()));return Oe((()=>{r(e()?.tagName.toLowerCase()||_V(t?.()))})),n}function _V(e){return YU(e)?e:void 0}function DV(e){const[t,n]=gt(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return ut(en,mt(n,{get component(){return t.as}}))}var MV=["id","name","validationState","required","disabled","readOnly"];var OV=Be();function RV(){const e=Ke(OV);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function AV(e){const t=RV(),n=wV({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(DV,mt({as:"div"},(()=>t.dataset()),n))}function LV(e){const t=RV(),n=wV({id:t.generateId("error-message")},e),[r,o]=gt(n,["forceMount"]),i=()=>"invalid"===t.validationState();return Oe((()=>{i()&&$e(t.registerErrorMessage(o.id))})),ut(Ct,{get when(){return r.forceMount||i()},get children(){return ut(DV,mt({as:"div"},(()=>t.dataset()),o))}})}function IV(e){let t;const n=RV(),r=wV({id:n.generateId("label")},e),[o,i]=gt(r,["ref"]),s=NV((()=>t),(()=>"label"));return Oe((()=>$e(n.registerLabel(i.id)))),ut(DV,mt({as:"label",ref(e){const n=MU((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Re((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function FV(e,t){Oe(Ie(e,(e=>{if(null==e)return;const n=function(e){return function(e){return e.matches("textarea, input, select, button")}(e)?e.form:e.closest("form")}(e);null!=n&&(n.addEventListener("reset",t,{passive:!0}),$e((()=>{n.removeEventListener("reset",t)})))})))}function $V(e){const[t,n]=_e(e.defaultValue?.()),r=Re((()=>void 0!==e.value?.())),o=Re((()=>r()?e.value?.():t()));return[o,t=>{Le((()=>{const i=function(e,...t){return"function"==typeof e?e(...t):e}(t,o());return Object.is(i,o())||(r()||n(i),e.onChange?.(i)),i}))}]}function qV(e){const[t,n]=$V(e);return[()=>t()??!1,n]}var zV=Object.defineProperty,UV=(e,t)=>{for(var n in t)zV(e,n,{get:t[n],enumerable:!0})},VV=Be();function BV(){return Ke(VV)}function KV(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function HV(e,t){const n=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.ref(),s=o.ref();return i===s?0:i&&s?KV(i,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(e);e!==n&&t(n)}function WV(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){Oe((()=>{const n=setTimeout((()=>{HV(e(),t)}));$e((()=>clearTimeout(n)))}))}(e,t);let n=[];Oe((()=>{const r=function(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 ZU(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&HV(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}$e((()=>o.disconnect()))}))}function GV(e={}){const[t,n]=function(e){const[t,n]=$V(e);return[()=>t()??[],n]}({value:()=>$z(e.items),onChange:t=>e.onItemsChange?.(t)});WV(t,n);const r=e=>(n((t=>{const n=function(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const t=e[r]?.ref();if(t&&KV(t,n))return r+1}return 0}(t,e);return function(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}(t,e,n)})),()=>{n((t=>{const n=t.filter((t=>t.ref()!==e.ref()));return t.length===n.length?t:n}))});return{DomCollectionProvider:e=>ut(VV.Provider,{value:{registerItem:r},get children(){return e.children}})}}function YV(e){const t=function(){const e=BV();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=wV({shouldRegisterItem:!0},e);Oe((()=>{if(!n.shouldRegisterItem)return;$e(t.registerItem(n.getItem()))}))}function QV(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=YU(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=YU(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(YU(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return YU(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(YU(l)||"number"==typeof l)r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;else if(null!=a(l)){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const o=a(l)??[];if(o.length>0){const i=QV({dataSource:o,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...i),t+=i.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++;return r}function XV(e,t=[]){return Re((()=>{const n=QV({dataSource:$z(e.dataSource),getKey:$z(e.getKey),getTextValue:$z(e.getTextValue),getDisabled:$z(e.getDisabled),getSectionChildren:$z(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var JV=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),ZV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function eB(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return JV.has(t)}const t=e.split("-")[0];return ZV.has(t)}(e)?"rtl":"ltr"}function tB(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:eB(e)}}var nB=tB(),rB=new Set;function oB(){nB=tB();for(const e of rB)e(nB)}var iB=Be();function sB(){const e=function(){const[e,t]=_e(nB),n=Re((()=>e()));return Fe((()=>{0===rB.size&&window.addEventListener("languagechange",oB),rB.add(t),$e((()=>{rB.delete(t),0===rB.size&&window.removeEventListener("languagechange",oB)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return Ke(iB)||e}var aB=new Map;var lB=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function cB(e){return rV()||oV()?e.altKey:e.ctrlKey}function uB(e){return rV()?e.metaKey:e.ctrlKey}function dB(e){return new lB(e)}function hB(e){const t=wV({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=_e(!1),[o,i]=_e(),s=Re((()=>{const e=$z(t.selectedKeys);return null!=e?dB(e):e})),a=Re((()=>{const e=$z(t.defaultSelectedKeys);return null!=e?dB(e):new lB})),[l,c]=function(e){const[t,n]=$V(e);return[()=>t()??new lB,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=_e($z(t.selectionBehavior));return Oe((()=>{const e=l();"replace"===$z(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),Oe((()=>{d($z(t.selectionBehavior)??"toggle")})),{selectionMode:()=>$z(t.selectionMode),disallowEmptySelection:()=>$z(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!$z(t.allowDuplicateSelectionEvents)&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,l())||c(e)}}}function fB(e,t,n){const r=mt({selectOnFocus:()=>"replace"===$z(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=sB();let s={top:0,left:0};VU((()=>$z(r.isVirtualized)?void 0:o()),"scroll",(()=>{const e=o();e&&(s={top:e.scrollTop,left:e.scrollLeft})}));const{typeSelectHandlers:a}=function(e){const[t,n]=_e(""),[r,o]=_e(-1);return{typeSelectHandlers:{onKeyDown:i=>{if($z(e.isDisabled))return;const s=$z(e.keyboardDelegate),a=$z(e.selectionManager);if(!s.getKeyForSearch)return;const l=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!l||i.ctrlKey||i.metaKey)return;" "===l&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n((e=>e+l)),u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);null==u&&function(e){return e.split("").every((t=>t===e[0]))}(c)&&(c=c[0],u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),null!=u&&(a.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>$z(r.disallowTypeAhead),keyboardDelegate:()=>$z(r.keyboardDelegate),selectionManager:()=>$z(r.selectionManager)}),l=()=>$z(r.orientation)??"vertical",c=()=>{const e=$z(r.autoFocus);if(!e)return;const n=$z(r.selectionManager),o=$z(r.keyboardDelegate);let i;"first"===e&&(i=o.getFirstKey?.()),"last"===e&&(i=o.getLastKey?.());const s=n.selectedKeys();s.size&&(i=s.values().next().value),n.setFocused(!0),n.setFocusedKey(i);const a=t();a&&null==i&&!$z(r.shouldUseVirtualFocus)&&lV(a)};Fe((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),Oe(Ie([o,()=>$z(r.isVirtualized),()=>$z(r.selectionManager).focusedKey()],(e=>{const[t,n,o]=e;if(n)o&&r.scrollToKey?.(o);else if(o&&t){const e=t.querySelector(`[data-key="${o}"]`);e&&EV(t,e)}})));return{tabIndex:Re((()=>{if(!$z(r.shouldUseVirtualFocus))return null==$z(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{iV(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=$z(r.selectionManager),s=$z(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!cB(e)&&o.replaceSelection(t))},u=$z(r.keyboardDelegate),d=$z(r.shouldFocusWrap),h=o.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(u.getKeyBelow){let t;e.preventDefault(),t=null!=h?u.getKeyBelow(h):u.getFirstKey?.(),null==t&&d&&(t=u.getFirstKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(u.getKeyAbove){let t;e.preventDefault(),t=null!=h?u.getKeyAbove(h):u.getLastKey?.(),null==t&&d&&(t=u.getLastKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(u.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyLeftOf(h):t?u.getFirstKey?.():u.getLastKey?.(),c(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(u.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyRightOf(h):t?u.getLastKey?.():u.getFirstKey?.(),c(n)}break;case"Home":if(u.getFirstKey){e.preventDefault();const t=u.getFirstKey(h,uB(e));null!=t&&(o.setFocusedKey(t),uB(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"End":if(u.getLastKey){e.preventDefault();const t=u.getLastKey(h,uB(e));null!=t&&(o.setFocusedKey(t),uB(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"PageDown":if(u.getKeyPageBelow&&null!=h){e.preventDefault();c(u.getKeyPageBelow(h))}break;case"PageUp":if(u.getKeyPageAbove&&null!=h){e.preventDefault();c(u.getKeyPageAbove(h))}break;case"a":uB(e)&&"multiple"===o.selectionMode()&&!0!==$z(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),$z(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!$z(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t){const n=t?.tabbable?fV:hV,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(n)&&vV(e)&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(r.currentNode=t.from),r}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&lV(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=$z(r.selectionManager),n=$z(r.keyboardDelegate),i=$z(r.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey()){const r=e=>{null!=e&&(t.setFocusedKey(e),i&&t.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!$z(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(lV(n),EV(e,n))}}},onFocusOut:e=>{const t=$z(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function pB(e,t){const n=()=>$z(e.selectionManager),r=()=>$z(e.key),o=()=>$z(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):"toggle"===n().selectionBehavior()||uB(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>$z(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=Re((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=Re((()=>$z(e.virtualized)?void 0:r()));return Oe(Ie([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():lV(t))}))),{isSelected:()=>n().isSelected(r()),isDisabled:s,allowsSelection:a,tabIndex:c,dataKey:u,onPointerDown:t=>{a()&&(l=t.pointerType,"mouse"!==t.pointerType||0!==t.button||$z(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&$z(e.shouldSelectOnPressUp)&&$z(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&($z(e.shouldSelectOnPressUp)&&!$z(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(cB(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var mB=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(null==e||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if("none"===this.state.selectionMode())return!1;const t=this.getKey(e);return null!=t&&this.state.selectedKeys().has(t)}isEmpty(){return 0===this.state.selectedKeys().size}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every((t=>e.has(t)))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index<e.index)||(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index>e.index)||(e=n)}return e?.key}extendSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode())return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new lB(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?null!=n.index&&null!=r.index&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;null!=r;){const e=this.collection().getItem(r);if(e&&"item"===e.type&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?t&&"item"===t.type?t.key:null:e}toggleSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode()&&!this.isSelected(e))return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=new lB(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&0===n.size||this.state.setSelectedKeys(n)}replaceSelection(e){if("none"===this.selectionMode())return;const t=this.getKey(e);if(null==t)return;const n=this.canSelectItem(t)?new lB([t],t,t):new lB;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new lB;for(const n of e){const e=this.getKey(n);if(null!=e&&(t.add(e),"single"===this.selectionMode()))break}this.state.setSelectedKeys(t)}selectAll(){"multiple"===this.selectionMode()&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new lB)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode()&&("single"===this.selectionMode()?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior()||t&&"touch"===t.pointerType?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode())return!1;const t=this.collection().getItem(e);return null!=t&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(t=>{for(;null!=t;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;"item"===n.type&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},gB=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(0===this.keyMap.size)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),"item"===o.type&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};var vB,yB=e=>"function"==typeof e?e():e,bB=e=>{const t=Re((()=>{const t=yB(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=_e(yB(e.show)?"present":"hidden");let i="none";return Oe((r=>{const s=yB(e.show);return Le((()=>{if(r===s)return s;const e=i,a=n();if(s)o("present");else if("none"===a||"none"===t()?.display)o("hidden");else{o(!0===r&&e!==a?"hiding":"hidden")}})),s})),Oe((()=>{const t=yB(e.element);if(!t)return;const s=e=>{e.target===t&&(i=n())},a=e=>{const i=n().includes(e.animationName);e.target===t&&i&&"hiding"===r()&&o("hidden")};t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),$e((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},xB="data-kb-top-layer",wB=!1,SB=[];function CB(e){return SB.findIndex((t=>t.node===e))}function kB(){return SB.filter((e=>e.isPointerBlocking))}function EB(){return kB().length>0}function jB(e){const t=CB([...kB()].slice(-1)[0]?.node);return CB(e)<t}var TB={layers:SB,isTopMostLayer:function(e){return SB[SB.length-1].node===e},hasPointerBlockingLayer:EB,isBelowPointerBlockingLayer:jB,addLayer:function(e){SB.push(e)},removeLayer:function(e){const t=CB(e);t<0||SB.splice(t,1)},indexOf:CB,find:function(e){return SB[CB(e)]},assignPointerEventToLayers:function(){for(const{node:e}of SB)e.style.pointerEvents=jB(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(EB()&&!wB){const t=ZU(e);vB=document.body.style.pointerEvents,t.body.style.pointerEvents="none",wB=!0}},restoreBodyPointerEvents:function(e){if(EB())return;const t=ZU(e);t.body.style.pointerEvents=vB,0===t.body.style.length&&t.body.removeAttribute("style"),wB=!1}};UV({},{Button:()=>_B,Root:()=>NB});var PB=["button","color","file","image","reset","submit"];function NB(e){let t;const n=wV({type:"button"},e),[r,o]=gt(n,["ref","type","disabled"]),i=NV((()=>t),(()=>"button")),s=Re((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==PB.indexOf(e.type)}({tagName:e,type:r.type})})),a=Re((()=>"input"===i())),l=Re((()=>"a"===i()&&null!=t?.getAttribute("href")));return ut(DV,mt({as:"button",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get type(){return s()||a()?r.type:void 0},get role(){return s()||l()?void 0:"button"},get tabIndex(){return s()||l()||r.disabled?void 0:0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!(s()||a()||!r.disabled)||void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var _B=NB,DB=["top","right","bottom","left"],MB=Math.min,OB=Math.max,RB=Math.round,AB=Math.floor,LB=e=>({x:e,y:e}),IB={left:"right",right:"left",bottom:"top",top:"bottom"},FB={start:"end",end:"start"};function $B(e,t,n){return OB(e,MB(t,n))}function qB(e,t){return"function"==typeof e?e(t):e}function zB(e){return e.split("-")[0]}function UB(e){return e.split("-")[1]}function VB(e){return"x"===e?"y":"x"}function BB(e){return"y"===e?"height":"width"}function KB(e){return["top","bottom"].includes(zB(e))?"y":"x"}function HB(e){return VB(KB(e))}function WB(e){return e.replace(/start|end/g,(e=>FB[e]))}function GB(e){return e.replace(/left|right|bottom|top/g,(e=>IB[e]))}function YB(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function QB(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 XB(e,t,n){let{reference:r,floating:o}=e;const i=KB(t),s=HB(t),a=BB(s),l=zB(t),c="y"===i,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 f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(UB(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function JB(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=qB(t,e),p=YB(f),m=a[h?"floating"===d?"reference":"floating":d],g=QB(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=QB(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function ZB(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eK(e){return DB.some((t=>e[t]>=0))}function tK(e){return oK(e)?(e.nodeName||"").toLowerCase():"#document"}function nK(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rK(e){var t;return null==(t=(oK(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function oK(e){return e instanceof Node||e instanceof nK(e).Node}function iK(e){return e instanceof Element||e instanceof nK(e).Element}function sK(e){return e instanceof HTMLElement||e instanceof nK(e).HTMLElement}function aK(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof nK(e).ShadowRoot)}function lK(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pK(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function cK(e){return["table","td","th"].includes(tK(e))}function uK(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(nQ){return!1}}))}function dK(e){const t=hK(),n=iK(e)?pK(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function hK(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function fK(e){return["html","body","#document"].includes(tK(e))}function pK(e){return nK(e).getComputedStyle(e)}function mK(e){return iK(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gK(e){if("html"===tK(e))return e;const t=e.assignedSlot||e.parentNode||aK(e)&&e.host||rK(e);return aK(t)?t.host:t}function vK(e){const t=gK(e);return fK(t)?e.ownerDocument?e.ownerDocument.body:e.body:sK(t)&&lK(t)?t:vK(t)}function yK(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=vK(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=nK(o);return i?t.concat(s,s.visualViewport||[],lK(o)?o:[],s.frameElement&&n?yK(s.frameElement):[]):t.concat(o,yK(o,[],n))}function bK(e){const t=pK(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=sK(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=RB(n)!==i||RB(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function xK(e){return iK(e)?e:e.contextElement}function wK(e){const t=xK(e);if(!sK(t))return LB(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=bK(t);let s=(i?RB(n.width):n.width)/r,a=(i?RB(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var SK=LB(0);function CK(e){const t=nK(e);return hK()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:SK}function kK(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=xK(e);let s=LB(1);t&&(r?iK(r)&&(s=wK(r)):s=wK(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==nK(e))&&t}(i,n,r)?CK(i):LB(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=nK(i),t=r&&iK(r)?nK(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=wK(o),t=o.getBoundingClientRect(),r=pK(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=nK(o),o=n.frameElement}}return QB({width:u,height:d,x:l,y:c})}function EK(e){return kK(rK(e)).left+mK(e).scrollLeft}function jK(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=nK(e),r=rK(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=hK();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=rK(e),n=mK(e),r=e.ownerDocument.body,o=OB(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=OB(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+EK(e);const a=-n.scrollTop;return"rtl"===pK(r).direction&&(s+=OB(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(rK(e));else if(iK(t))r=function(e,t){const n=kK(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=sK(e)?wK(e):LB(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=CK(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return QB(r)}function TK(e,t){const n=gK(e);return!(n===t||!iK(n)||fK(n))&&("fixed"===pK(n).position||TK(n,t))}function PK(e,t,n){const r=sK(t),o=rK(t),i="fixed"===n,s=kK(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=LB(0);if(r||!r&&!i)if(("body"!==tK(t)||lK(o))&&(a=mK(t)),r){const e=kK(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=EK(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function NK(e){return"static"===pK(e).position}function _K(e,t){return sK(e)&&"fixed"!==pK(e).position?t?t(e):e.offsetParent:null}function DK(e,t){const n=nK(e);if(uK(e))return n;if(!sK(e)){let t=gK(e);for(;t&&!fK(t);){if(iK(t)&&!NK(t))return t;t=gK(t)}return n}let r=_K(e,t);for(;r&&cK(r)&&NK(r);)r=_K(r,t);return r&&fK(r)&&NK(r)&&!dK(r)?n:r||function(e){let t=gK(e);for(;sK(t)&&!fK(t);){if(dK(t))return t;if(uK(t))return null;t=gK(t)}return null}(e)||n}var MK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=rK(r),a=!!t&&uK(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=LB(1);const u=LB(0),d=sK(r);if((d||!d&&!i)&&(("body"!==tK(r)||lK(s))&&(l=mK(r)),sK(r))){const e=kK(r);c=wK(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:rK,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?uK(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=yK(e,[],!1).filter((e=>iK(e)&&"body"!==tK(e))),o=null;const i="fixed"===pK(e).position;let s=i?gK(e):e;for(;iK(s)&&!fK(s);){const t=pK(s),n=dK(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||lK(s)&&!n&&TK(e,s))?r=r.filter((e=>e!==s)):o=t,s=gK(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=jK(t,n,o);return e.top=OB(r.top,e.top),e.right=MB(r.right,e.right),e.bottom=MB(r.bottom,e.bottom),e.left=OB(r.left,e.left),e}),jK(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:DK,getElementRects:async function(e){const t=this.getOffsetParent||DK,n=this.getDimensions,r=await n(e.floating);return{reference:PK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=bK(e);return{width:t,height:n}},getScale:wK,isElement:iK,isRTL:function(e){return"rtl"===pK(e).direction}};function OK(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=xK(e),u=o||i?[...c?yK(c):[],...yK(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=rK(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-AB(u)+"px "+-AB(o.clientWidth-(c+d))+"px "+-AB(o.clientHeight-(u+h))+"px "+-AB(c)+"px",threshold:OB(0,MB(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(nQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?kK(e):null;return l&&function t(){const r=kK(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var RK=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=zB(n),a=UB(n),l="y"===KB(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=qB(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},AK=function(e){return void 0===e&&(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:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qB(e,t),c={x:n,y:r},u=await JB(t,l),d=KB(zB(o)),h=VB(d);let f=c[h],p=c[d];if(i){f=$B(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=$B(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},LK=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=qB(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=zB(o),y=KB(a),b=zB(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[GB(a)]:function(e){const t=GB(e);return[WB(e),t,WB(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=UB(e);let i=function(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[]}}(zB(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(WB)))),i}(a,m,p,x));const C=[a,...w],k=await JB(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=UB(e),o=HB(e),i=BB(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=GB(s)),[s,GB(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=j.filter((e=>{if(S){const t=KB(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},IK=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=qB(e,t),l=await JB(t,a),c=zB(n),u=UB(n),d="y"===KB(n),{width:h,height:f}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=f-l.top-l.bottom,v=h-l.left-l.right,y=MB(f-l[p],g),b=MB(h-l[m],v),x=!t.middlewareData.shift;let w=y,S=b;if(d?S=u||x?MB(b,v):v:w=u||x?MB(y,g):g,x&&!u){const e=OB(l.left,0),t=OB(l.right,0),n=OB(l.top,0),r=OB(l.bottom,0);d?S=h-2*(0!==e||0!==t?e+t:OB(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:OB(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const C=await o.getDimensions(i.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},FK=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=qB(e,t);switch(r){case"referenceHidden":{const e=ZB(await JB(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:eK(e)}}}case"escaped":{const e=ZB(await JB(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:eK(e)}}}default:return{}}}}},$K=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=qB(e,t)||{};if(null==c)return{};const d=YB(u),h={x:n,y:r},f=HB(o),p=BB(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=MB(d[v],E),T=MB(d[y],E),P=j,N=C-m[p]-T,_=C/2-m[p]/2+k,D=$B(P,_,N),M=!l.arrow&&null!=UB(o)&&_!==D&&i.reference[p]/2-(_<P?j:T)-m[p]/2<0,O=M?_<P?_-P:_-N:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:_-D-O,...M&&{alignmentOffset:O}},reset:M}}}),qK=(e,t,n)=>{const r={platform:MK,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=XB(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=XB(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},zK=Be();function UK(){const e=Ke(zK);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var VK=At('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),BK={top:180,right:-90,bottom:0,left:90};function KK(e){const t=UK(),n=wV({size:30},e),[r,o]=gt(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=_e();return Oe((()=>{const t=e();var r;t&&n((r=t,ZU(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return ut(DV,mt({as:"div",ref(e){const n=MU(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return WU({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s()?.getPropertyValue("background-color")||"none",stroke:s()?.getPropertyValue(`border-${i()}-color`)||"none","stroke-width":a()},r.style)}},o,{get children(){const e=VK(),t=e.firstChild;return Me((()=>It(t,"transform",`rotate(${BK[i()]} 15 15) translate(0 2)`))),e}}))}function HK(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if("function"==typeof DOMRect)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 WK(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var GK={top:"bottom",right:"left",bottom:"top",left:"right"};var YK=Object.assign((function(e){const t=wV({getAnchorRect:e=>e?.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]=_e(),[o,i]=_e(),[s,a]=_e(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?HK(t):e?e.getBoundingClientRect():HK()}};var e,n},{direction:c}=sB();async function u(){const e=l(),r=n(),i=o();if(!e||!r)return;const s=(i?.clientHeight||0)/2,u="number"==typeof t.gutter?t.gutter+s:t.gutter??s;r.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),e.getBoundingClientRect();const d=[RK((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}}))];if(!1!==t.flip){const e="string"==typeof t.flip?t.flip.split(" "):void 0;if(void 0!==e&&!e.every(WK))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(LK({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(AK({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(IK({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:o}){const i=Math.round(o.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty("--kb-popper-anchor-width",`${i}px`),r.style.setProperty("--kb-popper-content-available-width",`${e}px`),r.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(r.style.width=`${i}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(FK({padding:t.detachedPadding})),i&&d.push($K({element:i,padding:t.arrowPadding}));const h=await qK(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...MK,isRTL:()=>"rtl"===c()}});if(a(h.placement),t.onCurrentPlacementChange?.(h.placement),!r)return;r.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=GK[n];return r?"left"===n||"right"===n?`${o} ${"start"===r?"top":"bottom"}`:"start"===r?`${o} ${"rtl"===t?"right":"left"}`:`${o} ${"rtl"===t?"left":"right"}`:`${o} center`}(h.placement,c()));const f=Math.round(h.x),p=Math.round(h.y);let m;if(t.hideWhenDetached&&(m=h.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(r.style,{top:"0",left:"0",transform:`translate3d(${f}px, ${p}px, 0)`,visibility:m}),i&&h.middlewareData.arrow){const{x:e,y:t}=h.middlewareData.arrow,n=h.placement.split("-")[0];Object.assign(i.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return Oe((()=>{const e=l(),t=n();if(!e||!t)return;$e(OK(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),Oe((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),ut(zK.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:KK,Context:zK,usePopperContext:UK,Positioner:function(e){const t=UK(),[n,r]=gt(e,["ref","style"]);return ut(DV,mt({as:"div",ref(e){const r=MU(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return WU({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var QK="interactOutside.pointerDownOutside",XK="interactOutside.focusOutside";var JK=Be();function ZK(e){let t;const n=Ke(JK),[r,o]=gt(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=xV;const o=()=>ZU(t()),i=t=>e.onPointerDownOutside?.(t),s=t=>e.onFocusOutside?.(t),a=t=>e.onInteractOutside?.(t),l=n=>{const r=n.target;return r instanceof HTMLElement&&!r.closest(`[${xB}]`)&&!!XU(o(),r)&&!XU(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=sV([i,a]);r.addEventListener(QK,o,{once:!0});const s=new CustomEvent(QK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||aV(e)&&0===e.button}});r.dispatchEvent(s)}"touch"===e.pointerType?(o().removeEventListener("click",n),r=n,o().addEventListener("click",n,{once:!0})):n()},u=e=>{const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=sV([s,a]);r.addEventListener(XK,o,{once:!0});const i=new CustomEvent(XK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};Oe((()=>{$z(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),$e((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>!!t&&(r.excludedElements?.some((t=>XU(t(),e)))||[...i].some((t=>XU(t,e)))),onPointerDownOutside:e=>{t&&!TB.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||TB.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},(()=>t)),function(e){const t=t=>{t.key===tV.Escape&&e.onEscapeKeyDown?.(t)};Oe((()=>{if($z(e.isDisabled))return;const n=e.ownerDocument?.()??ZU();n.addEventListener("keydown",t),$e((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>ZU(t),onEscapeKeyDown:e=>{t&&TB.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Fe((()=>{if(!t)return;TB.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);TB.assignPointerEventToLayers(),TB.disableBodyPointerEvents(t),$e((()=>{t&&(TB.removeLayer(t),e?.(),TB.assignPointerEventToLayers(),TB.restoreBodyPointerEvents(t))}))})),Oe(Ie([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=TB.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,TB.assignPointerEventToLayers()),t&&TB.disableBodyPointerEvents(e),$e((()=>{TB.restoreBodyPointerEvents(e)}))}),{defer:!0}));return ut(JK.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return ut(DV,mt({as:"div",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function eH(e={}){const[t,n]=qV({value:()=>$z(e.open),defaultValue:()=>!!$z(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var tH={};UV(tH,{Description:()=>AV,ErrorMessage:()=>LV,Item:()=>sH,ItemControl:()=>aH,ItemDescription:()=>lH,ItemIndicator:()=>cH,ItemInput:()=>uH,ItemLabel:()=>dH,Label:()=>hH,RadioGroup:()=>pH,Root:()=>fH});var nH=Be();function rH(){const e=Ke(nH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var oH=Be();function iH(){const e=Ke(oH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function sH(e){const t=RV(),n=rH(),r=wV({id:`${t.generateId("item")}-${bt()}`},e),[o,i]=gt(r,["value","disabled","onPointerDown"]),[s,a]=_e(),[l,c]=_e(),[u,d]=_e(),[h,f]=_e(),[p,m]=_e(!1),g=Re((()=>n.isSelectedValue(o.value))),v=Re((()=>o.disabled||t.isDisabled()||!1)),y=e=>{iV(e,o.onPointerDown),p()&&e.preventDefault()},b=Re((()=>({...t.dataset(),"data-disabled":v()?"":void 0,"data-checked":g()?"":void 0}))),x={value:()=>o.value,dataset:b,isSelected:g,isDisabled:v,inputId:s,labelId:l,descriptionId:u,inputRef:h,select:()=>n.setSelectedValue(o.value),generateId:QU((()=>i.id)),registerInput:PV(a),registerLabel:PV(c),registerDescription:PV(d),setIsFocused:m,setInputRef:f};return ut(oH.Provider,{value:x,get children(){return ut(DV,mt({as:"div",role:"group",onPointerDown:y},b,i))}})}function aH(e){const t=iH(),n=wV({id:t.generateId("control")},e),[r,o]=gt(n,["onClick","onKeyDown"]);return ut(DV,mt({as:"div",onClick:e=>{iV(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{iV(e,r.onKeyDown),e.key===tV.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function lH(e){const t=iH(),n=wV({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(DV,mt({as:"div"},(()=>t.dataset()),n))}function cH(e){const t=iH(),n=wV({id:t.generateId("indicator")},e),[r,o]=gt(n,["ref","forceMount"]),[i,s]=_e(),{present:a}=bB({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return ut(Ct,{get when(){return a()},get children(){return ut(DV,mt({as:"div",ref(e){const t=MU(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function uH(e){const t=RV(),n=rH(),r=iH(),o=wV({id:r.generateId("input")},e),[i,s]=gt(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=_e(!1);return Oe(Ie([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),Oe((()=>$e(r.registerInput(s.id)))),ut(DV,mt({as:"input",ref(e){const t=MU(r.setInputRef,i.ref);"function"==typeof t&&t(e)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return WU({...TV},i.style)},get"aria-labelledby"(){return[i["aria-labelledby"],r.labelId(),null!=i["aria-labelledby"]&&null!=s["aria-label"]?s.id:void 0].filter(Boolean).join(" ")||void 0},get"aria-describedby"(){return[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0},onChange:e=>{if(iV(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{iV(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{iV(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function dH(e){const t=iH(),n=wV({id:t.generateId("label")},e);return Oe((()=>$e(t.registerLabel(n.id)))),ut(DV,mt({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function hH(e){return ut(IV,mt({as:"span"},e))}function fH(e){let t;const n=wV({id:`radiogroup-${bt()}`,orientation:"vertical"},e),[r,o,i]=gt(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],MV),[s,a]=$V({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=wV({id:`form-control-${bt()}`},e),[n,r]=_e(),[o,i]=_e(),[s,a]=_e(),[l,c]=_e();return{formControlContext:{name:()=>$z(t.name)??$z(t.id),dataset:Re((()=>({"data-valid":"valid"===$z(t.validationState)?"":void 0,"data-invalid":"invalid"===$z(t.validationState)?"":void 0,"data-required":$z(t.required)?"":void 0,"data-disabled":$z(t.disabled)?"":void 0,"data-readonly":$z(t.readOnly)?"":void 0}))),validationState:()=>$z(t.validationState),isRequired:()=>$z(t.required),isDisabled:()=>$z(t.disabled),isReadOnly:()=>$z(t.readOnly),labelId:n,fieldId:o,descriptionId:s,errorMessageId:l,getAriaLabelledBy:(e,t,r)=>{const o=null!=r||null!=n();return[r,n(),o&&null!=t?e:void 0].filter(Boolean).join(" ")||void 0},getAriaDescribedBy:e=>[s(),l(),e].filter(Boolean).join(" ")||void 0,generateId:QU((()=>$z(t.id))),registerLabel:PV(r),registerField:PV(i),registerDescription:PV(a),registerErrorMessage:PV(c)}}}(o);FV((()=>t),(()=>a(r.defaultValue??"")));const c=()=>l.getAriaDescribedBy(r["aria-describedby"]),u=e=>e===s(),d={ariaDescribedBy:c,isSelectedValue:u,setSelectedValue:e=>{if(!l.isReadOnly()&&!l.isDisabled()&&(a(e),t))for(const n of t.querySelectorAll("[type='radio']")){n.checked=u(n.value)}}};return ut(OV.Provider,{value:l,get children(){return ut(nH.Provider,{value:d,get children(){return ut(DV,mt({as:"div",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return $z(o.id)},get"aria-invalid"(){return"invalid"===l.validationState()||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return r.orientation},get"aria-labelledby"(){return l.getAriaLabelledBy($z(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var pH=Object.assign(fH,{Description:AV,ErrorMessage:LV,Item:sH,ItemControl:aH,ItemDescription:lH,ItemIndicator:cH,ItemInput:uH,ItemLabel:dH,Label:hH}),mH=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=null!=o?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=null!=o?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=r;){const t=this.collection().getItem(r);if(t){const o=t.textValue.slice(0,e.length);if(t.textValue&&0===n.compare(o,e))return r}r=this.getKeyBelow(r)}}};function gH(e,t,n){const r=function(e){const{locale:t}=sB(),n=Re((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return Re((()=>{const r=n();let o;return aB.has(r)&&(o=aB.get(r)),o||(o=new Intl.Collator(t(),e),aB.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return fB({selectionManager:()=>$z(e.selectionManager),keyboardDelegate:Re((()=>{const n=$z(e.keyboardDelegate);return n||new mH(e.collection,t,r)})),autoFocus:()=>$z(e.autoFocus),deferAutoFocus:()=>$z(e.deferAutoFocus),shouldFocusWrap:()=>$z(e.shouldFocusWrap),disallowEmptySelection:()=>$z(e.disallowEmptySelection),selectOnFocus:()=>$z(e.selectOnFocus),disallowTypeAhead:()=>$z(e.disallowTypeAhead),shouldUseVirtualFocus:()=>$z(e.shouldUseVirtualFocus),allowsTabNavigation:()=>$z(e.allowsTabNavigation),isVirtualized:()=>$z(e.isVirtualized),scrollToKey:t=>$z(e.scrollToKey)?.(t),orientation:()=>$z(e.orientation)},t)}var vH="focusScope.autoFocusOnMount",yH="focusScope.autoFocusOnUnmount",bH={bubbles:!1,cancelable:!0},xH={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=GU(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=GU(this.stack,e),this.active()?.resume()}};function wH(e,t){const[n,r]=_e(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>ZU(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,TV),e},u=()=>{const e=t();return e?pV(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};Oe((()=>{const e=t();if(!e)return;xH.add(o);const n=JU(e);if(!XU(e,n)){const t=new CustomEvent(vH,bH);e.addEventListener(vH,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{lV(d()),JU(e)===n&&lV(e)}),0)}$e((()=>{e.removeEventListener(vH,s),setTimeout((()=>{const r=new CustomEvent(yH,bH);(()=>{const e=t();if(!e)return!1;const n=JU(e);return!!n&&!XU(e,n)&&gV(n)})()&&r.preventDefault(),e.addEventListener(yH,a),e.dispatchEvent(r),r.defaultPrevented||lV(n??l().body),e.removeEventListener(yH,a),xH.remove(o)}),0)}))})),Oe((()=>{const r=t();if(!r||!$z(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${xB}]`)||(XU(r,t)?i=t:lV(i))},s=e=>{const t=e.relatedTarget??JU(r);t?.closest(`[${xB}]`)||XU(r,t)||lV(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),$e((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),Oe((()=>{const r=t();if(!r||!$z(e.trapFocus)||n())return;const o=c();r.insertAdjacentElement("afterbegin",o);const i=c();function s(e){const t=d(),n=(()=>{const e=u();return e.length>0?e[e.length-1]:null})();lV(e.relatedTarget===t?n:t)}r.insertAdjacentElement("beforeend",i),o.addEventListener("focusin",s),i.addEventListener("focusin",s);const a=new MutationObserver((e=>{for(const t of e)t.previousSibling===i&&(i.remove(),r.insertAdjacentElement("beforeend",i)),t.nextSibling===o&&(o.remove(),r.insertAdjacentElement("afterbegin",o))}));a.observe(r,{childList:!0,subtree:!1}),$e((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var SH="data-live-announcer";function CH(e){Oe((()=>{$z(e.isDisabled)||$e(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${SH}], [${xB}]`))n.add(r);const t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(const t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),s=t(e);if(s===NodeFilter.FILTER_ACCEPT&&i(e),s!==NodeFilter.FILTER_REJECT){let e=o.nextNode();for(;null!=e;)i(e),e=o.nextNode()}},i=e=>{const t=kH.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),kH.set(e,t+1))};EH.length&&EH[EH.length-1].disconnect();o(t);const s=new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some((e=>e.contains(t.target)))){for(const e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(const e of t.addedNodes)!(e instanceof HTMLElement||e instanceof SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.reactAriaTopLayer?e instanceof Element&&o(e):n.add(e)}}));s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return EH.push(a),()=>{s.disconnect();for(const e of r){const t=kH.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),kH.delete(e)):kH.set(e,t-1)}a===EH[EH.length-1]?(EH.pop(),EH.length&&EH[EH.length-1].observe()):EH.splice(EH.indexOf(a),1)}}($z(e.targets),$z(e.root)))}))}var kH=new WeakMap,EH=[];var jH=new Map,TH=e=>{Oe((()=>{const t=yB(e.style)??{},n=yB(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=jH.get(e.key);o?o.activeCount++:jH.set(e.key,{activeCount:1,originalStyles:r,properties:n.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);$e((()=>{const t=jH.get(e.key);if(t)if(1===t.activeCount){jH.delete(e.key);for(const[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(const n of t.properties)e.element.style.removeProperty(n);0===e.element.style.length&&e.element.removeAttribute("style"),e.cleanup?.()}else t.activeCount--}))}))},PH=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},NH=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[_H,DH]=_e([]),MH=e=>[e.deltaX,e.deltaY],OH=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],RH=(e,t,n,r)=>{const o=null!==r&&AH(r,e),[i,s]=((e,t,n)=>{const r="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let o=e,i=0,s=0,a=!1;do{const[e,l,c]=PH(o,t),u=c-e-r*l;0===l&&0===u||!NH(o,t)||(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},AH=(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},LH=e=>{const t=mt({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=bt();let r=[0,0],o=null,i=null;Oe((()=>{yB(t.enabled)&&(DH((e=>[...e,n])),$e((()=>{DH((e=>e.filter((e=>e!==n))))})))})),Oe((()=>{if(!yB(t.enabled)||!yB(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(yB(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===yB(t.preventScrollbarShiftMode)?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,o.push({key:"--scrollbar-width",value:`${n}px`}));const i=window.scrollY,s=window.scrollX;TH({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{yB(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else TH({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),Oe((()=>{var e;(e=n,_H().indexOf(e)===_H().length-1&&yB(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),$e((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=OH(e),o=null,i=null},a=e=>{const n=e.target,r=yB(t.element),o=MH(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=RH(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!AH(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=yB(t.element),s=e.target;let a;if(2===e.touches.length)a=!yB(t.allowPinchZoom);else{if(null==o||null===i){const t=OH(e).map(((e,t)=>r[t]-e)),n=Math.abs(t[0])>Math.abs(t[1])?"x":"y";o=n,i="x"===n?t[0]:t[1]}if("range"===s.type)a=!1;else{const e=RH(s,o,i,n);a=!n||!AH(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},IH=Be();function FH(){return Ke(IH)}function $H(){const e=FH();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var qH=Be();function zH(){const e=Ke(qH);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var UH=Be();function VH(){const e=Ke(UH);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function BH(e){let t;const n=VH(),r=$H(),o=wV({id:n.generateId(`item-${bt()}`)},e),[i,s]=gt(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=_e(),[c,u]=_e(),[d,h]=_e(),f=()=>r.listState().selectionManager(),p=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};YV({getItem:()=>({ref:()=>t,type:"item",key:p(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=pB({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{iV(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(lV(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{iV(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{iV(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(iV(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":m()}},w=Re((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),S=Re((()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":f().focusedKey()===p()?"":void 0}))),C={isChecked:()=>i.checked,dataset:S,setLabelRef:h,generateId:QU((()=>s.id)),registerLabel:PV(l),registerDescription:PV(u)};return ut(qH.Provider,{value:C,get children(){return ut(DV,mt({as:"div",ref(e){const n=MU((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return sV([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return sV([b,g.onPointerUp])},get onClick(){return sV([i.onClick,g.onClick])},get onKeyDown(){return sV([x,g.onKeyDown])},get onMouseDown(){return sV([i.onMouseDown,g.onMouseDown])},get onFocus(){return sV([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:y},S,s))}})}function KH(e){const t=wV({closeOnSelect:!1},e),[n,r]=gt(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=qV({value:()=>$z(e.isSelected),defaultValue:()=>!!$z(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{$z(e.isReadOnly)||$z(e.isDisabled)||n(t)},toggle:()=>{$z(e.isReadOnly)||$z(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return ut(BH,mt({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var HH=Be();function WH(){return Ke(HH)}var GH={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>GH.next("ltr"===e?"rtl":"ltr",t)},YH=e=>"horizontal"===e?"ArrowDown":"ArrowRight",QH=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function XH(e){const t=VH(),n=$H(),r=WH(),{direction:o}=sB(),i=wV({id:t.generateId("trigger")},e),[s,a]=gt(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>t.value()??s.id,void 0===r.lastValue()&&r.setLastValue(l));const c=NV((()=>n.triggerRef()),(()=>"button")),u=Re((()=>"a"===c()&&null!=n.triggerRef()?.getAttribute("href")));Oe(Ie((()=>r?.value()),(e=>{u()&&e===l()&&n.triggerRef()?.focus()})));const d=()=>{void 0!==r?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)};return Oe((()=>$e(n.registerTriggerId(s.id)))),ut(NB,mt({ref(e){const t=MU(n.setTriggerRef,s.ref);"function"==typeof t&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Re((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&r?.value()===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{iV(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{iV(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{iV(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(iV(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case YH(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){if(document.contains(e)){const t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let n=yV(e);for(;e&&n&&e!==t&&n!==t;)EV(n,e),n=yV(e=n)}else{const{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:r,top:o}=e.getBoundingClientRect();(Math.abs(t-r)>1||Math.abs(n-o)>1)&&e.scrollIntoView?.({block:"nearest"})}}}(e.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case QH(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case GH.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case GH.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{iV(e,s.onFocus),void 0!==r&&"touch"!==e.currentTarget.dataset.pointerType&&r.setValue(l)},role:void 0!==r?"menuitem":void 0},(()=>n.dataset()),a))}var JH=Be();function ZH(){return Ke(JH)}function eW(e){let t;const n=VH(),r=$H(),o=WH(),i=ZH(),{direction:s}=sB(),a=wV({id:n.generateId(`content-${bt()}`)},e),[l,c]=gt(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>null==r.parentMenuContext()&&void 0===o&&n.isModal(),h=gH({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>"horizontal"===n.orientation()?"vertical":"horizontal"},(()=>t));wH({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{void 0===o&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{l.onEscapeKeyDown?.(e),o?.setAutoFocusMenu(!1),r.close(!0)},p=e=>{l.onFocusOutside?.(e),n.isModal()&&e.preventDefault()};Oe((()=>$e(r.registerContentId(l.id))));const m={ref:MU((e=>{r.setContentRef(e),t=e}),l.ref),role:"menu",get id(){return l.id},get tabIndex(){return h.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:sV([l.onKeyDown,h.onKeyDown,e=>{if(XU(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case GH.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case GH.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:sV([l.onMouseDown,h.onMouseDown]),onFocusIn:sV([l.onFocusIn,h.onFocusIn]),onFocusOut:sV([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{iV(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(iV(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;XU(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return ut(Ct,{get when(){return r.contentPresent()},get children(){return ut(Ct,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return ut(DV,mt({as:"div"},(()=>r.dataset()),m,c))},get children(){return ut(YK.Positioner,{get children(){return ut(ZK,mt({get disableOutsidePointerEvents(){return Re((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return WU({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:f,onFocusOutside:p,get onDismiss(){return r.close}},(()=>r.dataset()),m,c))}})}})}})}function tW(e){let t;const n=VH(),r=$H(),[o,i]=gt(e,["ref"]);return LH({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),ut(eW,mt({ref(e){const n=MU((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var nW=Be();function rW(e){const t=wV({id:VH().generateId(`group-${bt()}`)},e),[n,r]=_e(),o={generateId:QU((()=>t.id)),registerLabelId:PV(r)};return ut(nW.Provider,{value:o,get children(){return ut(DV,mt({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function oW(e){const t=function(){const e=Ke(nW);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=wV({id:t.generateId("label")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerLabelId(r.id)))),ut(DV,mt({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function iW(e){const t=$H();return ut(DV,mt({as:"span","aria-hidden":"true"},(()=>t.dataset()),wV({children:"▼"},e)))}function sW(e){return ut(BH,mt({role:"menuitem",closeOnSelect:!0},e))}function aW(e){const t=zH(),n=wV({id:t.generateId("description")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerDescription(r.id)))),ut(DV,mt({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function lW(e){const t=zH(),n=wV({id:t.generateId("indicator")},e),[r,o]=gt(n,["forceMount"]);return ut(Ct,{get when(){return r.forceMount||t.isChecked()},get children(){return ut(DV,mt({as:"div"},(()=>t.dataset()),o))}})}function cW(e){const t=zH(),n=wV({id:t.generateId("label")},e),[r,o]=gt(n,["ref","id"]);return Oe((()=>$e(t.registerLabel(r.id)))),ut(DV,mt({as:"div",ref(e){const n=MU(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function uW(e){const t=$H();return ut(Ct,{get when(){return t.contentPresent()},get children(){return ut(Zt,e)}})}var dW=Be();function hW(e){const t=wV({id:VH().generateId(`radiogroup-${bt()}`)},e),[n,r]=gt(t,["value","defaultValue","onChange","disabled"]),[o,i]=$V({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return ut(dW.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return ut(rW,r)}})}function fW(e){const t=function(){const e=Ke(dW);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=wV({closeOnSelect:!1},e),[r,o]=gt(n,["value","onSelect"]);return ut(BH,mt({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function pW(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top])}return i}function mW(e){const t=VH(),n=BV(),r=FH(),o=WH(),i=ZH(),s=wV({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=gt(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=_e(),[p,m]=_e(),[g,v]=_e(),[y,b]=_e(),[x,w]=_e(!0),[S,C]=_e(l.placement),[k,E]=_e([]),[j,T]=_e([]),{DomCollectionProvider:P}=GV({items:j,onItemsChange:T}),N=eH({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:_}=bB({show:()=>t.forceMount()||N.isOpen(),element:()=>y()??null}),D=function(e){const t=hB(e),n=XV({dataSource:()=>$z(e.dataSource),getKey:()=>$z(e.getKey),getTextValue:()=>$z(e.getTextValue),getDisabled:()=>$z(e.getDisabled),getSectionChildren:()=>$z(e.getSectionChildren),factory:t=>new gB(e.filter?e.filter(t):t)},[()=>e.filter]),r=new mB(n,t);return De((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:j}),M=e=>{w(e),N.open()},O=(e=!1)=>{N.close(),e&&r&&r.close(!0)},R=()=>{const e=y();e&&(lV(e),D.selectionManager().setFocused(!0),D.selectionManager().setFocusedKey(void 0))},A=()=>{null!=i?setTimeout((()=>R())):R()},L=e=>{return d===u?.side&&(t=e,n=u?.area,!!n&&function(e,t){const[n,r]=e;let o=!1;for(let i=t.length,s=0,a=i-1;s<i;a=s++){const[e,l]=t[s],[c,u]=t[a],[,d]=t[0===a?i-1:a-1]||[0,0],h=(l-u)*(n-e)-(e-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===h)return!0;h>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===h)return!0;h<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r==l&&(n>=c&&n<=e||n>=e&&n<=c))return!0}return o}([t.clientX,t.clientY],n));var t,n};CH({isDisabled:()=>!(null==r&&N.isOpen()&&t.isModal()),targets:()=>[y(),...k()].filter(Boolean)}),Oe((()=>{const e=y();if(!e||!r)return;const t=r.registerNestedMenu(e);$e((()=>{t()}))})),Oe((()=>{void 0===r&&o?.registerMenu(t.value(),[y(),...k()])})),Oe((()=>{void 0===r&&void 0!==o&&(o.value()===t.value()?(g()?.focus(),o.autoFocusMenu()&&M(!0)):O())})),Oe((()=>{void 0===r&&void 0!==o&&N.isOpen()&&o.setValue(t.value())})),$e((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:Re((()=>({"data-expanded":N.isOpen()?"":void 0,"data-closed":N.isOpen()?void 0:""}))),isOpen:N.isOpen,contentPresent:_,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:M,close:O,toggle:e=>{w(e),N.toggle()},focusContent:A,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||A()},onTriggerLeave:e=>{L(e)&&e.preventDefault()},setPointerDir:e=>d=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>u=e,registerNestedMenu:e=>{E((t=>[...t,e]));const t=r?.registerNestedMenu(e);return()=>{E((t=>GU(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:PV(f),registerContentId:PV(m)};return ut(P,{get children(){return ut(IH.Provider,{value:I,get children(){return ut(Ct,{when:void 0===i,get fallback(){return l.children},get children(){return ut(YK,mt({anchorRef:g,contentRef:y,onCurrentPlacementChange:C},l))}})}})}})}function gW(e){const{direction:t}=sB();return ut(mW,mt({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var vW=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function yW(e){const t=$H(),n=VH(),[r,o]=gt(e,["onFocusOutside","onKeyDown"]),{direction:i}=sB();return ut(eW,mt({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;XU(t.triggerRef(),n)||t.close()},onKeyDown:e=>{iV(e,r.onKeyDown);const o=XU(e.currentTarget,e.target),s=vW(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),lV(t.triggerRef()))}},o))}var bW=["Enter"," "],xW=(e,t)=>"ltr"===e?[...bW,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...bW,"horizontal"===t?"ArrowLeft":"ArrowUp"];function wW(e){let t;const n=VH(),r=$H(),o=wV({id:n.generateId(`sub-trigger-${bt()}`)},e),[i,s]=gt(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=sB(),u=()=>i.id,d=()=>{const e=r.parentMenuContext();if(null==e)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},h=pB({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{iV(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{iV(e,i.onKeyDown),e.repeat||i.disabled||xW(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(r.listState().collection().getFirstKey()))};return Oe((()=>{if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");$e(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1}))})),Oe(Ie((()=>r.parentMenuContext()?.pointerGraceTimeoutId()),(e=>{$e((()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)}))}))),Oe((()=>$e(r.registerTriggerId(i.id)))),$e((()=>{l()})),ut(DV,mt({as:"div",ref(e){const n=MU((e=>{r.setTriggerRef(e),t=e}),i.ref);"function"==typeof n&&n(e)},get id(){return i.id},role:"menuitem",get tabIndex(){return h.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return Re((()=>!!r.isOpen()))()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return d().focusedKey()===u()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return sV([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return sV([i.onPointerUp,h.onPointerUp])},get onClick(){return sV([f,h.onClick])},get onKeyDown(){return sV([p,h.onKeyDown])},get onMouseDown(){return sV([i.onMouseDown,h.onMouseDown])},get onFocus(){return sV([i.onFocus,h.onFocus])},onPointerMove:e=>{if(iV(e,i.onPointerMove),"mouse"!==e.pointerType)return;const t=r.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(i.disabled?t?.onItemLeave(e):(r.isOpen()||a||(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),lV(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(iV(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:pW(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());const o=window.setTimeout((()=>{t?.setPointerGraceIntent(null)}),300);t?.setPointerGraceTimeoutId(o)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)}},(()=>r.dataset()),s))}function SW(e){const t=WH(),n=wV({id:`menu-${bt()}`,modal:!0},e),[r,o]=gt(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=eH({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>r.onOpenChange?.(e)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:QU((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return ut(UH.Provider,{value:s,get children(){return ut(mW,mt({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function CW(e){let t;const n=wV({orientation:"horizontal"},e),[r,o]=gt(n,["ref","orientation"]),i=NV((()=>t),(()=>"hr"));return ut(DV,mt({as:"hr",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get role(){return"hr"!==i()?"separator":void 0},get"aria-orientation"(){return"vertical"===r.orientation?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}UV({},{Root:()=>CW,Separator:()=>kW});var kW=CW,EW={};function jW(e){const t=VH(),n=$H(),[r,o]=gt(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return ut(tW,mt({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||lV(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function TW(e){return ut(SW,wV({id:`dropdownmenu-${bt()}`},e))}UV(EW,{Arrow:()=>KK,CheckboxItem:()=>KH,Content:()=>jW,DropdownMenu:()=>PW,Group:()=>rW,GroupLabel:()=>oW,Icon:()=>iW,Item:()=>sW,ItemDescription:()=>aW,ItemIndicator:()=>lW,ItemLabel:()=>cW,Portal:()=>uW,RadioGroup:()=>hW,RadioItem:()=>fW,Root:()=>TW,Separator:()=>CW,Sub:()=>gW,SubContent:()=>yW,SubTrigger:()=>wW,Trigger:()=>XH});var PW=Object.assign(TW,{Arrow:KK,CheckboxItem:KH,Content:jW,Group:rW,GroupLabel:oW,Icon:iW,Item:sW,ItemDescription:aW,ItemIndicator:lW,ItemLabel:cW,Portal:uW,RadioGroup:hW,RadioItem:fW,Separator:CW,Sub:gW,SubContent:yW,SubTrigger:wW,Trigger:XH}),NW={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},_W=At('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),DW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),MW=At('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),OW=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),RW=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),AW=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),LW=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),IW=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),FW=At('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),$W=At('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),qW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),zW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),UW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),VW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),BW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),KW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),HW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),WW=At('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),GW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),YW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),QW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),XW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),JW=At('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function ZW(){return _W()}function eG(){return DW()}function tG(){return MW()}function nG(){return OW()}function rG(){return RW()}function oG(){return(e=RW()).style.setProperty("transform","rotate(90deg)"),e;var e}function iG(){return(e=RW()).style.setProperty("transform","rotate(-90deg)"),e;var e}function sG(){return AW()}function aG(){return LW()}function lG(){return IW()}function cG(){return FW()}function uG(){return $W()}function dG(){return qW()}function hG(){return zW()}function fG(){return UW()}function pG(){return VW()}function mG(e){return t=BW(),n=t.firstChild,Me((()=>It(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function gG(){return KW()}function vG(){return HW()}function yG(e){return[ut(Ct,{get when(){return e.checked},get children(){var t=BW(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),ut(Ct,{get when(){return!e.checked},get children(){var t=WW(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function bG(){return GW()}function xG(){return YW()}function wG(){return QW()}function SG(){return XW()}function CG(){const e=bt();return t=JW(),i=(o=(r=(n=t.firstChild).nextSibling).nextSibling).firstChild,a=(s=o.nextSibling).firstChild,u=(c=(l=s.nextSibling).nextSibling).firstChild,h=(d=c.nextSibling).firstChild,m=(p=(f=d.nextSibling).nextSibling).firstChild,v=(g=p.nextSibling).firstChild,x=(b=(y=g.nextSibling).nextSibling).firstChild,S=(w=b.nextSibling).firstChild,E=(k=(C=w.nextSibling).nextSibling).firstChild,T=(j=k.nextSibling).firstChild,_=(N=(P=j.nextSibling).nextSibling).firstChild,M=(D=N.nextSibling).firstChild,A=(R=(O=D.nextSibling).nextSibling).firstChild,I=(L=R.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,U=(z=F.nextSibling).firstChild,B=(V=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=V.nextSibling).firstChild).nextSibling).nextSibling.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,ae=(se=K.nextSibling).firstChild,ce=(le=se.nextSibling).firstChild,he=(de=(ue=le.nextSibling).firstChild).nextSibling,pe=(fe=ue.nextSibling).firstChild,ge=(me=fe.nextSibling).firstChild,Ae=(Re=(Oe=(Me=(De=(_e=(Ne=(Pe=(Te=(je=(Ee=(ke=(Ce=(Se=(we=(xe=(be=(ye=(ve=me.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,It(n,"id",`a-${e}`),It(r,"fill",`url(#a-${e})`),It(i,"id",`am-${e}`),It(s,"id",`b-${e}`),It(a,"filter",`url(#am-${e})`),It(l,"mask",`url(#b-${e})`),It(u,"id",`ah-${e}`),It(d,"id",`k-${e}`),It(h,"filter",`url(#ah-${e})`),It(f,"mask",`url(#k-${e})`),It(m,"id",`ae-${e}`),It(g,"id",`j-${e}`),It(v,"filter",`url(#ae-${e})`),It(y,"mask",`url(#j-${e})`),It(x,"id",`ai-${e}`),It(w,"id",`i-${e}`),It(S,"filter",`url(#ai-${e})`),It(C,"mask",`url(#i-${e})`),It(E,"id",`aj-${e}`),It(j,"id",`h-${e}`),It(T,"filter",`url(#aj-${e})`),It(P,"mask",`url(#h-${e})`),It(_,"id",`ag-${e}`),It(D,"id",`g-${e}`),It(M,"filter",`url(#ag-${e})`),It(O,"mask",`url(#g-${e})`),It(A,"id",`af-${e}`),It(L,"id",`f-${e}`),It(I,"filter",`url(#af-${e})`),It(F,"mask",`url(#f-${e})`),It($,"id",`m-${e}`),It(q,"fill",`url(#m-${e})`),It(U,"id",`ak-${e}`),It(V,"id",`e-${e}`),It(B,"filter",`url(#ak-${e})`),It(K,"mask",`url(#e-${e})`),It(H,"id",`n-${e}`),It(W,"fill",`url(#n-${e})`),It(G,"id",`r-${e}`),It(Y,"fill",`url(#r-${e})`),It(Q,"id",`s-${e}`),It(X,"fill",`url(#s-${e})`),It(J,"id",`q-${e}`),It(Z,"fill",`url(#q-${e})`),It(ee,"id",`p-${e}`),It(te,"fill",`url(#p-${e})`),It(ne,"id",`o-${e}`),It(re,"fill",`url(#o-${e})`),It(oe,"id",`l-${e}`),It(ie,"fill",`url(#l-${e})`),It(ae,"id",`al-${e}`),It(le,"id",`d-${e}`),It(ce,"filter",`url(#al-${e})`),It(ue,"mask",`url(#d-${e})`),It(de,"id",`u-${e}`),It(he,"fill",`url(#u-${e})`),It(pe,"id",`ad-${e}`),It(me,"id",`c-${e}`),It(ge,"filter",`url(#ad-${e})`),It(ve,"mask",`url(#c-${e})`),It(ye,"id",`t-${e}`),It(be,"fill",`url(#t-${e})`),It(xe,"id",`v-${e}`),It(we,"stroke",`url(#v-${e})`),It(Se,"id",`aa-${e}`),It(Ce,"stroke",`url(#aa-${e})`),It(ke,"id",`w-${e}`),It(Ee,"stroke",`url(#w-${e})`),It(je,"id",`ac-${e}`),It(Te,"stroke",`url(#ac-${e})`),It(Pe,"id",`ab-${e}`),It(Ne,"stroke",`url(#ab-${e})`),It(_e,"id",`y-${e}`),It(De,"stroke",`url(#y-${e})`),It(Me,"id",`x-${e}`),It(Oe,"stroke",`url(#x-${e})`),It(Re,"id",`z-${e}`),It(Ae,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x,w,S,C,k,E,j,T,P,N,_,D,M,O,R,A,L,I,F,$,q,z,U,V,B,K,H,W,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,he,fe,pe,me,ge,ve,ye,be,xe,we,Se,Ce,ke,Ee,je,Te,Pe,Ne,_e,De,Me,Oe,Re,Ae}var kG=At('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),EG=At('<button title="Copy object to clipboard">'),jG=At('<button title="Remove all items"aria-label="Remove all items">'),TG=At('<button title="Delete item"aria-label="Delete item">'),PG=At('<button title="Toggle value"aria-label="Toggle value">'),NG=At('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),_G=At("<div>"),DG=At("<div><button> <span></span> <span> "),MG=At("<input>"),OG=At("<span>"),RG=At("<div><span>:"),AG=At("<div><div><button> [<!>...<!>]");var LG=e=>{const t=rU(),n=Jz().shadowDOMTarget?PU.bind({target:Jz().shadowDOMTarget}):PU,r=Re((()=>"dark"===t()?KG(n):BG(n)));return o=kG(),Me((()=>Ft(o,_U(r().expander,n`
|
|
43
|
+
*/(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);i+="; Expires="+n.expires.toUTCString()}n.httpOnly&&(i+="; HttpOnly");n.secure&&(i+="; Secure");n.partitioned&&(i+="; Partitioned");if(n.priority){switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}}if(n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}}return i};const kw=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Ew=/^[\u0021-\u003A\u003C-\u007E]*$/,jw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Tw=/^[\u0020-\u003A\u003D-\u007E]*$/,Pw=Object.prototype.toString,Nw=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function _w(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Dw(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Mw(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(nQ){return e}}function Ow(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=l(null==r?t.length-1:r),s="POP",a=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function u(e,n=null,r){let o=function(e,t,n=null,r){let o={pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?Fw(t):t,state:n,key:t&&t.key||r||Lw()};return o}(t?c().pathname:"/",e,n,r);return Aw("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:Iw(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?Fw(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){s="PUSH";let r=u(e,n);i+=1,t.splice(i,t.length,r),o&&a&&a({action:s,location:r,delta:1})},replace(e,n){s="REPLACE";let r=u(e,n);t[i]=r,o&&a&&a({action:s,location:r,delta:0})},go(e){s="POP";let n=l(i+e);i=n,a&&a({action:s,location:t[n],delta:e})},listen:e=>(a=e,()=>{a=null})}}function Rw(e,t){if(!1===e||null==e)throw new Error(t)}function Aw(e,t){if(!e)try{throw new Error(t)}catch(nQ){}}function Lw(){return Math.random().toString(36).substring(2,10)}function Iw({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function Fw(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function $w(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?Fw(t):t,i=Zw(o.pathname||"/",n);if(null==i)return null;let s=qw(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(s);let a=null;for(let l=0;null==a&&l<s.length;++l){let e=Jw(i);a=Qw(s[l],e,r)}return a}(e,t,n,!1)}function qw(e,t=[],n=[],r=""){let o=(e,o,i)=>{let s={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};s.relativePath.startsWith("/")&&(Rw(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length));let a=rS([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(Rw(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),qw(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:Yw(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of zw(e.path))o(e,t,n);else o(e,t)})),t}function zw(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let s=zw(r.join("/")),a=[];return a.push(...s.map((e=>""===e?i:[i,e].join("/")))),o&&a.push(...s),a.map((t=>e.startsWith("/")&&""===t?"/":t))}var Uw=/^:[\w-]+$/,Vw=3,Bw=2,Kw=1,Hw=10,Ww=-2,Gw=e=>"*"===e;function Yw(e,t){let n=e.split("/"),r=n.length;return n.some(Gw)&&(r+=Ww),t&&(r+=Bw),n.filter((e=>!Gw(e))).reduce(((e,t)=>e+(Uw.test(t)?Vw:""===t?Kw:Hw)),r)}function Qw(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a<r.length;++a){let e=r[a],l=a===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Xw({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Xw({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:rS([i,u.pathname]),pathnameBase:oS(rS([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=rS([i,u.pathnameBase]))}return s}function Xw(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Aw("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:n},r)=>{if("*"===t){s=i.slice(0,i.length-(a[r]||"").length).replace(/(.)\/+$/,"$1")}const o=a[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:s,pattern:e}}function Jw(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Aw(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Zw(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function eS(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function tS(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function nS(e,t,n,r=!1){let o;"string"==typeof e?o=Fw(e):(o={...e},Rw(!o.pathname||!o.pathname.includes("?"),eS("?","pathname","search",o)),Rw(!o.pathname||!o.pathname.includes("#"),eS("#","pathname","hash",o)),Rw(!o.search||!o.search.includes("#"),eS("#","search","hash",o)));let i,s=""===e||""===o.pathname,a=s?"/":o.pathname;if(null==a)i=n;else{let e=t.length-1;if(!r&&a.startsWith("..")){let t=a.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:n,search:r="",hash:o=""}="string"==typeof e?Fw(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:iS(r),hash:sS(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var rS=e=>e.join("/").replace(/\/\/+/g,"/"),oS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iS=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",sS=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var aS=["POST","PUT","PATCH","DELETE"];new Set(aS);var lS=["GET",...aS];new Set(lS);var cS=i.createContext(null);cS.displayName="DataRouter";var uS=i.createContext(null);uS.displayName="DataRouterState";var dS=i.createContext({isTransitioning:!1});dS.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var hS=i.createContext(null);hS.displayName="Navigation";var fS=i.createContext(null);fS.displayName="Location";var pS=i.createContext({outlet:null,matches:[],isDataRoute:!1});pS.displayName="Route";var mS=i.createContext(null);function gS(){return null!=i.useContext(fS)}function vS(){return Rw(gS(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(fS).location}mS.displayName="RouteError";var yS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bS(e){i.useContext(hS).static||i.useLayoutEffect(e)}function xS(){let{isDataRoute:e}=i.useContext(pS);return e?function(){let{router:e}=function(e){let t=i.useContext(cS);return Rw(t,TS(e)),t}("useNavigate"),t=PS("useNavigate"),n=i.useRef(!1);return bS((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{Aw(n.current,yS),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){Rw(gS(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(cS),{basename:t,navigator:n}=i.useContext(hS),{matches:r}=i.useContext(pS),{pathname:o}=vS(),s=JSON.stringify(tS(r)),a=i.useRef(!1);return bS((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(Aw(a.current,yS),!a.current)return;if("number"==typeof r)return void n.go(r);let l=nS(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:rS([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function wS(e,{relative:t}={}){let{matches:n}=i.useContext(pS),{pathname:r}=vS(),o=JSON.stringify(tS(n));return i.useMemo((()=>nS(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function SS(e,t,n,r){Rw(gS(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(hS),{matches:a}=i.useContext(pS),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;{let e=h&&h.path||"";_S(u,!h||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}o=vS();let f=o.pathname||"/",p=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=$w(e,{pathname:p});Aw(h||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),Aw(null==m||void 0!==m[m.length-1].route.element||void 0!==m[m.length-1].route.Component||void 0!==m[m.length-1].route.lazy,`Matched leaf route at location "${o.pathname}${o.search}${o.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=function(e,t=[],n=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let r=e,o=n?.errors;if(null!=o){let e=r.findIndex((e=>e.route.id&&void 0!==o?.[e.route.id]));Rw(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,e+1))}let s=!1,a=-1;if(n)for(let i=0;i<r.length;i++){let e=r[i];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(a=i),e.route.id){let{loaderData:t,errors:o}=n,i=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!o||void 0===o[e.route.id]);if(e.route.lazy||i){s=!0,r=a>=0?r.slice(0,a+1):[r[0]];break}}}return r.reduceRight(((e,l,c)=>{let u,d=!1,h=null,f=null;n&&(u=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||kS,s&&(a<0&&0===c?(_S("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,f=null):a===c&&(d=!0,f=l.route.hydrateFallbackElement||null)));let p=t.concat(r.slice(0,c+1)),m=()=>{let t;return t=u?h:d?f:l.route.Component?i.createElement(l.route.Component,null):l.route.element?l.route.element:e,i.createElement(jS,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(ES,{location:n.location,revalidation:n.revalidation,component:h,error:u,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:rS([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:rS([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function CS(){let e=function(){let e=i.useContext(mS),t=function(e){let t=i.useContext(uS);return Rw(t,TS(e)),t}("useRouteError"),n=PS("useRouteError");if(void 0!==e)return e;return t.errors?.[n]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return a=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:o},n):null,a)}i.createContext(null);var kS=i.createElement(CS,null),ES=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?i.createElement(pS.Provider,{value:this.props.routeContext},i.createElement(mS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function jS({routeContext:e,match:t,children:n}){let r=i.useContext(cS);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(pS.Provider,{value:e},n)}function TS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function PS(e){let t=function(e){let t=i.useContext(pS);return Rw(t,TS(e)),t}(e),n=t.matches[t.matches.length-1];return Rw(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var NS={};function _S(e,t,n){t||NS[e]||(NS[e]=!0,Aw(!1,n))}function DS({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=Ow({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=o.current,[a,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback((e=>{i.startTransition((()=>l(e)))}),[l]);return i.useLayoutEffect((()=>s.listen(c)),[s,c]),i.createElement(MS,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function MS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){Rw(!gS(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=i.useMemo((()=>({basename:a,navigator:o,static:s,future:{}})),[a,o,s]);"string"==typeof n&&(n=Fw(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,p=i.useMemo((()=>{let e=Zw(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:h,key:f},navigationType:r}}),[a,c,u,d,h,f,r]);return Aw(null!=p,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==p?null:i.createElement(hS.Provider,{value:l},i.createElement(fS.Provider,{children:t,value:p}))}i.memo((function({routes:e,future:t,state:n}){return SS(e,0,n,t)}));var OS="get",RS="application/x-www-form-urlencoded";function AS(e){return null!=e&&"string"==typeof e.tagName}function LS(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}var IS=null;var FS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $S(e){return null==e||FS.has(e)?e:(Aw(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${RS}"`),null)}function qS(e,t){let n,r,o,i,s;if(function(e){return AS(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?Zw(s,t):null,n=e.getAttribute("method")||OS,o=$S(e.getAttribute("enctype"))||RS,i=new FormData(e)}else if(function(e){return AS(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return AS(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||s.getAttribute("action");if(r=a?Zw(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||OS,o=$S(e.getAttribute("formenctype"))||$S(s.getAttribute("enctype"))||RS,i=new FormData(s,e),!function(){if(null===IS)try{new FormData(document.createElement("form"),0),IS=!1}catch(nQ){IS=!0}return IS}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,r)}}else{if(AS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=OS,r=null,o=RS,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function zS(e,t){if(!1===e||null==e)throw new Error(t)}function US(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function VS(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce(((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return window.__reactRouterContext&&window,window.location.reload(),new Promise((()=>{}))}}(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(US).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function BS(e,t,n,r,o,i){let s=(e,t)=>!n[t]||e.route.id!==n[t].route.id,a=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===i?t.filter(((e,t)=>s(e,t)||a(e,t))):"data"===i?t.filter(((t,i)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(s(t,i)||a(t,i))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function KS(e,t){return n=e.map((e=>{let n=t.routes[e.route.id];if(!n)return[];let r=[n.module];return n.imports&&(r=r.concat(n.imports)),r})).flat(1),[...new Set(n)];var n}var HS=i.createContext(void 0);function WS(){let e=i.useContext(HS);return zS(e,"You must render this element inside a <HydratedRouter> element"),e}function GS(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YS({page:e,...t}){let{router:n}=function(){let e=i.useContext(cS);return zS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>$w(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(QS,{page:e,matches:r,...t}):null}function QS({page:e,matches:t,...n}){let r=vS(),{manifest:o,routeModules:s}=WS(),{loaderData:a,matches:l}=function(){let e=i.useContext(uS);return zS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>BS(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>BS(e,t,l,o,r,"assets")),[e,t,l,o,r]),d=i.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,i=!1;if(t.forEach((e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in a&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:n.add(e.route.id))})),0===n.size)return[];let l=function(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return t.pathname="/"===t.pathname?"_root.data":`${t.pathname.replace(/\/$/,"")}.data`,t}(e);return i&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[a,r,o,c,t,e,s]),h=i.useMemo((()=>KS(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=WS(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return VS(e,t,n).then((e=>{r||o(e)})),()=>{r=!0}}),[e,t,n]),r}(u);return i.createElement(i.Fragment,null,d.map((e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),h.map((e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),f.map((({key:e,link:t})=>i.createElement("link",{key:e,...t}))))}function XS(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}HS.displayName="FrameworkContext";var JS="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{JS&&(window.__reactRouterVersion="7.1.0")}catch(nQ){}var ZS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eC=i.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...h},f){let p,{basename:m}=i.useContext(hS),g="string"==typeof c&&ZS.test(c),v=!1;if("string"==typeof c&&g&&(p=c,JS))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=Zw(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:v=!0}catch(nQ){Aw(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=function(e,{relative:t}={}){Rw(gS(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(hS),{hash:o,pathname:s,search:a}=wS(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:rS([n,s])),r.createHref({pathname:l,search:a,hash:o})}(c,{relative:r}),[b,x,w]=function(e,t){let n=i.useContext(HS),[r,o]=i.useState(!1),[s,a]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=t,f=i.useRef(null);i.useEffect((()=>{if("render"===e&&a(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{a(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),i.useEffect((()=>{if(r){let e=setTimeout((()=>{a(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let p=()=>{o(!0)},m=()=>{o(!1),a(!1)};return n?"intent"!==e?[s,f,{}]:[s,f,{onFocus:GS(l,p),onBlur:GS(c,m),onMouseEnter:GS(u,p),onMouseLeave:GS(d,m),onTouchStart:GS(h,p)}]:[!1,f,{}]}(n,h),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=xS(),c=vS(),u=wS(e,{relative:s});return i.useCallback((i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==n?n:Iw(c)===Iw(u);l(e,{replace:t,state:r,preventScrollReset:o,relative:s,viewTransition:a})}}),[c,l,u,n,r,t,e,o,s,a])}(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,viewTransition:d});let C=i.createElement("a",{...h,...w,href:p||y,onClick:v||o?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:XS(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(YS,{page:y})):C}));function tC(e){let t=i.useContext(cS);return Rw(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}function nC(e){Aw("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(LS(e)),n=i.useRef(!1),r=vS(),o=i.useMemo((()=>function(e,t){let n=LS(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),s=xS(),a=i.useCallback(((e,t)=>{const r=LS("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}eC.displayName="Link",i.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:s,viewTransition:a,children:l,...c},u){let d=wS(s,{relative:c.relative}),h=vS(),f=i.useContext(uS),{navigator:p,basename:m}=i.useContext(hS),g=null!=f&&function(e,t={}){let n=i.useContext(dS);Rw(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=tC("useViewTransitionState"),o=wS(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Zw(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Zw(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=Xw(o.pathname,a)||null!=Xw(o.pathname,s)}(d)&&!0===a,v=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,y=h.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&m&&(b=Zw(b,m)||b);const x="/"!==v&&v.endsWith("/")?v.length-1:v.length;let w,S=y===v||!r&&y.startsWith(v)&&"/"===y.charAt(x),C=null!=b&&(b===v||!r&&b.startsWith(v)&&"/"===b.charAt(v.length)),k={isActive:S,isPending:C,isTransitioning:g},E=S?e:void 0;w="function"==typeof n?n(k):[n,S?"active":null,C?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let j="function"==typeof o?o(k):o;return i.createElement(eC,{...c,"aria-current":E,className:w,ref:u,style:j,to:s,viewTransition:a},"function"==typeof l?l(k):l)})).displayName="NavLink",i.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:a=OS,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:h,...f},p)=>{let m=function(){let{router:e}=tC("useSubmit"),{basename:t}=i.useContext(hS),n=PS("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=qS(r,t);if(!1===o.navigate){let t=o.fetcherKey||oC();await e.fetch(t,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,n])}(),g=function(e,{relative:t}={}){let{basename:n}=i.useContext(hS),r=i.useContext(pS);Rw(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...wS(e||".",{relative:t})},a=vS();if(null==e){s.search=a.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();s.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(s.pathname="/"===s.pathname?n:rS([n,s.pathname]));return Iw(s)}(l,{relative:u}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof l&&ZS.test(l);return i.createElement("form",{ref:p,method:v,action:g,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||a;m(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:h})},...f,"data-discover":y||"render"!==e?void 0:"true"})})).displayName="Form";var rC=0,oC=()=>`__${String(++rC)}__`;new TextEncoder;const iC=({tabs:e,activeTab:r,onTabChange:o,actionButton:i,tabsLocation:s="left"})=>{const[a,l]=n.useState(i?.label||""),[c,u]=n.useState(!1),d=n.useRef([]),[h,f]=n.useState({width:0,left:0});return n.useEffect((()=>{const t=d.current[e.findIndex((e=>e.id===r))];t&&f({width:t.offsetWidth,left:t.offsetLeft})}),[r,e]),n.useEffect((()=>{if(i?.label){u(!0);const e=setTimeout((()=>{l(i.label),u(!1)}),200);return()=>clearTimeout(e)}}),[i?.label]),t.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100/50",children:[t.jsxs("div",{className:"relative flex items-center gap-8 "+("left"===s?"w-full justify-start":"w-full justify-center"),children:[t.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-gray-100/50 rounded-full"}),t.jsx("div",{className:"absolute bottom-0 h-[1px] rounded-full transition-all duration-300 ease-out\n bg-gradient-to-r from-primary to-primary/90\n shadow-[0_0_8px_rgba(var(--primary-rgb),0.3)]",style:{width:`${h.width}px`,left:`${h.left}px`}}),e.map(((e,n)=>t.jsx("button",{ref:e=>d.current[n]=e,onClick:()=>o(e.id),className:"relative px-1 py-3 text-lg transition-all duration-200 \n "+(r===e.id?"text-primary font-medium scale-102":"text-gray-500 hover:text-primary/70 hover:scale-102"),children:e.label},e.id)))]}),i&&t.jsx("div",{className:"relative z-10 pl-8 ml-8 border-l border-gray-100/50",children:t.jsx(lw,{onClick:i.onClick,className:"bg-primary hover:bg-primary/90 text-white shadow-sm hover:shadow-md transition-all duration-200",children:t.jsx("span",{className:`\n inline-block min-w-[80px] text-center\n transition-all duration-400 ease-in-out\n ${c?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}\n `,children:a})})})]}),t.jsx("div",{className:"relative min-h-[200px]",children:e.map((n=>t.jsx("div",{className:"absolute w-full transition-all duration-500 ease-in-out transform \n "+(r===n.id?"translate-x-0 opacity-100 pointer-events-auto":(e.findIndex((e=>e.id===n.id))<e.findIndex((e=>e.id===r))?"translate-x-[-100%]":"translate-x-[100%]")+" opacity-0 pointer-events-none"),children:n.content},n.id)))})]})};var sC=i["useId".toString()]||(()=>{}),aC=0;function lC(e){const[t,n]=i.useState(sC());return iu((()=>{n((e=>e??String(aC++)))}),[e]),e||(t?`radix-${t}`:"")}var cC=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(hC);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(uC,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(uC,{...o,ref:n,children:r})}));cC.displayName="Slot";var uC=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));uC.displayName="SlotClone";var dC=({children:e})=>t.jsx(t.Fragment,{children:e});function hC(e){return i.isValidElement(e)&&e.type===dC}var fC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?cC:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});var pC,mC="dismissableLayer.update",gC="dismissableLayer.pointerDownOutside",vC="dismissableLayer.focusOutside",yC=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bC=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(yC),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){wC(gC,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){wC(vC,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(pC=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),xC(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=pC)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),xC())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(mC,e),()=>document.removeEventListener(mC,e)}),[]),t.jsx(fC.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));bC.displayName="DismissableLayer";function xC(){const e=new CustomEvent(mC);document.dispatchEvent(e)}function wC(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(yC),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(fC.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var SC="focusScope.autoFocusOnMount",CC="focusScope.autoFocusOnUnmount",kC={bubbles:!1,cancelable:!0},EC=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:NC(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||NC(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&NC(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){_C.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(SC,kC);c.addEventListener(SC,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(NC(r,{select:t}),document.activeElement!==n)return}((e=jC(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&NC(c))}return()=>{c.removeEventListener(SC,d),setTimeout((()=>{const e=new CustomEvent(CC,kC);c.addEventListener(CC,h),c.dispatchEvent(e),e.defaultPrevented||NC(t??document.body,{select:!0}),c.removeEventListener(CC,h),_C.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=jC(e),n=TC(t,e),r=TC(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&NC(i,{select:!0})):(e.preventDefault(),r&&NC(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(fC.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function jC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function TC(e,t){for(const n of e)if(!PC(n,{upTo:t}))return n}function PC(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function NC(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}EC.displayName="FocusScope";var _C=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=DC(e,t),e.unshift(t)},remove(t){e=DC(e,t),e[0]?.resume()}}}();function DC(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var MC=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);iu((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(fC.div,{...s,ref:n}),c):null}));MC.displayName="Portal";var OC=0;function RC(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??AC()),document.body.insertAdjacentElement("beforeend",e[1]??AC()),OC++,()=>{1===OC&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),OC--}}),[])}function AC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var LC=function(){return LC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},LC.apply(this,arguments)};function IC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function FC(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var $C="right-scroll-bar-position",qC="width-before-scroll-bar";function zC(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var UC="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,VC=new WeakMap;function BC(e,t){var r=function(e,t){var r=n.useState((function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}}))[0];return r.callback=t,r.facade}(null,(function(t){return e.forEach((function(e){return zC(e,t)}))}));return UC((function(){var t=VC.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||zC(e,null)})),o.forEach((function(e){n.has(e)||zC(e,i)}))}VC.set(r,e)}),[e]),r}function KC(e){return e}function HC(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=KC);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=LC({async:!0,ssr:!1},e),t}var WC=function(e){var t=e.sideCar,n=IC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,LC({},n))};function GC(e,t){return e.useMedium(t),WC}WC.isSideCarExport=!0;var YC=HC(),QC=function(){},XC=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:QC,onWheelCapture:QC,onTouchMoveCapture:QC}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=e.gapMode,x=IC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=BC([n,t]),C=LC(LC({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:YC,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),LC(LC({},C),{ref:S})):i.createElement(y,LC({},C,{className:c,ref:S}),l))}));XC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},XC.classNames={fullWidth:qC,zeroRight:$C};function JC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ZC=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=JC())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ek=function(){var e,t=(e=ZC(),function(t,n){i.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){return t(e.styles,e.dynamic),null}},tk={left:0,top:0,right:0,gap:0},nk=function(e){return parseInt(e||"",10)||0},rk=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return tk;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[nk(t["padding"===e?"paddingLeft":"marginLeft"]),nk(n),nk(r)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ok=ek(),ik="data-scroll-locked",sk=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(ik,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat($C," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(qC," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat($C," .").concat($C," {\n right: 0 ").concat(r,";\n }\n \n .").concat(qC," .").concat(qC," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ik,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},ak=function(){var e=parseInt(document.body.getAttribute(ik)||"0",10);return isFinite(e)?e:0},lk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;i.useEffect((function(){return document.body.setAttribute(ik,(ak()+1).toString()),function(){var e=ak()-1;e<=0?document.body.removeAttribute(ik):document.body.setAttribute(ik,e.toString())}}),[]);var s=i.useMemo((function(){return rk(o)}),[o]);return i.createElement(ok,{styles:sk(s,!t,o,n?"":"!important")})},ck=!1;if("undefined"!=typeof window)try{var uk=Object.defineProperty({},"passive",{get:function(){return ck=!0,!0}});window.addEventListener("test",uk,uk),window.removeEventListener("test",uk,uk)}catch(oQ){ck=!1}var dk=!!ck&&{passive:!1},hk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},fk=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),pk(e,r)){var o=mk(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pk=function(e,t){return"v"===e?function(e){return hk(e,"overflowY")}(t):function(e){return hk(e,"overflowX")}(t)},mk=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},gk=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vk=function(e){return[e.deltaX,e.deltaY]},yk=function(e){return e&&"current"in e?e.current:e},bk=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},xk=0,wk=[];function Sk(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ck=GC(YC,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(xk++)[0],s=i.useState(ek)[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=FC([e.lockRef.current],(e.shards||[]).map(yk),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=gk(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=fk(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=fk(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=mk(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&pk(e,s)&&(u+=p,d+=f),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(wk.length&&wk[wk.length-1]===s){var r="deltaY"in n?vk(n):gk(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(yk).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:Sk(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=gk(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,vk(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,gk(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return wk.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,dk),document.addEventListener("touchmove",c,dk),document.addEventListener("touchstart",d,dk),function(){wk=wk.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,dk),document.removeEventListener("touchmove",c,dk),document.removeEventListener("touchstart",d,dk)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:bk(o)}):null,p?i.createElement(lk,{gapMode:e.gapMode}):null)}));var kk=i.forwardRef((function(e,t){return i.createElement(XC,LC({},e,{ref:t,sideCar:Ck}))}));kk.classNames=XC.classNames;var Ek=new WeakMap,jk=new WeakMap,Tk={},Pk=0,Nk=function(e){return e&&(e.host||Nk(e.parentNode))},_k=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Nk(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Tk[n]||(Tk[n]=new WeakMap);var i=Tk[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(Ek.get(e)||0)+1,c=(i.get(e)||0)+1;Ek.set(e,l),i.set(e,c),s.push(e),1===l&&o&&jk.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(nQ){}}))};return u(t),a.clear(),Pk++,function(){s.forEach((function(e){var t=Ek.get(e)-1,o=i.get(e)-1;Ek.set(e,t),i.set(e,o),t||(jk.has(e)||e.removeAttribute(r),jk.delete(e)),o||e.removeAttribute(n)})),--Pk||(Ek=new WeakMap,Ek=new WeakMap,jk=new WeakMap,Tk={})}},Dk=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),_k(r,o,n,"aria-hidden")):function(){return null}},Mk="Dialog",[Ok,Rk]=Lc(Mk),[Ak,Lk]=Ok(Mk),Ik=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d=!1,h]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(Ak,{scope:n,triggerRef:c,contentRef:u,contentId:lC(),titleId:lC(),descriptionId:lC(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};Ik.displayName=Mk;var Fk="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Fk,r),s=Ac(n,i.triggerRef);return t.jsx(fC.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rE(i.open),...o,ref:s,onClick:Mc(e.onClick,i.onOpenToggle)})})).displayName=Fk;var $k="DialogPortal",[qk,zk]=Ok($k,{forceMount:void 0}),Uk=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=Lk($k,n);return t.jsx(qk,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(au,{present:r||a.open,children:t.jsx(MC,{asChild:!0,container:s,children:e})})))})};Uk.displayName=$k;var Vk="DialogOverlay",Bk=i.forwardRef(((e,n)=>{const r=zk(Vk,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=Lk(Vk,e.__scopeDialog);return s.modal?t.jsx(au,{present:o||s.open,children:t.jsx(Kk,{...i,ref:n})}):null}));Bk.displayName=Vk;var Kk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Vk,r);return t.jsx(kk,{as:cC,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(fC.div,{"data-state":rE(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),Hk="DialogContent",Wk=i.forwardRef(((e,n)=>{const r=zk(Hk,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=Lk(Hk,e.__scopeDialog);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?Gk:Yk,{...i,ref:n})})}));Wk.displayName=Hk;var Gk=i.forwardRef(((e,n)=>{const r=Lk(Hk,e.__scopeDialog),o=i.useRef(null),s=Ac(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),t.jsx(Qk,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()))})})),Yk=i.forwardRef(((e,n)=>{const r=Lk(Hk,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(Qk,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),Qk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=Lk(Hk,r),u=i.useRef(null),d=Ac(n,u);return RC(),t.jsxs(t.Fragment,{children:[t.jsx(EC,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(bC,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rE(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(aE,{titleId:c.titleId}),t.jsx(lE,{contentRef:u,descriptionId:c.descriptionId})]})]})})),Xk="DialogTitle",Jk=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Xk,r);return t.jsx(fC.h2,{id:i.titleId,...o,ref:n})}));Jk.displayName=Xk;var Zk="DialogDescription",eE=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(Zk,r);return t.jsx(fC.p,{id:i.descriptionId,...o,ref:n})}));eE.displayName=Zk;var tE="DialogClose",nE=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Lk(tE,r);return t.jsx(fC.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})}));function rE(e){return e?"open":"closed"}nE.displayName=tE;var oE="DialogTitleWarning",[iE,sE]=function(e,n){const r=i.createContext(n),o=e=>{const{children:n,...o}=e,s=i.useMemo((()=>o),Object.values(o));return t.jsx(r.Provider,{value:s,children:n})};return o.displayName=e+"Provider",[o,function(t){const o=i.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(oE,{contentName:Hk,titleName:Xk,docsSlug:"dialog"}),aE=({titleId:e})=>{const t=sE(oE);return i.useEffect((()=>{if(e){document.getElementById(e)}}),[`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`,e]),null},lE=({contentRef:e,descriptionId:t})=>{const n=sE("DialogDescriptionWarning");return i.useEffect((()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)}}),[`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`,e,t]),null},cE=Ik,uE=Uk,dE=Bk,hE=Wk,fE=Jk,pE=eE,mE=nE,gE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?rw:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{}),vE=i.forwardRef(((e,n)=>t.jsx(gE.span,{...e,ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));function yE(...e){return _h(Zu(e))}vE.displayName="VisuallyHidden";const bE=cE,xE=({...e})=>t.jsx(uE,{children:t.jsx("div",{"data-reach-root":!0,children:e.children})}),wE=i.forwardRef((({className:e,...n},r)=>t.jsx(dE,{ref:r,className:yE("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));wE.displayName=dE.displayName;const SE=i.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(xE,{children:[t.jsx(wE,{}),t.jsxs(hE,{ref:i,className:yE("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),onInteractOutside:e=>{e.composedPath().some((e=>"classList"in e&&Array.from(e.classList).includes("pac-item")))&&e.preventDefault()},...o,children:[n,!r&&t.jsxs(mE,{className:"absolute right-6 top-6 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(Fd,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));SE.displayName=hE.displayName;const CE=i.forwardRef((({className:e,...n},r)=>t.jsx(fE,{ref:r,className:yE("text-lg font-semibold leading-none tracking-tight",e),...n})));CE.displayName=fE.displayName;const kE=i.forwardRef((({className:e,...n},r)=>t.jsx(pE,{ref:r,className:yE("text-sm text-muted-foreground",e),...n})));kE.displayName=pE.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsx(vE,{ref:o,className:yE(e),...r,children:n}))).displayName="DialogVisuallyHidden";const EE=async e=>{const t=new URLSearchParams;e?.cursor&&t.append("cursor",e.cursor),e?.limit&&t.append("limit",e.limit.toString()),e?.search&&t.append("search",e.search);return(await Ja(`${Ux}${t.toString()?`?${t.toString()}`:""}`)).data},jE=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(Ux,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=ue({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await Ja(`${Ux}/conditions`,{method:"GET"})).data)()});return{createSegment:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess,segmentsConditions:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchSegmentsConditions:n.refetch}},TE=e=>{const t=ne(),n=ue({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await Ja(`${Ux}/count`,{method:"POST",body:JSON.stringify(e)})).data)(e)});return{data:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchCount:()=>{t.invalidateQueries({queryKey:["automations","recipients","count",e]})}}},PE=e=>{const t=ue({queryKey:["segments",e],queryFn:()=>(async e=>e?(await Ja(`${Ux}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},NE=e=>{const t=ne(),n=de({mutationFn:t=>(async(e,t)=>t?(await Ja(`${Ux}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data:null)(t,e),onSuccess:()=>{t.invalidateQueries({queryKey:["segments",e]})}});return{updateSegment:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}};var _E=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e))(_E||{}),DE=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(DE||{}),ME=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e))(ME||{});const OE=({onClose:e,setClickedCreate:n,isDisabled:r,createButtonText:o})=>t.jsx("div",{children:t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx(lw,{className:"px-4 py-2",onClick:()=>e?.(!1),variant:"destructive",children:"Cancel"}),t.jsx(lw,{className:"px-4 py-2",onClick:()=>{n(!0)},disabled:r,children:o})]})}),RE="reach-styles-module__container___6PQqs",AE=nd(["reach-styles-module__base___WFahB"],{variants:{variant:{default:"reach-styles-module__default___zeGU1",secondary:"reach-styles-module__secondary___VQ4iH",destructive:"reach-styles-module__destructive___RLaRD",outline:"reach-styles-module__outline___L2VtW",google:"reach-styles-module__google___HcEij",date:"reach-styles-module__date___-6BC4"},size:{default:"reach-styles-module__sizeDefault___iGTp4",sm:"reach-styles-module__sizeSm___6T2oK"},iconOnly:{true:"reach-styles-module__iconOnly___8vUSp",false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:"reach-styles-module__iconOnlySm___9ZKv9"}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}}),LE=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:Dh(AE({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));LE.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(RE,e),...n}))).displayName="BadgeContainer";var IE=.999,FE=/[\\\/_+.#"@\[\(\{&]/,$E=/[\\\/_+.#"@\[\(\{&]/g,qE=/[\s-]/,zE=/[\s-]/g;function UE(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?1:.99;var a=`${o},${i}`;if(void 0!==s[a])return s[a];for(var l,c,u,d,h=r.charAt(i),f=n.indexOf(h,o),p=0;f>=0;)(l=UE(e,t,n,r,f+1,i+1,s))>p&&(f===o?l*=1:FE.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match($E))&&o>0&&(l*=Math.pow(IE,u.length))):qE.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(zE))&&o>0&&(l*=Math.pow(IE,d.length))):(l*=.17,o>0&&(l*=Math.pow(IE,f-o))),e.charAt(f)!==t.charAt(i)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(.1*(c=UE(e,t,n,r,f+1,i+2,s))>l&&(l=.1*c)),l>p&&(p=l),f=n.indexOf(h,f+1);return s[a]=p,p}function VE(e){return e.toLowerCase().replace(zE," ")}function BE(e,t,n){return UE(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,VE(e),VE(t),0,0,{})}function KE(){return KE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KE.apply(null,arguments)}function HE(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function WE(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function GE(...e){return n.useCallback(WE(...e),e)}function YE(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=r.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return n.useMemo((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return r.scopeName=t.scopeName,r}const QE=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{},XE=i["useId".toString()]||(()=>{});let JE=0;function ZE(e){const[t,n]=i.useState(XE());return QE((()=>{n((e=>null!=e?e:String(JE++)))}),[e]),e||(t?`radix-${t}`:"")}function ej(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function tj({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,i]=function({defaultProp:e,onChange:t}){const r=n.useState(e),[o]=r,i=n.useRef(o),s=ej(t);return n.useEffect((()=>{i.current!==o&&(s(o),i.current=o)}),[o,i,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,a=s?e:o,l=ej(r);return[a,n.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else i(t)}),[s,e,i,l])]}const nj=n.forwardRef(((e,t)=>{const{children:r,...o}=e,i=n.Children.toArray(r),s=i.find(ij);if(s){const e=s.props.children,r=i.map((t=>t===s?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t));return n.createElement(rj,KE({},o,{ref:t}),n.isValidElement(e)?n.cloneElement(e,void 0,r):null)}return n.createElement(rj,KE({},o,{ref:t}),r)}));nj.displayName="Slot";const rj=n.forwardRef(((e,t)=>{const{children:r,...o}=e;return n.isValidElement(r)?n.cloneElement(r,{...sj(o,r.props),ref:t?WE(t,r.ref):r.ref}):n.Children.count(r)>1?n.Children.only(null):null}));rj.displayName="SlotClone";const oj=({children:e})=>n.createElement(n.Fragment,null,e);function ij(e){return n.isValidElement(e)&&e.type===oj}function sj(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const aj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const r=n.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?nj:t;return n.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),n.createElement(s,KE({},i,{ref:r}))}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function lj(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const cj="dismissableLayer.update",uj="dismissableLayer.pointerDownOutside",dj="dismissableLayer.focusOutside";let hj;const fj=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pj=n.forwardRef(((e,t)=>{var r;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=n.useContext(fj),[h,f]=n.useState(null),p=null!==(r=null==h?void 0:h.ownerDocument)&&void 0!==r?r:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,m]=n.useState({}),g=GE(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=lj(e),o=n.useRef(!1),i=n.useRef((()=>{}));return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let n=function(){gj(uj,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);o.current=!1},n=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}}),[t,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=lj(e),o=n.useRef(!1);return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){gj(dj,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=lj(e);n.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[r,t])}((e=>{x===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),n.useEffect((()=>{if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(hj=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),mj(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=hj)}}),[h,p,o,d]),n.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),mj())}),[h,d]),n.useEffect((()=>{const e=()=>m({});return document.addEventListener(cj,e),()=>document.removeEventListener(cj,e)}),[]),n.createElement(aj.div,KE({},u,{ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:HE(e.onFocusCapture,k.onFocusCapture),onBlurCapture:HE(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:HE(e.onPointerDownCapture,C.onPointerDownCapture)}))}));function mj(){const e=new CustomEvent(cj);document.dispatchEvent(e)}function gj(e,t,n,{discrete:o}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync((()=>e.dispatchEvent(t)))}(i,s):i.dispatchEvent(s)}function vj(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const yj="focusScope.autoFocusOnMount",bj="focusScope.autoFocusOnUnmount",xj={bubbles:!1,cancelable:!0},wj=n.forwardRef(((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[l,c]=n.useState(null),u=vj(i),d=vj(s),h=n.useRef(null),f=GE(t,(e=>c(e))),p=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect((()=>{if(o){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:Ej(h.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Ej(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Ej(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,l,p.paused]),n.useEffect((()=>{if(l){jj.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(yj,xj);l.addEventListener(yj,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ej(r,{select:t}),document.activeElement!==n)return}((e=Sj(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Ej(l))}return()=>{l.removeEventListener(yj,u),setTimeout((()=>{const e=new CustomEvent(bj,xj);l.addEventListener(bj,d),l.dispatchEvent(e),e.defaultPrevented||Ej(null!=t?t:document.body,{select:!0}),l.removeEventListener(bj,d),jj.remove(p)}),0)}}var e}),[l,u,d,p]);const m=n.useCallback((e=>{if(!r&&!o)return;if(p.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=Sj(e),n=Cj(t,e),r=Cj(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&Ej(i,{select:!0})):(e.preventDefault(),r&&Ej(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,p.paused]);return n.createElement(aj.div,KE({tabIndex:-1},a,{ref:f,onKeyDown:m}))}));function Sj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function Cj(e,t){for(const n of e)if(!kj(n,{upTo:t}))return n}function kj(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Ej(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const jj=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Tj(e,t),e.unshift(t)},remove(t){var n;e=Tj(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Tj(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const Pj=n.forwardRef(((e,t)=>{var o;const{container:i=(null===globalThis||void 0===globalThis||null===(o=globalThis.document)||void 0===o?void 0:o.body),...s}=e;return i?r.createPortal(n.createElement(aj.div,KE({},s,{ref:t})),i):null})),Nj=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{};const _j=e=>{const{present:t,children:o}=e,i=function(e){const[t,o]=n.useState(),i=n.useRef({}),s=n.useRef(e),a=n.useRef("none"),l=e?"mounted":"unmounted",[c,u]=function(e,t){return n.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect((()=>{const e=Dj(i.current);a.current="mounted"===c?e:"none"}),[c]),Nj((()=>{const t=i.current,n=s.current;if(n!==e){const r=a.current,o=Dj(t);if(e)u("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))u("UNMOUNT");else{u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=e}}),[e,u]),Nj((()=>{if(t){const e=e=>{const n=Dj(i.current).includes(e.animationName);e.target===t&&n&&r.flushSync((()=>u("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=Dj(i.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback((e=>{e&&(i.current=getComputedStyle(e)),o(e)}),[])}}(t),s="function"==typeof o?o({present:i.isPresent}):n.Children.only(o),a=GE(i.ref,s.ref);return"function"==typeof o||i.isPresent?n.cloneElement(s,{ref:a}):null};function Dj(e){return(null==e?void 0:e.animationName)||"none"}_j.displayName="Presence";let Mj=0;function Oj(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Rj=HC(),Aj=function(){},Lj=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:Aj,onWheelCapture:Aj,onTouchMoveCapture:Aj}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=IC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,w=BC([n,t]),S=LC(LC({},b),o);return i.createElement(i.Fragment,null,d&&i.createElement(x,{sideCar:Rj,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n}),a?i.cloneElement(i.Children.only(l),LC(LC({},S),{ref:w})):i.createElement(y,LC({},S,{className:c,ref:w}),l))}));Lj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Lj.classNames={fullWidth:qC,zeroRight:$C};var Ij=!1;if("undefined"!=typeof window)try{var Fj=Object.defineProperty({},"passive",{get:function(){return Ij=!0,!0}});window.addEventListener("test",Fj,Fj),window.removeEventListener("test",Fj,Fj)}catch(oQ){Ij=!1}var $j=!!Ij&&{passive:!1},qj=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},zj=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Uj(e,n)){var r=Vj(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Uj=function(e,t){return"v"===e?function(e){return qj(e,"overflowY")}(t):function(e){return qj(e,"overflowX")}(t)},Vj=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Bj=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kj=function(e){return[e.deltaX,e.deltaY]},Hj=function(e){return e&&"current"in e?e.current:e},Wj=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Gj=0,Yj=[];const Qj=GC(Rj,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(Gj++)[0],s=i.useState((function(){return ek()}))[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=FC([e.lockRef.current],(e.shards||[]).map(Hj),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var o,i=Bj(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=zj(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=zj(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=Vj(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&Uj(e,s)&&(u+=p,d+=f),s=s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return c&&0===u?l=!0:c||0!==d||(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(Yj.length&&Yj[Yj.length-1]===s){var r="deltaY"in n?Kj(n):Bj(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(Hj).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=Bj(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,Kj(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,Bj(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return Yj.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,$j),document.addEventListener("touchmove",c,$j),document.addEventListener("touchstart",d,$j),function(){Yj=Yj.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,$j),document.removeEventListener("touchmove",c,$j),document.removeEventListener("touchstart",d,$j)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:Wj(o)}):null,p?i.createElement(lk,{gapMode:"margin"}):null)}));var Xj=i.forwardRef((function(e,t){return i.createElement(Lj,LC({},e,{ref:t,sideCar:Qj}))}));Xj.classNames=Lj.classNames;const Jj="Dialog",[Zj,eT]=function(e,t=[]){let r=[];const o=()=>{const t=r.map((e=>n.createContext(e)));return function(r){const o=(null==r?void 0:r[e])||t;return n.useMemo((()=>({[`__scope${e}`]:{...r,[e]:o}})),[r,o])}};return o.scopeName=e,[function(t,o){const i=n.createContext(o),s=r.length;function a(t){const{scope:r,children:o,...a}=t,l=(null==r?void 0:r[e][s])||i,c=n.useMemo((()=>a),Object.values(a));return n.createElement(l.Provider,{value:c},o)}return r=[...r,o],a.displayName=t+"Provider",[a,function(r,a){const l=n.useContext((null==a?void 0:a[e][s])||i);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},YE(o,...t)]}(Jj),[tT,nT]=Zj(Jj),rT="DialogPortal",[oT,iT]=Zj(rT,{forceMount:void 0}),sT="DialogOverlay",aT=n.forwardRef(((e,t)=>{const r=iT(sT,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nT(sT,e.__scopeDialog);return s.modal?n.createElement(_j,{present:o||s.open},n.createElement(lT,KE({},i,{ref:t}))):null})),lT=n.forwardRef(((e,t)=>{const{__scopeDialog:r,...o}=e,i=nT(sT,r);return n.createElement(Xj,{as:nj,allowPinchZoom:!0,shards:[i.contentRef]},n.createElement(aj.div,KE({"data-state":mT(i.open)},o,{ref:t,style:{pointerEvents:"auto",...o.style}})))})),cT="DialogContent",uT=n.forwardRef(((e,t)=>{const r=iT(cT,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nT(cT,e.__scopeDialog);return n.createElement(_j,{present:o||s.open},n.createElement(s.modal?dT:hT,KE({},i,{ref:t})))})),dT=n.forwardRef(((e,t)=>{const r=nT(cT,e.__scopeDialog),o=n.useRef(null),i=GE(t,r.contentRef,o);return n.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),n.createElement(fT,KE({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:HE(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=r.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:HE(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:HE(e.onFocusOutside,(e=>e.preventDefault()))}))})),hT=n.forwardRef(((e,t)=>{const r=nT(cT,e.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return n.createElement(fT,KE({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,s;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),t.defaultPrevented)||(o.current||null===(s=r.triggerRef.current)||void 0===s||s.focus(),t.preventDefault());o.current=!1,i.current=!1},onInteractOutside:t=>{var n,s;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));(null===(s=r.triggerRef.current)||void 0===s?void 0:s.contains(t.target))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}}))})),fT=n.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,l=nT(cT,r),c=GE(t,n.useRef(null));return n.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Oj()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Oj()),Mj++,()=>{1===Mj&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Mj--}}),[]),n.createElement(n.Fragment,null,n.createElement(wj,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s},n.createElement(pj,KE({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":mT(l.open)},a,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)})),pT="DialogTitle";function mT(e){return e?"open":"closed"}!function(e,t){const r=n.createContext(t);function o(e){const{children:t,...o}=e,i=n.useMemo((()=>o),Object.values(o));return n.createElement(r.Provider,{value:i},t)}o.displayName=e+"Provider"}("DialogTitleWarning",{contentName:cT,titleName:pT,docsSlug:"dialog"});const gT=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=n.useRef(null),c=n.useRef(null),[u=!1,d]=tj({prop:o,defaultProp:i,onChange:s});return n.createElement(tT,{scope:t,triggerRef:l,contentRef:c,contentId:ZE(),titleId:ZE(),descriptionId:ZE(),open:u,onOpenChange:d,onOpenToggle:n.useCallback((()=>d((e=>!e))),[d]),modal:a},r)},vT=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:i}=e,s=nT(rT,t);return n.createElement(oT,{scope:t,forceMount:r},n.Children.map(o,(e=>n.createElement(_j,{present:r||s.open},n.createElement(Pj,{asChild:!0,container:i},e)))))},yT=aT,bT=uT;var xT='[cmdk-group=""]',wT='[cmdk-group-items=""]',ST='[cmdk-item=""]',CT=`${ST}:not([aria-disabled="true"])`,kT="cmdk-item-select",ET="data-value",jT=(e,t,n)=>BE(e,t,n),TT=i.createContext(void 0),PT=()=>i.useContext(TT),NT=i.createContext(void 0),_T=()=>i.useContext(NT),DT=i.createContext(void 0),MT=i.forwardRef(((e,t)=>{let n=HT((()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}})),r=HT((()=>new Set)),o=HT((()=>new Map)),s=HT((()=>new Map)),a=HT((()=>new Set)),l=BT(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=i.useId(),x=i.useId(),w=i.useId(),S=i.useRef(null),C=QT();KT((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),KT((()=>{C(6,_)}),[]);let k=i.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)N(),T(),C(1,P);else if("value"===e&&(r||C(5,_),void 0!==(null==(o=l.current)?void 0:o.value))){return void(null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:""))}k.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),E=i.useMemo((()=>({value:(e,t,r)=>{var o;t!==(null==(o=s.current.get(e))?void 0:o.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,j(t,r)),C(2,(()=>{T(),k.emit()})))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{N(),T(),n.current.value||P(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{N(),(null==t?void 0:t.getAttribute("id"))===e&&P(),k.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:g,listId:b,inputId:w,labelId:x,listInnerRef:S})),[]);function j(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:jT;return e?i(e,n.current.search,t):0}function T(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach((n=>{let r=o.current.get(n),i=0;r.forEach((t=>{let n=e.get(t);i=Math.max(n,i)})),t.push([n,i])}));let r=S.current;M().sort(((t,n)=>{var r,o;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(wT);t?t.appendChild(e.parentElement===t?e:e.closest(`${wT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${wT} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=S.current.querySelector(`${xT}[${ET}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)}))}function P(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(ET);k.setState("value",t||void 0)}function N(){var e,t,i,a;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=j(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(i=s.current.get(o))?void 0:i.keywords)?a:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[r,s]of o.current)for(let e of s)if(n.current.filtered.items.get(e)>0){n.current.filtered.groups.add(r);break}n.current.filtered.count=c}function _(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(xT))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${ST}[aria-selected="true"]`)}function M(){var e;return Array.from(null==(e=S.current)?void 0:e.querySelectorAll(CT))}function O(e){let t=M()[e];t&&k.setState("value",t.getAttribute(ET))}function R(e){var t;let n=D(),r=M(),o=r.findIndex((e=>e===n)),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&k.setState("value",i.getAttribute(ET))}function A(e){let t,n=D(),r=null==n?void 0:n.closest(xT);for(;r&&!t;)r=e>0?UT(r,xT):VT(r,xT),t=null==r?void 0:r.querySelector(CT);t?k.setState("value",t.getAttribute(ET)):R(e)}let L=()=>O(M().length-1),I=e=>{e.preventDefault(),e.metaKey?L():e.altKey?A(1):R(1)},F=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?A(-1):R(-1)};return i.createElement(aj.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=y.onKeyDown)||t.call(y,e),!e.defaultPrevented)switch(e.key){case"n":case"j":v&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":v&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),L();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=D();if(t){let e=new Event(kT);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:JT},c),XT(e,(e=>i.createElement(NT.Provider,{value:k},i.createElement(TT.Provider,{value:E},e)))))})),OT=i.forwardRef(((e,t)=>{var n,r;let o=i.useId(),s=i.useRef(null),a=i.useContext(DT),l=PT(),c=BT(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;KT((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=YT(o,s,[e.value,e.children,s],e.keywords),h=_T(),f=GT((e=>e.value&&e.value===d.current)),p=GT((e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0)));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){h.setState("value",d.current,!0)}if(i.useEffect((()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(kT,m),()=>t.removeEventListener(kT,m)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:x,keywords:w,...S}=e;return i.createElement(aj.div,{ref:WT([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.disablePointerSelection?void 0:g,onClick:v?void 0:m},e.children)})),RT=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=i.useId(),l=i.useRef(null),c=i.useRef(null),u=i.useId(),d=PT(),h=GT((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));KT((()=>d.group(a)),[]),YT(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(aj.div,{ref:WT([l,t]),...s,"cmdk-group":"",role:"presentation",hidden:!h||void 0},n&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),XT(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement(DT.Provider,{value:f},e)))))})),AT=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=GT((e=>!e.search));return n||s?i.createElement(aj.div,{ref:WT([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),LT=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=_T(),a=GT((e=>e.search)),l=GT((e=>e.value)),c=PT(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${ST}[${ET}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return i.useEffect((()=>{null!=e.value&&s.setState("search",e.value)}),[e.value]),i.createElement(aj.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||s.setState("search",e.target.value),null==n||n(e.target.value)}})})),IT=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=PT();return i.useEffect((()=>{if(a.current&&s.current){let e,t=a.current,n=s.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{n.style.setProperty("--cmdk-list-height",t.offsetHeight.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),i.createElement(aj.div,{ref:WT([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},XT(e,(e=>i.createElement("div",{ref:WT([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),FT=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(gT,{open:n,onOpenChange:r},i.createElement(vT,{container:a},i.createElement(yT,{"cmdk-overlay":"",className:o}),i.createElement(bT,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(MT,{ref:t,...l}))))})),$T=i.forwardRef(((e,t)=>GT((e=>0===e.filtered.count))?i.createElement(aj.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),qT=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(aj.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},XT(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),zT=Object.assign(MT,{List:IT,Item:OT,Input:LT,Group:RT,Separator:AT,Dialog:FT,Empty:$T,Loading:qT});function UT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function VT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function BT(e){let t=i.useRef(e);return KT((()=>{t.current=e})),t}var KT="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function HT(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function WT(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function GT(e){let t=_T(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function YT(e,t,n,r=[]){let o=i.useRef(),s=PT();return KT((()=>{var i;let a=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=r.map((e=>e.trim()));s.value(e,a,l),null==(i=t.current)||i.setAttribute(ET,a),o.current=a})),o}var QT=()=>{let[e,t]=i.useState(),n=HT((()=>new Map));return KT((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function XT({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var JT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ZT=i.forwardRef((({className:e,...n},r)=>t.jsx(zT,{ref:r,className:Dh("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));ZT.displayName=zT.displayName;const eP=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(Nd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(zT.Input,{ref:o,className:Dh("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})));eP.displayName=zT.Input.displayName;const tP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.List,{ref:r,className:Dh("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));tP.displayName=zT.List.displayName;const nP=i.forwardRef(((e,n)=>t.jsx(zT.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));nP.displayName=zT.Empty.displayName;const rP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.Group,{ref:r,className:Dh("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n})));rP.displayName=zT.Group.displayName;const oP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.Separator,{ref:r,className:Dh("-mx-1 h-px bg-border",e),...n})));oP.displayName=zT.Separator.displayName;const iP=i.forwardRef((({className:e,...n},r)=>t.jsx(zT.Item,{ref:r,className:Dh("relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n})));iP.displayName=zT.Item.displayName;var sP="focusScope.autoFocusOnMount",aP="focusScope.autoFocusOnUnmount",lP={bubbles:!1,cancelable:!0},cP=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:fP(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||fP(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&fP(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){pP.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(sP,lP);c.addEventListener(sP,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fP(r,{select:t}),document.activeElement!==n)return}((e=uP(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&fP(c))}return()=>{c.removeEventListener(sP,d),setTimeout((()=>{const e=new CustomEvent(aP,lP);c.addEventListener(aP,h),c.dispatchEvent(e),e.defaultPrevented||fP(t??document.body,{select:!0}),c.removeEventListener(aP,h),pP.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=uP(e),n=dP(t,e),r=dP(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&fP(i,{select:!0})):(e.preventDefault(),r&&fP(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(Bc.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function uP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function dP(e,t){for(const n of e)if(!hP(n,{upTo:t}))return n}function hP(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function fP(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}cP.displayName="FocusScope";var pP=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=mP(e,t),e.unshift(t)},remove(t){e=mP(e,t),e[0]?.resume()}}}();function mP(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const gP=["top","right","bottom","left"],vP=Math.min,yP=Math.max,bP=Math.round,xP=Math.floor,wP=e=>({x:e,y:e}),SP={left:"right",right:"left",bottom:"top",top:"bottom"},CP={start:"end",end:"start"};function kP(e,t,n){return yP(e,vP(t,n))}function EP(e,t){return"function"==typeof e?e(t):e}function jP(e){return e.split("-")[0]}function TP(e){return e.split("-")[1]}function PP(e){return"x"===e?"y":"x"}function NP(e){return"y"===e?"height":"width"}function _P(e){return["top","bottom"].includes(jP(e))?"y":"x"}function DP(e){return PP(_P(e))}function MP(e){return e.replace(/start|end/g,(e=>CP[e]))}function OP(e){return e.replace(/left|right|bottom|top/g,(e=>SP[e]))}function RP(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function AP(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 LP(e,t,n){let{reference:r,floating:o}=e;const i=_P(t),s=DP(t),a=NP(s),l=jP(t),c="y"===i,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 f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(TP(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function IP(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=EP(t,e),p=RP(f),m=a[h?"floating"===d?"reference":"floating":d],g=AP(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=AP(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function FP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $P(e){return gP.some((t=>e[t]>=0))}function qP(){return"undefined"!=typeof window}function zP(e){return BP(e)?(e.nodeName||"").toLowerCase():"#document"}function UP(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function VP(e){var t;return null==(t=(BP(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function BP(e){return!!qP()&&(e instanceof Node||e instanceof UP(e).Node)}function KP(e){return!!qP()&&(e instanceof Element||e instanceof UP(e).Element)}function HP(e){return!!qP()&&(e instanceof HTMLElement||e instanceof UP(e).HTMLElement)}function WP(e){return!(!qP()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof UP(e).ShadowRoot)}function GP(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=eN(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function YP(e){return["table","td","th"].includes(zP(e))}function QP(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(nQ){return!1}}))}function XP(e){const t=JP(),n=KP(e)?eN(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function JP(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ZP(e){return["html","body","#document"].includes(zP(e))}function eN(e){return UP(e).getComputedStyle(e)}function tN(e){return KP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nN(e){if("html"===zP(e))return e;const t=e.assignedSlot||e.parentNode||WP(e)&&e.host||VP(e);return WP(t)?t.host:t}function rN(e){const t=nN(e);return ZP(t)?e.ownerDocument?e.ownerDocument.body:e.body:HP(t)&&GP(t)?t:rN(t)}function oN(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=rN(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=UP(o);if(i){const e=iN(s);return t.concat(s,s.visualViewport||[],GP(o)?o:[],e&&n?oN(e):[])}return t.concat(o,oN(o,[],n))}function iN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sN(e){const t=eN(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=HP(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=bP(n)!==i||bP(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function aN(e){return KP(e)?e:e.contextElement}function lN(e){const t=aN(e);if(!HP(t))return wP(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=sN(t);let s=(i?bP(n.width):n.width)/r,a=(i?bP(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const cN=wP(0);function uN(e){const t=UP(e);return JP()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:cN}function dN(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=aN(e);let s=wP(1);t&&(r?KP(r)&&(s=lN(r)):s=lN(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==UP(e))&&t}(i,n,r)?uN(i):wP(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=UP(i),t=r&&KP(r)?UP(r):r;let n=e,o=iN(n);for(;o&&r&&t!==n;){const e=lN(o),t=o.getBoundingClientRect(),r=eN(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=UP(o),o=iN(n)}}return AP({width:u,height:d,x:l,y:c})}function hN(e,t){const n=tN(e).scrollLeft;return t?t.left+n:dN(VP(e)).left+n}function fN(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:hN(e,r)),y:r.top+t.scrollTop}}function pN(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=UP(e),r=VP(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=JP();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=VP(e),n=tN(e),r=e.ownerDocument.body,o=yP(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=yP(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+hN(e);const a=-n.scrollTop;return"rtl"===eN(r).direction&&(s+=yP(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(VP(e));else if(KP(t))r=function(e,t){const n=dN(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=HP(e)?lN(e):wP(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=uN(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return AP(r)}function mN(e,t){const n=nN(e);return!(n===t||!KP(n)||ZP(n))&&("fixed"===eN(n).position||mN(n,t))}function gN(e,t,n){const r=HP(t),o=VP(t),i="fixed"===n,s=dN(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=wP(0);if(r||!r&&!i)if(("body"!==zP(t)||GP(o))&&(a=tN(t)),r){const e=dN(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=hN(o));const c=!o||r||i?wP(0):fN(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function vN(e){return"static"===eN(e).position}function yN(e,t){if(!HP(e)||"fixed"===eN(e).position)return null;if(t)return t(e);let n=e.offsetParent;return VP(e)===n&&(n=n.ownerDocument.body),n}function bN(e,t){const n=UP(e);if(QP(e))return n;if(!HP(e)){let t=nN(e);for(;t&&!ZP(t);){if(KP(t)&&!vN(t))return t;t=nN(t)}return n}let r=yN(e,t);for(;r&&YP(r)&&vN(r);)r=yN(r,t);return r&&ZP(r)&&vN(r)&&!XP(r)?n:r||function(e){let t=nN(e);for(;HP(t)&&!ZP(t);){if(XP(t))return t;if(QP(t))return null;t=nN(t)}return null}(e)||n}const xN={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=VP(r),a=!!t&&QP(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=wP(1);const u=wP(0),d=HP(r);if((d||!d&&!i)&&(("body"!==zP(r)||GP(s))&&(l=tN(r)),HP(r))){const e=dN(r);c=lN(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?wP(0):fN(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:VP,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?QP(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=oN(e,[],!1).filter((e=>KP(e)&&"body"!==zP(e))),o=null;const i="fixed"===eN(e).position;let s=i?nN(e):e;for(;KP(s)&&!ZP(s);){const t=eN(s),n=XP(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||GP(s)&&!n&&mN(e,s))?r=r.filter((e=>e!==s)):o=t,s=nN(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=pN(t,n,o);return e.top=yP(r.top,e.top),e.right=vP(r.right,e.right),e.bottom=vP(r.bottom,e.bottom),e.left=yP(r.left,e.left),e}),pN(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:bN,getElementRects:async function(e){const t=this.getOffsetParent||bN,n=this.getDimensions,r=await n(e.floating);return{reference:gN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=sN(e);return{width:t,height:n}},getScale:lN,isElement:KP,isRTL:function(e){return"rtl"===eN(e).direction}};function wN(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=aN(e),u=o||i?[...c?oN(c):[],...oN(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=VP(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-xP(u)+"px "+-xP(o.clientWidth-(c+d))+"px "+-xP(o.clientHeight-(u+h))+"px "+-xP(c)+"px",threshold:yP(0,vP(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(nQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?dN(e):null;return l&&function t(){const r=dN(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const SN=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=jP(n),a=TP(n),l="y"===_P(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=EP(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},CN=function(e){return void 0===e&&(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:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=EP(e,t),c={x:n,y:r},u=await IP(t,l),d=_P(jP(o)),h=PP(d);let f=c[h],p=c[d];if(i){f=kP(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=kP(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[d]:s}}}}}},kN=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=EP(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=jP(o),y=_P(a),b=jP(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[OP(a)]:function(e){const t=OP(e);return[MP(e),t,MP(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=TP(e);let i=function(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[]}}(jP(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(MP)))),i}(a,m,p,x));const C=[a,...w],k=await IP(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=TP(e),o=DP(e),i=NP(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=OP(s)),[s,OP(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=j.filter((e=>{if(S){const t=_P(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},EN=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=EP(e,t),u=await IP(t,c),d=jP(o),h=TP(o),f="y"===_P(o),{width:p,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g="end"===h?"top":"bottom");const y=m-u.top-u.bottom,b=p-u.left-u.right;let x=vP(m-u[g],y),w=vP(p-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),!t.middlewareData.shift&&!h){const e=yP(u.left,0),t=yP(u.right,0),n=yP(u.top,0),r=yP(u.bottom,0);f?w=p-2*(0!==e||0!==t?e+t:yP(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:yP(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const S=await s.getDimensions(a.floating);return p!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},jN=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=EP(e,t);switch(r){case"referenceHidden":{const e=FP(await IP(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:$P(e)}}}case"escaped":{const e=FP(await IP(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:$P(e)}}}default:return{}}}}},TN=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=EP(e,t)||{};if(null==c)return{};const d=RP(u),h={x:n,y:r},f=DP(o),p=NP(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=vP(d[v],E),T=vP(d[y],E),P=j,N=C-m[p]-T,_=C/2-m[p]/2+k,D=kP(P,_,N),M=!l.arrow&&null!=TP(o)&&_!==D&&i.reference[p]/2-(_<P?j:T)-m[p]/2<0,O=M?_<P?_-P:_-N:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:_-D-O,...M&&{alignmentOffset:O}},reset:M}}}),PN=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=EP(e,t),u={x:n,y:r},d=_P(o),h=PP(d);let f=u[h],p=u[d];const m=EP(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===h?"height":"width",t=i.reference[h]-i.floating[e]+g.mainAxis,n=i.reference[h]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===h?"width":"height",t=["top","left"].includes(jP(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[h]:f,[d]:p}}}},NN=(e,t,n)=>{const r={platform:xN,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=LP(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=LP(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var _N="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function DN(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!DN(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!DN(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function MN(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ON(e,t){const n=MN(e);return Math.round(t*n)/n}function RN(e){const t=i.useRef(e);return _N((()=>{t.current=e})),t}const AN=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?TN({element:n.current,padding:r}).fn(t):{}:n?TN({element:n,padding:r}).fn(t):{}}}),LN=(e,t)=>({...CN(e),options:[e,t]}),IN=(e,t)=>({...PN(e),options:[e,t]}),FN=(e,t)=>({...kN(e),options:[e,t]}),$N=(e,t)=>({...EN(e),options:[e,t]}),qN=(e,t)=>({...jN(e),options:[e,t]}),zN=(e,t)=>({...AN(e),options:[e,t]});var UN=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(Bc.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));UN.displayName="Arrow";var VN=UN;var BN="Popper",[KN,HN]=Lc(BN),[WN,GN]=KN(BN),YN=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(WN,{scope:n,anchor:o,onAnchorChange:s,children:r})};YN.displayName=BN;var QN="PopperAnchor",XN=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=GN(QN,r),l=i.useRef(null),c=Ac(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(Bc.div,{...s,ref:c})}));XN.displayName=QN;var JN="PopperContent",[ZN,e_]=KN(JN),t_=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,b=GN(JN,r),[x,w]=i.useState(null),S=Ac(n,(e=>w(e))),[C,k]=i.useState(null),E=function(e){const[t,n]=i.useState(void 0);return iu((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(C),j=E?.width??0,T=E?.height??0,P=o+("center"!==l?"-"+l:""),N="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(h)?h:[h],D=_.length>0,M={padding:N,boundary:_.filter(i_),altBoundary:D},{refs:O,floatingStyles:R,placement:A,isPositioned:L,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);DN(p,r)||m(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),x=i.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),w=i.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),S=a||g,C=l||y,k=i.useRef(null),E=i.useRef(null),j=i.useRef(h),T=null!=u,P=RN(u),N=RN(o),_=RN(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};N.current&&(e.platform=N.current),NN(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==_.current};M.current&&!DN(j.current,t)&&(j.current=t,s.flushSync((()=>{f(t)})))}))}),[p,t,n,N,_]);_N((()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);_N((()=>(M.current=!0,()=>{M.current=!1})),[]),_N((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(P.current)return P.current(S,C,D);D()}}),[S,C,D,P,T]);const O=i.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),R=i.useMemo((()=>({reference:S,floating:C})),[S,C]),A=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=ON(R.floating,h.x),r=ON(R.floating,h.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...MN(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,R.floating,h.x,h.y]);return i.useMemo((()=>({...h,update:D,refs:O,elements:R,floatingStyles:A})),[h,D,O,R,A])}({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>wN(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[(F={mainAxis:a+T,alignmentAxis:c},{...SN(F),options:[F,$]}),d&&LN({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?IN():void 0,...M}),d&&FN({...M}),$N({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&zN({element:C,padding:u}),s_({arrowWidth:j,arrowHeight:T}),m&&qN({strategy:"referenceHidden",...M})]});var F,$;const[q,z]=a_(A),U=Hc(v);iu((()=>{L&&U?.()}),[L,U]);const V=I.arrow?.x,B=I.arrow?.y,K=0!==I.arrow?.centerOffset,[H,W]=i.useState();return iu((()=>{x&&W(window.getComputedStyle(x).zIndex)}),[x]),t.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:L?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(ZN,{scope:r,placedSide:q,onArrowChange:k,arrowX:V,arrowY:B,shouldHideArrow:K,children:t.jsx(Bc.div,{"data-side":q,"data-align":z,...y,ref:S,style:{...y.style,animation:L?void 0:"none"}})})})}));t_.displayName=JN;var n_="PopperArrow",r_={top:"bottom",right:"left",bottom:"top",left:"right"},o_=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=e_(n_,r),s=r_[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(VN,{...o,ref:n,style:{...o.style,display:"block"}})})}));function i_(e){return null!==e}o_.displayName=n_;var s_=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=a_(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+a/2;let f="",p="";return"bottom"===l?(f=i?u:`${d}px`,p=-a+"px"):"top"===l?(f=i?u:`${d}px`,p=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",p=i?u:`${h}px`):"left"===l&&(f=`${r.floating.width+a}px`,p=i?u:`${h}px`),{data:{x:f,y:p}}}});function a_(e){const[t,n="center"]=e.split("-");return[t,n]}var l_=YN,c_=XN,u_=t_,d_=o_,h_="Popover",[f_,p_]=Lc(h_,[HN]),m_=HN(),[g_,v_]=f_(h_),y_=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=m_(n),u=i.useRef(null),[d,h]=i.useState(!1),[f=!1,p]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(l_,{...c,children:t.jsx(g_,{scope:n,contentId:lC(),triggerRef:u,open:f,onOpenChange:p,onOpenToggle:i.useCallback((()=>p((e=>!e))),[p]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback((()=>h(!0)),[]),onCustomAnchorRemove:i.useCallback((()=>h(!1)),[]),modal:l,children:r})})};y_.displayName=h_;var b_="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=v_(b_,r),a=m_(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(c_,{...a,...o,ref:n})})).displayName=b_;var x_="PopoverTrigger",w_=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=v_(x_,r),s=m_(r),a=Ac(n,i.triggerRef),l=t.jsx(Bc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":M_(i.open),...o,ref:a,onClick:Mc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(c_,{asChild:!0,...s,children:l})}));w_.displayName=x_;var S_="PopoverPortal",[C_,k_]=f_(S_,{forceMount:void 0}),E_=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=v_(S_,n);return t.jsx(C_,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};E_.displayName=S_;var j_="PopoverContent",T_=i.forwardRef(((e,n)=>{const r=k_(j_,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=v_(j_,e.__scopePopover);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?P_:N_,{...i,ref:n})})}));T_.displayName=j_;var P_=i.forwardRef(((e,n)=>{const r=v_(j_,e.__scopePopover),o=i.useRef(null),s=Ac(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),t.jsx(kk,{as:Fc,allowPinchZoom:!0,children:t.jsx(__,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),N_=i.forwardRef(((e,n)=>{const r=v_(j_,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(__,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),__=i.forwardRef(((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,f=v_(j_,r),p=m_(r);return RC(),t.jsx(cP,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(u_,{"data-state":M_(f.open),role:"dialog",id:f.contentId,...p,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),D_="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=v_(D_,r);return t.jsx(Bc.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=D_;function M_(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=m_(r);return t.jsx(d_,{...i,...o,ref:n})})).displayName="PopoverArrow";var O_=E_,R_=T_;const A_=y_,L_=w_,I_=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(O_,{children:t.jsx(R_,{ref:i,align:n,sideOffset:r,className:Dh("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})})));I_.displayName=R_.displayName;var F_=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(z_);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx($_,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx($_,{...o,ref:n,children:r})}));F_.displayName="Slot";var $_=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));$_.displayName="SlotClone";var q_=({children:e})=>t.jsx(t.Fragment,{children:e});function z_(e){return i.isValidElement(e)&&e.type===q_}var U_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?F_:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{}),V_="horizontal",B_=["horizontal","vertical"],K_=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=V_,...i}=e,s=function(e){return B_.includes(e)}(o)?o:V_;return t.jsx(U_.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));K_.displayName="Separator";var H_=K_;const W_=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(H_,{ref:i,decorative:r,orientation:n,className:Dh("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));W_.displayName=H_.displayName;const G_=nd("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),Y_=i.forwardRef((({options:e,onValueChange:n,variant:r,placeholder:o="Select options",animation:s=0,maxCount:a=3,modalPopover:l=!0,className:c,extraCommandItems:u,searchPlaceholder:d="Search...",handleSearchInput:h,emptyMessage:f="No results found.",searchIcon:p=t.jsx(Nd,{className:"h-4 w-4"}),selectedValues:m,setSelectedValues:g,...v},y)=>{const[b,x]=i.useState(!1),[w,S]=i.useState(!1),C=e=>{const t=m.includes(e)?m.filter((t=>t!==e)):[...m,e];g(t),n(t)},k=()=>{g([]),n([])};return t.jsxs(A_,{open:b,onOpenChange:x,modal:l,children:[t.jsx(L_,{asChild:!0,children:t.jsx("button",{type:"button",ref:y,...v,onClick:()=>{x((e=>!e))},className:Dh("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",c),children:t.jsxs("div",m.length>0?{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[m.slice(0,a).map((n=>{const o=e.find((e=>e.value===n)),i=o?.icon;return t.jsxs(LE,{className:Dh(w?"animate-bounce":"",G_({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(LE,{className:Dh("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",G_({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=m.slice(0,a);g(e),n(e)})()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Fd,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(W_,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(ud,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}:{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:o}),t.jsx(ud,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(I_,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),children:t.jsxs(ZT,{children:[t.jsx(eP,{searchIcon:p,placeholder:d,onKeyDown:e=>{if("Enter"===e.key)x(!0),h&&(h(e.currentTarget.value),x(!1));else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...m];e.pop(),g(e),n(e)}}}),t.jsxs(tP,{children:[t.jsx(nP,{children:f}),t.jsxs(rP,{children:[t.jsxs(iP,{onSelect:()=>{if(m.length===e.length)k();else{const t=e.map((e=>e.value));g(t),n(t)}},className:"cursor-pointer",children:[t.jsx("div",{className:Dh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(iP,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:Dh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",n?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),e.icon&&t.jsx(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:e.label})]},e.value)}))]}),t.jsx(oP,{}),t.jsx(rP,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(iP,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(W_,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(iP,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(Id,{className:Dh("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function Q_(e,[t,n]){return Math.min(n,Math.max(t,e))}Y_.displayName="MultiSelect";var X_=i.createContext(void 0);function J_(e){const t=i.useContext(X_);return e||t||"ltr"}var Z_=[" ","Enter","ArrowUp","ArrowDown"],eD=[" ","Enter"],tD="Select",[nD,rD,oD]=Vc(tD),[iD,sD]=Lc(tD,[oD,HN]),aD=HN(),[lD,cD]=iD(tD),[uD,dD]=iD(tD),hD=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:p,required:m,form:g}=e,v=aD(n),[y,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=J_(d),[E=!1,j]=cu({prop:o,defaultProp:s,onChange:a}),[T,P]=cu({prop:l,defaultProp:c,onChange:u}),N=i.useRef(null),_=!y||(g||!!y.closest("form")),[D,M]=i.useState(new Set),O=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(l_,{...v,children:t.jsxs(lD,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:lC(),value:T,onValueChange:P,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:N,disabled:p,children:[t.jsx(nD.Provider,{scope:n,children:t.jsx(uD,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback((e=>{M((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:i.useCallback((e=>{M((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),_?t.jsxs(JD,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:T,onChange:e=>P(e.target.value),disabled:p,form:g,children:[void 0===T?t.jsx("option",{value:""}):null,Array.from(D)]},O):null]})})};hD.displayName=tD;var fD="SelectTrigger",pD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=aD(r),l=cD(fD,r),c=l.disabled||o,u=Ac(n,l.onTriggerChange),d=rD(r),h=i.useRef("touch"),[f,p,m]=ZD((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=eM(t,e,n);void 0!==r&&l.onValueChange(r.value)})),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(c_,{asChild:!0,...a,children:t.jsx(Bc.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":XD(l.value)?"":void 0,...s,ref:u,onClick:Mc(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==h.current&&g(e)})),onPointerDown:Mc(s.onPointerDown,(e=>{h.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())})),onKeyDown:Mc(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Z_.includes(e.key)&&(g(),e.preventDefault())}))})})}));pD.displayName=fD;var mD="SelectValue",gD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=cD(mD,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Ac(n,c.onValueNodeChange);return iu((()=>{u(d)}),[u,d]),t.jsx(Bc.span,{...l,ref:h,style:{pointerEvents:"none"},children:XD(c.value)?t.jsx(t.Fragment,{children:a}):s})}));gD.displayName=mD;var vD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(Bc.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));vD.displayName="SelectIcon";var yD=e=>t.jsx(su,{asChild:!0,...e});yD.displayName="SelectPortal";var bD="SelectContent",xD=i.forwardRef(((e,n)=>{const r=cD(bD,e.__scopeSelect),[o,a]=i.useState();if(iu((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx(SD,{scope:e.__scopeSelect,children:t.jsx(nD.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(kD,{...e,ref:n})}));xD.displayName=bD;var wD=10,[SD,CD]=iD(bD),kD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=cD(bD,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=Ac(n,(e=>S(e))),[j,T]=i.useState(null),[P,N]=i.useState(null),_=rD(r),[D,M]=i.useState(!1),O=i.useRef(!1);i.useEffect((()=>{if(w)return Dk(w)}),[w]),RC();const R=i.useCallback((e=>{const[t,...n]=_().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&C&&(C.scrollTop=0),i===r&&C&&(C.scrollTop=C.scrollHeight),i?.focus(),document.activeElement!==o)return}}),[_,C]),A=i.useCallback((()=>R([j,w])),[R,j,w]);i.useEffect((()=>{D&&A()}),[D,A]);const{onOpenChange:L,triggerPointerDownPosRef:I}=x;i.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,L,I]),i.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[F,$]=ZD((e=>{const t=_().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=eM(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),q=i.useCallback(((e,t,n)=>{const r=!O.current&&!n;(void 0!==x.value&&x.value===t||r)&&(T(e),r&&(O.current=!0))}),[x.value]),z=i.useCallback((()=>w?.focus()),[w]),U=i.useCallback(((e,t,n)=>{(void 0!==x.value&&x.value===t||!O.current&&!n)&&N(e)}),[x.value]),V="popper"===o?jD:ED,B=V===jD?{side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return t.jsx(SD,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:j,onItemLeave:z,itemTextRefCallback:U,focusSelectedItem:A,selectedItemText:P,position:o,isPositioned:D,searchRef:F,children:t.jsx(kk,{as:Fc,allowPinchZoom:!0,children:t.jsx(cP,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Mc(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...B,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Mc(b.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=t.indexOf(e.target);t=t.slice(n+1)}setTimeout((()=>R(t))),e.preventDefault()}}))})})})})})}));kD.displayName="SelectContentImpl";var ED=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=cD(bD,r),l=CD(bD,r),[c,u]=i.useState(null),[d,h]=i.useState(null),f=Ac(n,(e=>h(e))),p=rD(r),m=i.useRef(!1),g=i.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback((()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&y&&b){const e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-wD,l=Q_(o,[wD,Math.max(wD,a-s)]);c.style.minWidth=i+"px",c.style.left=l+"px"}else{const o=window.innerWidth-n.right-(t.right-r.right),i=window.innerWidth-e.right-o,s=e.width+i,a=Math.max(s,t.width),l=window.innerWidth-wD,u=Q_(o,[wD,Math.max(wD,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=p(),s=window.innerHeight-2*wD,l=v.scrollHeight,u=window.getComputedStyle(d),h=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=h+f+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*y.offsetHeight,x),S=window.getComputedStyle(v),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),E=e.top+e.height/2-wD,j=s-E,T=y.offsetHeight/2,P=h+f+(y.offsetTop+T),N=x-P;if(P<=E){const e=i.length>0&&y===i[i.length-1].ref.current;c.style.bottom="0px";const t=Math.max(j,T+(e?k:0)+(d.clientHeight-v.offsetTop-v.offsetHeight)+g);c.style.height=P+t+"px"}else{const e=i.length>0&&y===i[0].ref.current;c.style.top="0px";const t=Math.max(E,h+v.offsetTop+(e?C:0)+T);c.style.height=t+N+"px",v.scrollTop=P-E+v.offsetTop}c.style.margin=`${wD}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>m.current=!0))}}),[p,a.trigger,a.valueNode,c,d,v,y,b,a.dir,o]);iu((()=>w()),[w]);const[S,C]=i.useState();iu((()=>{d&&C(window.getComputedStyle(d).zIndex)}),[d]);const k=i.useCallback((e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)}),[w,x]);return t.jsx(TD,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t.jsx(Bc.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));ED.displayName="SelectItemAlignedPosition";var jD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=wD,...s}=e,a=aD(r);return t.jsx(u_,{...a,...s,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));jD.displayName="SelectPopperPosition";var[TD,PD]=iD(bD,{}),ND="SelectViewport",_D=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=CD(ND,r),l=PD(ND,r),c=Ac(n,a.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(nD.Slot,{scope:r,children:t.jsx(Bc.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Mc(s.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*wD,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),s=Math.max(o,i);if(s<r){const o=s+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop}))})})]})}));_D.displayName=ND;var DD="SelectGroup",[MD,OD]=iD(DD);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=lC();return t.jsx(MD,{scope:r,id:i,children:t.jsx(Bc.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=DD;var RD="SelectLabel",AD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=OD(RD,r);return t.jsx(Bc.div,{id:i.id,...o,ref:n})}));AD.displayName=RD;var LD="SelectItem",[ID,FD]=iD(LD),$D=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=cD(LD,r),u=CD(LD,r),d=c.value===o,[h,f]=i.useState(a??""),[p,m]=i.useState(!1),g=Ac(n,(e=>u.itemRefCallback?.(e,o,s))),v=lC(),y=i.useRef("touch"),b=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(ID,{scope:r,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(nD.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:t.jsx(Bc.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:Mc(l.onFocus,(()=>m(!0))),onBlur:Mc(l.onBlur,(()=>m(!1))),onClick:Mc(l.onClick,(()=>{"mouse"!==y.current&&b()})),onPointerUp:Mc(l.onPointerUp,(()=>{"mouse"===y.current&&b()})),onPointerDown:Mc(l.onPointerDown,(e=>{y.current=e.pointerType})),onPointerMove:Mc(l.onPointerMove,(e=>{y.current=e.pointerType,s?u.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Mc(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:Mc(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(eD.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));$D.displayName=LD;var qD="SelectItemText",zD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=cD(qD,r),u=CD(qD,r),d=FD(qD,r),h=dD(qD,r),[f,p]=i.useState(null),m=Ac(n,(e=>p(e)),d.onItemTextChange,(e=>u.itemTextRefCallback?.(e,d.value,d.disabled))),g=f?.textContent,v=i.useMemo((()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value)),[d.disabled,d.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=h;return iu((()=>(y(v),()=>b(v))),[y,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(Bc.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));zD.displayName=qD;var UD="SelectItemIndicator",VD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return FD(UD,r).isSelected?t.jsx(Bc.span,{"aria-hidden":!0,...o,ref:n}):null}));VD.displayName=UD;var BD="SelectScrollUpButton",KD=i.forwardRef(((e,n)=>{const r=CD(BD,e.__scopeSelect),o=PD(BD,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){a(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(GD,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));KD.displayName=BD;var HD="SelectScrollDownButton",WD=i.forwardRef(((e,n)=>{const r=CD(HD,e.__scopeSelect),o=PD(HD,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(GD,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));WD.displayName=HD;var GD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=CD("SelectScrollButton",r),l=i.useRef(null),c=rD(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),iu((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(Bc.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Mc(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:Mc(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:Mc(s.onPointerLeave,(()=>{u()}))})})),YD=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(Bc.div,{"aria-hidden":!0,...o,ref:n})}));YD.displayName="SelectSeparator";var QD="SelectArrow";function XD(e){return""===e||void 0===e}i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=aD(r),s=cD(QD,r),a=CD(QD,r);return s.open&&"popper"===a.position?t.jsx(d_,{...i,...o,ref:n}):null})).displayName=QD;var JD=i.forwardRef(((e,n)=>{const{value:r,...o}=e,s=i.useRef(null),a=Ac(n,s),l=function(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(r);return i.useEffect((()=>{const e=s.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[l,r]),t.jsx(uu,{asChild:!0,children:t.jsx("select",{...o,ref:a,defaultValue:r})})}));function ZD(e){const t=Hc(e),n=i.useRef(""),r=i.useRef(0),o=i.useCallback((e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout((()=>e("")),1e3))}(o)}),[t]),s=i.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return i.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,s]}function eM(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(s=e,a=Math.max(o,0),s.map(((e,t)=>s[(a+t)%s.length])));var s,a;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}JD.displayName="BubbleSelect";var tM=pD,nM=vD,rM=yD,oM=xD,iM=_D,sM=AD,aM=$D,lM=zD,cM=VD,uM=KD,dM=WD,hM=YD;const fM=hD,pM=gD,mM=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(tM,{ref:o,className:Dh("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(nM,{asChild:!0,children:t.jsx(ud,{className:"h-4 w-4 opacity-50"})})]})));mM.displayName=tM.displayName;const gM=i.forwardRef((({className:e,...n},r)=>t.jsx(uM,{ref:r,className:Dh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(fd,{className:"h-4 w-4"})})));gM.displayName=uM.displayName;const vM=i.forwardRef((({className:e,...n},r)=>t.jsx(dM,{ref:r,className:Dh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ud,{className:"h-4 w-4"})})));vM.displayName=dM.displayName;const yM=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(rM,{children:t.jsxs(oM,{ref:i,className:Dh("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[t.jsx(gM,{}),t.jsx(iM,{className:Dh("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(vM,{})]})})));yM.displayName=oM.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(sM,{ref:r,className:Dh("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=sM.displayName;const bM=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(aM,{ref:o,className:Dh("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(cM,{children:t.jsx(cd,{className:"h-4 w-4"})})}),t.jsx(lM,{children:n})]})));bM.displayName=aM.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(hM,{ref:r,className:Dh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=hM.displayName;const xM=({condition:e,conditionNameToMetadata:r,buildInFieldToHumanReadable:o,updateCondition:i,deleteCondition:s,conditionState:a,index:l,iconDefinitions:c,operatorToHumanReadable:u})=>{const{toast:d}=Dc();n.useEffect((()=>{"exists"===e.operator&&i(l,"value",[])}),[e.operator]);const h="exists"!==e.operator,f=e.value.map((e=>String(e)));return t.jsx("div",{children:t.jsxs(Fx.div,{initial:{opacity:0,height:0,scale:.8},animate:{opacity:1,height:"auto",scale:1},exit:{opacity:0,height:0,scale:.8},transition:{duration:.2},className:`grid ${a.length>1?"grid-cols-[1fr_1fr_1fr_auto]":"grid-cols-[1fr_1fr_1fr]"} gap-4`,children:[t.jsxs(fM,{onValueChange:e=>i(l,"field",e),value:e.field,children:[t.jsx(mM,{children:t.jsx(pM,{placeholder:"Select field",children:o[e.field]??e.field})}),t.jsx(yM,{children:Object.keys(r).map((e=>t.jsx(bM,{value:e,children:o[e]??e},e)))})]}),t.jsxs(fM,{onValueChange:e=>i(l,"operator",e),value:e.operator,children:[t.jsx(mM,{children:t.jsx(pM,{})}),t.jsx(yM,{children:(r[e.field]?.operators||[]).map((e=>t.jsx(bM,{value:e,children:u[e]??e},e)))})]}),t.jsx(Fx.div,{className:"w-full",initial:!1,animate:{opacity:h?1:0,height:h?"auto":0},transition:{type:"spring",damping:25,stiffness:200},children:t.jsx("div",{className:"w-full border rounded-lg overflow-hidden "+(h?"":"hidden"),children:t.jsx(Y_,{selectedValues:f,setSelectedValues:e=>{i(l,"value",[...new Set(e)])},options:[...Array.from(new Set([...f,...r[e.field]?.options??[]])).map((e=>({label:e,value:e})))],defaultValue:f,onValueChange:e=>i(l,"value",e),searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:t=>{if(t.length>0){const n=r[e.field];if(!n)return void d({title:"Error",description:"Invalid field selected",variant:"destructive"});const o=(e=>{const{value:t,type:n}=e;switch(n){case _E.String:return t.length>0;case _E.Number:return!isNaN(Number(t));case _E.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case _E.Boolean:return"true"===t||"false"===t;case _E.Date:case _E.DateTime:return!isNaN(new Date(t).getTime());default:throw gw(n,_E)}})({value:t,type:n.type});o?i(l,"value",[...new Set([...f,t])]):d({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${n.type} type`,variant:"destructive"})}},searchIcon:t.jsx(c.PlusIcon,{className:"h-4 w-4"})})})}),a.length>1&&t.jsx(Fx.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>s(l),className:"p-2 hover:text-red-600","aria-label":"Delete condition",children:t.jsx(c.CloseButton,{})})]})})},wM={email:"Email",phone:"Phone",first_name:"First Name",last_name:"Last Name"},SM={[ME.EQUALS]:"Equals",[ME.NOT_EQUALS]:"Not Equals",[ME.GREATER_THAN]:"Greater Than",[ME.LESS_THAN]:"Less Than",[ME.EXISTS]:"Exists"},CM=({conditionNameToMetadata:e,setConditionState:n,conditionState:r,iconDefinitions:o})=>{const i=(e,t,o)=>{const i=[...r];i[e]={...i[e],[t]:o},n(i)},s=e=>{const t=r.filter(((t,n)=>n!==e));n(t)};return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Zh,{mode:"popLayout",children:r.map(((n,a)=>t.jsxs("div",{children:[t.jsx("div",{children:t.jsx(xM,{condition:n,conditionNameToMetadata:e,buildInFieldToHumanReadable:wM,updateCondition:i,deleteCondition:s,conditionState:r,index:a,iconDefinitions:o,operatorToHumanReadable:SM})}),a<r.length-1&&t.jsxs("div",{className:"flex items-center my-2",children:[t.jsx("div",{className:"h-px flex-1 bg-gray-200"}),t.jsx("span",{className:"px-4 text-sm font-medium text-gray-400",children:"AND"}),t.jsx("div",{className:"h-px flex-1 bg-gray-200"})]})]},a)))}),t.jsx("div",{children:t.jsxs(Fx.button,{whileHover:Object.keys(e).length>0?{scale:1.02}:void 0,whileTap:Object.keys(e).length>0?{scale:.98}:void 0,onClick:()=>{const t=Object.keys(e)[0],o={field:t,operator:e[t].operators[0],value:[]};n([...r,o])},disabled:0===Object.keys(e).length,className:Dh("flex items-center px-4 py-2",0===Object.keys(e).length&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{className:"mr-2",children:"+"}),0===Object.keys(e).length?"No Conditions Available":"Add Condition"]})})]})},kM=({nameAndDescriptionState:e,setNameAndDescriptionState:n})=>t.jsx("div",{children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium mb-2",children:"Name"}),t.jsx("input",{type:"text",placeholder:"Segment Name",className:"w-full p-2 border rounded-lg",value:e.name,onChange:t=>n({...e,name:t.target.value})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium mb-2",children:"Description"}),t.jsx("input",{type:"text",placeholder:"Description",className:"w-full p-2 border rounded-lg",value:e.description,onChange:t=>n({...e,description:t.target.value})})]})]})}),EM="relative rounded-lg",jM=({onClose:e,iconDefinitions:r,segmentId:o})=>{const i=nw(r),s=o||void 0,{toast:a}=Dc(),{segment:l}=PE(s),{updateSegment:c}=NE(s),{segmentsConditions:u,isLoading:d,createSegment:h,isCreating:f}=jE(),[p,m]=n.useState(!1),g=nw(i),[v,y]=n.useState([]),[b,x]=n.useState({name:"",description:""}),[w,S]=n.useState({}),C=b.name&&b.description&&v.some((e=>e.field&&e.operator&&("exists"===e.operator||e.value.length>0)));n.useEffect((()=>{u&&(s&&l?(x({name:l.name,description:l.description}),y(l.conditions)):y([{field:u.conditions[0].field,operator:u.conditions[0].operators[0],value:[]}]),S(u.conditions.reduce(((e,t)=>(e[t.field]={operators:t.operators,type:t.type,options:t.options},e)),{})))}),[u,l,s]);return d?t.jsx("div",{className:EM,children:t.jsx(zx,{text:["Fetching Segment data","Finishing up"]})}):f||p?t.jsx("div",{className:EM,children:t.jsx(zx,{text:s&&l?["Updating Segment","Finishing up"]:["Creating Segment","Finishing up"]})}):t.jsxs("div",{className:EM,children:[t.jsx("div",{className:"relative w-full flex justify-end mb-4",children:t.jsx(lw,{onClick:()=>e?.(!1),className:"w-4 h-4 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors duration-200","aria-label":"Close",variant:"ghost",children:t.jsx(g.CloseButton,{})})}),t.jsxs("div",{className:"space-y-6",children:[t.jsx(kM,{nameAndDescriptionState:b,setNameAndDescriptionState:x}),t.jsx(CM,{conditionNameToMetadata:w,conditionState:v,setConditionState:y,iconDefinitions:g}),t.jsx(OE,{onClose:e,isDisabled:!C,setClickedCreate:()=>{if(!b.name||!b.description)return void a({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:n}=(e=>{for(const t of e){if(!t.field||!t.operator)return{valid:!1,error:"Please ensure all fields are filled out"};if(t.operator!==ME.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===ME.EXISTS&&t.value.length>0)return{valid:!1,error:"EXISTS operator can only be used with an empty array"}}return{valid:!0,error:void 0}})(v);if(!t)return void a({title:"Conditions are invalid",description:n??"Please ensure all fields are filled out",variant:"destructive"});m(!0);const r={name:b.name,description:b.description,conditions:v.map((e=>({...e,value:e.value.map(String)})))};l?c(r,{onSuccess:t=>{e?.(t?.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{y([]),x({name:"",description:""})}}):h(r,{onSuccess:t=>{e?.(t.id?t.id:"error")},onError:()=>{e?.("error")},onSettled:()=>{y([]),x({name:"",description:""})}})},createButtonText:l?"Update":"Create"})]})]})};var TM,PM="dismissableLayer.update",NM="dismissableLayer.pointerDownOutside",_M="dismissableLayer.focusOutside",DM=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),MM=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(DM),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){RM(NM,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){RM(_M,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(TM=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),OM(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=TM)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),OM())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(PM,e),()=>document.removeEventListener(PM,e)}),[]),t.jsx(Bc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));MM.displayName="DismissableLayer";function OM(){const e=new CustomEvent(PM);document.dispatchEvent(e)}function RM(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(DM),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Bc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var[AM,LM]=Lc("Tooltip",[HN]),IM=HN(),FM="TooltipProvider",$M=700,qM="tooltip.open",[zM,UM]=AM(FM),VM=e=>{const{__scopeTooltip:n,delayDuration:r=$M,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:a}=e,[l,c]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect((()=>{const e=d.current;return()=>window.clearTimeout(e)}),[]),t.jsx(zM,{scope:n,isOpenDelayed:l,delayDuration:r,onOpen:i.useCallback((()=>{window.clearTimeout(d.current),c(!1)}),[]),onClose:i.useCallback((()=>{window.clearTimeout(d.current),d.current=window.setTimeout((()=>c(!0)),o)}),[o]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback((e=>{u.current=e}),[]),disableHoverableContent:s,children:a})};VM.displayName=FM;var BM="Tooltip",[KM,HM]=AM(BM),WM=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=UM(BM,e.__scopeTooltip),d=IM(n),[h,f]=i.useState(null),p=lC(),m=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b=!1,x]=cu({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(qM))):u.onClose(),a?.(e)}}),w=i.useMemo((()=>b?y.current?"delayed-open":"instant-open":"closed"),[b]),S=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)}),[x]),C=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,x(!1)}),[x]),k=i.useCallback((()=>{window.clearTimeout(m.current),m.current=window.setTimeout((()=>{y.current=!0,x(!0),m.current=0}),v)}),[v,x]);return i.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),t.jsx(l_,{...d,children:t.jsx(KM,{scope:n,contentId:p,open:b,stateAttribute:w,trigger:h,onTriggerChange:f,onTriggerEnter:i.useCallback((()=>{u.isOpenDelayed?k():S()}),[u.isOpenDelayed,k,S]),onTriggerLeave:i.useCallback((()=>{g?C():(window.clearTimeout(m.current),m.current=0)}),[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:r})})};WM.displayName=BM;var GM="TooltipTrigger",YM=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=HM(GM,r),a=UM(GM,r),l=IM(r),c=Ac(n,i.useRef(null),s.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),h=i.useCallback((()=>u.current=!1),[]);return i.useEffect((()=>()=>document.removeEventListener("pointerup",h)),[h]),t.jsx(c_,{asChild:!0,...l,children:t.jsx(Bc.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:Mc(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:Mc(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:Mc(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})})),onFocus:Mc(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:Mc(e.onBlur,s.onClose),onClick:Mc(e.onClick,s.onClose)})})}));YM.displayName=GM;var QM="TooltipPortal",[XM,JM]=AM(QM,{forceMount:void 0}),ZM=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=HM(QM,n);return t.jsx(XM,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};ZM.displayName=QM;var eO="TooltipContent",tO=i.forwardRef(((e,n)=>{const r=JM(eO,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=HM(eO,e.__scopeTooltip);return t.jsx(au,{present:o||a.open,children:t.jsx(a.disableHoverableContent?iO:nO,{side:i,...s,ref:n})})})),nO=i.forwardRef(((e,n)=>{const r=HM(eO,e.__scopeTooltip),o=UM(eO,e.__scopeTooltip),s=i.useRef(null),a=Ac(n,s),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,h=s.current,{onPointerInTransitChange:f}=o,p=i.useCallback((()=>{c(null),f(!1)}),[f]),m=i.useCallback(((e,t)=>{const n={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(n,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(n,e.currentTarget.getBoundingClientRect())),o=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(o),f(!0)}),[f]);return i.useEffect((()=>()=>p()),[p]),i.useEffect((()=>{if(u&&h){const e=e=>m(e,h),t=e=>m(e,u);return u.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}}),[u,h,m,p]),i.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||h?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,l);r?p():o&&(p(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,h,l,d,p]),t.jsx(iO,{...e,ref:a})})),[rO,oO]=AM(BM,{isInside:!1}),iO=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=HM(eO,r),d=IM(r),{onClose:h}=u;return i.useEffect((()=>(document.addEventListener(qM,h),()=>document.removeEventListener(qM,h))),[h]),i.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,h]),t.jsx(MM,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:t.jsxs(u_,{"data-state":u.stateAttribute,...d,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(qc,{children:o}),t.jsx(rO,{scope:r,isInside:!0,children:t.jsx(du,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));tO.displayName=eO;var sO="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=IM(r);return oO(sO,r).isInside?null:t.jsx(d_,{...i,...o,ref:n})})).displayName=sO;var aO=ZM,lO=tO;const cO=VM,uO=WM,dO=YM,hO=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(aO,{children:t.jsx(lO,{ref:o,sideOffset:n,className:Dh("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));hO.displayName=lO.displayName;const fO=({title:e,alertText:n,Icon:r=bd,onClick:o})=>t.jsx(cO,{children:t.jsxs(uO,{children:[t.jsx(dO,{asChild:!0,children:t.jsx(r,{className:"h-4 w-4 cursor-pointer transition-colors",onClick:o})}),t.jsx(hO,{className:"text-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-[300px]",children:[n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-amber-500/10 p-2 rounded-full",children:t.jsx("svg",{className:"w-5 h-5 text-amber-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),t.jsx("p",{className:"font-semibold text-amber-500",children:n})]}),t.jsx("p",{className:"text-[13px] leading-relaxed text-primary-foreground/90",children:e})]})})]})}),pO="flex flex-col items-center justify-center h-full",mO=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=Jx(e);if(a||!s)return t.jsx("div",{className:pO,children:t.jsx(zx,{text:["Fetching Statistics","Finishing up"]})});const l=()=>{const e="flex items-center bg-white rounded-lg p-4 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md";return t.jsxs("div",{className:"grid gap-4 p-4 transition-all duration-300 "+("email"===o?"grid-cols-3":"grid-cols-1 max-w-md mx-auto"),children:[t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.MessagesSent,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("p",{className:"text-sm font-medium text-gray-500",children:["email"===o?"Emails":"SMS"," Sent"]}),t.jsx(fO,{title:`Total number of ${"email"===o?"emails":"SMS messages"} that were successfully sent in this campaign`})]}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s[o].numberSent})]})]})}),"email"===o&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.OpenRate,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Open Rate"}),t.jsx(fO,{title:"Percentage of recipients who opened the email out of total emails delivered"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.openPercentage.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.TotalBounceRate,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Total Bounce Rate"}),t.jsx(fO,{title:"Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[(s.email.softBounceRate+s.email.hardBounceRate).toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.LinksClicked,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium ",children:"Links Clicked"}),t.jsx(fO,{title:"Total number of times recipients clicked on links within the email"})]}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.email.linksClicked})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.SpamComplies,{className:"w-6 h-6 "})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Spam Complaints"}),t.jsx(fO,{title:"Percentage of recipients who marked this email as spam"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.spamComplaintRate.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:e,children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(r.UnsubscribeRate,{className:"w-6 h-6"})}),t.jsxs("div",{className:"ml-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Unsubscribe Rate"}),t.jsx(fO,{title:"Percentage of recipients who unsubscribed after receiving this email"})]}),t.jsxs("p",{className:"text-2xl font-semibold text-gray-900",children:[s.email.unsubscribedRate.toFixed(2),"%"]})]})]})})]})]})};return t.jsx("div",{className:"space-y-6",children:t.jsx(iC,{tabs:[{id:"email",label:"Email Stats",content:t.jsx("div",{children:t.jsx("div",{children:t.jsx(l,{})})})},{id:"sms",label:"SMS Stats",content:t.jsx("div",{children:t.jsx("div",{children:t.jsx(l,{})})})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"center"})})};function gO(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function vO(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const yO=6048e5,bO=43200;let xO={};function wO(){return xO}function SO(e,t){const n=wO(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=gO(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function CO(e){return SO(e,{weekStartsOn:1})}function kO(e){const t=gO(e),n=t.getFullYear(),r=vO(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=CO(r),i=vO(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=CO(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function EO(e){const t=gO(e);return t.setHours(0,0,0,0),t}function jO(e){const t=gO(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function TO(e,t){return function(e,t){return vO(e,+gO(e)+t)}(e,6e4*t)}function PO(e,t){const n=gO(e),r=gO(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function NO(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=gO(e);return!isNaN(Number(n))}function _O(e){const t=gO(e);return+function(e){const t=gO(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=gO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function DO(e,t){const n=gO(e),r=gO(t),o=PO(n,r),i=Math.abs(function(e,t){const n=gO(e),r=gO(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(n,r));let s;if(i<1)s=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*i);let t=PO(n,r)===-o;_O(gO(e))&&1===i&&1===PO(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function MO(e,t,n){const r=function(e,t){return+gO(e)-+gO(t)}(e,t)/1e3;return(o=n?.roundingMethod,e=>{const t=(o?Math[o]:Math.trunc)(e);return 0===t?0:t})(r);var o}const OO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function RO(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const AO={date:RO({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:RO({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:RO({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},LO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function IO(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function FO(e){return(t,n={})=>{const r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;const i=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],a=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,(e=>e.test(i)));let l;l=e.valueCallback?e.valueCallback(a):a,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(i.length)}}}var $O;const qO={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=OO[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:AO,formatRelative:(e,t,n,r)=>LO[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:IO({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:IO({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:IO({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:IO({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:IO({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:($O={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match($O.matchPattern);if(!n)return null;const r=n[0],o=e.match($O.parsePattern);if(!o)return null;let i=$O.valueCallback?$O.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:FO({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:FO({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:FO({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:FO({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:FO({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function zO(e){const t=gO(e),n=function(e,t){const n=EO(e),r=EO(t),o=+n-jO(n),i=+r-jO(r);return Math.round((o-i)/864e5)}(t,function(e){const t=gO(e),n=vO(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function UO(e){const t=gO(e),n=+CO(t)-+function(e){const t=kO(e),n=vO(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),CO(n)}(t);return Math.round(n/yO)+1}function VO(e,t){const n=gO(e),r=n.getFullYear(),o=wO(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=vO(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=SO(s,t),l=vO(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=SO(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function BO(e,t){const n=gO(e),r=+SO(n,t)-+function(e,t){const n=wO(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=VO(e,t),i=vO(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),SO(i,t)}(n,t);return Math.round(r/yO)+1}function KO(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const HO={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return KO("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):KO(n+1,2)},d:(e,t)=>KO(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>KO(e.getHours()%12||12,t.length),H:(e,t)=>KO(e.getHours(),t.length),m:(e,t)=>KO(e.getMinutes(),t.length),s:(e,t)=>KO(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return KO(Math.trunc(r*Math.pow(10,n-3)),t.length)}},WO="midnight",GO="noon",YO="morning",QO="afternoon",XO="evening",JO="night",ZO={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return HO.y(e,t)},Y:function(e,t,n,r){const o=VO(e,r),i=o>0?o:1-o;if("YY"===t){return KO(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):KO(i,t.length)},R:function(e,t){return KO(kO(e),t.length)},u:function(e,t){return KO(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return KO(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return KO(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return HO.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return KO(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=BO(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):KO(o,t.length)},I:function(e,t,n){const r=UO(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):KO(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):HO.d(e,t)},D:function(e,t,n){const r=zO(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):KO(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return KO(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return KO(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return KO(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?GO:0===r?WO:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?XO:r>=12?QO:r>=4?YO:JO,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return HO.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):HO.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):KO(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):KO(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):HO.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):HO.s(e,t)},S:function(e,t){return HO.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return tR(r);case"XXXX":case"XX":return nR(r);default:return nR(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tR(r);case"xxxx":case"xx":return nR(r);default:return nR(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eR(r,":");default:return"GMT"+nR(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eR(r,":");default:return"GMT"+nR(r,":")}},t:function(e,t,n){return KO(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return KO(e.getTime(),t.length)}};function eR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+KO(i,2)}function tR(e,t){if(e%60==0){return(e>0?"-":"+")+KO(Math.abs(e)/60,2)}return nR(e,t)}function nR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+KO(Math.trunc(r/60),2)+t+KO(r%60,2)}const rR=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},oR=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},iR={p:oR,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return rR(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",rR(r,t)).replace("{{time}}",oR(o,t))}},sR=/^D+$/,aR=/^Y+$/,lR=["D","DD","YY","YYYY"];const cR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dR=/^'([^]*?)'?$/,hR=/''/g,fR=/[a-zA-Z]/;function pR(e,t,n){const r=wO(),o=r.locale??qO,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=gO(e);if(!NO(a))throw new RangeError("Invalid time value");let l=t.match(uR).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,iR[t])(e,o.formatLong)}return e})).join("").match(cR).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:mR(e)};if(ZO[t])return{isToken:!0,value:e};if(t.match(fR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return aR.test(e)}(r)||function(e){return sR.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(lR.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,ZO[r[0]])(a,r,o.localize,c)})).join("")}function mR(e){const t=e.match(dR);return t?t[1].replace(hR,"'"):e}function gR(e,t){return function(e,t,n){const r=wO(),o=n?.locale??r.locale??qO,i=PO(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:i});let a,l;i>0?(a=gO(t),l=gO(e)):(a=gO(e),l=gO(t));const c=MO(l,a),u=(jO(l)-jO(a))/1e3,d=Math.round((c-u)/60);let h;if(d<2)return n?.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,s):c<10?o.formatDistance("lessThanXSeconds",10,s):c<20?o.formatDistance("lessThanXSeconds",20,s):c<40?o.formatDistance("halfAMinute",0,s):o.formatDistance(c<60?"lessThanXMinutes":"xMinutes",1,s):0===d?o.formatDistance("lessThanXMinutes",1,s):o.formatDistance("xMinutes",d,s);if(d<45)return o.formatDistance("xMinutes",d,s);if(d<90)return o.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return o.formatDistance("aboutXHours",e,s)}if(d<2520)return o.formatDistance("xDays",1,s);if(d<bO){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/bO),o.formatDistance("aboutXMonths",h,s);if(h=DO(l,a),h<12){const e=Math.round(d/bO);return o.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/12);return e<3?o.formatDistance("aboutXYears",t,s):e<9?o.formatDistance("overXYears",t,s):o.formatDistance("almostXYears",t+1,s)}}(e,function(e){return vO(e,Date.now())}(e),t)}const vR=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Dh("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...r})));vR.displayName="Input";const yR=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Dh("w-full caption-bottom text-sm",e),...n})})));yR.displayName="Table";const bR=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Dh("[&_tr]:border-b",e),...n})));bR.displayName="TableHeader";const xR=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Dh("[&_tr:last-child]:border-0",e),...n})));xR.displayName="TableBody";const wR=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Dh("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));wR.displayName="TableRow";const SR=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Dh("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));SR.displayName="TableHead";const CR=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Dh("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));CR.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:Dh("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const kR=({columns:e,fetchData:r,itemsPerPage:o=10,emptyState:i={title:"No Items Found",description:"No items are currently available."},className:s,onRowClick:a})=>{const[l,c]=n.useState([]),[u,d]=n.useState(!1),[h,f]=n.useState(),[p,m]=n.useState(!0),[g,v]=n.useState(null),y=n.useCallback((async e=>{try{d(!0),v(null);const t=await r({cursor:e,limit:o});c(e?e=>[...e,...t.items]:t.items),m(!!t.cursor),f(t.cursor)}catch(oQ){v(oQ instanceof Error?oQ.message:"An error occurred")}finally{d(!1)}}),[r,o]);return n.useEffect((()=>{c([]),f(void 0),m(!0),y()}),[y]),g?t.jsx("div",{className:"flex items-center justify-center p-8 text-center text-red-600",children:t.jsx("p",{children:g})}):t.jsxs("div",u||0!==l.length?{className:Dh(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(yR,{children:[t.jsx(bR,{children:t.jsx(wR,{children:e.map((e=>t.jsx(SR,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(xR,{children:l.map(((n,r)=>t.jsx(wR,{onClick:()=>a?.(n),className:a?"cursor-pointer hover:bg-gray-50/50 transition-colors":"hover:bg-gray-50/50 transition-colors",children:e.map((e=>t.jsx(CR,{style:{width:e.width},children:e.cell?e.cell(n[e.accessorKey],n):n[e.accessorKey]||t.jsx("span",{className:"text-gray-400",children:"Not provided"})},String(e.accessorKey))))},r)))})]})}),p&&t.jsx("div",{className:"mt-4 flex justify-center",children:t.jsx("button",{onClick:()=>y(h),disabled:u,className:"rounded-lg bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 disabled:opacity-50",children:u?"Loading...":"Load More"})})]}:{className:"flex flex-col items-center justify-center p-8 text-center",children:[i.icon&&t.jsx("div",{className:"mb-4",children:i.icon}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:i.title}),t.jsx("p",{className:"text-gray-500",children:i.description})]})},ER=({status:e})=>{switch(e){case ew.DRAFT:return t.jsx(LE,{variant:"secondary",children:"Draft"});case ew.ACTIVE:return t.jsx(LE,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case ew.RUNNING:return t.jsx(LE,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case ew.COMPLETED:return t.jsx(LE,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case ew.FAILED:return t.jsx(LE,{variant:"destructive",children:"Failed"});case ew.DEACTIVATED:return t.jsx(LE,{variant:"destructive",children:"Cancelled"});default:gw(e,ew)}},jR=({onViewAutomation:e})=>{const[r,o]=n.useState(""),[i,s]=n.useState("all"),a=e=>t.jsx(ER,{status:e}),l=e=>{let n="bg-gray-400";switch(e){case ew.ACTIVE:n="bg-green-500";break;case ew.DRAFT:n="bg-gray-400";break;case ew.DEACTIVATED:n="bg-red-500";break;case ew.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})},c=n=>t.jsx(kR,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[l(n.status),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),a(n.status)]})]})},{header:"Stats",accessorKey:"emailsSent",width:"25%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(tw.EmailIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.emailsSent||0})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(tw.SmsIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.smsSent||0})]})]})},{header:"Modified",accessorKey:"updated_at",width:"25%",cell:(e,n)=>{const r=e||n.created_at;return t.jsx("div",{className:"text-gray-600",children:r?gR(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:e,limit:t})=>{const o=await(async e=>{const t=new URLSearchParams;return e.cursor&&t.append("cursor",e.cursor),e.limit&&t.append("limit",e.limit.toString()),e.status&&t.append("status",e.status),e.search&&t.append("search",e.search),(await Ja(`${Vx}?${t.toString()}`,{method:"GET"})).data})({cursor:e,limit:t,status:n,search:r||void 0});return{items:o.automations,cursor:o.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-document-text h-12 w-12 text-gray-400"}),title:"No Automations Found",description:"Create your first automation to get started."},onRowClick:t=>{e(t.id)},className:"rounded-lg bg-white"}),u=[{id:"all",label:"All",content:c()},{id:"active",label:"Active",content:c("active")},{id:"draft",label:"Drafts",content:c("draft")}];return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative w-[400px]",children:[t.jsx(vR,{placeholder:"Search automations...",value:r,onChange:e=>o(e.target.value),className:"pl-9 bg-gray-50 border-0 focus-visible:ring-2"}),t.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:t.jsx("div",{className:"i-heroicons-magnifying-glass h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx("div",{className:"i-heroicons-funnel h-5 w-5 text-gray-500"})})]}),t.jsx(iC,{tabs:u,activeTab:i,onTabChange:s})]})},TR=({onSelectSegment:e})=>{const[r,o]=n.useState(""),{toast:i}=Dc(),s=e=>{const n={[DE.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[DE.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[DE.CUSTOM];return t.jsx(LE,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative w-[400px]",children:[t.jsx(vR,{placeholder:"Search segments...",value:r,onChange:e=>o(e.target.value),className:"pl-9 bg-gray-50 border-0 focus-visible:ring-2"}),t.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:t.jsx("div",{className:"i-heroicons-magnifying-glass h-4 w-4"})})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx("div",{className:"i-heroicons-funnel h-5 w-5 text-gray-500"})})]}),t.jsx(kR,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),s(n.type)]}),t.jsx("span",{className:"text-sm text-gray-500 truncate max-w-[300px]",children:n.description})]})})},{header:"Users",accessorKey:"user_count",width:"25%",cell:e=>t.jsxs("div",{className:"text-gray-600",children:[e.toLocaleString()," ",1===e?"user":"users"]})},{header:"Modified",accessorKey:"user_count_updated_at",width:"25%",cell:e=>t.jsx("div",{className:"text-gray-600",children:e?gR(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:e,limit:t})=>{const n=await EE({cursor:e,limit:t,search:r||void 0});return{items:n.segments,cursor:n.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-user-group h-12 w-12 text-gray-400"}),title:"No Segments Found",description:"Create your first segment to get started."},onRowClick:t=>{t.type===DE.CUSTOM?e(t.id):i({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},PR=({iconDefinitionsPassed:e})=>{const r=xS(),{toast:o}=Dc(),[i,s]=n.useState(!1),[a,l]=n.useState("automations"),[c,u]=n.useState(!1),[d,h]=n.useState(null),f=nw(e),p=[{id:"automations",label:"Automations",content:t.jsx(jR,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)}})},{id:"segments",label:"Segments",content:t.jsx(TR,{onSelectSegment:e=>{h(e),u(!0)}})}];return t.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[t.jsx(bE,{open:i,onOpenChange:s,children:t.jsx(SE,{hideCloseButton:!0,children:t.jsx(Sw,{iconDefinitions:f,onClose:e=>{"error"===e?(o({title:"Error creating automation",description:"Please try again",variant:"destructive"}),s(!1)):!1===e?s(!1):r(`/automations/view-modal/${e}?autoOpenEditPopup=true&showBackButton=true`)}})})}),t.jsx(bE,{open:c,onOpenChange:u,children:t.jsx(SE,{hideCloseButton:!0,children:t.jsx(jM,{iconDefinitions:f,segmentId:d??void 0,onClose:e=>{"error"===e?(o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),u(!1),h(null)):!1===e?(u(!1),h(null)):(o({title:"Segment created!"}),h(null))}})})}),t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx("div",{className:"bg-white rounded-2xl w-full p-6 relative",children:t.jsx(mO,{iconDefinitions:f})}),t.jsx("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl",children:t.jsx(iC,{tabs:p,activeTab:a,onTabChange:e=>l(e),actionButton:{onClick:()=>{"automations"===a?s(!0):u(!0)},label:"Create New "+("automations"===a?"Automation":"Segment")}})})]})]})};var NR="rovingFocusGroup.onEntryFocus",_R={bubbles:!1,cancelable:!0},DR="RovingFocusGroup",[MR,OR,RR]=Vc(DR),[AR,LR]=Lc(DR,[RR]),[IR,FR]=AR(DR),$R=i.forwardRef(((e,n)=>t.jsx(MR.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(MR.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(qR,{...e,ref:n})})})));$R.displayName=DR;var qR=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,p=i.useRef(null),m=Ac(n,p),g=J_(a),[v=null,y]=cu({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=Hc(d),S=OR(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=p.current;if(e)return e.addEventListener(NR,w),()=>e.removeEventListener(NR,w)}),[w]),t.jsx(IR,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:i.useCallback((e=>y(e)),[y]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>E((e=>e-1))),[]),children:t.jsx(Bc.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:Mc(e.onMouseDown,(()=>{C.current=!0})),onFocus:Mc(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(NR,_R);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));BR([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}C.current=!1})),onBlur:Mc(e.onBlur,(()=>x(!1)))})})})),zR="RovingFocusGroupItem",UR=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=lC(),u=a||c,d=FR(zR,r),h=d.currentTabStopId===u,f=OR(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return p(),()=>m()}),[o,p,m]),t.jsx(MR.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(Bc.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:Mc(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:Mc(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:VR[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>BR(o)))}var n,r}))})})}));UR.displayName=zR;var VR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function BR(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var KR=$R,HR=UR,WR="Tabs",[GR,YR]=Lc(WR,[LR]),QR=LR(),[XR,JR]=GR(WR),ZR=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=J_(l),[h,f]=cu({prop:o,onChange:i,defaultProp:s});return t.jsx(XR,{scope:r,baseId:lC(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(Bc.div,{dir:d,"data-orientation":a,...u,ref:n})})}));ZR.displayName=WR;var eA="TabsList",tA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=JR(eA,r),a=QR(r);return t.jsx(KR,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(Bc.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));tA.displayName=eA;var nA="TabsTrigger",rA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=JR(nA,r),l=QR(r),c=sA(a.baseId,o),u=aA(a.baseId,o),d=o===a.value;return t.jsx(HR,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(Bc.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:Mc(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:Mc(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));rA.displayName=nA;var oA="TabsContent",iA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=e,c=JR(oA,r),u=sA(c.baseId,o),d=aA(c.baseId,o),h=o===c.value,f=i.useRef(h);return i.useEffect((()=>{const e=requestAnimationFrame((()=>f.current=!1));return()=>cancelAnimationFrame(e)}),[]),t.jsx(au,{present:s||h,children:({present:r})=>t.jsx(Bc.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:r&&a})})}));function sA(e,t){return`${e}-trigger-${t}`}function aA(e,t){return`${e}-content-${t}`}iA.displayName=oA;var lA=tA,cA=rA,uA=iA;const dA=ZR,hA=i.forwardRef((({className:e,...n},r)=>t.jsx(lA,{ref:r,className:Dh("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));hA.displayName=lA.displayName;const fA=i.forwardRef((({className:e,...n},r)=>t.jsx(cA,{ref:r,className:Dh("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...n})));fA.displayName=cA.displayName;const pA=i.forwardRef((({className:e,...n},r)=>t.jsx(uA,{ref:r,className:Dh("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));pA.displayName=uA.displayName;const mA=()=>{const e=ue({queryKey:["channel-senders"],queryFn:()=>(async()=>(await Ja(`${Bx}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},gA=()=>{const e=ne(),t=de({mutationFn:e=>(async(e,t)=>(await Ja(`${Bx}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data)(e.toUpdate,e.id),onSuccess:()=>{e.invalidateQueries({queryKey:["channel-senders"]})}});return{updateChannelSender:t.mutate,isUpdating:t.isPending,updateError:t.error}},vA=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(`${Kx}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},yA=(e,t)=>{const n=ne(),r=de({mutationFn:e=>(async e=>(await Ja(`${Kx}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(Wx(e,{action:[...t.action_data||[],{action_type:"send_communication",action_metadata:{action_type:"send_communication",communication_group_id:r.id}}]}),n.invalidateQueries({queryKey:["automations"]}),n.invalidateQueries({queryKey:["communicationGroups"]}),r)});return{createCommunicationForAutomation:r.mutate,isCreating:r.isPending}},bA=()=>{const e=ne(),t=de({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await Ja(`${Kx}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data)(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{updateCommunicationGroup:t.mutate,isUpdating:t.isPending,updateError:t.error,isUpdateSuccess:t.isSuccess}},xA=()=>{const e=ue({queryKey:["merge-fields"],queryFn:()=>(async()=>(await Ja(`${Kx}/merge-fields`)).data)()});return{getMergeFields:e.data,isGetting:e.isPending,getError:e.error,isGetSuccess:e.isSuccess}},wA=()=>{const e=de({mutationFn:({id:e,params:t})=>(async(e,t)=>(await Ja(`${Kx}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}},SA=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",CA=({type:e})=>t.jsxs("div",{className:"w-full h-full min-h-[300px] flex flex-col items-center justify-center bg-gradient-to-b from-gray-50 to-white p-8",children:[t.jsx("div",{className:"mb-4 text-gray-300",children:t.jsx("svg",{className:"w-16 h-16",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"})})}),t.jsxs("p",{className:"text-gray-400 font-medium text-lg text-center mb-2",children:["No ","email"===e?"Email":"SMS"," Preview Available"]}),t.jsxs("p",{className:"text-gray-400 text-sm text-center",children:["Edit your ","email"===e?"Email":"SMS"," template to see a preview here"]})]}),kA=({html:e,height:n,width:r})=>t.jsx("div",{className:"w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(CA,{type:"email"})}),EA=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",children:[t.jsxs("div",{className:"bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e?`${e} <${s}>`:s})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Subject:"}),t.jsx("span",{className:"text-gray-800 font-medium",children:r})]}),o&&t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Preview Text:"}),t.jsx("span",{className:"text-gray-600 italic",children:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(kA,{html:i,height:a.height,width:a.width})})]})},jA=({fromPhone:e,body:n})=>t.jsxs("div",{className:"max-w-sm mx-auto",children:[t.jsx("div",{className:"bg-gray-50 p-5 rounded-lg border border-gray-100 mb-6",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e})]})}),t.jsx("div",{className:"border-4 border-gray-800 rounded-3xl p-1 bg-gray-800 shadow-xl mx-auto max-w-xs",children:t.jsx("div",{className:"bg-gray-100 rounded-2xl p-4 h-[400px] overflow-y-auto",children:t.jsx("div",{className:"flex justify-end mb-4",children:t.jsx("div",{className:"bg-green-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm whitespace-pre-wrap",children:n})})})})]}),TA=({emailPreview:e,smsPreview:r,iconDefinitions:o})=>{const[i,s]=n.useState("email");return n.useEffect((()=>{e?s("email"):r&&s("sms")}),[e,r]),t.jsx(Fx.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"w-full",children:t.jsxs("div",{className:"bg-gray-200 rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[e&&t.jsxs(lw,{onClick:()=>s("email"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("email"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.EmailIcon,{className:"w-5 h-5 transition-colors duration-200 "+("email"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"Email Preview"})]}),"email"===i&&t.jsx(Fx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),r&&t.jsxs(lw,{onClick:()=>s("sms"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("sms"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.SmsIcon,{className:"w-5 h-5 transition-colors duration-200 "+("sms"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===i&&t.jsx(Fx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(Zh,{mode:"wait",children:["email"===i&&e&&t.jsx(Fx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(EA,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(Fx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(jA,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},PA=({automationId:e,iconDefinitions:r})=>{const{automation:o,isFetching:i}=Gx(e),{getCommunicationGroup:s}=vA(),{channelSenders:a}=mA(),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(!1),p=n.useMemo((()=>{const e=o?.action_data?.map((e=>e.action_metadata.communication_group_id));if(e&&0!==e.length&&!(e.length>1))return e[0]}),[o]);return n.useEffect((()=>{const e=p;e&&a?(f(!0),s(e,{onSuccess:e=>{try{const t=e.email_channel_sender_id,n=a.channel_senders.find((e=>e.id===t));n&&e.email_html_body&&c({emailHtml:e.email_html_body,emailSubject:e.email_subject,emailBaseDomain:n.channel_sender_metadata.baseDomain,emailFromName:n.channel_sender_metadata.emailFromName,emailFromEmail:`${n.channel_sender_metadata.userPart}@${n.channel_sender_metadata.baseDomain}`,emailPreviewText:e.email_preview_text});const r=e.sms_channel_sender_id,o=a.channel_senders.find((e=>e.id===r));o&&(o.channel_sender_metadata.from||o.channel_sender_metadata.messageServiceSid)&&e.sms_message_body&&d({fromPhone:SA(o.channel_sender_metadata),smsBody:e.sms_message_body,companyName:e.text_message_company_name})}finally{f(!1)}}})):f(!1)}),[o,s,p,a,i]),t.jsx("div",h||i?{className:"min-h-[500px] flex items-center justify-center",children:t.jsx(zx,{text:["Fetching Automation","Finishing up"]})}:{className:"p-6 bg-white",children:t.jsxs("div",l||u?{className:"space-y-4",children:[t.jsx(TA,{iconDefinitions:r,emailPreview:l&&l.emailFromEmail&&l.emailSubject&&l.emailHtml?{fromEmail:l?.emailFromEmail,fromName:l?.emailFromName??null,subject:l?.emailSubject,previewText:l?.emailPreviewText??null,body:l?.emailHtml}:null,smsPreview:u&&u.fromPhone&&u.smsBody?{fromPhone:u?.fromPhone,body:u?.smsBody,companyName:u?.companyName}:null}),t.jsx("div",{className:"text-center text-sm text-gray-500",children:t.jsx("p",{children:"These previews show exactly how your messages will appear to your customers"})})]}:{className:"py-12 flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-6",children:t.jsx("svg",{className:"w-16 h-16 text-gray-300",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Automation Content Missing"}),t.jsx("p",{className:"text-gray-500 max-w-md",children:"Complete your automation setup to preview the content here. We'll guide you through each step. Start by clicking Actions in the top right, and then click Edit!"})]})})},NA=({automationId:e,iconDefinitions:n})=>{const{recipients:r,isLoading:o,fetchError:i}=Yx(e),{isLoading:s}=Jx(e);if(o||s)return t.jsx("div",{className:pO,children:t.jsx(zx,{text:["Fetching Recipients","Finishing up"]})});if(i)return t.jsxs("div",{children:["Error: ",i.message]});if(!r||0===r.recipients.length)return t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-4",children:t.jsx(tw.UserIcon,{className:"h-12 w-12 text-gray-400"})}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:"No Recipients Found"}),t.jsx("p",{className:"text-gray-500",children:"This automation currently has no assigned recipients. Please update the include or exclude segments to add recipients."})]});const a="30%",l="35%",c="35%";return t.jsxs("div",{className:"relative",children:[t.jsx("div",{children:t.jsx(mO,{automationId:e,iconDefinitions:n})}),t.jsx(W_,{className:"my-4"}),t.jsxs(yR,{children:[t.jsx(bR,{children:t.jsxs(wR,{children:[t.jsx(SR,{style:{width:a},children:"Name"}),t.jsx(SR,{style:{width:l},children:"Email"}),t.jsx(SR,{style:{width:c},children:"Phone"})]})}),t.jsx(xR,{children:r.recipients.map((e=>t.jsxs(wR,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(CR,{style:{width:a},children:e.first_name||e.last_name?`${e.first_name||""} ${e.last_name||""}`.trim():t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CR,{style:{width:l},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CR,{style:{width:c},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};var _A,DA="dismissableLayer.update",MA="dismissableLayer.pointerDownOutside",OA="dismissableLayer.focusOutside",RA=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),AA=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(RA),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){IA(MA,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){IA(OA,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(_A=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),LA(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_A)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),LA())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(DA,e),()=>document.removeEventListener(DA,e)}),[]),t.jsx(Bc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));AA.displayName="DismissableLayer";function LA(){const e=new CustomEvent(DA);document.dispatchEvent(e)}function IA(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(RA),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Bc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var FA=["Enter"," "],$A=["ArrowUp","PageDown","End"],qA=["ArrowDown","PageUp","Home",...$A],zA={ltr:[...FA,"ArrowRight"],rtl:[...FA,"ArrowLeft"]},UA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},VA="Menu",[BA,KA,HA]=Vc(VA),[WA,GA]=Lc(VA,[HA,HN,LR]),YA=HN(),QA=LR(),[XA,JA]=WA(VA),[ZA,eL]=WA(VA),tL=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=YA(n),[u,d]=i.useState(null),h=i.useRef(!1),f=Hc(a),p=J_(s);return i.useEffect((()=>{const e=()=>{h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>h.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(l_,{...c,children:t.jsx(XA,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(ZA,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:h,dir:p,modal:l,children:o})})})};tL.displayName=VA;var nL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YA(r);return t.jsx(c_,{...i,...o,ref:n})}));nL.displayName="MenuAnchor";var rL="MenuPortal",[oL,iL]=WA(rL,{forceMount:void 0}),sL=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=JA(rL,n);return t.jsx(oL,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};sL.displayName=rL;var aL="MenuContent",[lL,cL]=WA(aL),uL=i.forwardRef(((e,n)=>{const r=iL(aL,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=JA(aL,e.__scopeMenu),a=eL(aL,e.__scopeMenu);return t.jsx(BA.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||s.open,children:t.jsx(BA.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?dL:hL,{...i,ref:n})})})})})),dL=i.forwardRef(((e,n)=>{const r=JA(aL,e.__scopeMenu),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return Dk(e)}),[]),t.jsx(fL,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),hL=i.forwardRef(((e,n)=>{const r=JA(aL,e.__scopeMenu);return t.jsx(fL,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),fL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...v}=e,y=JA(aL,r),b=eL(aL,r),x=YA(r),w=QA(r),S=KA(r),[C,k]=i.useState(null),E=i.useRef(null),j=Ac(n,E,y.onContentChange),T=i.useRef(0),P=i.useRef(""),N=i.useRef(0),_=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),O=g?kk:i.Fragment,R=g?{as:Fc,allowPinchZoom:!0}:void 0,A=e=>{const t=P.current+e,n=S().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),s=n.find((e=>e.textValue===i))?.ref.current;!function e(t){P.current=t,window.clearTimeout(T.current),""!==t&&(T.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))};i.useEffect((()=>()=>window.clearTimeout(T.current)),[]),RC();const L=i.useCallback((e=>D.current===_.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,t)}(e,_.current?.area)),[]);return t.jsx(lL,{scope:r,searchRef:P,onItemEnter:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),onItemLeave:i.useCallback((e=>{L(e)||(E.current?.focus(),k(null))}),[L]),onTriggerLeave:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),pointerGraceTimerRef:N,onPointerGraceIntentChange:i.useCallback((e=>{_.current=e}),[]),children:t.jsx(O,{...R,children:t.jsx(cP,{asChild:!0,trapped:s,onMountAutoFocus:Mc(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(AA,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:t.jsx(KR,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Mc(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(u_,{role:"menu","aria-orientation":"vertical","data-state":$L(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Mc(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&A(e.key));if(e.target!==E.current)return;if(!qA.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));$A.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:Mc(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),P.current="")})),onPointerMove:Mc(e.onPointerMove,UL((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));uL.displayName=aL;var pL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Bc.div,{role:"group",...o,ref:n})}));pL.displayName="MenuGroup";var mL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Bc.div,{...o,ref:n})}));mL.displayName="MenuLabel";var gL="MenuItem",vL="menu.itemSelect",yL=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=eL(gL,e.__scopeMenu),c=cL(gL,e.__scopeMenu),u=Ac(n,a),d=i.useRef(!1);return t.jsx(bL,{...s,ref:u,disabled:r,onClick:Mc(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(vL,{bubbles:!0,cancelable:!0});e.addEventListener(vL,(e=>o?.(e)),{once:!0}),Kc(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Mc(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:Mc(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||FA.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));yL.displayName=gL;var bL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=cL(gL,r),c=QA(r),u=i.useRef(null),d=Ac(n,u),[h,f]=i.useState(!1),[p,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[a.children]),t.jsx(BA.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:t.jsx(HR,{asChild:!0,...c,focusable:!o,children:t.jsx(Bc.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Mc(e.onPointerMove,UL((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Mc(e.onPointerLeave,UL((e=>l.onItemLeave(e)))),onFocus:Mc(e.onFocus,(()=>f(!0))),onBlur:Mc(e.onBlur,(()=>f(!1)))})})})})),xL=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(PL,{scope:e.__scopeMenu,checked:r,children:t.jsx(yL,{role:"menuitemcheckbox","aria-checked":qL(r)?"mixed":r,...i,ref:n,"data-state":zL(r),onSelect:Mc(i.onSelect,(()=>o?.(!!qL(r)||!r)),{checkForDefaultPrevented:!1})})})}));xL.displayName="MenuCheckboxItem";var wL="MenuRadioGroup",[SL,CL]=WA(wL,{value:void 0,onValueChange:()=>{}}),kL=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=Hc(o);return t.jsx(SL,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(pL,{...i,ref:n})})}));kL.displayName=wL;var EL="MenuRadioItem",jL=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=CL(EL,e.__scopeMenu),s=r===i.value;return t.jsx(PL,{scope:e.__scopeMenu,checked:s,children:t.jsx(yL,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":zL(s),onSelect:Mc(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));jL.displayName=EL;var TL="MenuItemIndicator",[PL,NL]=WA(TL,{checked:!1}),_L=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=NL(TL,r);return t.jsx(au,{present:o||qL(s.checked)||!0===s.checked,children:t.jsx(Bc.span,{...i,ref:n,"data-state":zL(s.checked)})})}));_L.displayName=TL;var DL=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Bc.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));DL.displayName="MenuSeparator";var ML=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YA(r);return t.jsx(d_,{...i,...o,ref:n})}));ML.displayName="MenuArrow";var[OL,RL]=WA("MenuSub"),AL="MenuSubTrigger",LL=i.forwardRef(((e,n)=>{const r=JA(AL,e.__scopeMenu),o=eL(AL,e.__scopeMenu),s=RL(AL,e.__scopeMenu),a=cL(AL,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},h=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>h),[h]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(nL,{asChild:!0,...d,children:t.jsx(bL,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":$L(r.open),...e,ref:Rc(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Mc(e.onPointerMove,UL((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(a.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),h()}),100))}))),onPointerLeave:Mc(e.onPointerLeave,UL((e=>{h();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],s=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:Mc(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||zA[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));LL.displayName=AL;var IL="MenuSubContent",FL=i.forwardRef(((e,n)=>{const r=iL(aL,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=JA(aL,e.__scopeMenu),l=eL(aL,e.__scopeMenu),c=RL(IL,e.__scopeMenu),u=i.useRef(null),d=Ac(n,u);return t.jsx(BA.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||a.open,children:t.jsx(BA.Slot,{scope:e.__scopeMenu,children:t.jsx(fL,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Mc(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Mc(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:Mc(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=UA[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function $L(e){return e?"open":"closed"}function qL(e){return"indeterminate"===e}function zL(e){return qL(e)?"indeterminate":e?"checked":"unchecked"}function UL(e){return t=>"mouse"===t.pointerType?e(t):void 0}FL.displayName=IL;var VL=tL,BL=nL,KL=sL,HL=uL,WL=pL,GL=mL,YL=yL,QL=xL,XL=kL,JL=jL,ZL=_L,eI=DL,tI=ML,nI=LL,rI=FL,oI="DropdownMenu",[iI,sI]=Lc(oI,[GA]),aI=GA(),[lI,cI]=iI(oI),uI=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=aI(n),d=i.useRef(null),[h=!1,f]=cu({prop:s,defaultProp:a,onChange:l});return t.jsx(lI,{scope:n,triggerId:lC(),triggerRef:d,contentId:lC(),open:h,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(VL,{...u,open:h,onOpenChange:f,dir:o,modal:c,children:r})})};uI.displayName=oI;var dI="DropdownMenuTrigger",hI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=cI(dI,r),a=aI(r);return t.jsx(BL,{asChild:!0,...a,children:t.jsx(Bc.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:Rc(n,s.triggerRef),onPointerDown:Mc(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:Mc(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));hI.displayName=dI;var fI=e=>{const{__scopeDropdownMenu:n,...r}=e,o=aI(n);return t.jsx(KL,{...o,...r})};fI.displayName="DropdownMenuPortal";var pI="DropdownMenuContent",mI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=cI(pI,r),a=aI(r),l=i.useRef(!1);return t.jsx(HL,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:Mc(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;s.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));mI.displayName=pI;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(WL,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var gI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(GL,{...i,...o,ref:n})}));gI.displayName="DropdownMenuLabel";var vI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(YL,{...i,...o,ref:n})}));vI.displayName="DropdownMenuItem";var yI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(QL,{...i,...o,ref:n})}));yI.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(XL,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var bI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(JL,{...i,...o,ref:n})}));bI.displayName="DropdownMenuRadioItem";var xI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(ZL,{...i,...o,ref:n})}));xI.displayName="DropdownMenuItemIndicator";var wI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(eI,{...i,...o,ref:n})}));wI.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(tI,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var SI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(nI,{...i,...o,ref:n})}));SI.displayName="DropdownMenuSubTrigger";var CI=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=aI(r);return t.jsx(rI,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));CI.displayName="DropdownMenuSubContent";var kI=fI,EI=mI,jI=gI,TI=vI,PI=yI,NI=bI,_I=xI,DI=wI,MI=SI,OI=CI;const RI=uI,AI=hI;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(MI,{ref:i,className:Dh("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(hd,{className:"ml-auto"})]}))).displayName=MI.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(OI,{ref:r,className:Dh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=OI.displayName;const LI=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(kI,{children:t.jsx(EI,{ref:o,sideOffset:n,className:Dh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));LI.displayName=EI.displayName;const II=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(TI,{ref:o,className:Dh("relative flex cursor-default select-none items-center gap-2 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 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));II.displayName=TI.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(PI,{ref:i,className:Dh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(_I,{children:t.jsx(cd,{className:"h-4 w-4"})})}),n]}))).displayName=PI.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(NI,{ref:o,className:Dh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(_I,{children:t.jsx(vd,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=NI.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(jI,{ref:o,className:Dh("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=jI.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(DI,{ref:r,className:Dh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=DI.displayName;const FI="reach-styles-module__stepIndicatorContainer___FoKXB",$I="reach-styles-module__iconContainer___Ki-1n",qI="reach-styles-module__checkIcon___-krUS",zI="reach-styles-module__minusIcon___r5cKs",UI="reach-styles-module__minusIconActive___-4JHM",VI="reach-styles-module__minusIconInactive___JtvVB",BI="reach-styles-module__label___tiCMA",KI="reach-styles-module__labelActive___EXydD",HI="reach-styles-module__labelInactive___g-J3r",WI=({label:e,isCompleted:n,isActive:r})=>t.jsxs("div",{className:FI,children:[t.jsx("div",n?{className:$I,children:t.jsx(cd,{className:qI})}:{className:$I,children:t.jsx(jd,{className:Dh(zI,r?UI:VI)})}),t.jsx("span",{className:Dh(BI,r?KI:HI),children:e})]}),GI=({iconDefinitions:e,handleBack:n,handleNext:r,backText:o,nextText:i,backDisabled:s,nextDisabled:a,hideBack:l,thirdOptionText:c,thirdOptionOnClick:u})=>t.jsxs("div",{className:"flex gap-4",children:[!l&&t.jsxs(lw,{onClick:n,disabled:s,variant:"secondary",className:Dh("flex items-center gap-2",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:o})]}),c&&u&&t.jsx(lw,{onClick:u,variant:"secondary",className:Dh("flex items-center gap-2"),children:t.jsx("span",{children:c})}),t.jsxs(lw,{onClick:r,disabled:a,className:Dh("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),YI="reach-styles-module__header___-izE2",QI="reach-styles-module__title___n1hA9",XI="reach-styles-module__description___EvXM-",JI="reach-styles-module__content___okv68",ZI="reach-styles-module__footer___YA4U4",eF=nd("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),tF=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:Dh(eF({variant:n}),e),...r})));tF.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(YI,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(QI,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(XI,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(JI,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Dh(ZI,e),...n}))).displayName="CardFooter";const nF=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},rF=()=>{const e=ue({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await Ja("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var oF=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(oF||{}),iF=i.forwardRef(((e,n)=>t.jsx(Bc.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));iF.displayName="Label";var sF=iF;const aF=nd("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lF=i.forwardRef((({className:e,...n},r)=>t.jsx(sF,{ref:r,className:Dh(aF(),e),...n})));lF.displayName=sF.displayName;const cF=()=>t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Email Editor Help Center"}),t.jsx("p",{className:"text-gray-500",children:"Learn how to use our email editor's powerful features"})]}),t.jsx("div",{className:"space-y-8",children:t.jsxs("div",{className:"bg-white rounded-xl border shadow-sm p-6",children:[t.jsx("h3",{className:"text-lg font-medium mb-4",children:"Using Dynamic Content"}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-50",children:[t.jsx("img",{src:"https://reach-static-assets.s3.us-east-2.amazonaws.com/email-sms/merge-tags-demo.gif",alt:"Merge Tags Demo",className:"w-full shadow-lg"}),t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4",children:t.jsx("p",{className:"text-white text-sm",children:"Demonstration: Adding merge tags to personalize your emails"})})]}),t.jsx(dw,{onClick:()=>{},title:"Dynamic Content",subtitle:"Dynamic content is a way to insert dynamic content into your email such as the customer's name, email, or other details.",icon:t.jsx(Cd,{}),selected:!0})]})]})})]}),uF=({type:e})=>t.jsxs("div",{className:"flex items-start space-x-2 text-sm text-gray-600",children:[t.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),t.jsxs("span",{children:["Please configure at least one ",e," sender before editing the template"]})]}),dF={all:["stripo"],token:()=>[...dF.all,"token"],editorData:()=>[...dF.all,"editorData"],templates:()=>[...dF.all,"templates"],demoTemplate:()=>[...dF.templates(),"demo"]},hF=async()=>(await Ja(`${Hx}/editor-data`)).data,fF=e=>ue({queryKey:["stripo","templates",e],queryFn:()=>(async e=>(await Ja(`${Hx}/template/${e}`)).data)(e),...Wa}),pF=({containerRef:e,stripoDialogDimensions:n,showSaving:r})=>t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[t.jsx("div",{id:"externalSystemContainer",className:"flex items-center px-4 py-2"}),r&&t.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/50 flex items-center justify-center z-50",children:t.jsx(zx,{textColor:"white",color:"white",text:["Saving..."]})}),t.jsx("div",{id:"stripoEditorContainer",ref:e,style:{width:n.width-75,height:n.height-75},className:"overflow-auto z-10"})]}),mF="UiEditorScript",gF=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{forceRecreate:!0,metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await Ja(`${Hx}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(mF))r();else{const e=document.createElement("script");e.id=mF,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),vF=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a})=>{const l=n.useRef(!1),c=n.useRef(null),{data:u,isLoading:d}=fF(e.id),{data:h,isLoading:f}=(()=>{const e=ne();return{...ue({queryKey:dF.editorData(),queryFn:hF,...Wa}),invalidateEditorData:()=>e.invalidateQueries({queryKey:dF.editorData()})}})(),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateCommunicationGroup:y}=bA();return n.useEffect((()=>{if(o&&window.UIEditor&&u?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(u.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(y({groupId:u.communicationGroupId,params:{email_html_body:t}}),v(!0))},minimize:!0,mergeTags:[],forseAmp:!1,resetDataSavedFlag:!1,disableLineHeightsReplace:!0});window.StripoEditorApi.actionsApi.save((function(e){e||m(!0)}))}}),[o,c,i,r,u,y,a]),n.useEffect((()=>{(async()=>{p&&g&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),m(!1),v(!1),r(!1))})()}),[p,g,r,i]),n.useEffect((()=>{h?.businessId&&c.current&&u&&(l.current||(gF({emailId:u.communicationGroupId,html:u.html||"<div></div>",css:u.css||"",container:c.current,businessId:h.businessId,mergeFields:h.mergeFields||[]}).catch((e=>{})),l.current=!0))}),[h,u]),t.jsx("div",d||f||!h||!u?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(zx,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(pF,{containerRef:c,stripoDialogDimensions:s,showSaving:o})})},yF=({automation:e})=>{const r=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[o,i]=n.useState(r()??null),[s,a]=n.useState(!1),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(null),[p,m]=n.useState(null),[g,v]=n.useState(!1),[y,b]=n.useState(!1),[x,w]=n.useState(null),[S,C]=n.useState(null),[k,E]=n.useState(null),[j,T]=n.useState(!1),{refetchAutomation:P}=Gx(e.id),[N,_]=n.useState(!1),D=nF(x,500),M=nF(S,500),{channelSenders:O}=mA(),{channelAccounts:R}=rF(),{getCommunicationGroup:A}=vA(),{createCommunicationForAutomation:L}=yA(e.id,e),{updateCommunicationGroup:I}=bA(),{updateChannelSender:F}=gA(),{updateAutomation:$}=Xx(e.id),[q,z]=n.useState({width:0,height:0}),[U,V]=n.useState({width:0,height:0}),B=n.useRef(null),K=e=>{c(e.email_channel_sender_id),d(e.email_subject),f(e.email_preview_text),m(e.email_html_body)};if(n.useEffect((()=>{const e=()=>{B.current&&requestAnimationFrame((()=>{V({width:B.current?B.current.offsetWidth-100:0,height:B.current?B.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[B]),n.useEffect((()=>{const e=()=>{z({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>{l&&u&&p&&!s&&(a(!0),o?I({groupId:o,params:{email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}}}):L({email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}},{onSuccess:e=>{i(e.id)}}),a(!1))}),[l,u,h,p,e.action_data,I,$,r,o,s,L]),n.useEffect((()=>{o&&A(o,{onSuccess:e=>{K(e)}})}),[r,A,e.action_data,e,o,O?.channel_senders]),n.useEffect((()=>{if(void 0!==O&&!1===j){if(!o){const e=O?.channel_senders?.filter((e=>e.channel_sender_metadata.userPart));if(e?.[0]){const t=e[0];c(t.id),t&&(w(t.channel_sender_metadata.emailFromName),C(t.channel_sender_metadata.emailReplyTo))}}T(!0)}}),[j,O?.channel_senders,o,O]),n.useEffect((()=>{if(l){const e=O?.channel_senders?.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),C(e.channel_sender_metadata.emailReplyTo))}}),[l,O]),n.useEffect((()=>{if(D){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:D}}})}}),[D,O?.channel_senders,l,F]),n.useEffect((()=>{if(M){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M))return void E("Please enter a valid email address");E(null)}if(M){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:M}}})}}),[M,O?.channel_senders,l,F,S]),n.useEffect((()=>{!1===g&&o&&(A(o,{onSuccess:e=>{K(e),B.current&&V({width:B.current.offsetWidth,height:B.current.offsetHeight})}}),P())}),[g,o,A,P,O?.channel_senders]),!R||!O)return t.jsx("div",{children:t.jsx(zx,{text:["Loading..."]})});const H=O.channel_senders?.filter((e=>e.channel_sender_metadata.userPart)),W=H?.map((e=>{const t=R.channel_accounts?.find((t=>t.id===e.channel_account_id));if(!t)return null;switch(t.channel_account_metadata.type){case oF.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`};case oF.TWILLIO:return null;default:throw gw(t.channel_account_metadata.type,oF)}})).filter((e=>null!==e));return t.jsxs("div",{className:"relative",children:[t.jsx(bE,{open:N,onOpenChange:_,children:t.jsxs(SE,{className:"min-w-[50vw] min-h-[50vh]",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Email Preview Help"}),t.jsx(kE,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(cF,{})]})}),t.jsx(bE,{open:g,onOpenChange:v,children:t.jsxs(SE,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Email Editor"}),t.jsx(kE,{children:"Learn more about the email editor and how to use it to create your email."})]}),t.jsxs("div",{className:"w-full h-full",children:[t.jsxs("div",{className:"flex justify-between items-center p-1 border-b",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Email Editor"}),t.jsx(fO,{title:"Click to learn more about email template ",onClick:()=>_(!0)})]}),t.jsx("button",{onClick:()=>b(!0),className:"text-sm bg-black text-white px-3 py-1 rounded",children:"Save"})]}),t.jsx("div",{className:" w-full",children:t.jsx(vF,{showStripoEditor:g,automation:e,setShowStripoEditor:v,saveClicked:y,setSaveClicked:b,stripoDialogDimensions:q,setCommunicationGroupId:i})})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(lF,{children:"From Email"}),t.jsxs(fM,{onValueChange:e=>{c(e)},value:l??void 0,children:[t.jsx(mM,{children:t.jsx(pM,{placeholder:"Select email",children:l?W?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(yM,{children:W?.map((e=>t.jsx(bM,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(lF,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(fO,{title:"This will be the friendly name of the sender that the customer will see in the inbox",alertText:"Changes to the sender name will be applied across all emails using this address"})]})}),t.jsx(vR,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:!l})]}),t.jsxs("div",{children:[t.jsx(lF,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(fO,{title:"This will be the email address that customer can reply to on the email",alertText:"Changes to the reply to email will be applied across all emails using this address"})]})}),t.jsx(vR,{placeholder:"Enter reply to email",value:S??"",onChange:e=>C(e.target.value),disabled:!l}),k&&t.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]}),t.jsxs("div",{children:[t.jsx(lF,{children:"Subject"}),t.jsx(vR,{placeholder:"Enter email subject",value:u??"",onChange:e=>d(e.target.value)})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(lF,{children:"Preview Text"}),t.jsx(fO,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(vR,{placeholder:"Enter preview text",value:h??"",onChange:e=>f(e.target.value)})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 h-full flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsxs("div",{children:[t.jsx(lw,{onClick:()=>v(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(W?.length??0),children:"Edit"}),0===(W?.length??0)&&t.jsx("div",{className:"relative inline-block",children:t.jsx("div",{className:"absolute right-0 top-full mt-2 w-64 p-3 bg-white border rounded-lg shadow-lg z-10",children:t.jsx(uF,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 h-full w-full",ref:B,children:t.jsx(kA,{html:p??"",height:U.height,width:U.width})})]})]})]})},bF=async()=>(await Ja("/businesses/me")).data,xF=i.forwardRef((({className:e,...n},r)=>t.jsx("textarea",{className:Dh("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n})));xF.displayName="Textarea";const wF=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(!1),s=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[a,l]=n.useState(""),[c,u]=n.useState(null),[d,h]=n.useState(!1),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(s()??null),[b,x]=n.useState(!1),[w,S]=n.useState(!1),{channelSenders:C}=mA(),{data:k,isLoading:E}={...ue({queryKey:["me"],queryFn:bF,...Wa})},{channelAccounts:j}=rF(),{createCommunicationForAutomation:T}=yA(e.id,e),{updateCommunicationGroup:P}=bA(),{getCommunicationGroup:N}=vA(),{getMergeFields:_,isGetting:D}=xA(),M=n.useRef(null),O=nF(m,1e3),R=nF(c,1e3),A=nF(f,1e3),L=e=>I?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??I?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{null===R||null===O||o||(i(!0),v?P({groupId:v,params:{sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A}}):T({sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A},{onSuccess:e=>{y(e.id)}}),i(!1))}),[R,O,A,o,v,P,T]),n.useEffect((()=>{v&&N(v,{onSuccess:e=>{u(e.sms_channel_sender_id),g(e.sms_message_body),e.text_message_company_name&&p(e.text_message_company_name)}})}),[e.action_data,v,N,k]);if(n.useEffect((()=>{if(void 0!==C&&!1===b){const e=C.channel_senders?.filter((e=>e.channel_sender_metadata.from));e?.[0]&&u(e[0].id),x(!0)}}),[C,b]),n.useEffect((()=>{f||!k?.name||d||(h(!0),p(k.name))}),[f,k?.name,d]),!j||!C||D||E)return t.jsx("div",{children:t.jsx(zx,{text:["Loading..."]})});const I=C.channel_senders?.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(bE,{open:w,onOpenChange:S,children:t.jsxs(SE,{children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"SMS Editor"}),t.jsx(kE,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx(xF,{ref:M,className:"min-h-[300px]",placeholder:"Text message content...",value:m??"",onChange:e=>{g(e.target.value)},maxLength:1600-(f?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(fM,{value:a,onValueChange:e=>{const t=M.current,n=m||"",r=t?.selectionStart??n.length,o=t?.selectionEnd??n.length,i=n.slice(0,r)+e+n.slice(o);g(i),l(""),setTimeout((()=>{const n=r+e.length;t?.focus(),t?.setSelectionRange(n,n)}),0)},children:[t.jsx(mM,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(yM,{children:_?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(bM,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(fO,{title:"Dynamic content is a way to insert dynamic content into your messages such as the customer's name, email, or other details."})]}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(m&&m.length>1400?m.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[m?m.length:0,"/",1600-(f?.length||0)," ","characters"]})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(lF,{children:"From Number"}),t.jsxs(fM,{onValueChange:e=>{u(e)},value:c??void 0,children:[t.jsx(mM,{children:t.jsx(pM,{placeholder:"Select number",children:c?L(c):"Select number"})}),t.jsx(yM,{children:I?.map((e=>t.jsx(bM,{value:e.id,children:e.channel_sender_metadata.friendlyName??e.channel_sender_metadata.from??"Select number"},e.id)))})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(lF,{children:"Company Name"}),t.jsx(fO,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(vR,{placeholder:"Enter company name",value:f??"",onChange:e=>{p(e.target.value??null)},disabled:!c})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsx("div",{children:t.jsx(lw,{onClick:()=>S(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(I?.length??0),children:"Edit"})})]}),t.jsx("div",{children:c?t.jsx(t.Fragment,{children:c&&m?t.jsx(jA,{fromPhone:L(c),body:f?`${f}:\n${m}`:m}):t.jsx(CA,{type:"sms"})}):t.jsx(uF,{type:"sms"})})]})]})]})},SF=({selectedChannels:e,setSelectedChannels:n,expandedChannels:r,setExpandedChannels:o,iconDefinitions:i})=>{const{toast:s}=Dc(),a="flex items-center gap-2 px-3 py-1.5 rounded-md transition-all duration-200";return t.jsxs("div",{className:"",children:[t.jsx("h3",{className:"text-xl",children:"Message Types"}),t.jsx("p",{className:"text-gray-600 mb-2",children:"Select the channels you want to use in this automation"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(lw,{variant:e.includes("email")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("email")?e.includes("sms")?n(["sms"]):s({title:"Cant Remove Email",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"email"]),o([...r||[],"email"]))},children:[t.jsx("span",{children:t.jsx(i.EmailIcon,{size:15})}),"Email"]}),t.jsxs(lw,{variant:e.includes("sms")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("sms")?e.includes("email")?n(["email"]):s({title:"Cant Remove SMS",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"sms"]),o([...r||[],"sms"]))},children:[t.jsx("span",{children:t.jsx(i.SmsIcon,{size:15})}),"SMS"]})]})]})},CF=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(null),[s,a]=n.useState(null),{getCommunicationGroup:l}=vA(),{updateCommunicationGroup:c}=bA(),u=n.useMemo((()=>{const t=e.action_data?.map((e=>e.action_metadata.communication_group_id));if(t&&0!==t.length&&!(t.length>1))return t[0]}),[e]);n.useEffect((()=>{const e=u;if(!e)return i(["email"]),void a(["email"]);l(e,{onSuccess:e=>{const t=[];e.email_channel_sender_id&&t.push("email"),e.sms_channel_sender_id&&t.push("sms"),i(t),a(t)}})}),[e,l,u]),n.useEffect((()=>{const e=u;e&&o&&(o.includes("email")||c({groupId:e,params:{email_channel_sender_id:null}}),o.includes("sms")||c({groupId:e,params:{sms_channel_sender_id:null}}))}),[o,u,c]);const d=e=>{a((t=>t?.includes(e)?t?.filter((t=>t!==e)):[...t||[],e]))};return o&&s?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(tF,{className:"p-4 rounded-xl shadow-none",children:t.jsx(SF,{selectedChannels:o,setSelectedChannels:i,expandedChannels:s,setExpandedChannels:a,iconDefinitions:r})}),o.includes("email")&&t.jsxs(tF,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("email"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(Fx.div,{animate:{rotate:s?.includes("email")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"Email Campaign"})]}),t.jsx(Zh,{children:s?.includes("email")&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(yF,{automation:e})})})})]}),o.includes("sms")&&t.jsxs(tF,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("sms"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(Fx.div,{animate:{rotate:s?.includes("sms")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"SMS Campaign"})]}),t.jsx(Zh,{children:s?.includes("sms")&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(wF,{automation:e,iconDefinitions:r})})})})]})]}):t.jsx("div",{className:"py-4 flex justify-center items-center",children:t.jsx(zx,{text:["Loading..."]})})},kF=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=TE({include_segments:r,exclude_segments:o});n.useEffect((()=>{c()}),[r,o]);const u=n.useMemo((()=>a?.recipients?a.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[a?.recipients]);return t.jsxs("div",{className:"w-full p-4",children:[t.jsxs("div",{className:"mb-4 md:mb-6",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:i}),s&&t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[30rem]:grid-cols-3 gap-2 md:gap-3 mb-4 md:mb-6",children:[t.jsx(Fx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block bg-blue-100/50 rounded-xl p-2.5",children:t.jsx(e.UserIcon,{className:"w-5 h-5 text-blue-600"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Total Matches"}),t.jsx("p",{className:"text-xl font-semibold text-gray-900 truncate",children:l?t.jsx("span",{className:"animate-pulse",children:"..."}):a?.count?.toLocaleString()??0})]})]})}),t.jsx(Fx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(Fx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-blue-100/50 text-blue-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.emails/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Email Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.emails}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(Fx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(Fx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-green-100/50 text-green-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.phones/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Phone Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.phones}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.phones?"contact":"contacts"})]})]})]})})]})}),!l&&a?.recipients&&t.jsx("div",{className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl border border-gray-100 overflow-hidden",children:t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-gray-100/90 backdrop-blur-sm",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Name"}),t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Contact"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-200/50",children:a.recipients.map(((e,n)=>t.jsxs("tr",{className:"hover:bg-white/50 transition-colors",children:[t.jsxs("td",{className:"px-3 sm:px-4 py-3 text-sm text-gray-900",children:[e.first_name," ",e.last_name]}),t.jsx("td",{className:"px-3 sm:px-4 py-3",children:t.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[e.email&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg",children:"Email"}),e.phone&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg",children:"Phone"})]})})]},n)))})]})})})]})};function EF(e){return(EF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jF(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function TF(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function PF(e){TF(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===EF(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function NF(e,t){TF(2,arguments);var n=PF(e),r=jF(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function _F(e,t){TF(2,arguments);var n=PF(e),r=jF(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var DF={};function MF(){return DF}function OF(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=PF(e),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function RF(e){return TF(1,arguments),OF(e,{weekStartsOn:1})}function AF(e){TF(1,arguments);var t=function(e){TF(1,arguments);var t=PF(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=RF(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=RF(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),RF(n)}function LF(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function IF(e){TF(1,arguments);var t=PF(e);return t.setHours(0,0,0,0),t}function FF(e,t){TF(2,arguments);var n=IF(e),r=IF(t),o=n.getTime()-LF(n),i=r.getTime()-LF(r);return Math.round((o-i)/864e5)}function $F(e,t){return TF(2,arguments),NF(e,7*jF(t))}function qF(e,t){return TF(2,arguments),_F(e,12*jF(t))}function zF(e,t){TF(2,arguments);var n=IF(e),r=IF(t);return n.getTime()===r.getTime()}function UF(e){return TF(1,arguments),e instanceof Date||"object"===EF(e)&&"[object Date]"===Object.prototype.toString.call(e)}function VF(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function BF(e){TF(1,arguments);var t=PF(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function KF(e){TF(1,arguments);var t=PF(e);return t.setDate(1),t.setHours(0,0,0,0),t}function HF(e){TF(1,arguments);var t=PF(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function WF(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=PF(e),f=h.getDay(),p=6+(f<d?-7:0)-(f-d);return h.setDate(h.getDate()+p),h.setHours(23,59,59,999),h}function GF(e){return TF(1,arguments),WF(e,{weekStartsOn:1})}function YF(e,t){return TF(2,arguments),function(e,t){TF(2,arguments);var n=PF(e).getTime(),r=jF(t);return new Date(n+r)}(e,-jF(t))}function QF(e){TF(1,arguments);var t=PF(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function XF(e){TF(1,arguments);var t=PF(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=QF(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=QF(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function JF(e){TF(1,arguments);var t=PF(e),n=QF(t).getTime()-function(e){TF(1,arguments);var t=XF(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),QF(n)}(t).getTime();return Math.round(n/6048e5)+1}function ZF(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=PF(e),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function e$(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=PF(e),d=u.getUTCFullYear(),h=MF(),f=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var m=ZF(p,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var v=ZF(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function t$(e,t){TF(1,arguments);var n=PF(e),r=ZF(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=e$(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),ZF(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function n$(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var r$=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return n$("yy"===t?r%100:r,t.length)},o$=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):n$(n+1,2)},i$=function(e,t){return n$(e.getUTCDate(),t.length)},s$=function(e,t){return n$(e.getUTCHours()%12||12,t.length)},a$=function(e,t){return n$(e.getUTCHours(),t.length)},l$=function(e,t){return n$(e.getUTCMinutes(),t.length)},c$=function(e,t){return n$(e.getUTCSeconds(),t.length)},u$=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return n$(Math.floor(r*Math.pow(10,n-3)),t.length)},d$="midnight",h$="noon",f$="morning",p$="afternoon",m$="evening",g$="night",v$={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return r$(e,t)},Y:function(e,t,n,r){var o=e$(e,r),i=o>0?o:1-o;return"YY"===t?n$(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):n$(i,t.length)},R:function(e,t){return n$(XF(e),t.length)},u:function(e,t){return n$(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return n$(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return n$(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return o$(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return n$(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=t$(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):n$(o,t.length)},I:function(e,t,n){var r=JF(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):n$(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):i$(e,t)},D:function(e,t,n){var r=function(e){TF(1,arguments);var t=PF(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime();return Math.floor((n-r)/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):n$(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return n$(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return n$(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return n$(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?h$:0===o?d$:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?m$:o>=12?p$:o>=4?f$:g$,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return s$(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):a$(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):n$(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):n$(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):l$(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):c$(e,t)},S:function(e,t){return u$(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return b$(o);case"XXXX":case"XX":return x$(o);default:return x$(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return b$(o);case"xxxx":case"xx":return x$(o);default:return x$(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+y$(o,":");default:return"GMT"+x$(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+y$(o,":");default:return"GMT"+x$(o,":")}},t:function(e,t,n,r){return n$(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return n$((r._originalDate||e).getTime(),t.length)}};function y$(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var s=t;return n+String(o)+s+n$(i,2)}function b$(e,t){return e%60==0?(e>0?"-":"+")+n$(Math.abs(e)/60,2):x$(e,t)}function x$(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+n$(Math.floor(o/60),2)+n+n$(o%60,2)}var w$=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},S$=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},C$={p:S$,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return w$(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",w$(o,t)).replace("{{time}}",S$(i,t))}},k$=["D","DD"],E$=["YY","YYYY"];function j$(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var T$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function P$(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var N$={date:P$({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:P$({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:P$({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},_$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function D$(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var M$={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:D$({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:D$({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:D$({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:D$({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:D$({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function O$(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;var i,s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(a,(function(e){return e.test(s)}));return i=e.valueCallback?e.valueCallback(l):l,{value:i=n.valueCallback?n.valueCallback(i):i,rest:t.slice(s.length)}}}var R$={ordinalNumber:function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:O$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:O$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:O$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:O$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:O$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},A$={code:"en-US",formatDistance:function(e,t,n){var r,o=T$[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:N$,formatRelative:function(e,t,n,r){return _$[e]},localize:M$,match:R$,options:{weekStartsOn:0,firstWeekContainsDate:1}},L$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,I$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,F$=/^'([^]*?)'?$/,$$=/''/g,q$=/[a-zA-Z]/;function z$(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x;TF(2,arguments);var w=String(t),S=MF(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:A$,k=jF(null!==(i=null!==(s=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:S.firstWeekContainsDate)&&void 0!==s?s:null===(d=S.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=jF(null!==(f=null!==(p=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:S.weekStartsOn)&&void 0!==p?p:null===(b=S.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var j=PF(e);if(!function(e){if(TF(1,arguments),!UF(e)&&"number"!=typeof e)return!1;var t=PF(e);return!isNaN(Number(t))}(j))throw new RangeError("Invalid time value");var T=YF(j,LF(j)),P={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:j};return w.match(I$).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,C$[t])(e,C.formatLong):e})).join("").match(L$).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(F$);if(!t)return e;return t[1].replace($$,"'")}(r);var i=v$[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===E$.indexOf(r)||j$(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==k$.indexOf(e)}(r)||j$(r,t,String(e)),i(T,r,C.localize,P);if(o.match(q$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function U$(e){return TF(1,arguments),Math.floor(function(e){return TF(1,arguments),PF(e).getTime()}(e)/1e3)}function V$(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=MF(),d=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=function(e,t){var n,r,o,i,s,a,l,c;TF(1,arguments);var u=PF(e),d=u.getFullYear(),h=MF(),f=jF(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var m=OF(p,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var v=OF(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(h,0,d),f.setHours(0,0,0,0),OF(f,t)}function B$(e,t){return TF(1,arguments),function(e,t,n){TF(2,arguments);var r=OF(e,n),o=OF(t,n),i=r.getTime()-LF(r),s=o.getTime()-LF(o);return Math.round((i-s)/6048e5)}(function(e){TF(1,arguments);var t=PF(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),KF(e),t)+1}function K$(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getTime()>r.getTime()}function H$(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getTime()<r.getTime()}function W$(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function G$(e,t){return TF(2,arguments),NF(e,-jF(t))}function Y$(e,t){TF(2,arguments);var n=PF(e),r=jF(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=function(e){TF(1,arguments);var t=PF(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return n.setMonth(r,Math.min(i,a)),n}function Q$(e,t){TF(2,arguments);var n=PF(e),r=jF(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var X$=function(){return X$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},X$.apply(this,arguments)};function J$(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Z$(e){return"multiple"===e.mode}function eq(e){return"range"===e.mode}function tq(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var nq={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var rq=Object.freeze({__proto__:null,formatCaption:function(e,t){return z$(e,"LLLL y",t)},formatDay:function(e,t){return z$(e,"d",t)},formatMonthCaption:function(e,t){return z$(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return z$(e,"cccccc",t)},formatYearCaption:function(e,t){return z$(e,"yyyy",t)}}),oq=Object.freeze({__proto__:null,labelDay:function(e,t,n){return z$(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return z$(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var iq=n.createContext(void 0);function sq(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:nq,formatters:rq,labels:oq,locale:A$,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},s=function(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=KF(r):t&&(i=new Date(t,0,1)),o?s=BF(o):n&&(s=new Date(n,11,31)),{fromDate:i?IF(i):void 0,toDate:s?IF(s):void 0}}(o),a=s.fromDate,l=s.toDate,c=null!==(n=o.captionLayout)&&void 0!==n?n:i.captionLayout;"buttons"===c||a&&l||(c="buttons"),(tq(o)||Z$(o)||eq(o))&&(r=o.onSelect);var u=X$(X$(X$({},i),o),{captionLayout:c,classNames:X$(X$({},i.classNames),o.classNames),components:X$({},o.components),formatters:X$(X$({},i.formatters),o.formatters),fromDate:a,labels:X$(X$({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:X$(X$({},i.modifiers),o.modifiers),modifiersClassNames:X$(X$({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:X$(X$({},i.styles),o.styles),toDate:l});return t.jsx(iq.Provider,{value:u,children:e.children})}function aq(){var e=n.useContext(iq);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function lq(e){var n=aq();return t.jsx("div",{className:n.classNames.caption_label,style:n.styles.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:(0,n.formatters.formatCaption)(e.displayMonth,{locale:n.locale})})}function cq(e){return t.jsx("svg",X$({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function uq(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=aq(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:cq;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:o,children:s}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function dq(e){var n,r=aq(),o=r.fromDate,i=r.toDate,s=r.styles,a=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});var h=[];if(function(e,t){TF(2,arguments);var n=PF(e),r=PF(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=KF(o),p=o.getMonth();p<=i.getMonth();p++)h.push(Y$(f,p));else for(f=KF(new Date),p=0;p<=11;p++)h.push(Y$(f,p));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:uq;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=Y$(KF(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:a}),children:h.map((function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:a})},e.getMonth())}))})}function hq(e){var n,r=e.displayMonth,o=aq(),i=o.fromDate,s=o.toDate,a=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,h=o.labels.labelYearDropdown,f=[];if(!i)return t.jsx(t.Fragment,{});if(!s)return t.jsx(t.Fragment,{});for(var p=i.getFullYear(),m=s.getFullYear(),g=p;g<=m;g++)f.push(Q$(HF(new Date),g));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:uq;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=Q$(KF(r),Number(t.target.value));e.onChange(n)},value:r.getFullYear(),caption:d(r,{locale:a}),children:f.map((function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:a})},e.getFullYear())}))})}function fq(){var e=aq(),t=function(e){var t=e.month||e.defaultMonth||e.today||new Date,n=e.toDate,r=e.fromDate,o=e.numberOfMonths,i=void 0===o?1:o;return n&&VF(n,t)<0&&(t=_F(n,-1*(i-1))),r&&VF(t,r)<0&&(t=r),KF(t)}(e),r=function(e,t){var r=n.useState(e);return[void 0===t?r[0]:t,r[1]]}(t,e.month),o=r[1];return[r[0],function(t){var n;if(!e.disableNavigation){var r=KF(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var pq=n.createContext(void 0);function mq(e){var n=aq(),r=fq(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=KF(e),i=VF(KF(_F(o,r)),o),s=[],a=0;a<i;a++){var l=_F(o,a);s.push(l)}return n&&(s=s.reverse()),s}(o,n),a=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.numberOfMonths,o=void 0===r?1:r,i=t.pagedNavigation?o:1,s=KF(e);if(!n)return _F(s,i);if(!(VF(n,e)<o))return _F(s,i)}}(o,n),l=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.numberOfMonths,o=t.pagedNavigation?void 0===r?1:r:1,i=KF(e);if(!n)return _F(i,-o);if(!(VF(i,n)<=0))return _F(i,-o)}}(o,n),c=function(e){return s.some((function(t){return W$(e,t)}))};return t.jsx(pq.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&H$(e,t)?i(_F(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function gq(){var e=n.useContext(pq);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function vq(e){var n,r=aq(),o=r.classNames,i=r.styles,s=r.components,a=gq().goToMonth,l=function(t){a(_F(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:lq,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:i.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(dq,{onChange:l,displayMonth:e.displayMonth}),t.jsx(hq,{onChange:l,displayMonth:e.displayMonth})]})}function yq(e){return t.jsx("svg",X$({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function bq(e){return t.jsx("svg",X$({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var xq=n.forwardRef((function(e,n){var r=aq(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=X$(X$({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",X$({},e,{ref:n,type:"button",className:a,style:l}))}));function wq(e){var n,r,o=aq(),i=o.dir,s=o.locale,a=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,h=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var f=u(e.previousMonth,{locale:s}),p=[a.nav_button,a.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:s}),g=[a.nav_button,a.nav_button_next].join(" "),v=null!==(n=null==h?void 0:h.IconRight)&&void 0!==n?n:bq,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:yq;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(xq,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:t.jsx("rtl"===i?v:y,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(xq,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:t.jsx("rtl"===i?y:v,{className:a.nav_icon,style:l.nav_icon})})]})}function Sq(e){var n=aq().numberOfMonths,r=gq(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return W$(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(wq,{displayMonth:e.displayMonth,hideNext:n>1&&(c||!u),hidePrevious:n>1&&(u||!c),nextMonth:i,previousMonth:o,onPreviousClick:function(){o&&s(o)},onNextClick:function(){i&&s(i)}})}function Cq(e){var n,r,o=aq(),i=o.classNames,s=o.styles,a=o.captionLayout,l=o.components,c=null!==(n=null==l?void 0:l.CaptionLabel)&&void 0!==n?n:lq;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(vq,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(vq,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(Sq,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(Sq,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function kq(e){var n=aq(),r=n.footer;return r?t.jsx("tfoot",{className:n.classNames.tfoot,style:n.styles.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:r})})}):t.jsx(t.Fragment,{})}function Eq(){var e=aq(),n=e.classNames,r=e.styles,o=e.showWeekNumber,i=e.locale,s=e.formatters.formatWeekdayName,a=e.labels.labelWeekday,l=function(e,t,n){for(var r=n?RF(new Date):OF(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=NF(r,i);o.push(s)}return o}(i,e.weekStartsOn,e.ISOWeek);return t.jsxs("tr",{style:r.head_row,className:n.head_row,children:[o&&t.jsx("td",{style:r.head_cell,className:n.head_cell}),l.map((function(e,o){return t.jsx("th",{scope:"col",className:n.head_cell,style:r.head_cell,"aria-label":a(e,{locale:i}),children:s(e,{locale:i})},o)}))]})}function jq(){var e,n=aq(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:Eq;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function Tq(e){var n=aq();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var Pq=n.createContext(void 0);function Nq(e){if(!Z$(e.initialProps)){return t.jsx(Pq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(_q,{initialProps:e.initialProps,children:e.children})}function _q(e){var n=e.initialProps,r=e.children,o=n.selected,i=n.min,s=n.max,a={disabled:[]};return o&&a.disabled.push((function(e){var t=s&&o.length>s-1,n=o.some((function(t){return zF(t,e)}));return Boolean(t&&!n)})),t.jsx(Pq.Provider,{value:{selected:o,onDayClick:function(e,t,r){var a,l;if((null===(a=n.onDayClick)||void 0===a||a.call(n,e,t,r),!Boolean(t.selected&&i&&(null==o?void 0:o.length)===i))&&!Boolean(!t.selected&&s&&(null==o?void 0:o.length)===s)){var c=o?J$([],o):[];if(t.selected){var u=c.findIndex((function(t){return zF(e,t)}));c.splice(u,1)}else c.push(e);null===(l=n.onSelect)||void 0===l||l.call(n,c,e,t,r)}},modifiers:a},children:r})}function Dq(){var e=n.useContext(Pq);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var Mq,Oq,Rq=n.createContext(void 0);function Aq(e){if(!eq(e.initialProps)){return t.jsx(Rq.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(Lq,{initialProps:e.initialProps,children:e.children})}function Lq(e){var n=e.initialProps,r=e.children,o=n.selected,i=o||{},s=i.from,a=i.to,l=n.min,c=n.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],a?(u.range_end=[a],zF(s,a)||(u.range_middle=[{after:s,before:a}])):u.range_end=[s]):a&&(u.range_start=[a],u.range_end=[a]),l&&(s&&!a&&u.disabled.push({after:G$(s,l-1),before:NF(s,l-1)}),s&&a&&u.disabled.push({after:s,before:NF(s,l-1)}),!s&&a&&u.disabled.push({after:G$(a,l-1),before:NF(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:NF(s,1-c)}),u.disabled.push({after:NF(s,c-1)})),s&&a){var d=c-(FF(a,s)+1);u.disabled.push({before:G$(s,d)}),u.disabled.push({after:NF(a,d)})}!s&&a&&(u.disabled.push({before:NF(a,1-c)}),u.disabled.push({after:NF(a,c-1)}))}return t.jsx(Rq.Provider,{value:{selected:o,onDayClick:function(e,t,r){var i,s;null===(i=n.onDayClick)||void 0===i||i.call(n,e,t,r);var a=function(e,t){var n=t||{},r=n.from,o=n.to;if(r&&o){if(zF(o,e)&&zF(r,e))return;if(zF(o,e))return{from:o,to:void 0};if(zF(r,e))return;return K$(r,e)?{from:e,to:o}:{from:r,to:e}}return o?K$(e,o)?{from:o,to:e}:{from:e,to:o}:r?H$(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,o);null===(s=n.onSelect)||void 0===s||s.call(n,a,e,t,r)},modifiers:u},children:r})}function Iq(){var e=n.useContext(Rq);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Fq(e){return Array.isArray(e)?J$([],e):void 0!==e?[e]:[]}(Oq=Mq||(Mq={})).Outside="outside",Oq.Disabled="disabled",Oq.Selected="selected",Oq.Hidden="hidden",Oq.Today="today",Oq.RangeStart="range_start",Oq.RangeEnd="range_end",Oq.RangeMiddle="range_middle";var $q=Mq.Selected,qq=Mq.Disabled,zq=Mq.Hidden,Uq=Mq.Today,Vq=Mq.RangeEnd,Bq=Mq.RangeMiddle,Kq=Mq.RangeStart,Hq=Mq.Outside;var Wq=n.createContext(void 0);function Gq(e){var n=aq(),r=function(e,t,n){var r,o=((r={})[$q]=Fq(e.selected),r[qq]=Fq(e.disabled),r[zq]=Fq(e.hidden),r[Uq]=[e.today],r[Vq]=[],r[Bq]=[],r[Kq]=[],r[Hq]=[],r);return e.fromDate&&o[qq].push({before:e.fromDate}),e.toDate&&o[qq].push({after:e.toDate}),Z$(e)?o[qq]=o[qq].concat(t.modifiers[qq]):eq(e)&&(o[qq]=o[qq].concat(n.modifiers[qq]),o[Kq]=n.modifiers[Kq],o[Bq]=n.modifiers[Bq],o[Vq]=n.modifiers[Vq]),o}(n,Dq(),Iq()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=Fq(e[1])})),t}(n.modifiers),i=X$(X$({},r),o);return t.jsx(Wq.Provider,{value:i,children:e.children})}function Yq(){var e=n.useContext(Wq);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Qq(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(UF(t))return zF(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(UF)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return n=e,s=(r=t).to,(i=r.from)&&s?(FF(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),FF(n,i)>=0&&FF(s,n)>=0):s?zF(s,n):!!i&&zF(i,n);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var a=FF(t.before,e)>0,l=FF(t.after,e)<0;return K$(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?FF(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?FF(t.before,e)>0:"function"==typeof t&&t(e)}))}function Xq(e,t,n){var r=Object.keys(t).reduce((function(n,r){return Qq(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!W$(e,n)&&(o.outside=!0),o}function Jq(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=void 0===s?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,h={day:NF,week:$F,month:_F,year:qF,startOfWeek:function(e){return o.ISOWeek?RF(e):OF(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?GF(e):WF(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(TF(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==EF(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=PF(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)})),n||new Date(NaN)}([c,h]):"after"===r&&u&&(h=function(e){var t,n;if(TF(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==EF(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=PF(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=Xq(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:Jq(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:X$(X$({},a),{count:a.count+1})})}var Zq=n.createContext(void 0);function ez(e){var r=gq(),o=Yq(),i=n.useState(),s=i[0],a=i[1],l=n.useState(),c=l[0],u=l[1],d=function(e,t){for(var n,r,o=KF(e[0]),i=BF(e[e.length-1]),s=o;s<=i;){var a=Xq(s,t);if(a.disabled||a.hidden)s=NF(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=NF(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=aq(),m=function(e,t){if(s){var n=Jq(s,{moveBy:e,direction:t,context:p,modifiers:o});zF(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(Zq.Provider,{value:{focusedDay:s,focusTarget:h,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}},children:e.children})}function tz(){var e=n.useContext(Zq);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var nz=n.createContext(void 0);function rz(e){if(!tq(e.initialProps)){return t.jsx(nz.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(oz,{initialProps:e.initialProps,children:e.children})}function oz(e){var n=e.initialProps;return t.jsx(nz.Provider,{value:{selected:n.selected,onDayClick:function(e,t,r){var o,i,s;null===(o=n.onDayClick)||void 0===o||o.call(n,e,t,r),!t.selected||n.required?null===(s=n.onSelect)||void 0===s||s.call(n,e,e,t,r):null===(i=n.onSelect)||void 0===i||i.call(n,void 0,e,t,r)}},children:e.children})}function iz(){var e=n.useContext(nz);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function sz(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(Mq).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function az(e,r,o){var i,s,a,l=aq(),c=tz(),u=function(e,t){return Xq(e,Yq(),t)}(e,r),d=function(e,t){var n=aq(),r=iz(),o=Dq(),i=Iq(),s=tz(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,f=s.focusMonthBefore,p=s.focusMonthAfter,m=s.focusYearBefore,g=s.focusYearAfter,v=s.focusStartOfWeek,y=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;tq(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):Z$(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):eq(n)?null===(c=i.onDayClick)||void 0===c||c.call(i,e,t,s):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,s)},onFocus:function(r){var o;h(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,r)},onBlur:function(r){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,r)},onKeyDown:function(r){var o;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?a():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():a();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():p();break;case"Home":r.preventDefault(),r.stopPropagation(),v();break;case"End":r.preventDefault(),r.stopPropagation(),y()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,r)},onKeyUp:function(r){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,r)},onMouseEnter:function(r){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,r)},onMouseLeave:function(r){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,r)},onPointerEnter:function(r){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,r)},onPointerLeave:function(r){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,r)},onTouchCancel:function(r){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,r)},onTouchEnd:function(r){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,r)},onTouchMove:function(r){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,r)},onTouchStart:function(r){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,r)}}}(e,u),h=function(){var e=aq(),t=iz(),n=Dq(),r=Iq();return tq(e)?t.selected:Z$(e)?n.selected:eq(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&zF(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=sz(l,u).join(" "),m=function(e,t){var n=X$({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=X$(X$({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),g=Boolean(u.outside&&!l.showOutsideDays||u.hidden),v=null!==(a=null===(s=l.components)||void 0===s?void 0:s.DayContent)&&void 0!==a?a:Tq,y={style:m,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&zF(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&zF(c.focusedDay,e),w=X$(X$(X$({},y),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=x||b?0:-1,i)),d);return{isButton:f,isHidden:g,activeModifiers:u,selectedDays:h,buttonProps:w,divProps:y}}function lz(e){var r=n.useRef(null),o=az(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(xq,X$({name:"day",ref:r},o.buttonProps)):t.jsx("div",X$({},o.divProps))}function cz(e){var n=e.number,r=e.dates,o=aq(),i=o.onWeekNumberClick,s=o.styles,a=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(n),{locale:l});if(!i)return t.jsx("span",{className:a.weeknumber,style:s.weeknumber,children:u});var d=c(Number(n),{locale:l});return t.jsx(xq,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function uz(e){var n,r,o,i=aq(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:lz,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:cz;return i.showWeekNumber&&(o=t.jsx("td",{className:a.cell,style:s.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:a.row,style:s.row,children:[o,e.dates.map((function(n){return t.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:t.jsx(c,{displayMonth:e.displayMonth,date:n})},U$(n))}))]})}function dz(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?GF(t):WF(t,n),o=(null==n?void 0:n.ISOWeek)?RF(e):OF(e,n),i=FF(r,o),s=[],a=0;a<=i;a++)s.push(NF(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){TF(1,arguments);var t=PF(e),n=RF(t).getTime()-AF(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){TF(1,arguments);var n=PF(e),r=OF(n,t).getTime()-V$(n,t).getTime();return Math.round(r/6048e5)+1}(t,n),o=e.find((function(e){return e.weekNumber===r}));return o?(o.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)}),[]);return l}function hz(e){var n,r,o,i=aq(),s=i.locale,a=i.classNames,l=i.styles,c=i.hideHead,u=i.components,d=i.weekStartsOn,h=i.firstWeekContainsDate,f=i.ISOWeek,p=function(e,t){var n=dz(KF(e),BF(e),t);if(null==t?void 0:t.useFixedWeeks){var r=B$(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=$F(i,6-r),a=dz($F(i,1),s,t);n.push.apply(n,a)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(i.fixedWeeks),ISOWeek:f,locale:s,weekStartsOn:d,firstWeekContainsDate:h}),m=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:jq,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:uz,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:kq;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(m,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:p.map((function(n){return t.jsx(g,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(v,{displayMonth:e.displayMonth})]})}var fz="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,pz=!1,mz=0;function gz(){return"react-day-picker-".concat(++mz)}function vz(e){var r,o,i=aq(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=gq().displayMonths,d=function(e){var t,r=null!=e?e:pz?gz():null,o=n.useState(r),i=o[0],s=o[1];return fz((function(){null===i&&s(gz())}),[]),n.useEffect((function(){!1===pz&&(pz=!0)}),[]),null!==(t=null!=e?e:i)&&void 0!==t?t:void 0}(i.id?"".concat(i.id,"-").concat(e.displayIndex):void 0),h=i.id?"".concat(i.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],p=l.month,m=0===e.displayIndex,g=e.displayIndex===u.length-1,v=!m&&!g;"rtl"===s&&(g=(r=[m,g])[0],m=r[1]),m&&(f.push(a.caption_start),p=X$(X$({},p),l.caption_start)),g&&(f.push(a.caption_end),p=X$(X$({},p),l.caption_end)),v&&(f.push(a.caption_between),p=X$(X$({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:Cq;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(hz,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function yz(e){var n=aq();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function bz(e){var r,o,i=e.initialProps,s=aq(),a=tz(),l=gq(),c=n.useState(!1),u=c[0],d=c[1];n.useEffect((function(){s.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),d(!0)))}),[s.initialFocus,u,a.focus,a.focusTarget,a]);var h=[s.classNames.root,s.className];s.numberOfMonths>1&&h.push(s.classNames.multiple_months),s.showWeekNumber&&h.push(s.classNames.with_weeknumber);var f=X$(X$({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return X$(X$({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:yz;return t.jsx("div",X$({className:h.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},p,{children:t.jsx(m,{children:l.displayMonths.map((function(e,n){return t.jsx(vz,{displayIndex:n,displayMonth:e},n)}))})}))}function xz(e){var n=e.children,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children"]);return t.jsx(sq,{initialProps:r,children:t.jsx(mq,{children:t.jsx(rz,{initialProps:r,children:t.jsx(Nq,{initialProps:r,children:t.jsx(Aq,{initialProps:r,children:t.jsx(Gq,{children:t.jsx(ez,{children:n})})})})})})})}function wz(e){return t.jsx(xz,X$({},e,{children:t.jsx(bz,{initialProps:e})}))}function Sz({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(wz,{showOutsideDays:r,className:Dh("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Dh(aw({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:Dh("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===o.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:Dh(aw({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:()=>t.jsx(dd,{className:"h-4 w-4"}),IconRight:()=>t.jsx(hd,{className:"h-4 w-4"})},...o})}Sz.displayName="Calendar";const Cz=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(A_,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(L_,{asChild:!0,children:t.jsxs(lw,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(pd,{className:"opacity-50"})]})}),t.jsx(I_,{className:"w-[200px] p-0",children:t.jsxs(ZT,{children:[t.jsx(eP,{placeholder:r,className:"h-9"}),t.jsxs(tP,{children:[t.jsx(nP,{children:o}),t.jsx(rP,{children:e.map((e=>t.jsxs(iP,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(cd,{className:Dh("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},kz=({automation:e})=>{const r=()=>e.trigger_metadata?.scheduled_at?new Date(e.trigger_metadata.scheduled_at):TO(new Date,15),[o,s]=i.useState(r()),[a,l]=i.useState(r()<new Date?"Please select a time in the future":null),[c,u]=i.useState(pR(o,"HH:mm")),{updateAutomation:d}=Xx(e.id),[h,f]=i.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),p=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=TO(new Date,15);new Date(e.toLocaleString("en-US",{timeZone:h}))<new Date(t.toLocaleString("en-US",{timeZone:h}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(e))};return n.useEffect((()=>{const e=new Date(o.toLocaleString("en-US",{timeZone:h})),t=-e.getTimezoneOffset(),n=Math.floor(Math.abs(t)/60).toString().padStart(2,"0"),r=(Math.abs(t)%60).toString().padStart(2,"0"),i=t>=0?"+":"-",s=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:00${i}${n}:${r}`;d({trigger:{trigger_type:Zx.ONE_TIME,scheduled_at:s,timezone:h}})}),[o,h,d]),t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full ",children:[t.jsxs(A_,{children:[t.jsx(L_,{asChild:!0,children:t.jsxs(lw,{variant:"outline",className:Dh("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(ld,{className:"mr-2 h-4 w-4"}),o?pR(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(I_,{className:"w-auto p-0",children:t.jsx(Sz,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=c.split(":").map(Number);e.setHours(t,n),m(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:c,onChange:e=>{if(u(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),m(r)}},className:Dh("flex h-9 w-full sm:w-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"border-red-500")}),t.jsx(Cz,{data:p,placeholder:"Select timezone...",searchPlaceholder:"Search timezone...",noResultsMessage:"No timezone found",value:h,setValue:e=>{const t=new Date(o.toLocaleString("en-US",{timeZone:e})),n=TO(new Date,15);t<new Date(n.toLocaleString("en-US",{timeZone:e}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(t),f(e))}})]}),a&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),a]})]})},Ez=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(Fx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(dw,{selected:"sendNow"===i,title:"Send Now",subtitle:"Campaign will begin sending in 5 minutes",icon:t.jsx(e.SendButton,{}),onClick:()=>{s("sendNow"),o({trigger:{trigger_type:Zx.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(dw,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(Zh,{children:"schedule"===i&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mt-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center",children:t.jsx(kz,{automation:r})})})})]}),r.trigger_metadata.scheduled_at&&t.jsxs(Fx.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.6,ease:[.23,1,.32,1],delay:.1},className:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(Fx.p,{initial:{opacity:0},animate:{opacity:.8},transition:{delay:.3,duration:.4},className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx(Fx.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.4},className:"text-md font-bold text-gray-800",children:new Date(r.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short",timeZone:r.trigger_metadata.timezone||void 0})})]})]})})})},jz=({automation:e,iconDefinitions:r,loading:o})=>{const i=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),{updateAutomation:s}=Xx(e.id),[a,l]=n.useState(!1),c=i(),{getCommunicationGroup:u}=vA(),{channelSenders:d}=mA(),{channelAccounts:h}=rF(),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(null),[b,x]=n.useState(null);return n.useEffect((()=>{d&&y(d),h&&x(h)}),[d,h]),n.useEffect((()=>{c?u(c,{onSuccess:e=>{const t=e.email_channel_sender_id,n=e.sms_channel_sender_id,r=v?.channel_senders.find((e=>e.id===t)),o=v?.channel_senders.find((e=>e.id===n));if(r&&e.email_subject&&e.email_html_body){const t=r.channel_sender_metadata?.userPart,n=b?.channel_accounts.find((e=>e.id===r.channel_account_id));if(n)switch(n.channel_account_metadata.type){case oF.REACH_MANAGED:p({fromEmail:`${t}@${n.channel_account_metadata.baseDomain}.embedreach.com`,fromName:r.channel_sender_metadata.emailFromName,subject:e.email_subject,previewText:e.email_preview_text,body:e.email_html_body});break;case oF.TWILLIO:break;default:throw gw(n.channel_account_metadata.type,oF)}}if(o){const t=v?.channel_senders.find((e=>e.id===n));t&&e.sms_message_body&&(t.channel_sender_metadata?.from||t.channel_sender_metadata?.messageServiceSid)&&g({fromPhone:SA(t.channel_sender_metadata),body:e.sms_message_body,companyName:e.text_message_company_name})}l(!0)},onError:()=>{l(!0)}}):l(!0)}),[b?.channel_accounts,v?.channel_senders,c,u]),o||!a?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(zx,{text:["Loading..."]})}):f||m?t.jsxs("div",{className:"max-w-8xl mx-auto p-6 gap-4 grid",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsx(TA,{emailPreview:f,smsPreview:m,iconDefinitions:r}),t.jsx(kF,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),t.jsx(tF,{className:"p-4 shadow-sm border-none",children:t.jsx(Ez,{automation:e,iconDefinitions:r,updateAutomation:s})})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},Tz=({iconDefinitions:e,onSelectionChange:r,defaultValue:o="all"})=>{const[i,s]=n.useState(o),a=e=>{s(e),r?.(e)};return t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx(dw,{onClick:()=>a("all"),title:"All patrons",subtitle:"Send to everyone",icon:t.jsx(e.UsersIcon,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"all"===i}),t.jsx(dw,{onClick:()=>a("segments"),title:"Select patrons",subtitle:"Choose from segments",icon:t.jsx(e.UserEdit,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"segments"===i})]})},Pz=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(Y_,{selectedValues:l,setSelectedValues:c,options:u,defaultValue:e,onValueChange:t=>{const n=t.filter((t=>!e.includes(t))),r=e.filter((e=>!t.includes(e)));n.forEach(o),r.forEach(i)},placeholder:"Select segments",maxCount:5,extraCommandItems:[e=>t.jsxs(iP,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Nz=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Pz,{segments:r,allSegments:l?.segments||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(lw,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(Fx.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(Zh,{children:u&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{},children:t.jsx(Pz,{segments:o,allSegments:l?.segments||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},_z=({iconDefinitions:e,automation:r})=>{const{toast:o}=Dc(),[i,s]=n.useState(!1),[a,l]=n.useState(!1),{segments:c,isLoading:u,refetchSegments:d}=(()=>{const e=ue({queryKey:["segments"],queryFn:()=>EE()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:h}=Xx(r.id),[f,p]=n.useState(r.includeSegmentIds||[]),[m,g]=n.useState(r.excludeSegmentIds||[]),v=1===f.length&&0===m.length&&void 0!==c?.segments?.find((e=>e.type===DE.ALL_USERS&&e.id===f[0])),[y,b]=n.useState(v?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(f)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(m))&&h({include_segments:f,exclude_segments:m})}),[f,m,r.includeSegmentIds,r.excludeSegmentIds,h]);const x=n.useCallback((()=>c?.segments?.find((e=>e.type===DE.ALL_USERS))),[c]);return n.useEffect((()=>{if("all"===y&&c){const e=x();e&&p([e.id]),g([])}}),[y,c,x]),n.useEffect((()=>{if(!a&&c){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){b("all");const e=x();return e&&h({include_segments:[e.id],exclude_segments:[]}),void l(!0)}b(v?"all":"segments"),l(!0)}}),[y,f.length,m.length,c,a,v,x,h,r.includeSegmentIds,r.excludeSegmentIds]),!u&&c&&a?t.jsxs("div",{className:"p-3 w-full h-full flex items-center justify-center",children:[t.jsx(bE,{open:i,modal:!0,onOpenChange:s,children:t.jsxs(SE,{hideCloseButton:!0,children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Create Segment"}),t.jsx(kE,{children:"Create a new segment to use in your automation."})]}),t.jsx(jM,{iconDefinitions:e,onClose:e=>{var t;"error"===e?(o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),s(!1)):!1===e?s(!1):e&&(t=e,d(),p((e=>[...e,t])),s(!1))}})]})}),t.jsx("div",{className:" w-full",children:t.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[t.jsxs(Fx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" flex flex-col items-center justify-center",children:[t.jsx(Tz,{iconDefinitions:e,onSelectionChange:e=>{b(e)},defaultValue:y}),t.jsx(Zh,{mode:"wait",children:"segments"===y&&t.jsx(Fx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:"easeInOut"},className:"mt-4 w-full",children:t.jsx(Nz,{iconDefinitions:e,includedSegments:f,excludedSegments:m,handleAddSegment:(e,t)=>{"include"===t?p((t=>[...t,e])):g((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?p((t=>t.filter((t=>t!==e)))):g((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:s,segments:c,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(Fx.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:" rounded-lg p-8 flex flex-col justify-start h-full shadow-sm",children:t.jsx(kF,{iconDefinitions:e,includeSegments:f,excludeSegments:m,title:"Estimated Matches",subtitle:"The number of recipients will update in real-time as you add or remove lists."})})]})})]}):t.jsx("div",{children:t.jsx(zx,{text:["Fetching segments","Finishing up"]})})},Dz=({title:e,subtitle:n,content:r})=>t.jsxs("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl bg-gray-100 ",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold",children:e}),n&&t.jsx("p",{className:"text-gray-600 mt-1",children:n})]}),t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 relative",children:r})]}),Mz=({automationId:e,iconDefinitions:r,logoUrl:o,setOpenEditAutomationPopup:i})=>{const{toast:s}=Dc(),[a,l]=n.useState(0),{automation:c}=Gx(e),[u,d]=n.useState(!1),{updateAutomation:h}=Xx(e),{getCommunicationGroup:f}=vA();if(!c)return t.jsx("div",{children:t.jsx(zx,{text:["Fetching Automation data","Finishing up"]})});const p=[{id:"audience",title:"Choose Audience",isValid:()=>!!(c&&c.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>!!c.action_data?.length&&null!==c.action_data?.find((e=>"send_communication"===e.action_type))?.action_metadata.communication_group_id},{id:"preview",title:"Preview and Schedule",isValid:()=>!1}];return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("div",{className:"w-full px-6 py-4 border-b border-gray-200 flex items-center gap-4",children:t.jsx("div",{className:"flex-shrink-0",children:o&&t.jsx("img",{src:o,alt:"Logo",className:"w-6 h-6"})})}),t.jsxs("div",{className:"flex-1 flex flex-col px-6 pt-0",children:[t.jsxs("div",{className:"flex gap-8 flex-1",children:[t.jsxs("nav",{className:"hidden lg:block space-y-0 w-50 self-start",children:[t.jsx("div",{className:"mb-5 mt-4",children:t.jsxs("button",{onClick:()=>i(!1),className:"flex items-center gap-1 px-2 py-1.5 bg-gray-100 rounded-full text-gray-700 hover:bg-gray-200 text-sm",children:[t.jsx("span",{children:"←"})," Go back"]})}),t.jsxs("div",{className:"pb-4",children:[t.jsx("h1",{className:"text-xl font-bold mb-2",children:"Automations"}),t.jsx("p",{className:"text-gray-600 text-sm",children:"Configure your automations"})]}),p.map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n===a?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n<a?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(WI,{label:e.title,isActive:n===a,isCompleted:e.isValid()})},e.id)))]}),t.jsx("div",{className:"hidden lg:block h-[100%] w-px bg-gray-200 dark:bg-gray-700"}),t.jsx("div",{className:"flex-1 relative",children:t.jsx("div",{className:"h-[calc(100vh-10rem)] overflow-y-auto overflow-visible",children:t.jsx("div",{className:"min-h-full flex items-center justify-center",children:t.jsxs(Zh,{mode:"wait",children:[0===a&&t.jsx($x,{className:"w-full max-w-8xl py-8",children:t.jsx(Dz,{title:"Choose Audience",content:t.jsx(_z,{iconDefinitions:r,automation:c})})},"audience"),1===a&&t.jsx($x,{className:"w-full max-w-8xl py-8",children:t.jsx(Dz,{title:"Edit Content",content:t.jsx(CF,{automation:c,iconDefinitions:r})})},"content"),2===a&&t.jsx($x,{className:"w-full max-w-8xl py-8",children:t.jsx(Dz,{title:"Preview and Schedule",content:t.jsx(jz,{automation:c,iconDefinitions:r,loading:u})})},"preview")]})})})})]}),t.jsx("div",{className:"absolute bottom-5 right-5 z-5 bg-white/30 backdrop-blur-xl p-2 rounded-xl border border-gray-200/50 shadow-lg",children:t.jsx(GI,{iconDefinitions:r,handleBack:()=>{l(a-1)},handleNext:async()=>{const{canMove:e,errorMessage:t}=await(async()=>{if(0===a)return{canMove:c.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(1===a){const e=c.action_data?.find((e=>"send_communication"===e.action_type));if(!e)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};const t=e.action_metadata.communication_group_id,n=await new Promise(((e,n)=>{f(t,{onSuccess:t=>{e(t)},onError:()=>{n("Error fetching communication group")}})}));if(!n||!n.sms_channel_sender_id&&!n.email_channel_sender_id)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(n.email_channel_sender_id&&(!n.email_html_body||!n.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(n.sms_channel_sender_id&&!n.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}return{canMove:!0,errorMessage:null}})();e?2===a?(d(!0),h({status:ew.ACTIVE}),i(!1),s({title:"Automation scheduled!"})):l(a+1):s({title:"Oops!",description:t??"Please fill out all required fields",variant:"destructive"})},hideBack:0===a,backText:0===a?"Cancel":"Back",nextText:2===a?"Schedule":"Next",backDisabled:0===a,nextDisabled:2===a&&!(c.trigger_metadata.scheduled_at&&new Date(c.trigger_metadata.scheduled_at)>new Date&&Boolean(c.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:2===a?"Save as Draft":void 0,thirdOptionOnClick:()=>{h({status:ew.DRAFT}),i(!1),s({title:"Automation saved as draft",description:"You can continue editing it later"})}})})]})]})},Oz=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),Rz=e=>{if(!/^[0-9\s()+.-]+$/.test(e))return!1;const t=e.replace(/\D/g,"");return e.startsWith("+")?t.length>=10&&t.length<=15:10===t.length||!(11!==t.length||!t.startsWith("1"))},Az=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),{getCommunicationGroup:u}=vA(),[d,h]=n.useState(null),[f,p]=n.useState(!1),{sendTestCommunication:m,sendError:g,isSendSuccess:v}=wA(),{toast:y}=Dc(),b=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;return n?new Promise(((e,t)=>{u(n,{onSuccess:n=>{switch(r){case"email":e(n.email_channel_sender_id);break;case"sms":e(n.sms_channel_sender_id);break;default:t(new Error(`Unsupported type: ${r}`))}},onError:e=>{t(e||new Error("Error fetching communication group"))}})})):Promise.resolve(null)}),[e.action_data,u,r]);n.useEffect((()=>{(async()=>{try{const e=await b();h(e)}catch(e){h(null)}finally{p(!0)}})()}),[b]),n.useEffect((()=>{v&&(y({title:"Success",description:`Preview ${"email"===r?"email":"SMS"} sent successfully!`}),o(!1))}),[v,r,o,y]),n.useEffect((()=>{g&&(y({title:"Error",description:`Failed to send preview: ${g.message}`,variant:"destructive"}),o(!1))}),[g,y,o]);return f?d?t.jsxs("div",{className:"",children:[t.jsxs("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:["Send Preview ","email"===r?"Email":"SMS"]}),t.jsx(vR,{type:"email"===r?"email":"tel",placeholder:"email"===r?"Enter email address":"Enter phone number",value:s,onChange:e=>{a(e.target.value),c("")},className:"w-full px-3 py-3 border border-gray-300 rounded-lg text-base mb-4 \n focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n placeholder-gray-400"}),l&&t.jsx("p",{className:"text-red-500 text-sm mb-4 -mt-2",children:l}),t.jsx(lw,{onClick:()=>{if(!("email"===r?Oz(s):Rz(s)))return void c("Please enter a valid "+("email"===r?"email address":"phone number"));if(!d)return void c("No sender found, please update the automation first!");const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;if(!n)return Promise.resolve(null);m({id:n,params:"email"===r?{email_address:s}:{phone_number:s}})},disabled:!s,className:"w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium\n hover:bg-blue-700 transition-colors duration-200\n disabled:bg-gray-400 disabled:cursor-not-allowed",children:"Send Preview"})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsxs("div",{className:"text-center flex flex-col justify-center items-center gap-2",children:[t.jsx(i.AlertCircleIcon,{className:"h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No sender found"}),t.jsx("p",{className:"text-gray-500",children:"Please update the automation to include a sender for this type"})]})}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(zx,{text:["Fetching sender id","Finishing up"]})})},Lz=({automation:e,iconDefinitions:r,autoOpenEditPopup:o,showBackButton:i=!1,logoUrl:s})=>{const a=xS(),[l,c]=n.useState(!1),[u,d]=n.useState(!1),[h,f]=n.useState(!1),[p,m]=n.useState(!1),{updateAutomation:g}=Xx(e.id),{invalidateAutomation:v}=Gx(e.id);n.useEffect((()=>{o&&c(!0)}),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(bE,{open:l,onOpenChange:e=>{c(e),!1===e&&v()},children:t.jsxs(SE,{className:"max-w-screen min-h-screen max-h-screen overflow-hidden rounded-none sm:rounded-none",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Edit Automation"}),t.jsx(kE,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(Mz,{automationId:e.id,iconDefinitions:r,setOpenEditAutomationPopup:c,logoUrl:s})]})}),t.jsx(bE,{open:h,onOpenChange:f,children:t.jsxs(SE,{className:"sm:max-w-[425px]",children:[t.jsx(CE,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(kE,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(lw,{variant:"outline",onClick:()=>f(!1),children:"Keep Running"}),t.jsx(lw,{variant:"destructive",onClick:()=>{g({status:ew.DEACTIVATED}),f(!1)},children:"Yes, Cancel Automation"})]})]})}),t.jsx(bE,{open:u,onOpenChange:d,children:t.jsxs(SE,{className:"",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Send Preview SMS"}),t.jsx(kE,{children:"Send a preview SMS to the automation."})]}),t.jsx(Az,{automation:e,type:"sms",setOpenSendPreviewPopup:d,iconDefinitions:r})]})}),t.jsx(bE,{open:p,onOpenChange:m,children:t.jsxs(SE,{className:"",children:[t.jsxs(vE,{children:[t.jsx(CE,{children:"Send Preview Email"}),t.jsx(kE,{children:"Send a preview email to the automation."})]}),t.jsx(Az,{automation:e,type:"email",setOpenSendPreviewPopup:m,iconDefinitions:r})]})}),t.jsxs("div",{className:"p-6 border-b border-gray-200",children:[i&&t.jsx("div",{className:"flex justify-between items-start mb-4",children:t.jsx("div",{children:t.jsx(lw,{onClick:()=>a(-1),children:"Back"})})}),t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("h1",{className:"text-2xl font-semibold mb-1",children:[e.name," "]}),t.jsx(ER,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(RI,{modal:!1,children:[t.jsx(AI,{asChild:!0,children:t.jsxs(lw,{children:["Actions",t.jsx(r.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(LI,{children:[e.status===ew.DRAFT&&t.jsx(II,{onClick:()=>c(!0),children:"Edit"}),e.status===ew.ACTIVE&&t.jsx(II,{onClick:()=>{g({status:ew.DRAFT})},children:"Convert to Draft"}),e.status!==ew.COMPLETED&&e.status!==ew.FAILED&&e.status!==ew.DEACTIVATED&&t.jsx(II,{onClick:()=>f(!0),children:"Cancel"}),t.jsx(II,{onClick:()=>d(!0),children:"Send Preview SMS"}),t.jsx(II,{onClick:()=>m(!0),children:"Send Preview Email"})]})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Name"}),t.jsx("div",{className:"font-medium",children:e.name})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Date Created"}),t.jsx("div",{className:"font-medium",children:pR(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===Zx.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Type"}),t.jsx("div",{className:"font-medium",children:"One Time"})]})}),t.jsx("div",{children:e.trigger_type===Zx.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Scheduled For"}),t.jsx("div",{className:"font-medium",children:pR(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})},Iz=({iconDefinitions:e,autoOpenEditPopup:n,automationId:r,showBackButton:o=!1,logoUrl:s})=>{const a=nw(e),l=function(){let{matches:e}=i.useContext(pS),t=e[e.length-1];return t?t.params:{}}(),[c]=nC(),u=r||l?.automationId||c.get("automationId"),d=n||c.get("autoOpenEditPopup"),h="true"===c.get("showBackButton")||o,f=nw(a),{automation:p,isFetching:m,isLoading:g,fetchError:v}=Gx(u||"");return u?p||!m&&!g?v?t.jsxs("div",{children:["Error: ",v.message]}):p?t.jsxs("div",{className:pw,children:[t.jsx(Lz,{automation:p,iconDefinitions:f,autoOpenEditPopup:d,showBackButton:h,logoUrl:s}),t.jsx("div",{className:"pt-4",children:t.jsxs(dA,{defaultValue:"content",children:[t.jsxs(hA,{children:[t.jsx(fA,{value:"content",children:"Content"}),t.jsx(fA,{value:"recipients",children:"Recipients"})]}),t.jsx(pA,{value:"recipients",children:t.jsx(NA,{automationId:u,iconDefinitions:f})}),t.jsx(pA,{value:"content",children:t.jsx(PA,{automationId:u,iconDefinitions:f})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:pw,children:t.jsx(zx,{text:["Fetching Automation data","Finishing up"]})}):t.jsx("div",{children:"Invalid automation ID"})};Object.values(Object.assign({}));var Fz=e=>null!=e;var $z=e=>"function"!=typeof e||e.length?e:e(),qz=e=>Array.isArray(e)?e:e?[e]:[];var zz=$e;var Uz,Vz=function(e){const[t,n]=_e(),r=e?.throw?(e,t)=>{throw n(e instanceof Error?e:new Error(t)),e}:(e,t)=>{n(e instanceof Error?e:new Error(t))},o=e?.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=e?.prefix?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=_e(void 0,{equals:!1}),s.set(n,a)),a[0]();const l=o.reduce(((e,t)=>{if(null!==e||!t)return e;try{return t.getItem(`${i}${n}`)}catch(oQ){return r(oQ,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&e?.deserializer?e.deserializer(l,n,e.options):l}});return!1!==e?.sync&&Fe((()=>{const e=e=>{let t=!1;o.forEach((n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(oQ){r(oQ,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}})),t&&e.key&&s.get(e.key)?.[1]()};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),$e((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>t.addEventListener?.("storage",e))),$e((()=>o.forEach((t=>t.removeEventListener?.("storage",e))))))})),[a,(t,n,a)=>{const l=e?.serializer?e.serializer(n,t,a??e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(oQ){r(oQ,`Error setting ${i}${t} to ${l} in ${e.name}`)}}));const u=s.get(t);u&&u[1]()},{clear:()=>o.forEach((e=>{try{e.clear()}catch(oQ){r(oQ,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(oQ){r(oQ,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&e?.deserializer?e.deserializer(r,n,e.options):r;o&&(t[n]=o)}};return o.forEach((e=>{if("function"==typeof e.getAll){let t;try{t=e.getAll()}catch(oQ){r(oQ,`Error getting all values from in ${e.name}`)}for(const e of t)n(e,t[e])}else{let o,i=0;try{for(;o=e.key(i++);)t.hasOwnProperty(o)||n(o,e.getItem(o))}catch(oQ){r(oQ,`Error getting all values from ${e.name}`)}}})),t}}]},Bz=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:"boolean"==typeof r?`; ${n}`:`; ${n}=${r}`}return t},Kz=("function"==typeof(Uz={_cookies:[globalThis.document,"cookie"],getItem:e=>Kz._cookies[0][Kz._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=Kz.getItem(e);Kz._cookies[0][Kz._cookies[1]]=`${e}=${t}${Bz(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:Kz});window.dispatchEvent(o)},removeItem:e=>{Kz._cookies[0][Kz._cookies[1]]=`${e}=deleted${Bz({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return Kz._cookies[0][Kz._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return Kz._cookies[0][Kz._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(Uz.clear=()=>{let e;for(;e=Uz.key(0);)Uz.removeItem(e)}),Uz),Hz=796,Wz="bottom",Gz="system",Yz=Object.keys(Jn)[0],Qz=Object.keys(tr)[0],Xz=Be({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function Jz(){return Ke(Xz)}var Zz=Be(void 0),eU=e=>{const[t,n]=_e(null),r=()=>{const e=t();null!=e&&(e.close(),n(null))},o=(r,o)=>{if(null!=t())return;const i=window.open("","TSQD-Devtools-Panel",`width=${r},height=${o},popup`);if(!i)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");i.document.head.innerHTML="",i.document.body.innerHTML="",function(e=window.document){if(e[Ot]){for(let t of e[Ot].keys())e.removeEventListener(t,Wt);delete e[Ot]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(Jz().shadowDOMTarget||document).styleSheets].forEach((e=>{try{const t=[...e.cssRules].map((e=>e.cssText)).join(""),n=document.createElement("style"),r=e.ownerNode;let o="";r&&"id"in r&&(o=r.id),o&&n.setAttribute("id",o),n.textContent=t,i.document.head.appendChild(n)}catch(nQ){const n=document.createElement("link");if(null==e.href)return;n.rel="stylesheet",n.type=e.type,n.media=e.media.toString(),n.href=e.href,i.document.head.appendChild(n)}})),Lt(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};Oe((()=>{"true"!==(e.localStore.pip_open??"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),Oe((()=>{const e=(Jz().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(Jz().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),$e((()=>{t.disconnect()}))}}));const i=Re((()=>({pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:e.disabled??!1})));return ut(Zz.Provider,{value:i,get children(){return e.children}})},tU=()=>Re((()=>{const e=Ke(Zz);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),nU=Be((()=>"dark"));function rU(){return Ke(nU)}var oU={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},iU=Object.keys(oU).join("|"),sU=new RegExp(iU,"g");var aU=7,lU=6,cU=5,uU=4,dU=3,hU=2,fU=1,pU=0;function mU(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:fU,!n.accessors){const r=gU(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}const o=function(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const o=t[r],i=xU(o),s=yU(e,o);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:i})}return n}(e,n.accessors),i={rankedValue:e,rank:pU,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=gU(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=fU?r=a:r>l&&(r=l),r=Math.min(r,l),r>=c&&r>i.rank&&(i.rank=r,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=c,i.rankedValue=e.itemValue)}return i}function gU(e,t,n){return e=vU(e,n),(t=vU(t,n)).length>e.length?pU:e===t?aU:(e=e.toLowerCase())===(t=t.toLowerCase())?lU:e.startsWith(t)?cU:e.includes(` ${t}`)?uU:e.includes(t)?dU:1===t.length?pU:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?hU:function(e,t){let n=0,r=0;function o(e,t,r){for(let o=r,i=t.length;o<i;o++){if(t[o]===e)return n+=1,o+1}return-1}function i(e){return fU+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return pU;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return pU}return i(r-s)}(e,t)}function vU(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(sU,(e=>oU[e]))),e}function yU(e,t){let n=t;"object"==typeof t&&(n=t.accessor);const r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}var bU={maxRanking:1/0,minRanking:-1/0};function xU(e){return"function"==typeof e?bU:{...bU,...e}}var wU={data:""},SU=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,CU=/\/\*[^]*?\*\/| +/g,kU=/\n+/g,EU=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?EU(s,i):i+"{"+EU(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=EU(s,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=EU.p?EU.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},jU={},TU=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+TU(e[n]);return t}return e};function PU(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=TU(e),s=jU[i]||(jU[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!jU[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=SU.exec(e.replace(CU,""));)t[4]?r.shift():t[3]?(n=t[3].replace(kU," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(kU," ").trim();return r[0]})(e);jU[s]=EU(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&jU.g?jU.g:null;return n&&(jU.g=jU[s]),l=jU[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d})(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":EU(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||wU),t.g,t.o,t.k);var r}function NU(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=NU(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _U(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=NU(e))&&(r&&(r+=" "),r+=t);return r}function DU(e,t){const n=Le(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=_e([],{equals:!1}),[l]=[Ue,ze],c=e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return Re((t=>{const n=s(),a=e();if(Le(l))return l(),t;if(n.length){const e=t.filter((e=>!n.includes(e)));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:c}),e}return Le((()=>{const e=new Set(a),n=a.slice(),s=[],l=[],d=[];for(const t of a)(o.has(t)?d:s).push(t);let h=!s.length;for(let r=0;r<t.length;r++){const o=t[r];e.has(o)||(i.has(o)||(l.push(o),i.add(o)),u(n,o,r)),h&&o!==n[r]&&(h=!1)}return!l.length&&h?t:(r({list:n,added:s,removed:l,unchanged:d,finishRemoved:c}),o=e,n)}))}),t.appear?[]:n.slice())}function MU(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}PU.bind({g:1}),PU.bind({k:1});var OU=e=>e instanceof Element;function RU(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return RU(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=RU(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function AU(e,t=OU,n=OU){const r=Re(e),o=Re((()=>RU(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function LU(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function IU(e,t,n,r){const{onBeforeEnter:o,onEnter:i,onAfterEnter:s}=t;function a(t){t&&t.target!==n||(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),s?.(n))}o?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return r?.();i?.(n,(()=>a()))})),LU((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function FU(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return r?.();function a(t){t&&t.target!==n||(r?.(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),s?.(n))}o?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),i?.(n,(()=>a())),LU((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var $U=e=>{const t=function(e){return Re((()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}}))}(e);return DU(AU((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)IU(s,e,t);const a=[];for(const e of i)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&a.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask((()=>{const e=[];for(const{el:t,rect:n}of a)if(t.isConnected){const r=t.getBoundingClientRect(),o=n.left-r.left,i=n.top-r.top;(o||i)&&(t.style.transform=`translate(${o}px, ${i}px)`,t.style.transitionDuration="0s",e.push(t))}document;for(const t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener("transitionend",e),t.classList.remove(...s.move))};t.classList.add(...s.move),t.style.transform=t.style.transitionDuration="",t.addEventListener("transitionend",e)}}));for(const t of r)FU(s,e,t,(()=>o([t])))}})},qU=Symbol("fallback");function zU(e){for(const t of e)t.dispose()}function UU(e){const{by:t}=e;return Re(function(e,t,n,r={}){const o=new Map;return $e((()=>zU(o.values()))),()=>{const n=e()||[];return Le((()=>{if(!n.length)return zU(o.values()),o.clear(),r.fallback?[Ne((e=>(o.set(qU,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(qU);if(!o.size||s){s?.dispose(),o.delete(qU);for(let r=0;r<n.length;r++){const o=n[r];i(e,o,r,t(o,r))}return e}const a=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);a.delete(l);const c=o.get(l);c?(e[r]=c.mapped,c.setIndex?.(r),c.setItem((()=>s))):i(e,s,r,l)}for(const t of a)o.get(t)?.dispose(),o.delete(t);return e}))};function i(e,t,r,i){Ne((s=>{const[a,l]=_e(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=_e(r);c.setIndex=t,c.mapped=n(a,e)}else c.mapped=n(a);o.set(i,c),e[r]=c.mapped}))}}((()=>e.each),"function"==typeof t?t:e=>e[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function VU(e,t,n,r){const o=()=>{qz($z(e)).forEach((e=>{e&&qz($z(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),zz(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?Oe(o):Me(o)}function BU(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return $e(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}((e=>{for(const n of e){const{contentRect:e,target:o}=n,i=Math.round(e.width),s=Math.round(e.height),a=r.get(o);a&&a.width===i&&a.height===s||(t(e,o,n),r.set(o,{width:i,height:s}))}}),n);Oe((t=>{const n=qz($z(e)).filter(Fz);return function(e,t,n,r){const o=e.length,i=t.length;let s,a,l=0;if(i)if(o){for(;l<i&&t[l]===e[l];l++);for(s of(t=t.slice(l),e=e.slice(l),t))e.includes(s)||r(s);for(a of e)t.includes(a)||n(a)}else for(;l<i;l++)r(t[l]);else for(;l<o;l++)n(e[l])}(n,t,o,i),n}),[])}var KU=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function HU(e){const t={};let n;for(;n=KU.exec(e);)t[n[1]]=n[2];return t}function WU(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=HU(e)}else"string"==typeof t&&(t=HU(t));return{...e,...t}}function GU(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function YU(e){return"[object String]"===Object.prototype.toString.call(e)}function QU(e){return t=>`${e()}-${t}`}function XU(e,t){return!!e&&(e===t||e.contains(t))}function JU(e,t=!1){const{activeElement:n}=ZU(e);if(!n?.nodeName)return null;if(eV(n)&&n.contentDocument)return JU(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=ZU(n).getElementById(e);if(t)return t}}return n}function ZU(e){return e?e.ownerDocument||e:document}function eV(e){return"IFRAME"===e.tagName}var tV=(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))(tV||{});function nV(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function rV(){return nV(/^Mac/i)}function oV(){return nV(/^iPhone/i)||nV(/^iPad/i)||rV()&&navigator.maxTouchPoints>1}function iV(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function sV(e){return t=>{for(const n of e)iV(t,n)}}function aV(e){return rV()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function lV(e){if(e)if(function(){if(null==cV){cV=!1;try{document.createElement("div").focus({get preventScroll(){return cV=!0,!0}})}catch(nQ){}}return cV}())e.focus({preventScroll:!0});else{const t=function(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;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var cV=null;var uV=["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'])"],dV=[...uV,'[tabindex]:not([tabindex="-1"]):not([disabled])'],hV=uV.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",fV=dV.join(':not([hidden]):not([tabindex="-1"]),');function pV(e,t){const n=Array.from(e.querySelectorAll(hV)).filter(mV);return t&&mV(e)&&n.unshift(e),n.forEach(((e,t)=>{if(eV(e)&&e.contentDocument){const r=pV(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function mV(e){return gV(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function gV(e){return e.matches(hV)&&vV(e)}function vV(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||vV(e.parentElement,e))}function yV(e){for(;e&&!bV(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function bV(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function xV(){}function wV(e,t){return mt(e,t)}var SV=new Map,CV=new Set;function kV(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=SV.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),SV.delete(t.target)),0===SV.size)){for(const e of CV)e();CV.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=SV.get(t.target);n||(n=new Set,SV.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function EV(e,t){const n=jV(e,t,"left"),r=jV(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function jV(e,t,n){const r="left"===n?"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}"undefined"!=typeof document&&("loading"!==document.readyState?kV():document.addEventListener("DOMContentLoaded",kV));var TV={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 PV(e){return t=>(e(t),()=>e(void 0))}function NV(e,t){const[n,r]=_e(_V(t?.()));return Oe((()=>{r(e()?.tagName.toLowerCase()||_V(t?.()))})),n}function _V(e){return YU(e)?e:void 0}function DV(e){const[t,n]=gt(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return ut(en,mt(n,{get component(){return t.as}}))}var MV=["id","name","validationState","required","disabled","readOnly"];var OV=Be();function RV(){const e=Ke(OV);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function AV(e){const t=RV(),n=wV({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(DV,mt({as:"div"},(()=>t.dataset()),n))}function LV(e){const t=RV(),n=wV({id:t.generateId("error-message")},e),[r,o]=gt(n,["forceMount"]),i=()=>"invalid"===t.validationState();return Oe((()=>{i()&&$e(t.registerErrorMessage(o.id))})),ut(Ct,{get when(){return r.forceMount||i()},get children(){return ut(DV,mt({as:"div"},(()=>t.dataset()),o))}})}function IV(e){let t;const n=RV(),r=wV({id:n.generateId("label")},e),[o,i]=gt(r,["ref"]),s=NV((()=>t),(()=>"label"));return Oe((()=>$e(n.registerLabel(i.id)))),ut(DV,mt({as:"label",ref(e){const n=MU((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Re((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function FV(e,t){Oe(Ie(e,(e=>{if(null==e)return;const n=function(e){return function(e){return e.matches("textarea, input, select, button")}(e)?e.form:e.closest("form")}(e);null!=n&&(n.addEventListener("reset",t,{passive:!0}),$e((()=>{n.removeEventListener("reset",t)})))})))}function $V(e){const[t,n]=_e(e.defaultValue?.()),r=Re((()=>void 0!==e.value?.())),o=Re((()=>r()?e.value?.():t()));return[o,t=>{Le((()=>{const i=function(e,...t){return"function"==typeof e?e(...t):e}(t,o());return Object.is(i,o())||(r()||n(i),e.onChange?.(i)),i}))}]}function qV(e){const[t,n]=$V(e);return[()=>t()??!1,n]}var zV=Object.defineProperty,UV=(e,t)=>{for(var n in t)zV(e,n,{get:t[n],enumerable:!0})},VV=Be();function BV(){return Ke(VV)}function KV(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function HV(e,t){const n=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.ref(),s=o.ref();return i===s?0:i&&s?KV(i,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(e);e!==n&&t(n)}function WV(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){Oe((()=>{const n=setTimeout((()=>{HV(e(),t)}));$e((()=>clearTimeout(n)))}))}(e,t);let n=[];Oe((()=>{const r=function(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 ZU(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&HV(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}$e((()=>o.disconnect()))}))}function GV(e={}){const[t,n]=function(e){const[t,n]=$V(e);return[()=>t()??[],n]}({value:()=>$z(e.items),onChange:t=>e.onItemsChange?.(t)});WV(t,n);const r=e=>(n((t=>{const n=function(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const t=e[r]?.ref();if(t&&KV(t,n))return r+1}return 0}(t,e);return function(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}(t,e,n)})),()=>{n((t=>{const n=t.filter((t=>t.ref()!==e.ref()));return t.length===n.length?t:n}))});return{DomCollectionProvider:e=>ut(VV.Provider,{value:{registerItem:r},get children(){return e.children}})}}function YV(e){const t=function(){const e=BV();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=wV({shouldRegisterItem:!0},e);Oe((()=>{if(!n.shouldRegisterItem)return;$e(t.registerItem(n.getItem()))}))}function QV(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=YU(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=YU(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(YU(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return YU(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(YU(l)||"number"==typeof l)r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;else if(null!=a(l)){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const o=a(l)??[];if(o.length>0){const i=QV({dataSource:o,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...i),t+=i.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++;return r}function XV(e,t=[]){return Re((()=>{const n=QV({dataSource:$z(e.dataSource),getKey:$z(e.getKey),getTextValue:$z(e.getTextValue),getDisabled:$z(e.getDisabled),getSectionChildren:$z(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var JV=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),ZV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function eB(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return JV.has(t)}const t=e.split("-")[0];return ZV.has(t)}(e)?"rtl":"ltr"}function tB(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:eB(e)}}var nB=tB(),rB=new Set;function oB(){nB=tB();for(const e of rB)e(nB)}var iB=Be();function sB(){const e=function(){const[e,t]=_e(nB),n=Re((()=>e()));return Fe((()=>{0===rB.size&&window.addEventListener("languagechange",oB),rB.add(t),$e((()=>{rB.delete(t),0===rB.size&&window.removeEventListener("languagechange",oB)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return Ke(iB)||e}var aB=new Map;var lB=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function cB(e){return rV()||oV()?e.altKey:e.ctrlKey}function uB(e){return rV()?e.metaKey:e.ctrlKey}function dB(e){return new lB(e)}function hB(e){const t=wV({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=_e(!1),[o,i]=_e(),s=Re((()=>{const e=$z(t.selectedKeys);return null!=e?dB(e):e})),a=Re((()=>{const e=$z(t.defaultSelectedKeys);return null!=e?dB(e):new lB})),[l,c]=function(e){const[t,n]=$V(e);return[()=>t()??new lB,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=_e($z(t.selectionBehavior));return Oe((()=>{const e=l();"replace"===$z(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),Oe((()=>{d($z(t.selectionBehavior)??"toggle")})),{selectionMode:()=>$z(t.selectionMode),disallowEmptySelection:()=>$z(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!$z(t.allowDuplicateSelectionEvents)&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,l())||c(e)}}}function fB(e,t,n){const r=mt({selectOnFocus:()=>"replace"===$z(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=sB();let s={top:0,left:0};VU((()=>$z(r.isVirtualized)?void 0:o()),"scroll",(()=>{const e=o();e&&(s={top:e.scrollTop,left:e.scrollLeft})}));const{typeSelectHandlers:a}=function(e){const[t,n]=_e(""),[r,o]=_e(-1);return{typeSelectHandlers:{onKeyDown:i=>{if($z(e.isDisabled))return;const s=$z(e.keyboardDelegate),a=$z(e.selectionManager);if(!s.getKeyForSearch)return;const l=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!l||i.ctrlKey||i.metaKey)return;" "===l&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n((e=>e+l)),u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);null==u&&function(e){return e.split("").every((t=>t===e[0]))}(c)&&(c=c[0],u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),null!=u&&(a.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>$z(r.disallowTypeAhead),keyboardDelegate:()=>$z(r.keyboardDelegate),selectionManager:()=>$z(r.selectionManager)}),l=()=>$z(r.orientation)??"vertical",c=()=>{const e=$z(r.autoFocus);if(!e)return;const n=$z(r.selectionManager),o=$z(r.keyboardDelegate);let i;"first"===e&&(i=o.getFirstKey?.()),"last"===e&&(i=o.getLastKey?.());const s=n.selectedKeys();s.size&&(i=s.values().next().value),n.setFocused(!0),n.setFocusedKey(i);const a=t();a&&null==i&&!$z(r.shouldUseVirtualFocus)&&lV(a)};Fe((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),Oe(Ie([o,()=>$z(r.isVirtualized),()=>$z(r.selectionManager).focusedKey()],(e=>{const[t,n,o]=e;if(n)o&&r.scrollToKey?.(o);else if(o&&t){const e=t.querySelector(`[data-key="${o}"]`);e&&EV(t,e)}})));return{tabIndex:Re((()=>{if(!$z(r.shouldUseVirtualFocus))return null==$z(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{iV(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=$z(r.selectionManager),s=$z(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!cB(e)&&o.replaceSelection(t))},u=$z(r.keyboardDelegate),d=$z(r.shouldFocusWrap),h=o.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(u.getKeyBelow){let t;e.preventDefault(),t=null!=h?u.getKeyBelow(h):u.getFirstKey?.(),null==t&&d&&(t=u.getFirstKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(u.getKeyAbove){let t;e.preventDefault(),t=null!=h?u.getKeyAbove(h):u.getLastKey?.(),null==t&&d&&(t=u.getLastKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(u.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyLeftOf(h):t?u.getFirstKey?.():u.getLastKey?.(),c(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(u.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyRightOf(h):t?u.getLastKey?.():u.getFirstKey?.(),c(n)}break;case"Home":if(u.getFirstKey){e.preventDefault();const t=u.getFirstKey(h,uB(e));null!=t&&(o.setFocusedKey(t),uB(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"End":if(u.getLastKey){e.preventDefault();const t=u.getLastKey(h,uB(e));null!=t&&(o.setFocusedKey(t),uB(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"PageDown":if(u.getKeyPageBelow&&null!=h){e.preventDefault();c(u.getKeyPageBelow(h))}break;case"PageUp":if(u.getKeyPageAbove&&null!=h){e.preventDefault();c(u.getKeyPageAbove(h))}break;case"a":uB(e)&&"multiple"===o.selectionMode()&&!0!==$z(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),$z(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!$z(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t){const n=t?.tabbable?fV:hV,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(n)&&vV(e)&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(r.currentNode=t.from),r}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&lV(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=$z(r.selectionManager),n=$z(r.keyboardDelegate),i=$z(r.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey()){const r=e=>{null!=e&&(t.setFocusedKey(e),i&&t.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!$z(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(lV(n),EV(e,n))}}},onFocusOut:e=>{const t=$z(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function pB(e,t){const n=()=>$z(e.selectionManager),r=()=>$z(e.key),o=()=>$z(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):"toggle"===n().selectionBehavior()||uB(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>$z(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=Re((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=Re((()=>$z(e.virtualized)?void 0:r()));return Oe(Ie([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():lV(t))}))),{isSelected:()=>n().isSelected(r()),isDisabled:s,allowsSelection:a,tabIndex:c,dataKey:u,onPointerDown:t=>{a()&&(l=t.pointerType,"mouse"!==t.pointerType||0!==t.button||$z(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&$z(e.shouldSelectOnPressUp)&&$z(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&($z(e.shouldSelectOnPressUp)&&!$z(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(cB(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var mB=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(null==e||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if("none"===this.state.selectionMode())return!1;const t=this.getKey(e);return null!=t&&this.state.selectedKeys().has(t)}isEmpty(){return 0===this.state.selectedKeys().size}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every((t=>e.has(t)))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index<e.index)||(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index>e.index)||(e=n)}return e?.key}extendSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode())return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new lB(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?null!=n.index&&null!=r.index&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;null!=r;){const e=this.collection().getItem(r);if(e&&"item"===e.type&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?t&&"item"===t.type?t.key:null:e}toggleSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode()&&!this.isSelected(e))return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=new lB(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&0===n.size||this.state.setSelectedKeys(n)}replaceSelection(e){if("none"===this.selectionMode())return;const t=this.getKey(e);if(null==t)return;const n=this.canSelectItem(t)?new lB([t],t,t):new lB;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new lB;for(const n of e){const e=this.getKey(n);if(null!=e&&(t.add(e),"single"===this.selectionMode()))break}this.state.setSelectedKeys(t)}selectAll(){"multiple"===this.selectionMode()&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new lB)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode()&&("single"===this.selectionMode()?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior()||t&&"touch"===t.pointerType?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode())return!1;const t=this.collection().getItem(e);return null!=t&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(t=>{for(;null!=t;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;"item"===n.type&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},gB=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(0===this.keyMap.size)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),"item"===o.type&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};var vB,yB=e=>"function"==typeof e?e():e,bB=e=>{const t=Re((()=>{const t=yB(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=_e(yB(e.show)?"present":"hidden");let i="none";return Oe((r=>{const s=yB(e.show);return Le((()=>{if(r===s)return s;const e=i,a=n();if(s)o("present");else if("none"===a||"none"===t()?.display)o("hidden");else{o(!0===r&&e!==a?"hiding":"hidden")}})),s})),Oe((()=>{const t=yB(e.element);if(!t)return;const s=e=>{e.target===t&&(i=n())},a=e=>{const i=n().includes(e.animationName);e.target===t&&i&&"hiding"===r()&&o("hidden")};t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),$e((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},xB="data-kb-top-layer",wB=!1,SB=[];function CB(e){return SB.findIndex((t=>t.node===e))}function kB(){return SB.filter((e=>e.isPointerBlocking))}function EB(){return kB().length>0}function jB(e){const t=CB([...kB()].slice(-1)[0]?.node);return CB(e)<t}var TB={layers:SB,isTopMostLayer:function(e){return SB[SB.length-1].node===e},hasPointerBlockingLayer:EB,isBelowPointerBlockingLayer:jB,addLayer:function(e){SB.push(e)},removeLayer:function(e){const t=CB(e);t<0||SB.splice(t,1)},indexOf:CB,find:function(e){return SB[CB(e)]},assignPointerEventToLayers:function(){for(const{node:e}of SB)e.style.pointerEvents=jB(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(EB()&&!wB){const t=ZU(e);vB=document.body.style.pointerEvents,t.body.style.pointerEvents="none",wB=!0}},restoreBodyPointerEvents:function(e){if(EB())return;const t=ZU(e);t.body.style.pointerEvents=vB,0===t.body.style.length&&t.body.removeAttribute("style"),wB=!1}};UV({},{Button:()=>_B,Root:()=>NB});var PB=["button","color","file","image","reset","submit"];function NB(e){let t;const n=wV({type:"button"},e),[r,o]=gt(n,["ref","type","disabled"]),i=NV((()=>t),(()=>"button")),s=Re((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==PB.indexOf(e.type)}({tagName:e,type:r.type})})),a=Re((()=>"input"===i())),l=Re((()=>"a"===i()&&null!=t?.getAttribute("href")));return ut(DV,mt({as:"button",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get type(){return s()||a()?r.type:void 0},get role(){return s()||l()?void 0:"button"},get tabIndex(){return s()||l()||r.disabled?void 0:0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!(s()||a()||!r.disabled)||void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var _B=NB,DB=["top","right","bottom","left"],MB=Math.min,OB=Math.max,RB=Math.round,AB=Math.floor,LB=e=>({x:e,y:e}),IB={left:"right",right:"left",bottom:"top",top:"bottom"},FB={start:"end",end:"start"};function $B(e,t,n){return OB(e,MB(t,n))}function qB(e,t){return"function"==typeof e?e(t):e}function zB(e){return e.split("-")[0]}function UB(e){return e.split("-")[1]}function VB(e){return"x"===e?"y":"x"}function BB(e){return"y"===e?"height":"width"}function KB(e){return["top","bottom"].includes(zB(e))?"y":"x"}function HB(e){return VB(KB(e))}function WB(e){return e.replace(/start|end/g,(e=>FB[e]))}function GB(e){return e.replace(/left|right|bottom|top/g,(e=>IB[e]))}function YB(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function QB(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 XB(e,t,n){let{reference:r,floating:o}=e;const i=KB(t),s=HB(t),a=BB(s),l=zB(t),c="y"===i,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 f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(UB(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function JB(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=qB(t,e),p=YB(f),m=a[h?"floating"===d?"reference":"floating":d],g=QB(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=QB(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function ZB(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eK(e){return DB.some((t=>e[t]>=0))}function tK(e){return oK(e)?(e.nodeName||"").toLowerCase():"#document"}function nK(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rK(e){var t;return null==(t=(oK(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function oK(e){return e instanceof Node||e instanceof nK(e).Node}function iK(e){return e instanceof Element||e instanceof nK(e).Element}function sK(e){return e instanceof HTMLElement||e instanceof nK(e).HTMLElement}function aK(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof nK(e).ShadowRoot)}function lK(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pK(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function cK(e){return["table","td","th"].includes(tK(e))}function uK(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(nQ){return!1}}))}function dK(e){const t=hK(),n=iK(e)?pK(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function hK(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function fK(e){return["html","body","#document"].includes(tK(e))}function pK(e){return nK(e).getComputedStyle(e)}function mK(e){return iK(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gK(e){if("html"===tK(e))return e;const t=e.assignedSlot||e.parentNode||aK(e)&&e.host||rK(e);return aK(t)?t.host:t}function vK(e){const t=gK(e);return fK(t)?e.ownerDocument?e.ownerDocument.body:e.body:sK(t)&&lK(t)?t:vK(t)}function yK(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=vK(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=nK(o);return i?t.concat(s,s.visualViewport||[],lK(o)?o:[],s.frameElement&&n?yK(s.frameElement):[]):t.concat(o,yK(o,[],n))}function bK(e){const t=pK(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=sK(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=RB(n)!==i||RB(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function xK(e){return iK(e)?e:e.contextElement}function wK(e){const t=xK(e);if(!sK(t))return LB(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=bK(t);let s=(i?RB(n.width):n.width)/r,a=(i?RB(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var SK=LB(0);function CK(e){const t=nK(e);return hK()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:SK}function kK(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=xK(e);let s=LB(1);t&&(r?iK(r)&&(s=wK(r)):s=wK(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==nK(e))&&t}(i,n,r)?CK(i):LB(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=nK(i),t=r&&iK(r)?nK(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=wK(o),t=o.getBoundingClientRect(),r=pK(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=nK(o),o=n.frameElement}}return QB({width:u,height:d,x:l,y:c})}function EK(e){return kK(rK(e)).left+mK(e).scrollLeft}function jK(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=nK(e),r=rK(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=hK();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=rK(e),n=mK(e),r=e.ownerDocument.body,o=OB(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=OB(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+EK(e);const a=-n.scrollTop;return"rtl"===pK(r).direction&&(s+=OB(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(rK(e));else if(iK(t))r=function(e,t){const n=kK(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=sK(e)?wK(e):LB(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=CK(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return QB(r)}function TK(e,t){const n=gK(e);return!(n===t||!iK(n)||fK(n))&&("fixed"===pK(n).position||TK(n,t))}function PK(e,t,n){const r=sK(t),o=rK(t),i="fixed"===n,s=kK(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=LB(0);if(r||!r&&!i)if(("body"!==tK(t)||lK(o))&&(a=mK(t)),r){const e=kK(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=EK(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function NK(e){return"static"===pK(e).position}function _K(e,t){return sK(e)&&"fixed"!==pK(e).position?t?t(e):e.offsetParent:null}function DK(e,t){const n=nK(e);if(uK(e))return n;if(!sK(e)){let t=gK(e);for(;t&&!fK(t);){if(iK(t)&&!NK(t))return t;t=gK(t)}return n}let r=_K(e,t);for(;r&&cK(r)&&NK(r);)r=_K(r,t);return r&&fK(r)&&NK(r)&&!dK(r)?n:r||function(e){let t=gK(e);for(;sK(t)&&!fK(t);){if(dK(t))return t;if(uK(t))return null;t=gK(t)}return null}(e)||n}var MK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=rK(r),a=!!t&&uK(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=LB(1);const u=LB(0),d=sK(r);if((d||!d&&!i)&&(("body"!==tK(r)||lK(s))&&(l=mK(r)),sK(r))){const e=kK(r);c=wK(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:rK,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?uK(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=yK(e,[],!1).filter((e=>iK(e)&&"body"!==tK(e))),o=null;const i="fixed"===pK(e).position;let s=i?gK(e):e;for(;iK(s)&&!fK(s);){const t=pK(s),n=dK(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||lK(s)&&!n&&TK(e,s))?r=r.filter((e=>e!==s)):o=t,s=gK(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=jK(t,n,o);return e.top=OB(r.top,e.top),e.right=MB(r.right,e.right),e.bottom=MB(r.bottom,e.bottom),e.left=OB(r.left,e.left),e}),jK(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:DK,getElementRects:async function(e){const t=this.getOffsetParent||DK,n=this.getDimensions,r=await n(e.floating);return{reference:PK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=bK(e);return{width:t,height:n}},getScale:wK,isElement:iK,isRTL:function(e){return"rtl"===pK(e).direction}};function OK(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=xK(e),u=o||i?[...c?yK(c):[],...yK(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=rK(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-AB(u)+"px "+-AB(o.clientWidth-(c+d))+"px "+-AB(o.clientHeight-(u+h))+"px "+-AB(c)+"px",threshold:OB(0,MB(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(nQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?kK(e):null;return l&&function t(){const r=kK(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var RK=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=zB(n),a=UB(n),l="y"===KB(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=qB(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},AK=function(e){return void 0===e&&(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:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qB(e,t),c={x:n,y:r},u=await JB(t,l),d=KB(zB(o)),h=VB(d);let f=c[h],p=c[d];if(i){f=$B(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=$B(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},LK=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=qB(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=zB(o),y=KB(a),b=zB(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[GB(a)]:function(e){const t=GB(e);return[WB(e),t,WB(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=UB(e);let i=function(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[]}}(zB(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(WB)))),i}(a,m,p,x));const C=[a,...w],k=await JB(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=UB(e),o=HB(e),i=BB(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=GB(s)),[s,GB(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=j.filter((e=>{if(S){const t=KB(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},IK=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=qB(e,t),l=await JB(t,a),c=zB(n),u=UB(n),d="y"===KB(n),{width:h,height:f}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=f-l.top-l.bottom,v=h-l.left-l.right,y=MB(f-l[p],g),b=MB(h-l[m],v),x=!t.middlewareData.shift;let w=y,S=b;if(d?S=u||x?MB(b,v):v:w=u||x?MB(y,g):g,x&&!u){const e=OB(l.left,0),t=OB(l.right,0),n=OB(l.top,0),r=OB(l.bottom,0);d?S=h-2*(0!==e||0!==t?e+t:OB(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:OB(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const C=await o.getDimensions(i.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},FK=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=qB(e,t);switch(r){case"referenceHidden":{const e=ZB(await JB(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:eK(e)}}}case"escaped":{const e=ZB(await JB(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:eK(e)}}}default:return{}}}}},$K=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=qB(e,t)||{};if(null==c)return{};const d=YB(u),h={x:n,y:r},f=HB(o),p=BB(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=MB(d[v],E),T=MB(d[y],E),P=j,N=C-m[p]-T,_=C/2-m[p]/2+k,D=$B(P,_,N),M=!l.arrow&&null!=UB(o)&&_!==D&&i.reference[p]/2-(_<P?j:T)-m[p]/2<0,O=M?_<P?_-P:_-N:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:_-D-O,...M&&{alignmentOffset:O}},reset:M}}}),qK=(e,t,n)=>{const r={platform:MK,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=XB(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=XB(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},zK=Be();function UK(){const e=Ke(zK);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var VK=At('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),BK={top:180,right:-90,bottom:0,left:90};function KK(e){const t=UK(),n=wV({size:30},e),[r,o]=gt(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=_e();return Oe((()=>{const t=e();var r;t&&n((r=t,ZU(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return ut(DV,mt({as:"div",ref(e){const n=MU(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return WU({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s()?.getPropertyValue("background-color")||"none",stroke:s()?.getPropertyValue(`border-${i()}-color`)||"none","stroke-width":a()},r.style)}},o,{get children(){const e=VK(),t=e.firstChild;return Me((()=>It(t,"transform",`rotate(${BK[i()]} 15 15) translate(0 2)`))),e}}))}function HK(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if("function"==typeof DOMRect)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 WK(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var GK={top:"bottom",right:"left",bottom:"top",left:"right"};var YK=Object.assign((function(e){const t=wV({getAnchorRect:e=>e?.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]=_e(),[o,i]=_e(),[s,a]=_e(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?HK(t):e?e.getBoundingClientRect():HK()}};var e,n},{direction:c}=sB();async function u(){const e=l(),r=n(),i=o();if(!e||!r)return;const s=(i?.clientHeight||0)/2,u="number"==typeof t.gutter?t.gutter+s:t.gutter??s;r.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),e.getBoundingClientRect();const d=[RK((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}}))];if(!1!==t.flip){const e="string"==typeof t.flip?t.flip.split(" "):void 0;if(void 0!==e&&!e.every(WK))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(LK({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(AK({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(IK({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:o}){const i=Math.round(o.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty("--kb-popper-anchor-width",`${i}px`),r.style.setProperty("--kb-popper-content-available-width",`${e}px`),r.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(r.style.width=`${i}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(FK({padding:t.detachedPadding})),i&&d.push($K({element:i,padding:t.arrowPadding}));const h=await qK(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...MK,isRTL:()=>"rtl"===c()}});if(a(h.placement),t.onCurrentPlacementChange?.(h.placement),!r)return;r.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=GK[n];return r?"left"===n||"right"===n?`${o} ${"start"===r?"top":"bottom"}`:"start"===r?`${o} ${"rtl"===t?"right":"left"}`:`${o} ${"rtl"===t?"left":"right"}`:`${o} center`}(h.placement,c()));const f=Math.round(h.x),p=Math.round(h.y);let m;if(t.hideWhenDetached&&(m=h.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(r.style,{top:"0",left:"0",transform:`translate3d(${f}px, ${p}px, 0)`,visibility:m}),i&&h.middlewareData.arrow){const{x:e,y:t}=h.middlewareData.arrow,n=h.placement.split("-")[0];Object.assign(i.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return Oe((()=>{const e=l(),t=n();if(!e||!t)return;$e(OK(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),Oe((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),ut(zK.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:KK,Context:zK,usePopperContext:UK,Positioner:function(e){const t=UK(),[n,r]=gt(e,["ref","style"]);return ut(DV,mt({as:"div",ref(e){const r=MU(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return WU({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var QK="interactOutside.pointerDownOutside",XK="interactOutside.focusOutside";var JK=Be();function ZK(e){let t;const n=Ke(JK),[r,o]=gt(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=xV;const o=()=>ZU(t()),i=t=>e.onPointerDownOutside?.(t),s=t=>e.onFocusOutside?.(t),a=t=>e.onInteractOutside?.(t),l=n=>{const r=n.target;return r instanceof HTMLElement&&!r.closest(`[${xB}]`)&&!!XU(o(),r)&&!XU(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=sV([i,a]);r.addEventListener(QK,o,{once:!0});const s=new CustomEvent(QK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||aV(e)&&0===e.button}});r.dispatchEvent(s)}"touch"===e.pointerType?(o().removeEventListener("click",n),r=n,o().addEventListener("click",n,{once:!0})):n()},u=e=>{const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=sV([s,a]);r.addEventListener(XK,o,{once:!0});const i=new CustomEvent(XK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};Oe((()=>{$z(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),$e((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>!!t&&(r.excludedElements?.some((t=>XU(t(),e)))||[...i].some((t=>XU(t,e)))),onPointerDownOutside:e=>{t&&!TB.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||TB.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},(()=>t)),function(e){const t=t=>{t.key===tV.Escape&&e.onEscapeKeyDown?.(t)};Oe((()=>{if($z(e.isDisabled))return;const n=e.ownerDocument?.()??ZU();n.addEventListener("keydown",t),$e((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>ZU(t),onEscapeKeyDown:e=>{t&&TB.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Fe((()=>{if(!t)return;TB.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);TB.assignPointerEventToLayers(),TB.disableBodyPointerEvents(t),$e((()=>{t&&(TB.removeLayer(t),e?.(),TB.assignPointerEventToLayers(),TB.restoreBodyPointerEvents(t))}))})),Oe(Ie([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=TB.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,TB.assignPointerEventToLayers()),t&&TB.disableBodyPointerEvents(e),$e((()=>{TB.restoreBodyPointerEvents(e)}))}),{defer:!0}));return ut(JK.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return ut(DV,mt({as:"div",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function eH(e={}){const[t,n]=qV({value:()=>$z(e.open),defaultValue:()=>!!$z(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var tH={};UV(tH,{Description:()=>AV,ErrorMessage:()=>LV,Item:()=>sH,ItemControl:()=>aH,ItemDescription:()=>lH,ItemIndicator:()=>cH,ItemInput:()=>uH,ItemLabel:()=>dH,Label:()=>hH,RadioGroup:()=>pH,Root:()=>fH});var nH=Be();function rH(){const e=Ke(nH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var oH=Be();function iH(){const e=Ke(oH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function sH(e){const t=RV(),n=rH(),r=wV({id:`${t.generateId("item")}-${bt()}`},e),[o,i]=gt(r,["value","disabled","onPointerDown"]),[s,a]=_e(),[l,c]=_e(),[u,d]=_e(),[h,f]=_e(),[p,m]=_e(!1),g=Re((()=>n.isSelectedValue(o.value))),v=Re((()=>o.disabled||t.isDisabled()||!1)),y=e=>{iV(e,o.onPointerDown),p()&&e.preventDefault()},b=Re((()=>({...t.dataset(),"data-disabled":v()?"":void 0,"data-checked":g()?"":void 0}))),x={value:()=>o.value,dataset:b,isSelected:g,isDisabled:v,inputId:s,labelId:l,descriptionId:u,inputRef:h,select:()=>n.setSelectedValue(o.value),generateId:QU((()=>i.id)),registerInput:PV(a),registerLabel:PV(c),registerDescription:PV(d),setIsFocused:m,setInputRef:f};return ut(oH.Provider,{value:x,get children(){return ut(DV,mt({as:"div",role:"group",onPointerDown:y},b,i))}})}function aH(e){const t=iH(),n=wV({id:t.generateId("control")},e),[r,o]=gt(n,["onClick","onKeyDown"]);return ut(DV,mt({as:"div",onClick:e=>{iV(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{iV(e,r.onKeyDown),e.key===tV.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function lH(e){const t=iH(),n=wV({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(DV,mt({as:"div"},(()=>t.dataset()),n))}function cH(e){const t=iH(),n=wV({id:t.generateId("indicator")},e),[r,o]=gt(n,["ref","forceMount"]),[i,s]=_e(),{present:a}=bB({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return ut(Ct,{get when(){return a()},get children(){return ut(DV,mt({as:"div",ref(e){const t=MU(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function uH(e){const t=RV(),n=rH(),r=iH(),o=wV({id:r.generateId("input")},e),[i,s]=gt(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=_e(!1);return Oe(Ie([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),Oe((()=>$e(r.registerInput(s.id)))),ut(DV,mt({as:"input",ref(e){const t=MU(r.setInputRef,i.ref);"function"==typeof t&&t(e)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return WU({...TV},i.style)},get"aria-labelledby"(){return[i["aria-labelledby"],r.labelId(),null!=i["aria-labelledby"]&&null!=s["aria-label"]?s.id:void 0].filter(Boolean).join(" ")||void 0},get"aria-describedby"(){return[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0},onChange:e=>{if(iV(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{iV(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{iV(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function dH(e){const t=iH(),n=wV({id:t.generateId("label")},e);return Oe((()=>$e(t.registerLabel(n.id)))),ut(DV,mt({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function hH(e){return ut(IV,mt({as:"span"},e))}function fH(e){let t;const n=wV({id:`radiogroup-${bt()}`,orientation:"vertical"},e),[r,o,i]=gt(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],MV),[s,a]=$V({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=wV({id:`form-control-${bt()}`},e),[n,r]=_e(),[o,i]=_e(),[s,a]=_e(),[l,c]=_e();return{formControlContext:{name:()=>$z(t.name)??$z(t.id),dataset:Re((()=>({"data-valid":"valid"===$z(t.validationState)?"":void 0,"data-invalid":"invalid"===$z(t.validationState)?"":void 0,"data-required":$z(t.required)?"":void 0,"data-disabled":$z(t.disabled)?"":void 0,"data-readonly":$z(t.readOnly)?"":void 0}))),validationState:()=>$z(t.validationState),isRequired:()=>$z(t.required),isDisabled:()=>$z(t.disabled),isReadOnly:()=>$z(t.readOnly),labelId:n,fieldId:o,descriptionId:s,errorMessageId:l,getAriaLabelledBy:(e,t,r)=>{const o=null!=r||null!=n();return[r,n(),o&&null!=t?e:void 0].filter(Boolean).join(" ")||void 0},getAriaDescribedBy:e=>[s(),l(),e].filter(Boolean).join(" ")||void 0,generateId:QU((()=>$z(t.id))),registerLabel:PV(r),registerField:PV(i),registerDescription:PV(a),registerErrorMessage:PV(c)}}}(o);FV((()=>t),(()=>a(r.defaultValue??"")));const c=()=>l.getAriaDescribedBy(r["aria-describedby"]),u=e=>e===s(),d={ariaDescribedBy:c,isSelectedValue:u,setSelectedValue:e=>{if(!l.isReadOnly()&&!l.isDisabled()&&(a(e),t))for(const n of t.querySelectorAll("[type='radio']")){n.checked=u(n.value)}}};return ut(OV.Provider,{value:l,get children(){return ut(nH.Provider,{value:d,get children(){return ut(DV,mt({as:"div",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return $z(o.id)},get"aria-invalid"(){return"invalid"===l.validationState()||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return r.orientation},get"aria-labelledby"(){return l.getAriaLabelledBy($z(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var pH=Object.assign(fH,{Description:AV,ErrorMessage:LV,Item:sH,ItemControl:aH,ItemDescription:lH,ItemIndicator:cH,ItemInput:uH,ItemLabel:dH,Label:hH}),mH=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=null!=o?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=null!=o?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=r;){const t=this.collection().getItem(r);if(t){const o=t.textValue.slice(0,e.length);if(t.textValue&&0===n.compare(o,e))return r}r=this.getKeyBelow(r)}}};function gH(e,t,n){const r=function(e){const{locale:t}=sB(),n=Re((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return Re((()=>{const r=n();let o;return aB.has(r)&&(o=aB.get(r)),o||(o=new Intl.Collator(t(),e),aB.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return fB({selectionManager:()=>$z(e.selectionManager),keyboardDelegate:Re((()=>{const n=$z(e.keyboardDelegate);return n||new mH(e.collection,t,r)})),autoFocus:()=>$z(e.autoFocus),deferAutoFocus:()=>$z(e.deferAutoFocus),shouldFocusWrap:()=>$z(e.shouldFocusWrap),disallowEmptySelection:()=>$z(e.disallowEmptySelection),selectOnFocus:()=>$z(e.selectOnFocus),disallowTypeAhead:()=>$z(e.disallowTypeAhead),shouldUseVirtualFocus:()=>$z(e.shouldUseVirtualFocus),allowsTabNavigation:()=>$z(e.allowsTabNavigation),isVirtualized:()=>$z(e.isVirtualized),scrollToKey:t=>$z(e.scrollToKey)?.(t),orientation:()=>$z(e.orientation)},t)}var vH="focusScope.autoFocusOnMount",yH="focusScope.autoFocusOnUnmount",bH={bubbles:!1,cancelable:!0},xH={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=GU(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=GU(this.stack,e),this.active()?.resume()}};function wH(e,t){const[n,r]=_e(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>ZU(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,TV),e},u=()=>{const e=t();return e?pV(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};Oe((()=>{const e=t();if(!e)return;xH.add(o);const n=JU(e);if(!XU(e,n)){const t=new CustomEvent(vH,bH);e.addEventListener(vH,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{lV(d()),JU(e)===n&&lV(e)}),0)}$e((()=>{e.removeEventListener(vH,s),setTimeout((()=>{const r=new CustomEvent(yH,bH);(()=>{const e=t();if(!e)return!1;const n=JU(e);return!!n&&!XU(e,n)&&gV(n)})()&&r.preventDefault(),e.addEventListener(yH,a),e.dispatchEvent(r),r.defaultPrevented||lV(n??l().body),e.removeEventListener(yH,a),xH.remove(o)}),0)}))})),Oe((()=>{const r=t();if(!r||!$z(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${xB}]`)||(XU(r,t)?i=t:lV(i))},s=e=>{const t=e.relatedTarget??JU(r);t?.closest(`[${xB}]`)||XU(r,t)||lV(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),$e((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),Oe((()=>{const r=t();if(!r||!$z(e.trapFocus)||n())return;const o=c();r.insertAdjacentElement("afterbegin",o);const i=c();function s(e){const t=d(),n=(()=>{const e=u();return e.length>0?e[e.length-1]:null})();lV(e.relatedTarget===t?n:t)}r.insertAdjacentElement("beforeend",i),o.addEventListener("focusin",s),i.addEventListener("focusin",s);const a=new MutationObserver((e=>{for(const t of e)t.previousSibling===i&&(i.remove(),r.insertAdjacentElement("beforeend",i)),t.nextSibling===o&&(o.remove(),r.insertAdjacentElement("afterbegin",o))}));a.observe(r,{childList:!0,subtree:!1}),$e((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var SH="data-live-announcer";function CH(e){Oe((()=>{$z(e.isDisabled)||$e(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${SH}], [${xB}]`))n.add(r);const t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(const t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),s=t(e);if(s===NodeFilter.FILTER_ACCEPT&&i(e),s!==NodeFilter.FILTER_REJECT){let e=o.nextNode();for(;null!=e;)i(e),e=o.nextNode()}},i=e=>{const t=kH.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),kH.set(e,t+1))};EH.length&&EH[EH.length-1].disconnect();o(t);const s=new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some((e=>e.contains(t.target)))){for(const e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(const e of t.addedNodes)!(e instanceof HTMLElement||e instanceof SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.reactAriaTopLayer?e instanceof Element&&o(e):n.add(e)}}));s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return EH.push(a),()=>{s.disconnect();for(const e of r){const t=kH.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),kH.delete(e)):kH.set(e,t-1)}a===EH[EH.length-1]?(EH.pop(),EH.length&&EH[EH.length-1].observe()):EH.splice(EH.indexOf(a),1)}}($z(e.targets),$z(e.root)))}))}var kH=new WeakMap,EH=[];var jH=new Map,TH=e=>{Oe((()=>{const t=yB(e.style)??{},n=yB(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=jH.get(e.key);o?o.activeCount++:jH.set(e.key,{activeCount:1,originalStyles:r,properties:n.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);$e((()=>{const t=jH.get(e.key);if(t)if(1===t.activeCount){jH.delete(e.key);for(const[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(const n of t.properties)e.element.style.removeProperty(n);0===e.element.style.length&&e.element.removeAttribute("style"),e.cleanup?.()}else t.activeCount--}))}))},PH=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},NH=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[_H,DH]=_e([]),MH=e=>[e.deltaX,e.deltaY],OH=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],RH=(e,t,n,r)=>{const o=null!==r&&AH(r,e),[i,s]=((e,t,n)=>{const r="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let o=e,i=0,s=0,a=!1;do{const[e,l,c]=PH(o,t),u=c-e-r*l;0===l&&0===u||!NH(o,t)||(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},AH=(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},LH=e=>{const t=mt({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=bt();let r=[0,0],o=null,i=null;Oe((()=>{yB(t.enabled)&&(DH((e=>[...e,n])),$e((()=>{DH((e=>e.filter((e=>e!==n))))})))})),Oe((()=>{if(!yB(t.enabled)||!yB(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(yB(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===yB(t.preventScrollbarShiftMode)?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,o.push({key:"--scrollbar-width",value:`${n}px`}));const i=window.scrollY,s=window.scrollX;TH({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{yB(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else TH({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),Oe((()=>{var e;(e=n,_H().indexOf(e)===_H().length-1&&yB(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),$e((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=OH(e),o=null,i=null},a=e=>{const n=e.target,r=yB(t.element),o=MH(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=RH(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!AH(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=yB(t.element),s=e.target;let a;if(2===e.touches.length)a=!yB(t.allowPinchZoom);else{if(null==o||null===i){const t=OH(e).map(((e,t)=>r[t]-e)),n=Math.abs(t[0])>Math.abs(t[1])?"x":"y";o=n,i="x"===n?t[0]:t[1]}if("range"===s.type)a=!1;else{const e=RH(s,o,i,n);a=!n||!AH(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},IH=Be();function FH(){return Ke(IH)}function $H(){const e=FH();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var qH=Be();function zH(){const e=Ke(qH);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var UH=Be();function VH(){const e=Ke(UH);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function BH(e){let t;const n=VH(),r=$H(),o=wV({id:n.generateId(`item-${bt()}`)},e),[i,s]=gt(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=_e(),[c,u]=_e(),[d,h]=_e(),f=()=>r.listState().selectionManager(),p=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};YV({getItem:()=>({ref:()=>t,type:"item",key:p(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=pB({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{iV(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(lV(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{iV(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{iV(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(iV(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":m()}},w=Re((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),S=Re((()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":f().focusedKey()===p()?"":void 0}))),C={isChecked:()=>i.checked,dataset:S,setLabelRef:h,generateId:QU((()=>s.id)),registerLabel:PV(l),registerDescription:PV(u)};return ut(qH.Provider,{value:C,get children(){return ut(DV,mt({as:"div",ref(e){const n=MU((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return sV([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return sV([b,g.onPointerUp])},get onClick(){return sV([i.onClick,g.onClick])},get onKeyDown(){return sV([x,g.onKeyDown])},get onMouseDown(){return sV([i.onMouseDown,g.onMouseDown])},get onFocus(){return sV([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:y},S,s))}})}function KH(e){const t=wV({closeOnSelect:!1},e),[n,r]=gt(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=qV({value:()=>$z(e.isSelected),defaultValue:()=>!!$z(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{$z(e.isReadOnly)||$z(e.isDisabled)||n(t)},toggle:()=>{$z(e.isReadOnly)||$z(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return ut(BH,mt({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var HH=Be();function WH(){return Ke(HH)}var GH={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>GH.next("ltr"===e?"rtl":"ltr",t)},YH=e=>"horizontal"===e?"ArrowDown":"ArrowRight",QH=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function XH(e){const t=VH(),n=$H(),r=WH(),{direction:o}=sB(),i=wV({id:t.generateId("trigger")},e),[s,a]=gt(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>t.value()??s.id,void 0===r.lastValue()&&r.setLastValue(l));const c=NV((()=>n.triggerRef()),(()=>"button")),u=Re((()=>"a"===c()&&null!=n.triggerRef()?.getAttribute("href")));Oe(Ie((()=>r?.value()),(e=>{u()&&e===l()&&n.triggerRef()?.focus()})));const d=()=>{void 0!==r?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)};return Oe((()=>$e(n.registerTriggerId(s.id)))),ut(NB,mt({ref(e){const t=MU(n.setTriggerRef,s.ref);"function"==typeof t&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Re((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&r?.value()===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{iV(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{iV(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{iV(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(iV(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case YH(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){if(document.contains(e)){const t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let n=yV(e);for(;e&&n&&e!==t&&n!==t;)EV(n,e),n=yV(e=n)}else{const{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:r,top:o}=e.getBoundingClientRect();(Math.abs(t-r)>1||Math.abs(n-o)>1)&&e.scrollIntoView?.({block:"nearest"})}}}(e.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case QH(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case GH.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case GH.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{iV(e,s.onFocus),void 0!==r&&"touch"!==e.currentTarget.dataset.pointerType&&r.setValue(l)},role:void 0!==r?"menuitem":void 0},(()=>n.dataset()),a))}var JH=Be();function ZH(){return Ke(JH)}function eW(e){let t;const n=VH(),r=$H(),o=WH(),i=ZH(),{direction:s}=sB(),a=wV({id:n.generateId(`content-${bt()}`)},e),[l,c]=gt(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>null==r.parentMenuContext()&&void 0===o&&n.isModal(),h=gH({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>"horizontal"===n.orientation()?"vertical":"horizontal"},(()=>t));wH({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{void 0===o&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{l.onEscapeKeyDown?.(e),o?.setAutoFocusMenu(!1),r.close(!0)},p=e=>{l.onFocusOutside?.(e),n.isModal()&&e.preventDefault()};Oe((()=>$e(r.registerContentId(l.id))));const m={ref:MU((e=>{r.setContentRef(e),t=e}),l.ref),role:"menu",get id(){return l.id},get tabIndex(){return h.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:sV([l.onKeyDown,h.onKeyDown,e=>{if(XU(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case GH.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case GH.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:sV([l.onMouseDown,h.onMouseDown]),onFocusIn:sV([l.onFocusIn,h.onFocusIn]),onFocusOut:sV([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{iV(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(iV(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;XU(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return ut(Ct,{get when(){return r.contentPresent()},get children(){return ut(Ct,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return ut(DV,mt({as:"div"},(()=>r.dataset()),m,c))},get children(){return ut(YK.Positioner,{get children(){return ut(ZK,mt({get disableOutsidePointerEvents(){return Re((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return WU({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:f,onFocusOutside:p,get onDismiss(){return r.close}},(()=>r.dataset()),m,c))}})}})}})}function tW(e){let t;const n=VH(),r=$H(),[o,i]=gt(e,["ref"]);return LH({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),ut(eW,mt({ref(e){const n=MU((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var nW=Be();function rW(e){const t=wV({id:VH().generateId(`group-${bt()}`)},e),[n,r]=_e(),o={generateId:QU((()=>t.id)),registerLabelId:PV(r)};return ut(nW.Provider,{value:o,get children(){return ut(DV,mt({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function oW(e){const t=function(){const e=Ke(nW);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=wV({id:t.generateId("label")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerLabelId(r.id)))),ut(DV,mt({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function iW(e){const t=$H();return ut(DV,mt({as:"span","aria-hidden":"true"},(()=>t.dataset()),wV({children:"▼"},e)))}function sW(e){return ut(BH,mt({role:"menuitem",closeOnSelect:!0},e))}function aW(e){const t=zH(),n=wV({id:t.generateId("description")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerDescription(r.id)))),ut(DV,mt({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function lW(e){const t=zH(),n=wV({id:t.generateId("indicator")},e),[r,o]=gt(n,["forceMount"]);return ut(Ct,{get when(){return r.forceMount||t.isChecked()},get children(){return ut(DV,mt({as:"div"},(()=>t.dataset()),o))}})}function cW(e){const t=zH(),n=wV({id:t.generateId("label")},e),[r,o]=gt(n,["ref","id"]);return Oe((()=>$e(t.registerLabel(r.id)))),ut(DV,mt({as:"div",ref(e){const n=MU(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function uW(e){const t=$H();return ut(Ct,{get when(){return t.contentPresent()},get children(){return ut(Zt,e)}})}var dW=Be();function hW(e){const t=wV({id:VH().generateId(`radiogroup-${bt()}`)},e),[n,r]=gt(t,["value","defaultValue","onChange","disabled"]),[o,i]=$V({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return ut(dW.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return ut(rW,r)}})}function fW(e){const t=function(){const e=Ke(dW);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=wV({closeOnSelect:!1},e),[r,o]=gt(n,["value","onSelect"]);return ut(BH,mt({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function pW(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top])}return i}function mW(e){const t=VH(),n=BV(),r=FH(),o=WH(),i=ZH(),s=wV({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=gt(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=_e(),[p,m]=_e(),[g,v]=_e(),[y,b]=_e(),[x,w]=_e(!0),[S,C]=_e(l.placement),[k,E]=_e([]),[j,T]=_e([]),{DomCollectionProvider:P}=GV({items:j,onItemsChange:T}),N=eH({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:_}=bB({show:()=>t.forceMount()||N.isOpen(),element:()=>y()??null}),D=function(e){const t=hB(e),n=XV({dataSource:()=>$z(e.dataSource),getKey:()=>$z(e.getKey),getTextValue:()=>$z(e.getTextValue),getDisabled:()=>$z(e.getDisabled),getSectionChildren:()=>$z(e.getSectionChildren),factory:t=>new gB(e.filter?e.filter(t):t)},[()=>e.filter]),r=new mB(n,t);return De((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:j}),M=e=>{w(e),N.open()},O=(e=!1)=>{N.close(),e&&r&&r.close(!0)},R=()=>{const e=y();e&&(lV(e),D.selectionManager().setFocused(!0),D.selectionManager().setFocusedKey(void 0))},A=()=>{null!=i?setTimeout((()=>R())):R()},L=e=>{return d===u?.side&&(t=e,n=u?.area,!!n&&function(e,t){const[n,r]=e;let o=!1;for(let i=t.length,s=0,a=i-1;s<i;a=s++){const[e,l]=t[s],[c,u]=t[a],[,d]=t[0===a?i-1:a-1]||[0,0],h=(l-u)*(n-e)-(e-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===h)return!0;h>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===h)return!0;h<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r==l&&(n>=c&&n<=e||n>=e&&n<=c))return!0}return o}([t.clientX,t.clientY],n));var t,n};CH({isDisabled:()=>!(null==r&&N.isOpen()&&t.isModal()),targets:()=>[y(),...k()].filter(Boolean)}),Oe((()=>{const e=y();if(!e||!r)return;const t=r.registerNestedMenu(e);$e((()=>{t()}))})),Oe((()=>{void 0===r&&o?.registerMenu(t.value(),[y(),...k()])})),Oe((()=>{void 0===r&&void 0!==o&&(o.value()===t.value()?(g()?.focus(),o.autoFocusMenu()&&M(!0)):O())})),Oe((()=>{void 0===r&&void 0!==o&&N.isOpen()&&o.setValue(t.value())})),$e((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:Re((()=>({"data-expanded":N.isOpen()?"":void 0,"data-closed":N.isOpen()?void 0:""}))),isOpen:N.isOpen,contentPresent:_,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:M,close:O,toggle:e=>{w(e),N.toggle()},focusContent:A,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||A()},onTriggerLeave:e=>{L(e)&&e.preventDefault()},setPointerDir:e=>d=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>u=e,registerNestedMenu:e=>{E((t=>[...t,e]));const t=r?.registerNestedMenu(e);return()=>{E((t=>GU(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:PV(f),registerContentId:PV(m)};return ut(P,{get children(){return ut(IH.Provider,{value:I,get children(){return ut(Ct,{when:void 0===i,get fallback(){return l.children},get children(){return ut(YK,mt({anchorRef:g,contentRef:y,onCurrentPlacementChange:C},l))}})}})}})}function gW(e){const{direction:t}=sB();return ut(mW,mt({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var vW=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function yW(e){const t=$H(),n=VH(),[r,o]=gt(e,["onFocusOutside","onKeyDown"]),{direction:i}=sB();return ut(eW,mt({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;XU(t.triggerRef(),n)||t.close()},onKeyDown:e=>{iV(e,r.onKeyDown);const o=XU(e.currentTarget,e.target),s=vW(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),lV(t.triggerRef()))}},o))}var bW=["Enter"," "],xW=(e,t)=>"ltr"===e?[...bW,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...bW,"horizontal"===t?"ArrowLeft":"ArrowUp"];function wW(e){let t;const n=VH(),r=$H(),o=wV({id:n.generateId(`sub-trigger-${bt()}`)},e),[i,s]=gt(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=sB(),u=()=>i.id,d=()=>{const e=r.parentMenuContext();if(null==e)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},h=pB({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{iV(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{iV(e,i.onKeyDown),e.repeat||i.disabled||xW(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(r.listState().collection().getFirstKey()))};return Oe((()=>{if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");$e(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1}))})),Oe(Ie((()=>r.parentMenuContext()?.pointerGraceTimeoutId()),(e=>{$e((()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)}))}))),Oe((()=>$e(r.registerTriggerId(i.id)))),$e((()=>{l()})),ut(DV,mt({as:"div",ref(e){const n=MU((e=>{r.setTriggerRef(e),t=e}),i.ref);"function"==typeof n&&n(e)},get id(){return i.id},role:"menuitem",get tabIndex(){return h.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return Re((()=>!!r.isOpen()))()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return d().focusedKey()===u()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return sV([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return sV([i.onPointerUp,h.onPointerUp])},get onClick(){return sV([f,h.onClick])},get onKeyDown(){return sV([p,h.onKeyDown])},get onMouseDown(){return sV([i.onMouseDown,h.onMouseDown])},get onFocus(){return sV([i.onFocus,h.onFocus])},onPointerMove:e=>{if(iV(e,i.onPointerMove),"mouse"!==e.pointerType)return;const t=r.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(i.disabled?t?.onItemLeave(e):(r.isOpen()||a||(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),lV(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(iV(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:pW(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());const o=window.setTimeout((()=>{t?.setPointerGraceIntent(null)}),300);t?.setPointerGraceTimeoutId(o)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)}},(()=>r.dataset()),s))}function SW(e){const t=WH(),n=wV({id:`menu-${bt()}`,modal:!0},e),[r,o]=gt(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=eH({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>r.onOpenChange?.(e)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:QU((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return ut(UH.Provider,{value:s,get children(){return ut(mW,mt({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function CW(e){let t;const n=wV({orientation:"horizontal"},e),[r,o]=gt(n,["ref","orientation"]),i=NV((()=>t),(()=>"hr"));return ut(DV,mt({as:"hr",ref(e){const n=MU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get role(){return"hr"!==i()?"separator":void 0},get"aria-orientation"(){return"vertical"===r.orientation?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}UV({},{Root:()=>CW,Separator:()=>kW});var kW=CW,EW={};function jW(e){const t=VH(),n=$H(),[r,o]=gt(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return ut(tW,mt({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||lV(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function TW(e){return ut(SW,wV({id:`dropdownmenu-${bt()}`},e))}UV(EW,{Arrow:()=>KK,CheckboxItem:()=>KH,Content:()=>jW,DropdownMenu:()=>PW,Group:()=>rW,GroupLabel:()=>oW,Icon:()=>iW,Item:()=>sW,ItemDescription:()=>aW,ItemIndicator:()=>lW,ItemLabel:()=>cW,Portal:()=>uW,RadioGroup:()=>hW,RadioItem:()=>fW,Root:()=>TW,Separator:()=>CW,Sub:()=>gW,SubContent:()=>yW,SubTrigger:()=>wW,Trigger:()=>XH});var PW=Object.assign(TW,{Arrow:KK,CheckboxItem:KH,Content:jW,Group:rW,GroupLabel:oW,Icon:iW,Item:sW,ItemDescription:aW,ItemIndicator:lW,ItemLabel:cW,Portal:uW,RadioGroup:hW,RadioItem:fW,Separator:CW,Sub:gW,SubContent:yW,SubTrigger:wW,Trigger:XH}),NW={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},_W=At('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),DW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),MW=At('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),OW=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),RW=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),AW=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),LW=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),IW=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),FW=At('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),$W=At('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),qW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),zW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),UW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),VW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),BW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),KW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),HW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),WW=At('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),GW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),YW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),QW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),XW=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),JW=At('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function ZW(){return _W()}function eG(){return DW()}function tG(){return MW()}function nG(){return OW()}function rG(){return RW()}function oG(){return(e=RW()).style.setProperty("transform","rotate(90deg)"),e;var e}function iG(){return(e=RW()).style.setProperty("transform","rotate(-90deg)"),e;var e}function sG(){return AW()}function aG(){return LW()}function lG(){return IW()}function cG(){return FW()}function uG(){return $W()}function dG(){return qW()}function hG(){return zW()}function fG(){return UW()}function pG(){return VW()}function mG(e){return t=BW(),n=t.firstChild,Me((()=>It(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function gG(){return KW()}function vG(){return HW()}function yG(e){return[ut(Ct,{get when(){return e.checked},get children(){var t=BW(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),ut(Ct,{get when(){return!e.checked},get children(){var t=WW(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function bG(){return GW()}function xG(){return YW()}function wG(){return QW()}function SG(){return XW()}function CG(){const e=bt();return t=JW(),i=(o=(r=(n=t.firstChild).nextSibling).nextSibling).firstChild,a=(s=o.nextSibling).firstChild,u=(c=(l=s.nextSibling).nextSibling).firstChild,h=(d=c.nextSibling).firstChild,m=(p=(f=d.nextSibling).nextSibling).firstChild,v=(g=p.nextSibling).firstChild,x=(b=(y=g.nextSibling).nextSibling).firstChild,S=(w=b.nextSibling).firstChild,E=(k=(C=w.nextSibling).nextSibling).firstChild,T=(j=k.nextSibling).firstChild,_=(N=(P=j.nextSibling).nextSibling).firstChild,M=(D=N.nextSibling).firstChild,A=(R=(O=D.nextSibling).nextSibling).firstChild,I=(L=R.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,U=(z=F.nextSibling).firstChild,B=(V=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=V.nextSibling).firstChild).nextSibling).nextSibling.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,ae=(se=K.nextSibling).firstChild,ce=(le=se.nextSibling).firstChild,he=(de=(ue=le.nextSibling).firstChild).nextSibling,pe=(fe=ue.nextSibling).firstChild,ge=(me=fe.nextSibling).firstChild,Ae=(Re=(Oe=(Me=(De=(_e=(Ne=(Pe=(Te=(je=(Ee=(ke=(Ce=(Se=(we=(xe=(be=(ye=(ve=me.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,It(n,"id",`a-${e}`),It(r,"fill",`url(#a-${e})`),It(i,"id",`am-${e}`),It(s,"id",`b-${e}`),It(a,"filter",`url(#am-${e})`),It(l,"mask",`url(#b-${e})`),It(u,"id",`ah-${e}`),It(d,"id",`k-${e}`),It(h,"filter",`url(#ah-${e})`),It(f,"mask",`url(#k-${e})`),It(m,"id",`ae-${e}`),It(g,"id",`j-${e}`),It(v,"filter",`url(#ae-${e})`),It(y,"mask",`url(#j-${e})`),It(x,"id",`ai-${e}`),It(w,"id",`i-${e}`),It(S,"filter",`url(#ai-${e})`),It(C,"mask",`url(#i-${e})`),It(E,"id",`aj-${e}`),It(j,"id",`h-${e}`),It(T,"filter",`url(#aj-${e})`),It(P,"mask",`url(#h-${e})`),It(_,"id",`ag-${e}`),It(D,"id",`g-${e}`),It(M,"filter",`url(#ag-${e})`),It(O,"mask",`url(#g-${e})`),It(A,"id",`af-${e}`),It(L,"id",`f-${e}`),It(I,"filter",`url(#af-${e})`),It(F,"mask",`url(#f-${e})`),It($,"id",`m-${e}`),It(q,"fill",`url(#m-${e})`),It(U,"id",`ak-${e}`),It(V,"id",`e-${e}`),It(B,"filter",`url(#ak-${e})`),It(K,"mask",`url(#e-${e})`),It(H,"id",`n-${e}`),It(W,"fill",`url(#n-${e})`),It(G,"id",`r-${e}`),It(Y,"fill",`url(#r-${e})`),It(Q,"id",`s-${e}`),It(X,"fill",`url(#s-${e})`),It(J,"id",`q-${e}`),It(Z,"fill",`url(#q-${e})`),It(ee,"id",`p-${e}`),It(te,"fill",`url(#p-${e})`),It(ne,"id",`o-${e}`),It(re,"fill",`url(#o-${e})`),It(oe,"id",`l-${e}`),It(ie,"fill",`url(#l-${e})`),It(ae,"id",`al-${e}`),It(le,"id",`d-${e}`),It(ce,"filter",`url(#al-${e})`),It(ue,"mask",`url(#d-${e})`),It(de,"id",`u-${e}`),It(he,"fill",`url(#u-${e})`),It(pe,"id",`ad-${e}`),It(me,"id",`c-${e}`),It(ge,"filter",`url(#ad-${e})`),It(ve,"mask",`url(#c-${e})`),It(ye,"id",`t-${e}`),It(be,"fill",`url(#t-${e})`),It(xe,"id",`v-${e}`),It(we,"stroke",`url(#v-${e})`),It(Se,"id",`aa-${e}`),It(Ce,"stroke",`url(#aa-${e})`),It(ke,"id",`w-${e}`),It(Ee,"stroke",`url(#w-${e})`),It(je,"id",`ac-${e}`),It(Te,"stroke",`url(#ac-${e})`),It(Pe,"id",`ab-${e}`),It(Ne,"stroke",`url(#ab-${e})`),It(_e,"id",`y-${e}`),It(De,"stroke",`url(#y-${e})`),It(Me,"id",`x-${e}`),It(Oe,"stroke",`url(#x-${e})`),It(Re,"id",`z-${e}`),It(Ae,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x,w,S,C,k,E,j,T,P,N,_,D,M,O,R,A,L,I,F,$,q,z,U,V,B,K,H,W,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,he,fe,pe,me,ge,ve,ye,be,xe,we,Se,Ce,ke,Ee,je,Te,Pe,Ne,_e,De,Me,Oe,Re,Ae}var kG=At('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),EG=At('<button title="Copy object to clipboard">'),jG=At('<button title="Remove all items"aria-label="Remove all items">'),TG=At('<button title="Delete item"aria-label="Delete item">'),PG=At('<button title="Toggle value"aria-label="Toggle value">'),NG=At('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),_G=At("<div>"),DG=At("<div><button> <span></span> <span> "),MG=At("<input>"),OG=At("<span>"),RG=At("<div><span>:"),AG=At("<div><div><button> [<!>...<!>]");var LG=e=>{const t=rU(),n=Jz().shadowDOMTarget?PU.bind({target:Jz().shadowDOMTarget}):PU,r=Re((()=>"dark"===t()?KG(n):BG(n)));return o=kG(),Me((()=>Ft(o,_U(r().expander,n`
|
|
44
44
|
transform: rotate(${e.expanded?90:0}deg);
|
|
45
45
|
`,e.expanded&&n`
|
|
46
46
|
& svg {
|