@coristen/widget 0.1.12 → 0.1.13
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/README.md +1 -1
- package/dist/api.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +69 -69
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var TI=Object.create;var{getPrototypeOf:EI,defineProperty:Ru,getOwnPropertyNames:AI}=Object;var Ip=Object.prototype.hasOwnProperty;function MI(e){return this[e]}var kI,LI,bp=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?kI??=new WeakMap:LI??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?TI(EI(e)):{};let s=t||!e||!e.__esModule||!Ip.call(e,"default")?Ru(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let i of AI(e))if(!Ip.call(s,i))Ru(s,i,{get:MI.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var DI=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var FI=(e)=>e;function OI(e,t){this[e]=FI.bind(null,t)}var ri=(e,t)=>{for(var o in t)Ru(e,o,{get:t[o],enumerable:!0,configurable:!0,set:OI.bind(t,o)})};import*as sr from"react";var Mc=DI(function(VC){function MC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kC=typeof Object.is==="function"?Object.is:MC,LC=sr.useState,DC=sr.useEffect,FC=sr.useLayoutEffect,OC=sr.useDebugValue;function NC(e,t){var o=t(),r=LC({inst:{value:o,getSnapshot:t}}),n=r[0].inst,a=r[1];return FC(function(){n.value=o,n.getSnapshot=t,Tm(n)&&a({inst:n})},[e,o,t]),DC(function(){return Tm(n)&&a({inst:n}),e(function(){Tm(n)&&a({inst:n})})},[e]),OC(o),o}function Tm(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!kC(e,o)}catch(r){return!0}}function BC(e,t){return t()}var HC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?BC:NC;VC.useSyncExternalStore=sr.useSyncExternalStore!==void 0?sr.useSyncExternalStore:HC});var kr={};ri(kr,{android:()=>Ad,apple:()=>$u,ios:()=>Zu,linux:()=>Yb,mac:()=>Md,windows:()=>Xb});var Lr={};ri(Lr,{blink:()=>Jb,gecko:()=>Kb,webkit:()=>qu});var ju={};ri(ju,{voiceOver:()=>Qb});var rs={};ri(rs,{jsdom:()=>eC});import{Component as Vw,cloneElement as Uw,useCallback as lp,useEffect as mn,useMemo as _w,useRef as qs,useState as fr}from"react";import{ConvexProvider as Ww,ConvexReactClient as zw}from"convex/react";import{useEffect as Zs,useRef as B2,useState as Vr}from"react";import{useMutation as Na,useQuery as $s}from"convex/react";import*as ni from"react";import*as bn from"react";import{createContext as NI}from"react";var Cp=NI({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var Le=bn.forwardRef((e,t)=>{let{alt:o,color:r,size:n,weight:a,mirrored:s,children:i,weights:c,...u}=e,{color:l="currentColor",size:m,weight:p="regular",mirrored:d=!1,...f}=bn.useContext(Cp);return bn.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n!=null?n:m,height:n!=null?n:m,fill:r!=null?r:l,viewBox:"0 0 256 256",transform:s||d?"scale(-1, 1)":void 0,...f,...u},!!o&&bn.createElement("title",null,o),i,c.get(a!=null?a:p))});Le.displayName="IconBase";import*as bt from"react";var Sp=new Map([["bold",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),bt.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var ai=ni.forwardRef((e,t)=>ni.createElement(Le,{ref:t,...e,weights:Sp}));ai.displayName="ArrowUpIcon";import*as si from"react";import*as Ct from"react";var xp=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M216.49,56.48,177,96h19a12,12,0,0,1,0,24H148a12,12,0,0,1-12-12V60a12,12,0,0,1,24,0V79l39.51-39.52a12,12,0,0,1,17,17ZM108,136H60a12,12,0,0,0,0,24H79L39.51,199.51a12,12,0,0,0,17,17L96,177v19a12,12,0,0,0,24,0V148A12,12,0,0,0,108,136Z"}))],["duotone",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),Ct.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["fill",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M120,144v48a8,8,0,0,1-13.66,5.66L88,179.31,53.66,213.66a8,8,0,0,1-11.32-11.32L76.69,168,58.34,149.66A8,8,0,0,1,64,136h48A8,8,0,0,1,120,144ZM213.66,42.34a8,8,0,0,0-11.32,0L168,76.69,149.66,58.34A8,8,0,0,0,136,64v48a8,8,0,0,0,8,8h48a8,8,0,0,0,5.66-13.66L179.31,88l34.35-34.34A8,8,0,0,0,213.66,42.34Z"}))],["light",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M212.24,52.24,158.48,106H192a6,6,0,0,1,0,12H144a6,6,0,0,1-6-6V64a6,6,0,0,1,12,0V97.52l53.76-53.76a6,6,0,0,1,8.48,8.48ZM112,138H64a6,6,0,0,0,0,12H97.52L43.76,203.76a6,6,0,1,0,8.48,8.48L106,158.48V192a6,6,0,0,0,12,0V144A6,6,0,0,0,112,138Z"}))],["regular",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["thin",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M210.83,50.83,153.66,108H192a4,4,0,0,1,0,8H144a4,4,0,0,1-4-4V64a4,4,0,0,1,8,0v38.34l57.17-57.17a4,4,0,1,1,5.66,5.66ZM112,140H64a4,4,0,0,0,0,8h38.34L45.17,205.17a4,4,0,0,0,5.66,5.66L108,153.66V192a4,4,0,0,0,8,0V144A4,4,0,0,0,112,140Z"}))]]);var ii=si.forwardRef((e,t)=>si.createElement(Le,{ref:t,...e,weights:xp}));ii.displayName="ArrowsInSimpleIcon";import*as ci from"react";import*as St from"react";var wp=new Map([["bold",St.createElement(St.Fragment,null,St.createElement("path",{d:"M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z"}))],["duotone",St.createElement(St.Fragment,null,St.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),St.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["fill",St.createElement(St.Fragment,null,St.createElement("path",{d:"M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z"}))],["light",St.createElement(St.Fragment,null,St.createElement("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"}))],["regular",St.createElement(St.Fragment,null,St.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["thin",St.createElement(St.Fragment,null,St.createElement("path",{d:"M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z"}))]]);var li=ci.forwardRef((e,t)=>ci.createElement(Le,{ref:t,...e,weights:wp}));li.displayName="ArrowsOutSimpleIcon";import*as ui from"react";import*as xt from"react";var yp=new Map([["bold",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M241,150.65s0,0,0-.05a51.33,51.33,0,0,0-2.53-5.9L196.93,50.18a12,12,0,0,0-2.5-3.65,36,36,0,0,0-50.92,0A12,12,0,0,0,140,55V76H116V55a12,12,0,0,0-3.51-8.48,36,36,0,0,0-50.92,0,12,12,0,0,0-2.5,3.65L17.53,144.7A51.33,51.33,0,0,0,15,150.6s0,0,0,.05A52,52,0,1,0,116,168V100h24v68a52,52,0,1,0,101-17.35ZM80,62.28a12,12,0,0,1,12-1.22v63.15a51.9,51.9,0,0,0-35.9-7.62ZM64,196a28,28,0,1,1,28-28A28,28,0,0,1,64,196ZM164,61.06a12.06,12.06,0,0,1,12,1.22l23.87,54.31a51.9,51.9,0,0,0-35.9,7.62ZM192,196a28,28,0,1,1,28-28A28,28,0,0,1,192,196Z"}))],["duotone",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M104,168a40,40,0,1,1-40-40A40,40,0,0,1,104,168Zm88-40a40,40,0,1,0,40,40A40,40,0,0,0,192,128Z",opacity:"0.2"}),xt.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["fill",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M237.22,151.9l0-.1a1.42,1.42,0,0,0-.07-.22,48.46,48.46,0,0,0-2.31-5.3L193.27,51.8a8,8,0,0,0-1.67-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,8,8,0,0,0-1.67,2.44L21.2,146.28a48.46,48.46,0,0,0-2.31,5.3,1.72,1.72,0,0,0-.07.21s0,.08,0,.11a48,48,0,0,0,90.32,32.51,47.49,47.49,0,0,0,2.9-16.59V96h32v71.83a47.49,47.49,0,0,0,2.9,16.59,48,48,0,0,0,90.32-32.51Zm-143.15,27a32,32,0,0,1-60.2-21.71l1.81-4.13A32,32,0,0,1,96,167.88V168h0A32,32,0,0,1,94.07,178.94ZM203,198.07A32,32,0,0,1,160,168h0v-.11a32,32,0,0,1,60.32-14.78l1.81,4.13A32,32,0,0,1,203,198.07Z"}))],["light",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M233,147.24,191.43,52.6a6,6,0,0,0-1.25-1.83,30,30,0,0,0-42.42,0A6,6,0,0,0,146,55V82H110V55a6,6,0,0,0-1.76-4.25,30,30,0,0,0-42.42,0,6,6,0,0,0-1.25,1.83L23,147.24A46,46,0,1,0,110,168V94h36v74a46,46,0,1,0,87-20.76ZM64,202a34,34,0,1,1,34-34A34,34,0,0,1,64,202Zm0-80a45.77,45.77,0,0,0-18.55,3.92L75.06,58.54A18,18,0,0,1,98,57.71V137A45.89,45.89,0,0,0,64,122Zm94-64.28a18,18,0,0,1,22.94.83l29.61,67.37A45.9,45.9,0,0,0,158,137ZM192,202a34,34,0,1,1,34-34A34,34,0,0,1,192,202Z"}))],["regular",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["thin",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M231.22,148.09,189.6,53.41a3.94,3.94,0,0,0-.83-1.22,28,28,0,0,0-39.6,0A4,4,0,0,0,148,55V84H108V55a4,4,0,0,0-1.17-2.83,28,28,0,0,0-39.6,0,3.94,3.94,0,0,0-.83,1.22L24.78,148.09A44,44,0,1,0,108,168V92h40v76a44,44,0,1,0,83.22-19.91ZM64,204a36,36,0,1,1,36-36A36,36,0,0,1,64,204Zm0-80a43.78,43.78,0,0,0-22.66,6.3L73.4,57.35a20,20,0,0,1,26.6-.59v86A44,44,0,0,0,64,124Zm92-67.23a20,20,0,0,1,26.6.59l32.06,72.94A43.92,43.92,0,0,0,156,142.74ZM192,204a36,36,0,1,1,36-36A36,36,0,0,1,192,204Z"}))]]);var mi=ui.forwardRef((e,t)=>ui.createElement(Le,{ref:t,...e,weights:yp}));mi.displayName="BinocularsIcon";import*as fi from"react";import*as wt from"react";var vp=new Map([["bold",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),wt.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]);var pi=fi.forwardRef((e,t)=>fi.createElement(Le,{ref:t,...e,weights:vp}));pi.displayName="CaretLeftIcon";import*as di from"react";import*as yt from"react";var Rp=new Map([["bold",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),yt.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]);var gi=di.forwardRef((e,t)=>di.createElement(Le,{ref:t,...e,weights:Rp}));gi.displayName="CaretRightIcon";import*as hi from"react";import*as vt from"react";var Pp=new Map([["bold",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"}))],["duotone",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z",opacity:"0.2"}),vt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"}))],["fill",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"}))],["light",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"}))],["regular",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"}))],["thin",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"}))]]);var Ii=hi.forwardRef((e,t)=>hi.createElement(Le,{ref:t,...e,weights:Pp}));Ii.displayName="CircleHalfIcon";import*as bi from"react";import*as Rt from"react";var Tp=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Rt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]);var Ci=bi.forwardRef((e,t)=>bi.createElement(Le,{ref:t,...e,weights:Tp}));Ci.displayName="ClockCounterClockwiseIcon";import*as Si from"react";import*as Pt from"react";var Ep=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),Pt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]);var Cn=Si.forwardRef((e,t)=>Si.createElement(Le,{ref:t,...e,weights:Ep}));Cn.displayName="FileTextIcon";import*as xi from"react";import*as Tt from"react";var Ap=new Map([["bold",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["duotone",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Tt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["light",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]);var wi=xi.forwardRef((e,t)=>xi.createElement(Le,{ref:t,...e,weights:Ap}));wi.displayName="GlobeIcon";import*as yi from"react";import*as Et from"react";var Mp=new Map([["bold",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM212,173.44l-84,46-84-46V82.56l84-46,84,46Z"}))],["duotone",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M224,80.18v95.64a8,8,0,0,1-4.16,7l-88,48.18a8,8,0,0,1-7.68,0l-88-48.18a8,8,0,0,1-4.16-7V80.18a8,8,0,0,1,4.16-7l88-48.18a8,8,0,0,1,7.68,0l88,48.18A8,8,0,0,1,224,80.18Z",opacity:"0.2"}),Et.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM216,175.82,128,224,40,175.82V80.18L128,32h0l88,48.17Z"}))],["fill",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M232,80.18v95.64a16,16,0,0,1-8.32,14l-88,48.17a15.88,15.88,0,0,1-15.36,0l-88-48.17a16,16,0,0,1-8.32-14V80.18a16,16,0,0,1,8.32-14l88-48.17a15.88,15.88,0,0,1,15.36,0l88,48.17A16,16,0,0,1,232,80.18Z"}))],["light",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M222.72,67.91l-88-48.18a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.91ZM218,175.82a2,2,0,0,1-1,1.75l-88,48.18a2,2,0,0,1-1.92,0L39,177.57a2,2,0,0,1-1-1.75V80.18a2,2,0,0,1,1-1.75l88-48.18a2,2,0,0,1,1.92,0l88,48.18a2,2,0,0,1,1,1.75Z"}))],["regular",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM216,175.82,128,224,40,175.82V80.18L128,32h0l88,48.17Z"}))],["thin",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM220,175.82a4,4,0,0,1-2.08,3.5l-88,48.18a4,4,0,0,1-3.84,0l-88-48.18a4,4,0,0,1-2.08-3.5V80.18a4,4,0,0,1,2.08-3.5l88-48.18a3.94,3.94,0,0,1,3.84,0l88,48.18a4,4,0,0,1,2.08,3.5Z"}))]]);var vi=yi.forwardRef((e,t)=>yi.createElement(Le,{ref:t,...e,weights:Mp}));vi.displayName="HexagonIcon";import*as Ri from"react";import*as At from"react";var kp=new Map([["bold",At.createElement(At.Fragment,null,At.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),At.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]);var Pi=Ri.forwardRef((e,t)=>Ri.createElement(Le,{ref:t,...e,weights:kp}));Pi.displayName="ImageIcon";import*as Ti from"react";import*as Mt from"react";var Lp=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),Mt.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]);var Ei=Ti.forwardRef((e,t)=>Ti.createElement(Le,{ref:t,...e,weights:Lp}));Ei.displayName="PaletteIcon";import*as Ai from"react";import*as kt from"react";var Dp=new Map([["bold",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),kt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var Mi=Ai.forwardRef((e,t)=>Ai.createElement(Le,{ref:t,...e,weights:Dp}));Mi.displayName="PaperclipIcon";import*as ki from"react";import*as Lt from"react";var Fp=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Lt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]);var Yn=ki.forwardRef((e,t)=>ki.createElement(Le,{ref:t,...e,weights:Fp}));Yn.displayName="PlusIcon";import*as Li from"react";import*as Dt from"react";var Op=new Map([["bold",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M220,48V88a12,12,0,0,1-24,0V77L164.77,108.2a12,12,0,0,1-17-17L179,60H168a12,12,0,0,1,0-24h40A12,12,0,0,1,220,48ZM208,156a12,12,0,0,0-12,12v11L56.49,39.51a12,12,0,0,0-17,17L179,196H168a12,12,0,0,0,0,24h40a12,12,0,0,0,12-12V168A12,12,0,0,0,208,156ZM91.23,147.8,39.51,199.51a12,12,0,0,0,17,17l51.71-51.72a12,12,0,0,0-17-17Z"}))],["duotone",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M48,48l80,80L48,208Zm80,80,80,80V48Z",opacity:"0.2"}),Dt.createElement("path",{d:"M216,48V88a8,8,0,0,1-16,0V67.31L156.28,111A8,8,0,0,1,145,99.72L188.69,56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48Zm-8,112a8,8,0,0,0-8,8v20.69L53.66,42.34A8,8,0,0,0,42.34,53.66L188.69,200H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["fill",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M216,48V88a8,8,0,0,1-13.66,5.66L188,79.31,156.28,111A8,8,0,0,1,145,99.72L176.69,68,162.34,53.66A8,8,0,0,1,168,40h40A8,8,0,0,1,216,48Zm-4.94,112.61a8,8,0,0,0-8.72,1.73L188,176.69,53.66,42.34A8,8,0,0,0,42.34,53.66L176.69,188l-14.35,14.34A8,8,0,0,0,168,216h40a8,8,0,0,0,8-8V168A8,8,0,0,0,211.06,160.61ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["light",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M214,48V88a6,6,0,0,1-12,0V62.48l-47.13,47.14a6,6,0,0,1-8.49-8.49L193.52,54H168a6,6,0,0,1,0-12h40A6,6,0,0,1,214,48Zm-6,114a6,6,0,0,0-6,6v25.52L52.24,43.76a6,6,0,0,0-8.48,8.48L193.52,202H168a6,6,0,0,0,0,12h40a6,6,0,0,0,6-6V168A6,6,0,0,0,208,162ZM101.13,146.38,43.76,203.76a6,6,0,1,0,8.48,8.48l57.38-57.37a6,6,0,0,0-8.49-8.49Z"}))],["regular",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M216,48V88a8,8,0,0,1-16,0V67.31L156.28,111A8,8,0,0,1,145,99.72L188.69,56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48Zm-8,112a8,8,0,0,0-8,8v20.69L53.66,42.34A8,8,0,0,0,42.34,53.66L188.69,200H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["thin",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M212,48V88a4,4,0,0,1-8,0V57.66L153.46,108.2a4,4,0,1,1-5.66-5.66L198.34,52H168a4,4,0,0,1,0-8h40A4,4,0,0,1,212,48Zm-4,116a4,4,0,0,0-4,4v30.34L50.83,45.17a4,4,0,0,0-5.66,5.66L198.34,204H168a4,4,0,0,0,0,8h40a4,4,0,0,0,4-4V168A4,4,0,0,0,208,164ZM102.54,147.8,45.17,205.17a4,4,0,0,0,5.66,5.66l57.37-57.37a4,4,0,1,0-5.66-5.66Z"}))]]);var Di=Li.forwardRef((e,t)=>Li.createElement(Le,{ref:t,...e,weights:Op}));Di.displayName="ShuffleSimpleIcon";import*as Fi from"react";import*as Ft from"react";var Np=new Map([["bold",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Ft.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var Uo=Fi.forwardRef((e,t)=>Fi.createElement(Le,{ref:t,...e,weights:Np}));Uo.displayName="XIcon";import{makeFunctionReference as er}from"convex/server";var _o={welcomeSuggestions:er("conversations:welcomeSuggestions"),workspace:er("conversations:workspace"),visitorProfile:er("conversations:visitorProfile"),openWebsite:er("conversations:openWebsite"),visitorConversations:er("conversations:visitorConversations"),customerMessages:er("conversations:customerMessages"),startCustomer:er("conversations:startCustomer"),sendCustomer:er("conversations:sendCustomer"),retryAgentResponse:er("conversations:retryAgentResponse"),generateAttachmentUploadUrl:er("conversations:generateAttachmentUploadUrl"),markCustomerRead:er("conversations:markCustomerRead")};import{useEffect as Px,useRef as Tx,useState as Hs}from"react";function Wa(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t};return}var Bp={};function Ot(e,t,o,r,n){if(!o&&!r&&!n&&!e)return Oi(t);let a=Oi(e);if(t)a=za(a,t);if(o)a=za(a,o);if(r)a=za(a,r);if(n)a=za(a,n);return a}function Hp(e){if(e.length===0)return Bp;if(e.length===1)return Oi(e[0]);let t=Oi(e[0]);for(let o=1;o<e.length;o+=1)t=za(t,e[o]);return t}function Oi(e){if(Up(e))return{...e(Bp)};return BI(e)}function za(e,t){if(Up(t))return t(e);return HI(e,t)}function BI(e){let t={...e};for(let o in t){let r=t[o];if(Vp(o,r))t[o]=_p(r)}return t}function HI(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=Wa(e.style,r);break}case"className":{e[o]=Pu(e.className,r);break}default:if(Vp(o,r))e[o]=VI(e[o],r);else e[o]=r}}return e}function Vp(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t==="function"||typeof t>"u")}function Up(e){return typeof e==="function"}function VI(e,t){if(!t)return e;if(!e)return _p(t);return(...o)=>{let r=o[0];if(Wp(r)){let a=r;Ga(a);let s=t(...o);if(!a.baseUIHandlerPrevented)e?.(...o);return s}let n=t(...o);return e?.(...o),n}}function _p(e){if(!e)return e;return(...t)=>{let o=t[0];if(Wp(o))Ga(o);return e(...t)}}function Ga(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Pu(e,t){if(t){if(e)return t+" "+e;return t}return e}function Wp(e){return e!=null&&typeof e==="object"&&"nativeEvent"in e}import*as Zr from"react";import*as Gp from"react";var zp={};function Xe(e,t){let o=Gp.useRef(zp);if(o.current===zp)o.current=e(t);return o}function Wo(e,t,o,r){let n=Xe($p).current;if(UI(n,e,t,o,r))qp(n,[e,t,o,r]);return n.callback}function Zp(e){let t=Xe($p).current;if(_I(t,e))qp(t,e);return t.callback}function $p(){return{callback:null,cleanup:null,refs:[]}}function UI(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function _I(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function qp(e,t){if(e.refs=t,t.every((o)=>o==null)){e.callback=null;return}e.callback=(o)=>{if(e.cleanup)e.cleanup(),e.cleanup=null;if(o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=a(o);if(typeof s==="function")r[n]=s;break}case"object":{a.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=r[n];if(typeof s==="function")s();else a(null);break}case"object":{a.current=null;break}default:}}}}}}import*as Xp from"react";import*as jp from"react";var WI=parseInt(jp.version,10);function Kn(e){return WI>=e}function Tu(e){if(!Xp.isValidElement(e))return null;let t=e,o=t.props;return(Kn(19)?o?.ref:t.ref)??null}function Ye(){}var Mr=Object.freeze([]),Ue=Object.freeze({});function Yp(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let a=t[r](n);if(a!=null)Object.assign(o,a);continue}if(n===!0)o[`data-${r.toLowerCase()}`]="";else if(n)o[`data-${r.toLowerCase()}`]=n.toString()}return o}function Kp(e,t){return typeof e==="function"?e(t):e}function Jp(e,t){return typeof e==="function"?e(t):e}import{createElement as Qp}from"react";function ve(e,t,o={}){let r=t.render;if(o.enabled!==!1)r=Za(r);let n=zI(t,o,r);if(o.enabled===!1)return null;let a=o.state??Ue;return $I(e,r,n,a)}function zI(e,t,o){let{className:r,style:n}=e,{state:a=Ue,ref:s,props:i,stateAttributesMapping:c,enabled:u=!0}=t,l=u?Kp(r,a):void 0,m=u?Jp(n,a):void 0,p=u?Yp(a,c):Ue,d=u&&i?GI(i):void 0,f=u?Wa(p,d)??{}:Ue;if(typeof document<"u")if(!u)Wo(null,null);else if(Array.isArray(s))f.ref=Zp([f.ref,Tu(o),...s]);else f.ref=Wo(f.ref,Tu(o),s);if(!u)return Ue;if(l!==void 0)f.className=Pu(f.className,l);if(m!==void 0)f.style=Wa(f.style,m);return f}function GI(e){if(Array.isArray(e))return Hp(e);return Ot(void 0,e)}var ZI=Symbol.for("react.lazy");function Za(e){if(e?.$$typeof!==ZI)return e;let t=Zr.Children.toArray(e)[0];return Zr.isValidElement(t)?t:e}function $I(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=Ot(o,t.props);return n.ref=o.ref,Zr.cloneElement(t,n)}return qI(e,o)}function qI(e,t){if(e==="button")return Qp("button",{type:"button",...t,key:t.key});if(e==="img")return Qp("img",{alt:"",...t,key:t.key});return Zr.createElement(e,t)}function Jn(e){return ve(e.defaultTagName??"div",e,e)}function ed(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=ed(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function td(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=ed(e))&&(r&&(r+=" "),r+=t);return r}var od=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,rd=td,ro=(e,t)=>(o)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return rd(e,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className);let{variants:n,defaultVariants:a}=t,s=Object.keys(n).map((u)=>{let l=o===null||o===void 0?void 0:o[u],m=a===null||a===void 0?void 0:a[u];if(l===null)return null;let p=od(l)||od(m);return n[u][p]}),i=o&&Object.entries(o).reduce((u,l)=>{let[m,p]=l;if(p===void 0)return u;return u[m]=p,u},{}),c=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:m,className:p,...d}=l;return Object.entries(d).every((f)=>{let[S,g]=f;return Array.isArray(g)?g.includes({...a,...i}[S]):{...a,...i}[S]===g})?[...u,m,p]:u},[]);return rd(e,s,c,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className)};var Ir=(e,t=0)=>{let o=new Int32Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r)-48-t;return o},Ni=(e)=>{let t=new Int32Array(e.length+1);for(let o=0;o<e.length;o++)t[o+1]=t[o]+e[o];return t},$r=(e)=>{let t=new Int32Array(e.length),o=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r)-48;o+=n>>>1^-(n&1),t[r]=o}return t};var jI=[],Sn=Ni(Ir("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),XI=Ni(Ir(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var YI=(()=>{let e=Sn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let a=1,s=n+1;for(let i=Sn[n];i<Sn[n+1];i++)a+=t[s],s+=t[s];t[n]=a}let o=new Int32Array(Sn[e]),r=0;for(let n=0;n<e;n++){let a=n+1;for(let s=Sn[n];s<Sn[n+1];s++)o[r++]=a,a+=t[a]}return o})(),KI=Ir("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),JI=Ni(Ir("123333359346463635126536711576")),QI=Ir("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),eb=Ir("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),tb=$r("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),ob=(()=>{let e=new Int32Array(319).fill(-1),t=$r("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=$r("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=o[r];return e})(),rb="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((e)=>{let t=e.split(" "),o=t.shift();for(let r=0;r<t.length;r++)t[r]=o+t[r];return t}),nd=$r("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),nb=$r("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),ab=$r("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),ad=new Int32Array(995),sd=new Int32Array(995),id=new Int32Array(995),Eu="",Au=new Int32Array(1038);{let e=new Map,t=0,o=0;for(let r=0;r<nd.length;r++)for(let n of rb[ab[r]]){let a=e.get(n);if(a===void 0)a=t++,e.set(n,a),Au[a*2]=Eu.length,Au[a*2+1]=n.length,Eu+=n;ad[o]=nd[r],sd[o]=nb[r],id[o]=a,o++}}var sb=$r("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),ib=Ni(Ir("1::24444432:442:44:44>222222:44:4421322511111311111114")),cb=$r("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),lb=Ir("ij"),ub=Ir(""),mb=Ir("1"),fb="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",cd={GROUP_COUNT:384,customValidatorNames:jI,edgeStart:Sn,labelStart:XI,labelText:"@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",edgeTarget:YI,nodeGroup:KI,nodeVlist:ob,vlistPat:JI,vlistOps:QI,vlistRef:eb,vlistGroup:tb,litAnchor:ad,litGroup:sd,litPool:id,poolOffsets:Au,poolText:Eu,adjGid:sb,adjStart:ib,adjTgt:cb,patGid:lb,patTgt:ub,postfixLookupGroups:mb,orderSensitiveModifiers:fb};var pb="line"in Error();var Mu=(e,t,o)=>{let r=2166136261;for(let n=t;n<o;n++)r=Math.imul(r^e.charCodeAt(n),16777619);return r},Bi=(e,t,o)=>{let r=o-t,n=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,s=r>>1;n=Math.imul(n^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),n=Math.imul(n^e.charCodeAt(t+s)<<8^e.charCodeAt(t+s+a)<<16^e.charCodeAt(o-3),3266489909),n^=e.charCodeAt(o-2)<<8^e.charCodeAt(o-1)<<16;for(let i=t+3,c=o-4;i<t+8&&i<c;i++,c--)n=Math.imul(n^e.charCodeAt(i)^e.charCodeAt(c)<<8,16777619)}return n^n>>>15|0},ld=(e,t,o={})=>{let{GROUP_COUNT:r,edgeStart:n,labelStart:a,labelText:s,edgeTarget:i,nodeGroup:c,nodeVlist:u,vlistPat:l,vlistOps:m,vlistRef:p,vlistGroup:d,litAnchor:f,litGroup:S,litPool:g,poolOffsets:h,poolText:x,adjGid:b,adjStart:C,adjTgt:I,patGid:y,patTgt:w,postfixLookupGroups:v,customValidatorNames:R,orderSensitiveModifiers:L}=e,U=new Int32Array(r).fill(-1);for(let F=0;F<b.length;F++)U[b[F]]=F;let E=0;for(let F=0;F+1<C.length;F++){let q=C[F+1]-C[F];if(q>E)E=q}let O=32;while(O<2*(1+E+y.length))O<<=1;let k=new Int32Array(p.length+1);for(let F=0;F<p.length;F++)k[F+1]=k[F]+l[p[F]+1]-l[p[F]];let P=new Uint8Array(r);for(let F=0;F<v.length;F++)P[v[F]]=1;let N=n.length-1,j=new Uint8Array(N),T=0,B=!0;for(let F=0;F<f.length;F++){j[f[F]]=1;let q=h[g[F]*2+1];if(q>T)T=q;let ae=x.charCodeAt(h[g[F]*2]);if(ae===91||ae===40)B=!1}let W=1;while(W<f.length*2)W<<=1;let X=new Int32Array(W).fill(-1);for(let F=0;F<f.length;F++){let q=h[g[F]*2],ae=(Mu(x,q,q+h[g[F]*2+1])^Math.imul(f[F],2654435761)|0)&W-1;while(X[ae]!==-1)ae=ae+1&W-1;X[ae]=F}let A=(F,q,ae,Te)=>{let _e=(Mu(q,ae,Te)^Math.imul(F,2654435761)|0)&W-1,Be=Te-ae;for(;;){let Ke=X[_e];if(Ke===-1)return-1;if(f[Ke]===F&&h[g[Ke]*2+1]===Be){let It=h[g[Ke]*2],tt=!0;for(let Oe=0;Oe<Be;Oe++)if(x.charCodeAt(It+Oe)!==q.charCodeAt(ae+Oe)){tt=!1;break}if(tt)return S[Ke]}_e=_e+1&W-1}},ue=o.cacheSize??8192,V=o.prefix??e.prefix??"",G=V===""?"":V+":",Z=G.length,oe=(R??[]).map((F)=>{let q=t&&t[F];if(!q)throw Error("cn: missing validator "+F);return q}),Pe=/\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$/,ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,me=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fe=0,be=-1,ne=-1,we=-1,Ce=-1,De=(F)=>F>=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===95,Q=(F)=>/\s/.test(String.fromCharCode(F)),H=(F,q,ae)=>{if(fe=0,be=-1,ae-q<3)return;let Te=F.charCodeAt(q),_e=F.charCodeAt(ae-1);if(Te===91&&_e===93)fe=1;else if(Te===40&&_e===41)fe=2;else return;we=q+1,Ce=ae-1;let Be=q+1;if(De(F.charCodeAt(Be))){Be++;while(Be<ae-1){let Ke=F.charCodeAt(Be);if(!De(Ke)&&Ke!==45)break;Be++}if(Be<ae-2&&F.charCodeAt(Be)===58)be=q+1,ne=Be,we=Be+1}},Y=(F,q,ae,Te)=>{if(ae-q!==Te.length)return!1;for(let _e=0;_e<Te.length;_e++)if(F.charCodeAt(q+_e)!==Te.charCodeAt(_e))return!1;return!0},D=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,de=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K=(F)=>!!F&&!Number.isNaN(Number(F)),pe=(F,q,ae)=>{if(ae-q<11||!Y(F,q,q+10,"@container"))return!1;if(F.charCodeAt(q+10)===47)return ae-q>=12;let Te=F.charCodeAt(q+11);return Te===115&&ae-q>=17&&Y(F,q+10,q+16,"-size/")||Te===110&&ae-q>=19&&Y(F,q+10,q+18,"-normal/")},M=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],_="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map((F)=>F.split(" ")),Se=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],J=(F,q,ae,Te)=>{if(F>=10){if(F>=25)return oe[F-25](q.slice(ae,Te));let _e=F-10;if(fe!==M[_e])return!1;if(be>=0){for(let Be of _[_e])if(Y(q,be,ne,Be))return!0;return!1}switch(Se[_e]){case 0:return!1;case 1:return!0;case 2:{let Be=q.slice(we,Ce);return Pe.test(Be)&&!ee.test(Be)}case 3:return K(q.slice(we,Ce));case 4:return me.test(q.slice(we,Ce));default:return ie.test(q.slice(we,Ce))}}switch(F){case 0:return!0;case 1:return fe===0;case 2:return fe===1;case 3:return fe===2;case 4:return D.test(q.slice(ae,Te));case 5:return K(q.slice(ae,Te));case 6:{let _e=q.slice(ae,Te);return!!_e&&Number.isInteger(Number(_e))}case 7:return Te>ae&&q.charCodeAt(Te-1)===37&&K(q.slice(ae,Te-1));case 8:return de.test(q.slice(ae,Te));default:return pe(q,ae,Te)}},se=new Set(typeof L==="string"?L.split(" "):L),ge=(F,q,ae,Te,_e,Be)=>{let Ke=Mu(q,ae,Te)^(_e?2654435769:0)|0,It=F.get(Ke);if(It!==void 0)e:for(let ze=0;ze<It.length;ze++){let et=It[ze];if(et.imp!==_e||et.k.length!==Te-ae)continue;for(let Xt=0;Xt<et.k.length;Xt++)if(et.k.charCodeAt(Xt)!==q.charCodeAt(ae+Xt))continue e;return et.id}else F.set(Ke,It=[]);let tt=q.slice(ae,Te),Oe=Be(tt);return It.push({k:tt,imp:_e,id:Oe}),Oe},he=new Map,Ie=new Map,Ne=2,Qe=4096,gt=(F,q)=>{let ae=[],Te=0,_e=0,Be=0;for(let Oe=0;Oe<F.length;Oe++){let ze=F.charCodeAt(Oe);if(Te===0&&_e===0&&ze===58)ae.push(F.slice(Be,Oe)),Be=Oe+1;else if(ze===91)Te++;else if(ze===93)Te--;else if(ze===40)_e++;else if(ze===41)_e--}ae.push(F.slice(Be));let Ke=ae[0];if(ae.length>1){let Oe=[],ze=[];for(let et of ae)if(et.charCodeAt(0)===91||se.has(et)){if(ze.length)Oe.push(...ze.sort()),ze=[];Oe.push(et)}else ze.push(et);if(ze.length)Oe.push(...ze.sort());Ke=Oe.join(":")}let It=q?Ke+" !":Ke,tt=Ie.get(It);if(tt===void 0)Ie.set(It,tt=Ne++);return tt},bo=new Map,Co=r,Yo=r+4096,oo=()=>Co++,Kt=2097152,yo=8192,To=new Int32Array(yo),uo=Array(yo).fill(null),fn=new Int32Array(yo),pn=new Int32Array(yo),$e=new Uint8Array(yo),Zt=0,ye=(F,q,ae,Te,_e,Be,Ke,It)=>{let tt=F;if(uo[F]!==null)if(uo[F|1]===null)tt=F|1;else if((Zt++&3)===0)tt=F|Zt>>2&1;else return;uo[tt]=q.slice(ae,Te),To[tt]=_e,fn[tt]=Be,pn[tt]=Ke,$e[tt]=It},Me=()=>uo.fill(null),We=256,$t=[new Int32Array(We),new Int32Array(We),new Int32Array(We),new Int32Array(We)],[Jt,So,jt,Eo]=$t,Ko=new Uint8Array(We),No=new Uint8Array(We),$n=()=>{We*=2,$t=$t.map((q)=>{let ae=new Int32Array(We);return ae.set(q),ae}),[Jt,So,jt,Eo]=$t;let F=new Uint8Array(We);F.set(Ko),Ko=F,No=new Uint8Array(We)},pr=64,dn=new Int32Array(pr),gn=new Int32Array(pr),uu=new Int32Array(r),Ur=2048,mp=21,mu=new Float64Array(Ur),Xs=new Int32Array(Ur),_r=0,fu=(F,q)=>{if(F===0&&q<r){if(uu[q]===_r)return 1;return uu[q]=_r,0}let ae=F*2097152+q+1,Te=Math.imul(ae,2654435761)>>>mp;for(;;){if(Xs[Te]!==_r)break;if(mu[Te]===ae)return 1;Te=Te+1&Ur-1}return mu[Te]=ae,Xs[Te]=_r,0},Ys=(F,q,ae,Te,_e)=>{if(ae-q>=2&&F.charCodeAt(q)===91&&F.charCodeAt(ae-1)===93){let Be=-1;for(let Ke=q+1;Ke<ae-1;Ke++)if(F.charCodeAt(Ke)===58){Be=Ke;break}if(Be===-1||Be===q+1)return-1;return ge(bo,F,q+1,Be,0,oo)}if(Te>=0&&c[Te]>=0)return c[Te];for(let Be=_e-1;Be>=0;Be--){let Ke=gn[Be];if(Ke>ae)continue;let It=dn[Be],tt=ae-Ke;if(j[It]===1&&tt>0&&tt<=T){let Qt=F.charCodeAt(Ke);if(B===!1||Qt!==91&&Qt!==40){let zr=A(It,F,Ke,ae);if(zr>=0)return zr}}let Oe=u[It];if(Oe<0)continue;let ze=p[Oe],et=l[ze],Xt=l[ze+1];if(et===Xt)continue;H(F,Ke,ae);let mo=k[Oe]-et;for(let Qt=et;Qt<Xt;Qt++)if(J(m[Qt],F,Ke,ae))return d[mo+Qt]}return-1},Ks=(F)=>{let q=F.length,ae=0,Te=0,_e=!1;if(Ne>Qe||he.size>Qe)he=new Map,Ie=new Map,Ne=2,Me();if(Co>Yo)bo=new Map,Co=r,Me();let Be=0;while(Be<q){let Oe=F.charCodeAt(Be);if(Oe===32||Oe>=9&&Oe<=13||Oe>=160&&Q(Oe)){if(Oe!==32)_e=!0;Be++;continue}let ze=Be,et=0;while(Be<q){if(Oe=F.charCodeAt(Be),Oe<=32){if(Oe===32)break;if(Oe>=9&&Oe<=13){_e=!0;break}}else if(Oe>=160&&Q(Oe)){_e=!0;break}et=Math.imul(et^Oe,16777619),Be++}let Xt=Be,mo=Xt-ze;if(ae===We)$n();let Qt=ae++;Jt[Qt]=ze,So[Qt]=Xt,Te+=mo,et^=Math.imul(mo,2654435761);let zr=et^et>>>15|0,dr=zr&8190;{let at=-1;if(To[dr]===zr&&uo[dr]!==null&&uo[dr].length===mo)at=dr;else if(To[dr|1]===zr&&uo[dr|1]!==null&&uo[dr|1].length===mo)at=dr|1;if(at>=0){let Qo=uo[at],Er=!0;for(let Ar=0;Ar<mo;Ar++)if(Qo.charCodeAt(Ar)!==F.charCodeAt(ze+Ar)){Er=!1;break}if(Er){jt[Qt]=fn[at],Eo[Qt]=pn[at],Ko[Qt]=$e[at];continue}}}let jn=ze;if(Z!==0){if(Xt-ze<=Z||!F.startsWith(G,ze)){jt[Qt]=-1,ye(dr,F,ze,Xt,zr,-1,0,0);continue}jn=ze+Z}let du=0,gu=0,Ua=-1,hu=-1;for(let at=jn;at<Xt;at++){let Qo=F.charCodeAt(at);if(du===0&&gu===0){if(Qo===58){Ua=at;continue}if(Qo===47){hu=at;continue}}if(Qo===91)du++;else if(Qo===93)du--;else if(Qo===40)gu++;else if(Qo===41)gu--}let dp=Ua>=jn?Ua+1:jn,Bo=dp,Ho=Xt,_a=!1,gp=0;if(Ho>Bo&&F.charCodeAt(Ho-1)===33)_a=!0,Ho--;else if(Ho>Bo&&F.charCodeAt(Bo)===33)_a=!0,Bo++,gp=1;let hn=-1;if(hu>dp){if(hn=hu+gp,hn>=Ho)hn=-1}let Iu=Bo;if(Ho-Bo>1&&F.charCodeAt(Bo)===45)Iu=Bo+1;let gr=0,Gr=0,Xn=0,hp=-1,hr=0;if(u[0]>=0||j[0]===1)dn[0]=0,gn[0]=Iu,hr=1;let bu=-1,Cu=0;for(let at=Iu;at<Ho;at++){if(at===hn)bu=Gr<Xn?-1:gr,Cu=hr;if(gr!==-1){let Qo=F.charCodeAt(at),Er=-1;if(Gr<Xn)if(s.charCodeAt(Gr)===Qo){if(Gr++,Gr===Xn)Er=gr=hp}else gr=-1;else{let Ar=n[gr],oi=n[gr+1],yu=-1;for(let In=Ar;In<oi;In++){let vu=a[In];if(s.charCodeAt(vu)===Qo){if(a[In+1]-vu===1)Er=yu=i[In];else Gr=vu+1,Xn=a[In+1],hp=i[In],yu=gr;break}}gr=yu}if(Er>=0&&(u[Er]>=0||j[Er]===1)&&at+1<Ho&&F.charCodeAt(at+1)===45){if(hr===pr){pr*=2;let Ar=new Int32Array(pr);Ar.set(dn),dn=Ar;let oi=new Int32Array(pr);oi.set(gn),gn=oi}dn[hr]=Er,gn[hr]=at+2,hr++}}}if(hn===Ho)bu=Gr<Xn?-1:gr,Cu=hr;let Su=Gr<Xn?-1:gr,Vo,ti=!1;if(hn>=0){if(ti=!0,Vo=Ys(F,Bo,hn,bu,Cu),Vo!==-1&&Vo<r&&P[Vo]){let at=Ys(F,Bo,Ho,Su,hr);if(at!==-1&&at!==Vo)Vo=at,ti=!1}else if(Vo===-1)Vo=Ys(F,Bo,Ho,Su,hr),ti=!1}else Vo=Ys(F,Bo,Ho,Su,hr);let xu=0,wu=0;if(Vo===-1)jt[Qt]=-1;else wu=ti?1:0,xu=jn>=Ua?_a?1:0:ge(he,F,jn,Ua,_a?1:0,(at)=>gt(at,_a)),jt[Qt]=Vo,Ko[Qt]=wu,Eo[Qt]=xu;ye(dr,F,ze,Xt,zr,Vo,xu,wu)}if(ae===0)return"";if(ae===1)return Jt[0]===0&&So[0]===q?F:F.slice(Jt[0],So[0]);if(ae*O>Ur){while(ae*O>Ur)Ur<<=1,mp--;mu=new Float64Array(Ur),Xs=new Int32Array(Ur)}if(Ne>=Kt||Co>=Kt)throw Error("cn: too many distinct classes in one merge");if(_r=_r+1|0,_r===0)uu.fill(0),Xs.fill(0),_r=1;let Ke=!1;for(let Oe=ae-1;Oe>=0;Oe--){let ze=jt[Oe];if(ze===-1){No[Oe]=1;continue}let et=Eo[Oe];if(fu(et,ze)===1){No[Oe]=0,Ke=!0;continue}if(No[Oe]=1,ze<r){let Xt=U[ze];if(Xt>=0)for(let mo=C[Xt];mo<C[Xt+1];mo++)fu(et,I[mo]);if(Ko[Oe]&1){for(let mo=0;mo<y.length;mo++)if(y[mo]===ze)fu(et,w[mo])}}}if(!Ke&&!_e&&q===Te+ae-1)return F;let It="",tt=0;while(tt<ae){if(!No[tt]){tt++;continue}let Oe=Jt[tt],ze=So[tt],et=tt+1;while(et<ae&&No[et]&&Jt[et]===ze+1&&F.charCodeAt(ze)===32)ze=So[et],et++;if(It.length>0)It+=" ";It+=F.slice(Oe,ze),tt=et}return It},Wr=16384,Tr=new Int32Array(Wr*2),Js=0,Jo=1,Ha=Object.create(null),fp=Object.create(null),qn=new Map,pp=new Map,Qs=0,ei=0,Va=()=>{Js^=Wr,Jo=Jo+1|0,ei=0},vI=(F)=>{let q=Ha[F];if(q!==void 0)return q;let ae=Bi(F,0,F.length),Te=(ae&16383)+Js,_e=Tr[Te]===(ae^Jo)||Tr[Te^Wr]===(ae^Jo-1);if(_e){if(q=fp[F],q!==void 0)return Ha[F]=q,q}if(q=Ks(F),_e){if(Ha[F]=q,++Qs>ue)Qs=0,fp=Ha,Ha=Object.create(null),Va()}else if(Tr[Te]=ae^Jo,++ei>Wr)Va();return q},RI=(F)=>{let q=qn.get(F);if(q!==void 0)return q;let ae=Bi(F,0,F.length),Te=(ae&16383)+Js,_e=Tr[Te]===(ae^Jo)||Tr[Te^Wr]===(ae^Jo-1);if(_e){if(q=pp.get(F),q!==void 0)return qn.set(F,q),q}if(q=Ks(F),_e){if(qn.set(F,q),++Qs>ue)Qs=0,pp=qn,qn=new Map,Va()}else if(Tr[Te]=ae^Jo,++ei>Wr)Va();return q},PI=(F)=>{let q=Bi(F,0,F.length),ae=(q&16383)+Js;if(Tr[ae]===(q^Jo)||Tr[ae^Wr]===(q^Jo-1))return!0;if(Tr[ae]=q^Jo,++ei>Wr)Va();return!1},pu=ue===0?Ks:pb?(F)=>{let q=qn.get(F);return q!==void 0?q:RI(F)}:vI;return{merge:function(){return arguments.length===1&&typeof arguments[0]==="string"?pu(arguments[0]):pu(ud.apply(null,arguments))},mergeString:pu,seenBefore:ue===0?()=>!1:PI,mergeUncached:Ks}},Hi=(e,t)=>{if(!e)return"";if(typeof e==="string")return e;let o="";if(typeof e.length==="number"&&(t?Array.isArray(e):!0)){let r=e;for(let n=0;n<r.length;n++){let a=r[n];if(!a)continue;let s=typeof a==="string"?a:Hi(a,t);if(s){if(o)o+=" ";o+=s}}return o}if(t){if(typeof e==="number")return""+e;if(typeof e==="object"){for(let r in e)if(e[r]){if(o)o+=" ";o+=r}}}return o},db=(e,t)=>{let o="";for(let r=0;r<e.length;r++){let n=e[r];if(!n)continue;let a=typeof n==="string"?n:Hi(n,t);if(a){if(o)o+=" ";o+=a}}return o},ud=function(){return db(arguments,!1)};var md=(e,t)=>{let o=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,n=new Map,a=new Map,s=0,i=null,c=null,u=[],l=[],m=0,p=(h,x,b)=>{if(c===null)c=Array(4096).fill(""),u=Array(4096).fill(""),l=Array(4096).fill("");let C=Bi(h,0,h.length)&4094;if(c[C]===h&&u[C]===x)return l[C];if(c[C|1]===h&&u[C|1]===x)return l[C|1];let I=e(b?x+" "+h:h),y=c[C]===""?C:C|(c[C|1]===""?1:m++&1);return c[y]=h,u[y]=x,l[y]=I,I},d=(h,x,b,C)=>{let I=0;if(x){if(x!==h.a0)return!1;I=1}if(b){if(b!==(I===0?h.a0:h.a1))return!1;I++}if(C){if(C!==(I===0?h.a0:I===1?h.a1:h.a2))return!1;I++}return I===h.t},f=(h,x)=>{let b=h.a,C=0;for(let I=0;I<x.length;I++){let y=x[I];if(!y)continue;if(y!==b[C])return!1;C++}return C===h.t},S=(h,x)=>{let b=h.length,C=i===null?null:i.n;if(!x){if(C!==null&&f(C,h))return i=C,C.r;if(i!==null&&i!==C&&f(i,h))return i.r}let I="",y=-1,w=0,v=!1;for(let U=0;U<b;U++){let E=h[U];if(!E)continue;if(typeof E!=="string"){if(E=h[U]=Hi(E,!0),!E)continue;v=!0}if(y<0)I=E,y=U;w++}if(w===0)return"";if(w===1)return e(I);if(v){if(C!==null&&f(C,h))return i=C,C.r;if(i!==null&&i!==C&&f(i,h))return i.r}let R=n.get(I);if(R===void 0){if(R=a.get(I),R!==void 0)n.set(I,R)}let L=null;if(R!==void 0){if(R.skip>0){R.skip--,i=null;let E=I;for(let O=y+1;O<b;O++){let k=h[O];if(k)E+=" "+k}return p(E,"",!1)}let U=R.e;e:for(let E=0;E<U.length;E++){let O=U[E];if(O.t!==w)continue;let k=O.a,P=1;for(let N=y+1;N<b;N++){let j=h[N];if(j&&j!==k[P++])continue e}L=O;break}if(L!==null)R.miss=0}if(L===null){let U=I,E=[I];for(let k=y+1;k<b;k++){let P=h[k];if(!P)continue;U+=" "+P,E.push(P)}if(!o(U))return r(U);if(L={r:e(U),t:E.length,a0:E[0],a1:E[1],a2:E[2]??"",a:E,n:null},R===void 0)n.set(I,R={e:[],miss:0,skip:0,at:0});else if(++R.miss>16)R.miss=16,R.skip=1024,R.e.length=0,R.at=0;let O=R.e;if(O.length<256)O.push(L);else O[R.at]=L,R.at=R.at+1&255;if(++s>1000)s=0,a=n,n=new Map}if(i!==null&&i!==L)i.n=L;return i=L,L.r},g=(h)=>Array.isArray(h)?S(h.slice(),!1):e(Hi(h,!0));return function(h,x,b){let C=arguments.length;if((C|1)===3){let w=i;if(w!==null){let v=w.n;if(v!==null&&d(v,h,x,b))return i=v,v.r;if(w!==v&&d(w,h,x,b))return w.r}if(C===2&&typeof x==="string"&&x!==""){let v=n.get(h);if(v!==void 0&&v.skip>0)return v.skip--,i=null,p(x,h,!0)}return S([h,x,b],!0)}if(C===1)return typeof h==="string"?e(h):g(h);let I=i;if(I!==null){let w=I.n;if(w!==null){let v=w.a,R=0,L=!0;for(let U=0;U<C;U++){let E=arguments[U];if(!E)continue;if(E!==v[R]){L=!1;break}R++}if(L&&R===w.t)return i=w,w.r}if(I!==w){let v=I.a,R=0,L=!0;for(let U=0;U<C;U++){let E=arguments[U];if(!E)continue;if(E!==v[R]){L=!1;break}R++}if(L&&R===I.t)return I.r}}let y=[];for(let w=0;w<C;w++)y.push(arguments[w]);return S(y,!0)}};var ku=ld(cd),ce=md(ku.mergeString,ku),tVe=ku.merge;import*as bd from"react";import*as ta from"react";function Vi(){return typeof window<"u"}function Nt(e){if(Ui(e))return(e.nodeName||"").toLowerCase();return"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function br(e){var t;return(t=(Ui(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ui(e){if(!Vi())return!1;return e instanceof Node||e instanceof qe(e).Node}function Ve(e){if(!Vi())return!1;return e instanceof Element||e instanceof qe(e).Element}function je(e){if(!Vi())return!1;return e instanceof HTMLElement||e instanceof qe(e).HTMLElement}function tr(e){if(!Vi()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}function wn(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=no(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function fd(e){return/^(table|td|th)$/.test(Nt(e))}function $a(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var gb=/transform|translate|scale|rotate|perspective|filter/,hb=/paint|layout|strict|content/,xn=(e)=>!!e&&e!=="none",Lu;function _i(e){let t=Ve(e)?no(e):e;return xn(t.transform)||xn(t.translate)||xn(t.scale)||xn(t.rotate)||xn(t.perspective)||!Wi()&&(xn(t.backdropFilter)||xn(t.filter))||gb.test(t.willChange||"")||hb.test(t.contain||"")}function pd(e){let t=zo(e);while(je(t)&&!Go(t)){if(_i(t))return t;else if($a(t))return null;t=zo(t)}return null}function Wi(){if(Lu==null)Lu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return Lu}function Go(e){return/^(html|body|#document)$/.test(Nt(e))}function no(e){return qe(e).getComputedStyle(e)}function qa(e){if(Ve(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zo(e){if(Nt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||tr(e)&&e.host||br(e);return tr(t)?t.host:t}function dd(e){let t=zo(e);if(Go(t))return(e.ownerDocument||e).body;if(je(t)&&wn(t))return t;return dd(t)}function qr(e,t,o){var r;if(t===void 0)t=[];if(o===void 0)o=!0;let n=dd(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),s=qe(n);if(a){let i=zi(s);return t.concat(s,s.visualViewport||[],wn(n)?n:[],i&&o?qr(i):[])}else return t.concat(n,qr(n,[],o))}function zi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as Ib from"react";var ja={...Ib};var Du=ja.useInsertionEffect,bb=Du&&Du!==ja.useLayoutEffect?Du:(e)=>e();function re(e){let t=Xe(Cb).current;return t.next=e,bb(t.effect),t.trampoline}function Cb(){let e={next:void 0,callback:Sb,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Sb(){}import*as gd from"react";var xb=()=>{},z=typeof document<"u"?gd.useLayoutEffect:xb;function wb(e,t){return function(r,...n){let a=new URL(e);return a.searchParams.set("code",r.toString()),n.forEach((s)=>a.searchParams.append("args[]",s)),`${t} error #${r}; visit ${a} for the full message.`}}var yb=wb("https://base-ui.com/production-error","Base UI"),Ge=yb;import*as Gi from"react";var vb=Gi.createContext(void 0);function Qn(e=!1){let t=Gi.useContext(vb);if(t===void 0&&!e)throw Error(Ge(16));return t}import*as hd from"react";function Id(e){let{focusableWhenDisabled:t,disabled:o,composite:r=!1,tabIndex:n=0,isNativeButton:a}=e,s=r&&t!==!1,i=r&&t===!1;return{props:hd.useMemo(()=>{let u={onKeyDown(l){if(o&&t&&l.key!=="Tab")l.preventDefault()}};if(!r){if(u.tabIndex=n,!a&&o)u.tabIndex=t?n:-1}if(a&&(t||s)||!a&&o)u["aria-disabled"]=o;if(a&&(!t||i))u.disabled=o;return u},[r,o,t,s,i,a,n])}}function Ee(e){return e?.ownerDocument||document}function ea(e,t,{detail:o=0,pointerType:r=""}={}){e.dispatchEvent(new(qe(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:o,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function xo(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:r=0,native:n=!0,composite:a}=e,s=ta.useRef(null),i=Qn(!0),c=a??i!==void 0,{props:u}=Id({focusableWhenDisabled:o,disabled:t,composite:c,tabIndex:r,isNativeButton:n}),l=ta.useCallback(()=>{let d=s.current;if(!Fu(d))return;if(c&&t&&u.disabled===void 0&&d.disabled)d.disabled=!1},[t,u.disabled,c]);z(l,[l]);let m=ta.useCallback((d={})=>{let{onClick:f,onMouseDown:S,onKeyUp:g,onKeyDown:h,onPointerDown:x,...b}=d;return Ot({onClick(C){if(t){C.preventDefault();return}f?.(C)},onMouseDown(C){if(!t)S?.(C)},onKeyDown(C){if(t)return;if(Ga(C),h?.(C),C.baseUIHandlerPrevented)return;let I=C.target===C.currentTarget,y=C.currentTarget,w=Fu(y),v=!n&&Rb(y),R=I&&(n?w:!v),L=C.key==="Enter",U=C.key===" ",E=y.getAttribute("role"),O=E?.startsWith("menuitem")||E==="option"||E==="gridcell";if(I&&c&&U){if(C.defaultPrevented&&O)return;if(C.preventDefault(),!n||w)C.preventBaseUIHandler(),ea(y,C);return}if(!R||n||!U&&!L){if(I&&v&&U)C.preventDefault();return}if(C.defaultPrevented)return;if(C.preventDefault(),L)C.preventBaseUIHandler(),ea(y,C)},onKeyUp(C){if(t)return;if(Ga(C),g?.(C),C.target===C.currentTarget&&n&&c&&Fu(C.currentTarget)&&C.key===" "){C.preventDefault();return}if(C.baseUIHandlerPrevented)return;if(C.target===C.currentTarget&&!n&&!c&&!C.defaultPrevented&&C.key===" ")C.preventBaseUIHandler(),ea(C.currentTarget,C)},onPointerDown(C){if(t){C.preventDefault();return}x?.(C)}},n?{type:"button"}:{role:"button"},u,b)},[t,u,c,n]),p=re((d)=>{s.current=d,l()});return{getButtonProps:m,buttonRef:p}}function Fu(e){return je(e)&&e.tagName==="BUTTON"}function Rb(e){return je(e)&&e.tagName==="A"&&Boolean(e.href)}var Ou=bd.forwardRef(function(t,o){let{render:r,className:n,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:c,...u}=t,{getButtonProps:l,buttonRef:m}=xo({disabled:a,focusableWhenDisabled:s,native:i});return ve("button",t,{state:{disabled:a},ref:[o,m],props:[u,l]})});import{jsx as Tb}from"react/jsx-runtime";var Pb=ro("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function mt({className:e,variant:t="default",size:o="default",...r}){return Tb(Ou,{"data-slot":"button",className:ce(Pb({variant:t,size:o,className:e})),...r})}import{jsx as jr}from"react/jsx-runtime";var Eb=ro("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-40 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function oa({className:e,state:t="done",size:o="default",orientation:r="horizontal",...n}){return jr("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:ce(Eb({size:o,orientation:r}),e),...n})}var Ab=ro("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function Xa({className:e,variant:t="icon",...o}){return jr("div",{"data-slot":"attachment-media","data-variant":t,className:ce(Ab({variant:t}),e),...o})}function Ya({className:e,...t}){return jr("div",{"data-slot":"attachment-content",className:ce("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",e),...t})}function Ka({className:e,...t}){return jr("span",{"data-slot":"attachment-title",className:ce("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",e),...t})}function Ja({className:e,...t}){return jr("span",{"data-slot":"attachment-description",className:ce("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",e),...t})}function Zi({className:e,...t}){return jr("div",{"data-slot":"attachment-actions",className:ce("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",e),...t})}function Cd({className:e,variant:t,size:o="icon-xs",...r}){return jr(mt,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:ce(e),...r})}function $i({className:e,...t}){return jr("div",{"data-slot":"attachment-group",className:ce("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",e),...t})}import*as qi from"react";var Nu=qi.createContext(void 0);function Sd(e){let t=qi.useContext(Nu);if(t===void 0&&!e)throw Error(Ge(33));return t}import*as ji from"react";var Qa=ji.createContext(void 0);function vo(e){let t=ji.useContext(Qa);if(t===void 0&&!e)throw Error(Ge(36));return t}var yn="data-starting-style",es="data-ending-style";var Mb={[yn]:""},kb={[es]:""},Xr={transitionStatus(e){if(e==="starting")return Mb;if(e==="ending")return kb;return null}};var Bu="data-open",Hu="data-closed",Lb=yn,Db=es,xd="data-anchor-hidden";var Yi="data-popup-open",yd="data-pressed";var Fb={[Yi]:""},Ob={[Yi]:"",[yd]:""},Nb={[Bu]:""},Bb={[Hu]:""},Hb={[xd]:""},Ki={open(e){if(e)return Fb;return null}},Vu={open(e){if(e)return Ob;return null}},vn={open(e){if(e)return Nb;return Bb},anchorHidden(e){if(e)return Hb;return null}},ra={...vn,...Xr};import*as Ji from"react";var Vb=Ji.createContext(void 0);function na(e=!0){let t=Ji.useContext(Vb);if(t===void 0&&!e)throw Error(Ge(25));return t}var Rn="none",aa="trigger-press",Yt="trigger-hover",sa="trigger-focus",Uu="outside-press",_u="item-press",Ub="close-press";var ia="focus-out",Qi="escape-key";var ec="list-navigation",Rd="keyboard",_b="pointer";var Wb="cancel-open",ts="sibling-open",zb="disabled";var Wu="imperative-action";import*as os from"react";var zu=os.createContext(null);function Gu(e="root"){let t=os.useContext(zu),o=os.useContext(Qa);if(t===null||o===void 0)return null;return(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?t:null}var Gb={visible:!0,ref:null};function Zb(){return Gb}function Pd(e,t,o="root"){let r=Gu(o),a=((o==="submenu-trigger"?r?.useSubmenuTrigger:r?.useItem)??Zb)({label:e.label,children:e.children,render:e.render}),s=Wo(t,a.ref);return{visible:a.visible,ref:s,props:a.props}}import*as ca from"react";import*as kd from"react";function $b(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:qb,platform:jb,maxTouchPoints:Td}=$b(),Pn=qb.toLowerCase(),Tn=jb.toLowerCase();var Zu=/^i(os$|p)/.test(Tn)||Tn==="macintel"&&Td>1,Ed="android",Ad=Tn===Ed||Pn.includes(Ed),Md=!Zu&&Tn.startsWith("mac"),Xb=Tn.startsWith("win"),Yb=!Ad&&/^(linux|chrome os)/.test(Tn),$u=Md||Zu;var qu=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),Kb=!qu&&Pn.includes("firefox"),Jb=!qu&&Pn.includes("chrom");var Qb=$u;var eC=/jsdom|happydom/.test(Pn);function tC(e){e.preventDefault()}function Ld(e){let{closeOnClick:t,highlighted:o,id:r,nodeId:n,store:a,typingRef:s,itemRef:i,itemMetadata:c}=e,u=vo(),l=na(!0),m=c.type==="submenu-trigger",p=m?u.parentVirtualFocus:u.virtualFocus,f=(m&&u.parent.type==="menu"?u.parent.store:u.store).useState("webkitAriaSelected",o),{events:S}=a.useState("floatingTreeRoot"),g=a.useState("open"),h=l!==void 0,x=!p&&g&&o?0:-1;return kd.useMemo(()=>({id:r,role:"menuitem",tabIndex:x,"aria-selected":f,onMouseDown:p?tC:void 0,onKeyDown(b){if(b.key===" "&&s?.current)b.preventDefault()},onMouseMove(b){if(!n)return;S.emit("itemhover",{nodeId:n,target:b.currentTarget})},onClick(b){if(t)S.emit("close",{domEvent:b.nativeEvent,reason:_u})},onMouseUp(b){if(l){let C=l.initialCursorPointRef.current;if(l.initialCursorPointRef.current=null,h&&C&&Math.abs(b.clientX-C.x)<=1&&Math.abs(b.clientY-C.y)<=1)return;if(h&&!kr.mac&&b.button===2)return}if(i.current&&a.context.allowMouseUpTriggerRef.current&&(!h||b.button===2)){if(c.type==="regular-item")ea(i.current,b,{detail:1,pointerType:"mouse"})}}}),[t,x,r,S,n,a.context.allowMouseUpTriggerRef,s,i,l,h,c.type,f,p])}var Dd={type:"regular-item"};function Fd(e){let{closeOnClick:t,disabled:o,highlighted:r,id:n,store:a,typingRef:s=a.context.typingRef,nativeButton:i,itemMetadata:c,nodeId:u}=e,l=ca.useRef(null),{getButtonProps:m,buttonRef:p}=xo({disabled:o,focusableWhenDisabled:!0,native:i,composite:!0}),d=Ld({closeOnClick:t,highlighted:r,id:n,nodeId:u,store:a,typingRef:s,itemRef:l,itemMetadata:c}),f=ca.useCallback((g)=>Ot(d,{onMouseEnter(h){if(c.type!=="submenu-trigger")return;c.setActive(h.nativeEvent)}},g,m),[d,m,c]),S=Wo(l,p);return ca.useMemo(()=>({getItemProps:f,itemRef:S}),[f,S])}import*as En from"react";import*as tc from"react";var Xu=tc.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Od(){return tc.useContext(Xu)}function oc(e={}){let{guess:t,label:o,metadata:r,textRef:n,index:a}=e,{register:s,unregister:i,subscribeMapChange:c,nextIndexRef:u}=Od(),l=En.useRef(-1),[m,p]=En.useState(a==null&&t?()=>{if(l.current===-1){let g=u.current;u.current+=1,l.current=g}return l.current}:-1),d=a??m,f=En.useRef(null),S=En.useCallback((g)=>{let h=f.current;if(h)i(h);if(f.current=g,g)s(g,{metadata:r??null,index:a??null,label:o,textRef:n})},[a,s,i,r,o,n]);return z(()=>{if(a!=null)return;return c((g)=>{let h=f.current?g.get(f.current)?.index:null;if(h!=null)p(h)})},[a,c]),{ref:S,index:d}}import*as ac from"react";import*as rc from"react";function nc(){let[,e]=rc.useState({});return rc.useCallback(()=>{e({})},[])}var Nd=0;function oC(e,t="mui"){let o=ac.useRef(void 0),r=nc(),n=e??o.current;return ac.useEffect(()=>{if(o.current==null){if(Nd+=1,o.current=`${t}-${Nd}`,e==null)r()}},[e,t,r]),n}var Bd=ja.useId;function Cr(e,t){if(Bd!==void 0){let o=Bd();return e??(t?`${t}-${o}`:o)}return oC(e,t)}function ao(e){return Cr(e,"base-ui")}function Re(e,t,o,r){let n=!1,a=!1,s=r??Ue;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){a=!0},get isCanceled(){return n},get isPropagationAllowed(){return a},trigger:o,...s}}function Hd(e,t,o){let r=o??Ue;return{reason:e,event:t??new Event("base-ui"),...r}}import*as Yu from"react";import*as Vd from"react";function Yr(e){Vd.useEffect(e,Mr)}var sc=null,NUe=globalThis.requestAnimationFrame;class Ud{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(e)=>{this.isScheduled=!1;let t=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let o=!1;if(!this.isScheduled||o)requestAnimationFrame(this.tick),this.isScheduled=!0;return t}cancel(e){let t=e-this.startId;if(t<0||t>=this.callbacks.length)return;if(this.callbacks[t]===null)return;this.callbacks[t]=null,this.callbacksCount-=1}}var ic=new Ud;class Zo{static create(){return new Zo}static request(e){return ic.request(e)}static cancel(e){return ic.cancel(e)}currentId=sc;request(e){this.cancel(),this.currentId=ic.request(()=>{this.currentId=sc,e()})}cancel=()=>{if(this.currentId!==sc)ic.cancel(this.currentId),this.currentId=sc};disposeEffect=()=>this.cancel}function Dr(){let e=Xe(Zo.create).current;return Yr(e.disposeEffect),e}function cc(e,t=!1,o=!1,r=!1){let[n,a]=Yu.useState(e&&t?"idle":void 0),[s,i]=Yu.useState(e&&!r);if(e&&!s)i(!0),a("starting");if(!e&&s&&n!=="ending"&&!o)a("ending");if(!e&&!s&&n==="ending")a(void 0);return z(()=>{if(!e&&s&&n!=="ending"&&o){let c=Zo.request(()=>{a("ending")});return()=>{Zo.cancel(c)}}return},[e,s,n,o]),z(()=>{if(!e||t||n===void 0)return;let c=Zo.request(()=>{a(void 0)});return()=>{Zo.cancel(c)}},[t,e,n]),z(()=>{if(!e||!t)return;if(e&&s&&n!=="idle")a("starting");let c=Zo.request(()=>{a("idle")});return()=>{Zo.cancel(c)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}import*as _d from"react";import*as Ju from"react-dom";function or(e){if(e==null)return e;return"current"in e?e.current:e}function Ku(e,t){return e.getAnimations(t).filter((o)=>{let r=o.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}var lc=null;function rC(e){if(!lc){let t=[];lc=t,queueMicrotask(()=>{lc=null,Ju.flushSync(()=>{for(let o of t)o()})})}lc.push(e)}function la(e,t=!1,o=!1){let r=Dr();return re((n,a=null)=>{r.cancel();let s=or(e);if(s==null)return;let i=s,c=()=>{if(!o){Ju.flushSync(n);return}rC(()=>{if(!a?.aborted)n()})};if(typeof i.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function u(){Promise.all(Ku(i).map((l)=>l.finished.then(Ye))).then(()=>{if(!a?.aborted)c()},()=>{if(a?.aborted)return;if(Ku(i).some((m)=>m.pending||m.playState!=="finished")){u();return}c()})}if(t){let l=yn;if(!i.hasAttribute(l)){r.request(u);return}let m=new MutationObserver(()=>{if(!i.hasAttribute(l))m.disconnect(),u()});m.observe(i,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(u)})}function $o(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:a}=e,s=re(a),i=la(r,o,n);_d.useEffect(()=>{if(!t)return;let c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,o,s,i])}import*as Qu from"react";import{jsx as nC}from"react/jsx-runtime";var aC=Qu.forwardRef(function(t,o){let{render:r,className:n,id:a,label:s,nativeButton:i=!1,disabled:c=!1,closeOnClick:u=!0,style:l,...m}=t,{store:p}=vo(),d=oc({guess:!0,label:s}),f=ao(a),S=p.useState("disabled"),g=p.useState("isActive",d.index),h=p.useState("floatingNodeId"),x=p.useState("itemProps"),b=c||S,{getItemProps:C,itemRef:I}=Fd({closeOnClick:u,disabled:b,highlighted:g,id:f,store:p,nativeButton:i,nodeId:h,itemMetadata:Dd});return ve("div",t,{state:{disabled:b,highlighted:g},props:[x,m,C],ref:[I,o,d.ref]})}),Wd=Qu.forwardRef(function(t,o){let r=Pd(t,o);if(!r.visible)return null;return nC(aC,{...t,ref:r.ref})});import*as Hn from"react";import*as Sr from"react";var ns=0;class eo{static create(){return new eo}currentId=ns;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ns,t()},e)}isStarted(){return this.currentId!==ns}clear=()=>{if(this.currentId!==ns)clearTimeout(this.currentId),this.currentId=ns};disposeEffect=()=>this.clear}function Je(){let e=Xe(eo.create).current;return Yr(e.disposeEffect),e}function Mo(e){e.preventDefault(),e.stopPropagation()}function zd(e){return"nativeEvent"in e}function Kr(e){if(e.pointerType===""&&e.isTrusted)return!0;if(kr.android&&e.pointerType)return e.type==="click"&&e.buttons===1;return e.detail===0&&!e.pointerType}function ua(e){if(rs.jsdom)return!1;return!kr.android&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(kr.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ko(e,t){let o=["mouse","pen"];if(!t)o.push("",void 0);return o.includes(e)}function Gd(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function st(e){let t=e.activeElement;while(t?.shadowRoot?.activeElement!=null)t=t.shadowRoot.activeElement;return t}function le(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&tr(o)){let r=t;while(r){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function rr(e,t){let o=e;while(o){if(Ve(o)&&o.matches(t))return o;o=o.assignedSlot??o.parentNode??(tr(o)?o.host:null)}return null}function Ze(e){if("composedPath"in e)return e.composedPath()[0]??e.target;return e.target}var as="data-base-ui-focusable";var em="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ss="ArrowLeft",is="ArrowRight",tm="ArrowUp",uc="ArrowDown";var g_e=Yi,cs="data-trigger-disabled";function Jr(e,t){if(!Ve(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(cs);for(let[,r]of t.entries())if(le(r,o))return!r.hasAttribute(cs);return!1}function mc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function $d(e){return e.matches("html,body")}function Fr(e){return je(e)&&e.matches(em)}function om(e){return rr(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${em}`)!=null}function ls(e){if(!e)return!1;return e.getAttribute("role")==="combobox"&&Fr(e)}function Qr(e){if(!e||rs.jsdom)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}}function us(e){if(!e)return null;return e.hasAttribute(as)?e:e.querySelector(`[${as}]`)||e}function sC(e,t){if(t!=null&&!ko(t))return 0;if(typeof e==="function")return e();return e}function Or(e,t,o){let r=sC(e,o);if(typeof r==="number")return r;return r?.[t]}function rm(e){if(typeof e==="function")return e();return e}function fc(e,t){return t||e==="click"||e==="mousedown"}function qd(e){return e?.includes("mouse")&&e!=="mousedown"}import{jsx as M_e}from"react/jsx-runtime";var iC=Sr.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new eo,currentIdRef:{current:null},currentContextRef:{current:null}});function cC(e,t){e.current=t.current}function nm(e,t={open:!1}){let{open:o}=t,r=e.useState("floatingId"),n=Sr.useContext(iC),{currentIdRef:a,delayRef:s,timeoutMs:i,initialDelayRef:c,currentContextRef:u,hasProvider:l,timeout:m}=n,[p,d]=Sr.useState(!1),f=Sr.useRef(o);return z(()=>{f.current=o},[o]),z(()=>{function S(){u.current?.setIsInstantPhase(!1),a.current=null,u.current=null,s.current=c.current,m.clear()}if(!a.current)return;if(!o&&a.current===r){if(d(!1),i){let g=r;return m.start(i,()=>{if(e.select("open")||a.current&&a.current!==g)return;S()}),()=>{if(f.current||a.current!==g)m.clear()}}S()}return},[o,r,a,s,i,c,u,m,e]),z(()=>{if(!o)return;let S=u.current,g=a.current;if(m.clear(),u.current={onOpenChange:e.setOpen,setIsInstantPhase:d},a.current=r,s.current={open:0,close:Or(c.current,"close")},g!==null&&g!==r)d(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,Re(Rn));else d(!1),S?.setIsInstantPhase(!1)},[o,r,e,a,s,c,u,m]),z(()=>()=>{if(a.current===r){if(u.current=null,!f.current)return;a.current=null,cC(s,c),m.clear()}},[u,a,s,r,c,m]),Sr.useMemo(()=>({activeIdRef:a,hasProvider:l,delayRef:s,isInstantPhase:p}),[a,l,s,p])}import*as so from"react";function Ae(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function to(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];if(o)o()}}}function ct(e){let t=Xe(lC,e).current;return t.next=e,z(t.effect),t}function lC(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}import*as dc from"react";var jd={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},pc={...jd,position:"fixed",margin:0,top:0,left:0},B_e={...jd,position:"absolute"};import{jsx as uC}from"react/jsx-runtime";var nr=dc.forwardRef(function(t,o){let[r,n]=dc.useState();return z(()=>{if(ju.voiceOver&&Lr.webkit)n("button")},[]),uC("span",{...t,ref:o,style:pc,"aria-hidden":r?void 0:!0,...{tabIndex:0,role:r},"data-base-ui-focus-guard":""})});var{min:en,max:ar,round:fs,floor:ps}=Math,xr=(e)=>({x:e,y:e}),mC={left:"right",right:"left",bottom:"top",top:"bottom"};function hc(e,t,o){return ar(e,en(t,o))}function wr(e,t){return typeof e==="function"?e(t):e}function wo(e){return e.split("-")[0]}function Lo(e){return e.split("-")[1]}function Ic(e){return e==="x"?"y":"x"}function ds(e){return e==="y"?"height":"width"}function Ro(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function gs(e){return Ic(Ro(e))}function Kd(e,t,o){if(o===void 0)o=!1;let r=Lo(e),n=gs(e),a=ds(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])s=ms(s);return[s,ms(s)]}function Jd(e){let t=ms(e);return[gc(e),t,gc(t)]}function gc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Xd=["left","right"],Yd=["right","left"],fC=["top","bottom"],pC=["bottom","top"];function dC(e,t,o){switch(e){case"top":case"bottom":if(o)return t?Yd:Xd;return t?Xd:Yd;case"left":case"right":return t?fC:pC;default:return[]}}function Qd(e,t,o,r){let n=Lo(e),a=dC(wo(e),o==="start",r);if(n){if(a=a.map((s)=>s+"-"+n),t)a=a.concat(a.map(gc))}return a}function ms(e){let t=wo(e);return mC[t]+e.slice(t.length)}function gC(e){var t,o,r,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function bc(e){return typeof e!=="number"?gC(e):{top:e,right:e,bottom:e,left:e}}function An(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function Cc(e,t){return t<0||t>=e.length}function Sc(e,t){return sm(e.current,{disabledIndices:t})}function am(e,t){return sm(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function e0(e,t,o){let{decrement:r,loopFocus:n,allowEscape:a,disabledIndices:s,minIndex:i,maxIndex:c}=o,u=()=>sm(e,{startingIndex:t,decrement:r,disabledIndices:s}),l,m=!1;if(!n)l=r?Math.max(i,u()):Math.min(c,u());else if(r?t<=i:t>=c){let p=r?-1:e.length;if(a&&t!==p)l=-1;else l=r?c:i,m=!0}else l=u();return{index:Cc(e,l)?-1:l,wrapped:m}}function sm(e,{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:n=1}={}){let a=t;do a+=o?-n:n;while(a>=0&&a<=e.length-1&&im(e,a,r));return a}function im(e,t,o){if(typeof o==="function"?o(t):o?.includes(t)??!1)return!0;let n=e[t];if(!n)return!1;if(!Mn(n))return!0;if(n.matches(":disabled"))return!0;return!o&&(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")}function hC(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Mn(e,t=e?no(e):null){if(!e||!e.isConnected||!t||hC(t))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility();return t.display!=="none"&&t.display!=="contents"}var IC='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function bC(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let o=e.getRootNode();return tr(o)?o.host:null}function lm(e){for(let t of Array.from(e.children))if(Nt(t)==="summary")return t;return null}function CC(e,t){let o=lm(t);return!!o&&(e===o||le(o,e))}function t0(e){let t=e?Nt(e):"";return e!=null&&e.matches(IC)&&(t!=="summary"||e.parentElement!=null&&Nt(e.parentElement)==="details"&&lm(e.parentElement)===e)&&(t!=="details"||lm(e)==null)&&(t!=="input"||e.type!=="hidden")}function um(e){if(!t0(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=bC(t)){let o=t!==e,r=Nt(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&Nt(t)==="details"&&!t.open&&!CC(e,t)||t.hasAttribute("hidden")||!r&&!SC(t,o))return!1}return!0}function SC(e,t){let o=no(e);if(!t)return Mn(e,o);return o.display!=="none"}function o0(e){let t=e.tabIndex;if(t<0){let o=Nt(e);if(o==="details"||o==="audio"||o==="video"||je(e)&&e.isContentEditable)return 0}return t}function cm(e){if(Nt(e)!=="input")return null;let t=e;return t.type==="radio"&&t.name!==""?t:null}function r0(e,t){let o=cm(e);if(!o)return!0;let r=t.find((n)=>{let a=cm(n);return a?.name===o.name&&a.form===o.form&&a.checked});if(r)return r===o;return t.find((n)=>{let a=cm(n);return a?.name===o.name&&a.form===o.form})===o}function n0(e){if(je(e)&&Nt(e)==="slot"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}if(je(e)&&e.shadowRoot)return Array.from(e.shadowRoot.children);return Array.from(e.children)}function mm(e,t){n0(e).forEach((o)=>{if(t0(o))t.push(o);mm(o,t)})}function a0(e,t,o){n0(e).forEach((r)=>{if(je(r)&&r.matches(t))o.push(r);a0(r,t,o)})}function hs(e){return um(e)&&o0(e)>=0}function fm(e){let t=[];return mm(e,t),t.filter(um)}function Is(e){let t=fm(e);return t.filter((o)=>o0(o)>=0&&r0(o,t))}function s0(e,t){let o=Is(e),r=o.length;if(r===0)return;let n=st(Ee(e)),a=o.indexOf(n),s=a===-1?t===1?0:r-1:a+t;return o[s]}function xc(e){return s0(Ee(e).body,1)||e}function wc(e){return s0(Ee(e).body,-1)||e}function i0(e,t,o){if(!e)return null;let r=[];mm(Ee(e).body,r);let n=r.indexOf(e);if(n===-1)return null;let a=r.filter(um);for(let s=1;s<r.length;s+=1){let i=r[(n+t*s+r.length)%r.length];if(!le(o,i)&&hs(i)&&r0(i,a))return i}return r[n]}function Nr(e,t){let o=t||e.currentTarget,r=e.relatedTarget;return!r||!le(o,r)}function c0(e){Is(e).forEach((o)=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function pm(e){let t=[];a0(e,"[data-tabindex]",t),t.forEach((o)=>{let r=o.dataset.tabindex;if(delete o.dataset.tabindex,r)o.setAttribute("tabindex",r);else o.removeAttribute("tabindex")})}function qo(e,t,o=!0){return e.filter((n)=>n.parentId===t).flatMap((n)=>[...!o||n.context?.open?[n]:[],...qo(e,n.id,o)])}function dm(e,t){let o=[],r=e.find((n)=>n.id===t)?.parentId;while(r){let n=e.find((a)=>a.id===r);if(r=n?.parentId,n)o=o.concat(n)}return o}function yr(e){return`data-base-ui-${e}`}var yc=0;function ma(e,t={}){let{preventScroll:o=!1,sync:r=!1,shouldFocus:n}=t;cancelAnimationFrame(yc);function a(){if(n&&!n())return;e?.focus({preventScroll:o})}if(r)return a(),Ye;let s=requestAnimationFrame(a);return yc=s,()=>{if(yc===s)cancelAnimationFrame(s),yc=0}}var l0="data-base-ui-inert",bs=new WeakMap,vc=new WeakSet,Cs=new WeakMap,gm=0;function p0(e){if(!e)return null;return tr(e)?e.host:p0(e.parentNode)}var u0=(e,t)=>t.map((o)=>{if(e.contains(o))return o;let r=p0(o);if(e.contains(r))return r;return null}).filter((o)=>o!=null),m0=(e)=>{let t=new Set;return e.forEach((o)=>{let r=o;while(r&&!t.has(r))t.add(r),r=r.parentNode}),t},f0=(e,t,o)=>{let r=[],n=(a)=>{if(!a||o.has(a))return;Array.from(a.children).forEach((s)=>{if(Nt(s)==="script")return;if(t.has(s))n(s);else r.push(s)})};return n(e),r};function xC(e,t,o,{mark:r=!0}){let n=u0(t,e),a=r?f0(t,m0(n),new Set(n)):[],s=[],i=[];if(o){let c=u0(t,Array.from(t.querySelectorAll("[aria-live]"))),u=n.concat(c);f0(t,m0(u),new Set(u)).forEach((m)=>{let p=m.getAttribute("aria-hidden"),d=p!==null&&p!=="false",f=(bs.get(m)||0)+1;if(bs.set(m,f),s.push(m),f===1&&d)vc.add(m);if(!d)m.setAttribute("aria-hidden","true")})}if(r)a.forEach((c)=>{let u=(Cs.get(c)||0)+1;if(Cs.set(c,u),i.push(c),u===1)c.setAttribute(l0,"")});return gm+=1,()=>{if(s.forEach((c)=>{let u=(bs.get(c)||0)-1;if(bs.set(c,u),!u){if(!vc.has(c))c.removeAttribute("aria-hidden");vc.delete(c)}}),r)i.forEach((c)=>{let u=(Cs.get(c)||0)-1;if(Cs.set(c,u),!u)c.removeAttribute(l0)});if(gm-=1,!gm)bs=new WeakMap,vc=new WeakSet,Cs=new WeakMap}}function hm(e,t={}){let{ariaHidden:o=!1,mark:r=!0}=t,n=Ee(e[0]).body;return xC(e,n,o,{mark:r})}import*as pt from"react";import*as bm from"react-dom";var d0=500,g0=500,h0={style:{transition:"none"}},Rc="data-base-ui-click-trigger";var I0="[data-base-ui-swipe-ignore]",b0="[data-swipe-ignore]",C0={fallbackAxisSide:"none"},Pc={fallbackAxisSide:"end"},S0={clipPath:"inset(50%)",position:"fixed",top:0,left:0};import{jsx as Im,jsxs as x0}from"react/jsx-runtime";var w0=pt.createContext(null),Cm=()=>pt.useContext(w0),wC=yr("portal");function Tc(e={}){let{ref:t,container:o,componentProps:r=Ue,elementProps:n}=e,a=Cr(),i=Cm()?.portalNode,[c,u]=pt.useState(null),[l,m]=pt.useState(null),p=re((g)=>{if(g!==null)m(g)}),d=pt.useRef(null);z(()=>{if(o===null){if(d.current)d.current=null,m(null),u(null);return}let g=(o&&(Ui(o)?o:o.current))??i??document.body;if(g==null){if(d.current)d.current=null,m(null),u(null);return}if(d.current!==g)d.current=g,m(null),u(g)},[o,i]);let f=ve("div",r,{ref:[t,p],props:[{id:a,[wC]:""},n]}),S=c&&f?bm.createPortal(f,c):null;return{node:l,nodeId:pt.isValidElement(f)?f.props.id:void 0,subtree:S}}var Ss=pt.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,container:i,portalOwnerRole:c,...u}=t,{node:l,nodeId:m,subtree:p}=Tc({container:i,ref:o,componentProps:t,elementProps:u}),d=pt.useRef(null),f=pt.useRef(null),S=pt.useRef(null),g=pt.useRef(null),[h,x]=pt.useState(null),b=pt.useRef(!1),C=h?.modal,I=h?.open,y=!!h&&!h.modal&&h.open&&!!l;pt.useEffect(()=>{if(!l||C)return;function v(R){if(l&&R.relatedTarget&&Nr(R))if(R.type==="focusin"){if(b.current)pm(l),b.current=!1}else c0(l),b.current=!0}return to(Ae(l,"focusin",v,!0),Ae(l,"focusout",v,!0))},[l,C]),z(()=>{if(!l||I!==!0||!b.current)return;pm(l),b.current=!1},[I,l]);let w=pt.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:S,afterInsideRef:g,portalNode:l,setFocusManagerState:x}),[l]);return x0(pt.Fragment,{children:[p,x0(w0.Provider,{value:w,children:[y&&l&&Im(nr,{"data-type":"outside",ref:d,onFocus:(v)=>{if(Nr(v,l))S.current?.focus();else{let R=h?h.domReference:null;wc(R)?.focus()}}}),y&&l&&Im("span",{role:c,"aria-owns":m,style:S0}),l&&bm.createPortal(s,l),y&&l&&Im(nr,{"data-type":"outside",ref:f,onFocus:(v)=>{if(Nr(v,l))g.current?.focus();else{let R=h?h.domReference:null;if(xc(R)?.focus(),h?.closeOnFocusOut)h?.onOpenChange(!1,Re(ia,v.nativeEvent))}}})]})]})});import*as tn from"react";function Ec(){let e=new Map;return{emit(t,o){e.get(t)?.forEach((r)=>r(o))},on(t,o){if(!e.has(t))e.set(t,new Set);e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}class kn{nodesRef={current:[]};events=Ec();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex((o)=>o===e);if(t!==-1)this.nodesRef.current.splice(t,1)}}import{jsx as y0}from"react/jsx-runtime";var v0=tn.createContext(null),R0=tn.createContext(null),Do=()=>tn.useContext(v0)?.id||null,fo=(e)=>{let t=tn.useContext(R0);return e??t};function xs(e){let t=Cr(),o=fo(e),r=Do();return z(()=>{if(!t)return;let n={id:t,parentId:r};return o?.addNode(n),()=>{o?.removeNode(n)}},[o,t,r]),t}function Sm(e){let{children:t,id:o}=e,r=Do();return y0(v0.Provider,{value:tn.useMemo(()=>({id:o,parentId:r}),[o,r]),children:t})}function xm(e){let{children:t,externalTree:o}=e,r=Xe(()=>o??new kn).current;return y0(R0.Provider,{value:r,children:t})}import{jsx as P0,jsxs as yC}from"react/jsx-runtime";function vC(e,t){let o=qe(Ze(e));if(e instanceof o.KeyboardEvent)return"keyboard";if(e instanceof o.FocusEvent)return t||"keyboard";if("pointerType"in e)return e.pointerType||(Kr(e)?"keyboard":t||"mouse");if("touches"in e)return"touch";if(e instanceof o.MouseEvent)return t||(e.detail===0?"keyboard":"mouse");return""}var T0=20,on=[];function wm(){on=on.filter((e)=>e.deref()?.isConnected)}function E0(e){if(wm(),e&&Nt(e)!=="body"){if(on.push(new WeakRef(e)),on.length>T0)on=on.slice(-T0)}}function A0(){return wm(),on[on.length-1]?.deref()}function RC(e){if(!e)return null;if(hs(e))return e;return Is(e)[0]||e}function M0(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;let o=fm(e).filter((n)=>{let a=n.getAttribute("data-tabindex")||"";return hs(n)||n.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");if(o.length===0){if(r!=="0")e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")}else if(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1")}function ws(e){let{context:t,children:o,disabled:r=!1,initialFocus:n=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:d,externalTree:f,getInsideElements:S}=e,g=t.useState("open"),h=t.useState("domReferenceElement"),x=t.useState("floatingElement"),{events:b,dataRef:C}=t.context,I=re(()=>C.current.floatingContext?.nodeId),y=n===!1,w=ls(h)&&y,v=ct(n),R=ct(a),L=ct(s),U=ct(l),E=ct(g),O=fo(f),k=Cm(),P=so.useRef(!1),N=so.useRef(!1),j=so.useRef(!1),T=so.useRef(null),B=so.useRef(""),W=so.useRef(""),X=so.useRef(null),A=so.useRef(null),ue=Wo(X,d,k?.beforeInsideRef),V=Wo(A,k?.afterInsideRef),G=Je(),Z=Je(),oe=Dr(),Pe=k!=null,ee=us(x),ie=re((ne=ee)=>ne?Is(ne):[]),me=re(()=>S?.().filter((ne)=>ne!=null)??[]);so.useEffect(()=>{if(r||!c)return;function ne(Ce){if(Ce.key==="Tab"){if(le(ee,st(Ee(ee)))&&ie().length===0&&!w)Mo(Ce)}}let we=Ee(ee);return Ae(we,"keydown",ne)},[r,ee,c,w,ie]),so.useEffect(()=>{if(r||!g)return;let ne=Ee(ee);function we(){j.current=!1}function Ce(Q){let H=Ze(Q),Y=me(),D=le(x,H)||le(h,H)||le(k?.portalNode,H)||Y.some((de)=>de===H||le(de,H));if(j.current=!D,W.current=Q.pointerType||"keyboard",rr(H,`[${Rc}]`))N.current=!0,Z.start(0,()=>{N.current=!1})}function De(){W.current="keyboard"}return to(Ae(ne,"pointerdown",Ce,!0),Ae(ne,"pointerup",we,!0),Ae(ne,"pointercancel",we,!0),Ae(ne,"keydown",De,!0),we)},[r,x,h,ee,g,k,Z,me]),so.useEffect(()=>{if(r||!u)return;let ne=Ee(ee);function we(){N.current=!0,Z.start(0,()=>{N.current=!1})}function Ce(Y){let D=Ze(Y);if(hs(D))T.current=D}function De(Y){let{relatedTarget:D,currentTarget:de}=Y,K=Ze(Y);if(c&&D==null&&K!=null&&le(x,K))E0(K);queueMicrotask(()=>{let pe=I(),M=t.context.triggerElements,_=me(),Se=D?.hasAttribute(yr("focus-guard"))&&[X.current,A.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,or(p),or(m)].includes(D),J=!(le(h,D)||le(x,D)||le(D,x)||le(k?.portalNode,D)||_.some((se)=>se===D||le(se,D))||M.hasMatchingElement((se)=>le(se,D))||Se||O&&(qo(O.nodesRef.current,pe).find((se)=>le(se.context?.elements.floating,D)||le(se.context?.elements.domReference,D))||dm(O.nodesRef.current,pe).find((se)=>[se.context?.elements.floating,us(se.context?.elements.floating)].includes(D)||se.context?.elements.domReference===D)));if(de===h&&ee)M0(ee);if(i&&de!==h&&!Mn(K)&&st(ne)===ne.body){if(je(ee)){if(ee.focus(),i==="popup"){oe.request(()=>{ee.focus()});return}}let se=ie(),ge=T.current,he=(ge&&se.includes(ge)?ge:null)||se[se.length-1]||ee;if(je(he))he.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}if((w?!0:!c)&&D&&J&&!N.current&&(w||D!==A0()))P.current=!0,t.setOpen(!1,Re(ia,Y))})}function Q(){if(j.current)return;C.current.insideReactTree=!0,G.start(0,()=>{C.current.insideReactTree=!1})}let H=je(h)?h:null;if(!x&&!H)return;return to(H&&Ae(H,"focusout",De),H&&Ae(H,"pointerdown",we),x&&Ae(x,"focusin",Ce),x&&Ae(x,"focusout",De),x&&k&&Ae(x,"focusout",Q,!0))},[r,h,x,ee,c,O,k,t,u,i,ie,w,I,C,G,Z,oe,m,p,me]),so.useEffect(()=>{if(r||!x||!g)return;let ne=Array.from(k?.portalNode?.querySelectorAll(`[${yr("portal")}]`)||[]),Ce=(O?dm(O.nodesRef.current,I()):[]).find((de)=>ls(de.context?.elements.domReference||null))?.context?.elements.domReference,Q=[...[x,...ne,X.current,A.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...me()],Ce,or(p),or(m),w?h:null].filter((de)=>de!=null),H=hm(Q,{ariaHidden:c||w,mark:!1}),Y=[x,...ne].filter((de)=>de!=null),D=hm(Y);return()=>{D(),H()}},[g,r,h,x,c,k,w,O,I,m,p,me]),z(()=>{if(!g||r||!je(ee))return;B.current="",W.current="";let ne=Ee(ee),we=st(ne);queueMicrotask(()=>{let Ce=v.current,De=typeof Ce==="function"?Ce(U.current||""):Ce;if(De===void 0||De===!1)return;if(le(ee,we))return;let H=null,Y=()=>{if(H==null)H=ie(ee);return H[0]||ee},D;if(De===!0||De===null)D=Y();else D=or(De);D=D||Y();let de=le(ee,st(ne)),K=C.current.openEvent,pe=K?.type==="mousedown"&&Kr(K);ma(D,{sync:pe,preventScroll:D===ee,shouldFocus(){if(!E.current)return!1;if(de)return!0;let M=st(ne);return!(M!==D&&le(ee,M))}})})},[r,g,ee,ie,v,U,E,C]);let fe=so.useRef(null);z(()=>{if(r||!ee){fe.current=null;return}if(fe.current)fe.current.cancelled=!0,fe.current=null;let ne=Ee(ee),we=st(ne),Ce=U.current==null;E0(we);function De(H){if(!H.open)B.current=vC(H.nativeEvent,W.current);if(H.reason===ia&&H.triggerElement?.hasAttribute(yr("focus-guard"))||H.reason===Yt&&H.nativeEvent.type==="mouseleave")P.current=!0;if(H.reason!==Uu)return;if(H.nested)P.current=!1;else if(Kr(H.nativeEvent)||ua(H.nativeEvent))P.current=!1;else{let Y=!1;if(Ee(ee).createElement("div").focus({get preventScroll(){return Y=!0,!1}}),Y)P.current=!1;else P.current=!0}}b.on("openchange",De);function Q(H){let Y=R.current,D=typeof Y==="function"?Y(H):Y;if(D===void 0||D===!1)return null;if(D===null)D=!0;let de=h?.isConnected?h:null,K=we?.isConnected&&Nt(we)!=="body"?we:null,pe=Ce?K||de:de||K;if(!pe)pe=A0()||null;if(typeof D==="boolean")return pe;return or(D)||pe||null}return()=>{b.off("openchange",De);let H=st(ne),Y=me(),D=le(x,H)||Y.some((_)=>_===H||le(_,H))||O&&qo(O.nodesRef.current,I(),!1).some((_)=>le(_.context?.elements.floating,H)),de=R.current,K=B.current,pe=Q(K),M={cancelled:!1};fe.current=M,queueMicrotask(()=>{if(fe.current===M)fe.current=null;let _=RC(pe),Se=L.current??typeof de!=="boolean";if(!M.cancelled&&de&&!P.current&&je(_)&&(!Se&&_!==H&&H!==ne.body?D:!0)){let J={preventScroll:!0};if(K==="keyboard")J.focusVisible=!0;_.focus(J)}P.current=!1})}},[r,x,ee,R,L,U,b,O,h,I,me]),z(()=>{if(!Lr.webkit||g||!x)return;let ne=st(Ee(x));if(!je(ne)||!Fr(ne))return;if(le(x,ne))ne.blur()},[g,x]),z(()=>{if(r||!k)return;return k.setFocusManagerState({modal:c,closeOnFocusOut:u,open:g,onOpenChange:t.setOpen,domReference:h}),()=>{k.setFocusManagerState(null)}},[r,k,c,g,t,u,h]),z(()=>{if(r||!ee)return;return M0(ee),()=>{queueMicrotask(wm)}},[r,ee]);let be=!r&&(c?!w:!0)&&(Pe||c);return yC(so.Fragment,{children:[be&&P0(nr,{"data-type":"inside",ref:ue,onFocus:(ne)=>{if(c){let we=ie();ma(we[we.length-1])}else if(k?.portalNode)if(P.current=!1,Nr(ne,k.portalNode))xc(h)?.focus();else or(p??k.beforeOutsideRef)?.focus()}}),o,be&&P0(nr,{"data-type":"inside",ref:V,onFocus:(ne)=>{if(c)ma(ie()[0]);else if(k?.portalNode){if(u)P.current=!0;if(Nr(ne,k.portalNode))wc(h)?.focus();else or(m??k.afterOutsideRef)?.focus()}}})]})}import*as ys from"react";function vs(e,t={}){let{enabled:o=!0,event:r="click",toggle:n=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:i=0,reason:c=aa}=t,u=e.context.dataRef,l=ys.useRef(void 0),m=Dr(),p=Je(),d=ys.useMemo(()=>{function f(g,h,x,b){let C=Re(c,h,x);if(g&&b==="touch"&&i>0)p.start(i,()=>{e.setOpen(!0,C)});else e.setOpen(g,C)}function S(g,h,x){let b=u.current.openEvent,C=e.select("domReferenceElement")!==h;if(g&&C)return!0;if(!g)return!0;if(!n)return!0;if(b&&(typeof s==="function"?s():s))return!x(b.type);return!1}return{onPointerDown(g){l.current=ko(g.pointerType,!0)&&ua(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){let h=l.current,x=g.nativeEvent,b=e.select("open");if(g.button!==0||r==="click"||ko(h,!0)&&a)return;let C=S(b,g.currentTarget,(v)=>v==="click"||v==="mousedown"),I=Ze(x),y=Fr(I);if(y||h==="virtual"){f(C,x,y?I:g.currentTarget,h);return}let w=g.currentTarget;m.request(()=>{f(C,x,w,h)})},onClick(g){if(r==="mousedown-only")return;let h=l.current;if(r==="mousedown"&&h){l.current=void 0;return}if(ko(h,!0)&&a)return;let x=e.select("open"),b=S(x,g.currentTarget,(C)=>C==="click"||C==="mousedown"||C==="keydown"||C==="keyup");f(b,g.nativeEvent,g.currentTarget,h)},onKeyDown(){l.current=void 0}}},[u,r,a,c,e,s,n,m,p,i]);return ys.useMemo(()=>o?{reference:d}:Ue,[o,d])}import*as Po from"react";function PC(e,t){let o=null,r=null,n=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},s=t.axis==="x"||t.axis==="both",i=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",u=t.axis==="y"?a.width:0,l=t.axis==="x"?a.height:0,{x:m,y:p}=a;if(o==null&&t.x&&s)o=a.x-t.x;if(r==null&&t.y&&i)r=a.y-t.y;if(m-=o||0,p-=r||0,!n||c)m=s&&t.x!=null?t.x:m,p=i&&t.y!=null?t.y:p;return n=!0,{width:u,height:l,x:m,y:p,top:p,right:m+u,bottom:p+l,left:m}}}}function k0(e){return e!=null&&e.clientX!=null}function ym(e,t={}){let{enabled:o=!0,axis:r="both"}=t,n=e.useState("open"),a=e.useState("floatingElement"),s=e.useState("domReferenceElement"),i=e.context.dataRef,c=Po.useRef(!1),u=Po.useRef(null),[l,m]=Po.useState(),[p,d]=Po.useState([]),f=re((b)=>{e.set("positionReference",b)}),S=re((b,C,I)=>{if(c.current)return;if(i.current.openEvent&&!k0(i.current.openEvent))return;e.set("positionReference",PC(I??s,{x:b,y:C,axis:r,dataRef:i,pointerType:l}))}),g=re((b)=>{if(!n)S(b.clientX,b.clientY,b.currentTarget);else if(!u.current)S(b.clientX,b.clientY,b.currentTarget),d([])}),h=ko(l)?a:n;Po.useEffect(()=>{if(!o){f(s);return}if(!h)return;function b(){u.current?.(),u.current=null}let C=qe(a);function I(y){let w=Ze(y);if(!le(a,w))S(y.clientX,y.clientY);else b()}if(!i.current.openEvent||k0(i.current.openEvent))u.current=Ae(C,"mousemove",I);else f(s);return b},[h,o,a,i,s,e,S,f,p]),Po.useEffect(()=>()=>{e.set("positionReference",null)},[e]),Po.useEffect(()=>{if(o&&!a)c.current=!1},[o,a]),Po.useEffect(()=>{if(!o&&n)c.current=!0},[o,n]);let x=Po.useMemo(()=>{function b(C){m(C.pointerType)}return{onPointerDown:b,onPointerEnter:b,onMouseMove:g,onMouseEnter:g}},[g]);return Po.useMemo(()=>o?{reference:x,trigger:x}:{},[o,x])}import*as po from"react";function TC(){return!1}function EC(e){return{escapeKey:typeof e==="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e==="boolean"?e:e?.outsidePress??!0}}function Ln(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:a="sloppy",referencePress:s=TC,bubbles:i,externalTree:c}=t,u=e.useState("open"),l=e.useState("floatingElement"),{dataRef:m,events:p}=e.context,d=fo(c),f=re(typeof n==="function"?n:()=>!1),S=typeof n==="function"?f:n,g=S!==!1,h=re(()=>a),{escapeKey:x,outsidePress:b}=EC(i),C=po.useRef(!1),I=po.useRef(!1),y=po.useRef(!1),w=po.useRef(!1),v=po.useRef(!1),R=po.useRef(""),L=po.useRef(null),U=Je(),E=Je(),O=Je(),k=re(()=>{E.clear(),m.current.insideReactTree=!1}),P=re((V)=>{let G=m.current.floatingContext?.nodeId;return(d?qo(d.nodesRef.current,G):[]).some((oe)=>oe.context?.open&&!oe.context.dataRef.current[V])}),N=re((V)=>mc(V,e.select("floatingElement"))||mc(V,e.select("domReferenceElement"))),j=re((V)=>{if(!s())return;e.setOpen(!1,Re(aa,V.nativeEvent))}),T=re((V)=>{if(!u||!o||!r||V.key!=="Escape")return;let G=zd(V)?V.nativeEvent:V;if(v.current||G.isComposing)return;if(!x&&P("__escapeKeyBubbles"))return;let Z=Re(Qi,G);if(e.setOpen(!1,Z),!Z.isCanceled)V.preventDefault();if(!x&&!Z.isPropagationAllowed)V.stopPropagation()}),B=re(()=>{m.current.insideReactTree=!0,E.start(0,k)}),W=re((V)=>{if(!u||!o||V.button!==0)return;let G=Ze(V.nativeEvent);if(!le(e.select("floatingElement"),G))return;if(!C.current)C.current=!0,I.current=!1}),X=re((V)=>{if(!u||!o)return;if(!(V.defaultPrevented||V.nativeEvent.defaultPrevented))return;if(C.current)I.current=!0});po.useEffect(()=>{function V(G){if(!G.open)w.current=!1}return p.on("openchange",V),()=>{p.off("openchange",V)}},[p]),po.useEffect(()=>k,[k]),po.useEffect(()=>{if(!u||!o){if(!u)w.current=!1,v.current=!1,R.current="",L.current=null;return k}m.current.__escapeKeyBubbles=x,m.current.__outsidePressBubbles=b;let V=new eo,G=Ee(l);function Z(){O.clear(),v.current=!0}function oe(){v.current=!0,O.start(Lr.webkit?5:0,()=>{v.current=!1})}function Pe(){y.current=!0,V.start(0,()=>{y.current=!1})}function ee(){C.current=!1,I.current=!1}function ie(){let M=R.current,_=M==="pen"||!M?"mouse":M,Se=h(),J=typeof Se==="function"?Se():Se;if(typeof J==="string")return J;return J[_]}function me(M){let _=ie();return _==="intentional"&&M.type!=="click"||_==="sloppy"&&M.type==="click"}function fe(M){let _=m.current.floatingContext?.nodeId,Se=d&&qo(d.nodesRef.current,_).some((J)=>mc(M,J.context?.elements.floating));return N(M)||Se}function be(M){if(me(M)){if(M.type!=="click"&&!N(M))V.clear(),y.current=!1;k();return}if(m.current.insideReactTree){k();return}let _=Ze(M),Se=`[${yr("inert")}]`,J=Ve(_)?_.getRootNode():null,se=Array.from((tr(J)?J:Ee(e.select("floatingElement"))).querySelectorAll(Se)),ge=e.context.triggerElements;if(_&&(ge.hasElement(_)||ge.hasMatchingElement((Ie)=>le(Ie,_))))return;let he=Ve(_)?_:null;while(he&&!Go(he)){let Ie=zo(he);if(Go(Ie)||!Ve(Ie))break;he=Ie}if(se.length&&Ve(_)&&!$d(_)&&!le(_,e.select("floatingElement"))&&se.every((Ie)=>!le(he,Ie)))return;if(je(_)&&!("touches"in M)){let Ie=Go(_),Ne=no(_),Qe=/auto|scroll/,gt=Ie||Qe.test(Ne.overflowX),bo=Ie||Qe.test(Ne.overflowY),Co=gt&&_.clientWidth>0&&_.scrollWidth>_.clientWidth,Yo=bo&&_.clientHeight>0&&_.scrollHeight>_.clientHeight,oo=Ne.direction==="rtl",Kt=Yo&&(oo?M.offsetX<=_.offsetWidth-_.clientWidth:M.offsetX>_.clientWidth),yo=Co&&M.offsetY>_.clientHeight;if(Kt||yo)return}if(fe(M))return;if(ie()==="intentional"){if(M.detail!==0&&!Kr(M)&&!w.current)return;if(y.current){V.clear(),y.current=!1;return}}if(typeof S==="function"&&!S(M))return;if(P("__outsidePressBubbles"))return;e.setOpen(!1,Re(Uu,M)),k()}function ne(M){if(ie()!=="sloppy"||M.pointerType==="touch"||!e.select("open")||!o||N(M))return;be(M)}function we(M){if(ie()!=="sloppy"||!e.select("open")||!o||N(M))return;let _=M.touches[0];if(_)L.current={startTime:Date.now(),startX:_.clientX,startY:_.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},U.start(1000,()=>{if(L.current)L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1})}function Ce(M,_){let Se=Ze(M);if(!Se)return;let J=Ae(Se,M.type,()=>{_(M),J()})}function De(M){R.current="touch",Ce(M,we)}function Q(M){if(U.clear(),M.type==="pointerdown"){if(M.button===0)w.current=!0;R.current=M.pointerType}if(M.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;Ce(M,(_)=>{if(_.type==="pointerdown")ne(_);else be(_)})}function H(M){if(M.type==="pointercancel")w.current=!1;if(!C.current)return;let _=I.current;if(ee(),ie()!=="intentional")return;if(M.type==="pointercancel"){if(_)Pe();return}if(fe(M))return;if(_){Pe();return}if(typeof S==="function"&&!S(M))return;V.clear(),y.current=!0,k()}function Y(M){if(ie()!=="sloppy"||!L.current||N(M))return;let _=M.touches[0];if(!_)return;let Se=Math.abs(_.clientX-L.current.startX),J=Math.abs(_.clientY-L.current.startY),se=Math.sqrt(Se*Se+J*J);if(se>5)L.current.dismissOnTouchEnd=!0;if(se>10)be(M),U.clear(),L.current=null}function D(M){Ce(M,Y)}function de(M){if(ie()!=="sloppy"||!L.current||N(M))return;if(L.current.dismissOnTouchEnd)be(M);U.clear(),L.current=null}function K(M){Ce(M,de)}let pe=to(r&&to(Ae(G,"keydown",T),Ae(G,"compositionstart",Z),Ae(G,"compositionend",oe)),g&&to(Ae(G,"click",Q,!0),Ae(G,"pointerdown",Q,!0),Ae(G,"pointerup",H,!0),Ae(G,"pointercancel",H,!0),Ae(G,"mousedown",Q,!0),Ae(G,"mouseup",H,!0),Ae(G,"touchstart",De,{capture:!0,passive:!0}),Ae(G,"touchmove",D,{capture:!0,passive:!0}),Ae(G,"touchend",K,{capture:!0,passive:!0})));return()=>{pe(),V.clear(),ee(),y.current=!1}},[m,l,r,g,S,u,o,x,b,T,k,h,P,N,d,e,U,O]);let A=po.useMemo(()=>({onKeyDown:T,onPointerDown:j,onClick:j}),[T,j]),ue=po.useMemo(()=>({onKeyDown:T,onPointerDown:X,onMouseDown:X,onClickCapture:B,onMouseDownCapture(V){B(),W(V)},onPointerDownCapture(V){B(),W(V)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[T,B,W,X]);return po.useMemo(()=>o?{reference:A,floating:ue,trigger:A}:{},[o,A,ue])}import*as Rm from"react";import*as F0 from"react-dom";function Rs(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:a,onOpenChange:s}=e,i=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(o?"popupElement":"positionerElement"),l=s;return t.useSyncedValue("floatingId",n),z(()=>{let m={open:i,floatingId:n,referenceElement:c,floatingElement:u};if(Ve(c))m.domReferenceElement=c;if(r.state.positionReference===r.state.referenceElement)m.positionReference=c;r.update(m)},[i,n,c,u,r]),r.context.onOpenChange=l,r.context.nested=a,r}import*as vm from"react";function L0(e){let{open:t,ref:o,preventUnmountOnClose:r,setPreventUnmountOnClose:n,onUnmount:a,animateInitialOpen:s}=e,i=re(n),{mounted:c,setMounted:u,transitionStatus:l}=cc(t,!1,!1,s),m=t?!1:r;z(()=>{if(t)i(!1)},[t,i]);let p=vm.useRef(c),d=vm.useRef(!1),f=nc(),S=()=>{p.current=!1,u(!1),a()};z(()=>{if(p.current=c,d.current){if(d.current=!1,!t&&c)S()}});let g=re(()=>{if(!p.current)return;if(t){d.current=!0,f();return}S()});return $o({enabled:c&&!t&&!m,open:t,ref:o,onComplete(){if(!t)g()}}),{mounted:c,transitionStatus:l,preventUnmountingOnClose:m,forceUnmount:g}}var fa={tabIndex:-1,[as]:""};function O0(e){return(t)=>t==="touch"?e.current:!0}function Ac(e,t=!1){let o=Cr(),r=Do()!=null,n=Xe(()=>e(o,r)).current;return Rs({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function pa({handle:e,store:t}){return z(()=>e.attachStore(t),[e,t]),null}function D0(e){let t=e.context.triggerElements.size;if(e.select("open")&&e.state.triggerCount!==t)e.set("triggerCount",t)}function AC(e,t){let o=Rm.useRef(null);return re((r)=>{let n=o.current;if(n!==null){if(n.element===r&&n.store===t&&n.id===e)return;o.current=null;let a=n.store;if(a.context.triggerElements.getById(n.id)===n.element)a.context.triggerElements.delete(n.id),D0(a)}if(r!==null&&e!==void 0)o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),D0(t)})}function Ps(e,t,o,r=!1){let n=e.preventUnmountingOnClose;if(t)n=!1;else if(r)n=!0;let a=o?.id??null,{activeTriggerId:s,activeTriggerElement:i}=e;if(a||t)s=a,i=o??null;return{open:t,preventUnmountingOnClose:n,activeTriggerId:s,activeTriggerElement:i,openedWithoutTrigger:t?o==null:e.openedWithoutTrigger}}function Pm(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function N0(e,t,o,r={}){let n=o.reason,a=n===Yt,s=t&&n===sa,i=!t&&(n===aa||n===Qi),c=Pm(o);if(e.context.onOpenChange?.(t,o),o.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,o);let u=()=>{let l=Ps(e.state,t,o.trigger,c()),m={...r.extraState,...l};if(s)m.instantType="focus";else if(i)m.instantType="dismiss";else if(a)m.instantType=void 0;e.update(m)};if(a)F0.flushSync(u);else u()}function da(e,t,o,r){let n=o.useState("isMountedByTrigger",e),a=AC(e,o),s=re((c)=>{let u=o.select("open"),l=o.select("activeTriggerId");if(l===e){let m={activeTriggerElement:c,...u?r:null};o.update(m);return}if(l==null&&u&&!o.state.openedWithoutTrigger){let m={activeTriggerId:e??null,activeTriggerElement:c,...r};o.update(m)}}),i=re((c)=>{if(a(c),c)s(c)});return z(()=>(i(t.current),()=>i(null)),[i,t,o,e]),z(()=>{if(n){let c={activeTriggerElement:t.current,...r};o.update(c)}},[n,o,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:n}}function ga(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=Rm.useRef(null),n=e.useState("open"),a=e.useState("triggerCount"),s=e.useState("activeTriggerId"),i=e.useState("activeTriggerElement");z(()=>{if(!n){if(r.current=null,e.state.triggerCount!==0)e.set("triggerCount",0);if(e.state.openedWithoutTrigger)e.set("openedWithoutTrigger",!1);return}let c=e.context.triggerElements.size,u={};if(e.state.triggerCount!==c)u.triggerCount=c;let l=e.select("activeTriggerId"),m=null;if(l){let p=e.context.triggerElements.getById(l);if(!p){for(let[d,f]of e.context.triggerElements.entries())if(f===e.state.activeTriggerElement){u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d;break}if(u.activeTriggerId===void 0)if(r.current===l)m=l;else r.current=null}else if(r.current=l,p!==e.state.activeTriggerElement)u.activeTriggerElement=p}else r.current=null;if(!m&&!l&&!e.state.openedWithoutTrigger&&c===1){let p=e.context.triggerElements.entries().next();if(!p.done){let[d,f]=p.value;u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d}}if(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)e.update(u);if(m){if(o)queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){let p=Re(Rn);if(e.setOpen(!1,p),!p.isCanceled)e.update({activeTriggerId:null,activeTriggerElement:null})}})}},[n,e,a,s,i,o])}function ha(e,t,o,r){let{mounted:n,transitionStatus:a,forceUnmount:s}=L0({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:(i)=>t.set("preventUnmountingOnClose",i),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)}});return Xe(()=>(t.set("mounted",n),null)),t.useSyncedValues({mounted:n,transitionStatus:a}),{forceUnmount:s,transitionStatus:a}}function Ia(e,t){e.useSyncedValues(t),z(()=>()=>{e.update({activeTriggerProps:Ue,inactiveTriggerProps:Ue,popupProps:Ue})},[e])}function B0(e,t){z(()=>{if(!t&&e.state.openMethod!==null)e.set("openMethod",null)},[t,e]),z(()=>()=>{if(e.state.openMethod!==null)e.set("openMethod",null)},[e])}class Dn{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var km=bp(Mc(),1);import*as _0 from"react";import*as rn from"react";var _C=Mc();function WC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zC=typeof Object.is==="function"?Object.is:WC,GC=_C.useSyncExternalStore,ZC=rn.useRef,$C=rn.useEffect,qC=rn.useMemo,jC=rn.useDebugValue;var Em=function(e,t,o,r,n){var a=ZC(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=qC(function(){function c(d){if(!u){if(u=!0,l=d,d=r(d),n!==void 0&&s.hasValue){var f=s.value;if(n(f,d))return m=f}return m=d}if(f=m,zC(l,d))return f;var S=r(d);if(n!==void 0&&n(f,S))return l=d,f;return l=d,m=S}var u=!1,l,m,p=o===void 0?null:o;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,o,r,n]);var i=GC(e,a[0],a[1]);return $C(function(){s.hasValue=!0,s.value=i},[i]),jC(i),i};import*as H0 from"react";var Am=[],Mm=void 0;function V0(){return Mm}function U0(e){Am.push(e)}function Fn(e){let t=(o,r)=>{let n=Xe(XC).current,a;try{Mm=n;for(let s of Am)s.before(n);a=e(o,r);for(let s of Am)s.after(n);n.didInitialize=!0}finally{Mm=void 0}return a};return t.displayName=e.displayName||e.name,t}function ba(e){return H0.forwardRef(Fn(e))}function XC(){return{didInitialize:!1}}var YC=Kn(19),KC=YC?QC:eS;function kc(e,t,o,r,n){return KC(e,t,o,r,n)}function JC(e,t,o,r,n){let a=_0.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return km.useSyncExternalStore(e.subscribe,a,a)}U0({before(e){if(e.syncIndex=0,!e.didInitialize)e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);if(!Object.is(r.value,n))t=!0,r.value=n}if(t)e.syncTick+=1;return e.syncTick}},after(e){if(e.syncHooks.length>0){if(e.didChangeStore)e.didChangeStore=!1,e.subscribe=(t)=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}};km.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}}});function QC(e,t,o,r,n){let a=V0();if(!a)return JC(e,t,o,r,n);let s=a.syncIndex;a.syncIndex+=1;let i;if(!a.didInitialize)i={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},a.syncHooks.push(i);else if(i=a.syncHooks[s],i.store!==e||i.selector!==t||!Object.is(i.a1,o)||!Object.is(i.a2,r)||!Object.is(i.a3,n)){if(i.store!==e)a.didChangeStore=!0;i.store=e,i.selector=t,i.a1=o,i.a2=r,i.a3=n,i.value=t(e.getSnapshot(),o,r,n)}return i.value}function eS(e,t,o,r,n){return Em(e.subscribe,e.getSnapshot,e.getSnapshot,(a)=>t(a,o,r,n))}class Lm{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=(e)=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let o of this.listeners){if(t!==this.updateTick)return;o(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){if(!Object.is(this.state[e],t))this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,o,r){return kc(this,e,t,o,r)}}import*as On from"react";class ir extends Lm{constructor(e,t={},o){super(e);this.context=t,this.selectors=o}useSyncedValue(e,t){On.useDebugValue(e);let o=this;z(()=>{if(o.state[e]!==t)o.set(e,t)},[o,e,t])}useSyncedValueWithCleanup(e,t){let o=this;z(()=>{if(o.state[e]!==t)o.set(e,t);return()=>{o.set(e,void 0)}},[o,e,t])}useSyncedValues(e){let t=this,o=Object.values(e);z(()=>{t.update(e)},[t,...o])}useControlledProp(e,t){On.useDebugValue(e);let o=this,r=t!==void 0;z(()=>{if(r&&!Object.is(o.state[e],t))o.setState({...o.state,[e]:t})},[o,e,t,r])}select(e,t,o,r){let n=this.selectors[e];return n(this.state,t,o,r)}useState(e,t,o,r){return On.useDebugValue(e),kc(this,this.selectors[e],t,o,r)}useContextCallback(e,t){On.useDebugValue(e);let o=re(t??Ye);this.context[e]=o}useStateSetter(e){let t=On.useRef(void 0);if(t.current===void 0)t.current=(o)=>{this.set(e,o)};return t.current}observe(e,t){let o;if(typeof e==="function")o=e;else o=this.selectors[e];let r=o(this.state);return t(r,r,this),this.subscribe((n)=>{let a=o(n);if(!Object.is(r,a)){let s=r;r=a,t(a,s,this)}})}}var tS={open:(e)=>e.open,transitionStatus:(e)=>e.transitionStatus,domReferenceElement:(e)=>e.domReferenceElement,referenceElement:(e)=>e.positionReference??e.referenceElement,floatingElement:(e)=>e.floatingElement,floatingId:(e)=>e.floatingId};class Dm extends ir{constructor(e){let{syncOnly:t,nested:o,onOpenChange:r,triggerElements:n,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ec(),nested:o,triggerElements:n},tS);this.syncOnly=t}syncOpenEvent=(e,t)=>{if(!e||!this.state.open||t!=null&&Gd(t))this.context.dataRef.current.openEvent=e?t:void 0};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let o={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",o)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}function Ca(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Dm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ue,inactiveTriggerProps:Ue,popupProps:Ue}}var Ts=(e)=>e.triggerIdProp??e.activeTriggerId,Lc=(e)=>e.openProp??e.open,W0=(e)=>(e.popupElement?.id??e.floatingId)||void 0;function z0(e,t){return t!==void 0&&Lc(e)&&Ts(e)===t}function oS(e,t){if(z0(e,t))return!0;return t!==void 0&&Lc(e)&&Ts(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var nn={open:Lc,mounted:(e)=>e.mounted,transitionStatus:(e)=>Lc(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:(e)=>e.floatingRootContext,triggerCount:(e)=>e.triggerCount,preventUnmountingOnClose:(e)=>e.preventUnmountingOnClose,payload:(e)=>e.payload,activeTriggerId:Ts,activeTriggerElement:(e)=>e.mounted?e.activeTriggerElement:null,popupId:W0,isTriggerActive:(e,t)=>t!==void 0&&Ts(e)===t,isOpenedByTrigger:(e,t)=>z0(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ts(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>oS(e,t)?W0(e):void 0,popupProps:(e)=>e.popupProps,popupElement:(e)=>e.popupElement,positionerElement:(e)=>e.positionerElement};var G0=bp(Mc(),1);import*as Fm from"react";function Sa(e){let t=Fm.useCallback((r)=>{if(e===void 0)return Ye;return e.subscribeStore(r)},[e]),o=Fm.useCallback(()=>e===void 0?void 0:e.store,[e]);return G0.useSyncExternalStore(t,o,()=>e?.serverStore)}import*as vr from"react";var Om=kr.mac&&Lr.webkit;function Es(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=vr.useRef(!1),i=vr.useRef(null),c=vr.useRef(!0),u=Je();vr.useEffect(()=>{let m=e.select("domReferenceElement");if(!o)return;let p=qe(m);function d(){let g=e.select("domReferenceElement");if(!e.select("open")&&je(g)&&g===st(Ee(g)))s.current=!0,i.current=g}function f(){c.current=!0}function S(){c.current=!1}return to(Ae(p,"blur",d),Om&&Ae(p,"keydown",f,!0),Om&&Ae(p,"pointerdown",S,!0))},[e,o]),vr.useEffect(()=>{if(!o)return;function m(p){if(p.reason===aa||p.reason===Qi){let d=e.select("domReferenceElement");if(Ve(d))i.current=d,s.current=!0}}return n.on("openchange",m),()=>{n.off("openchange",m)}},[n,o,e]);let l=vr.useMemo(()=>{function m(){s.current=!1,i.current=null}return{onMouseLeave(){m()},onFocus(p){let d=p.currentTarget;if(s.current){if(i.current===d)return;m()}let f=Ze(p.nativeEvent);if(Ve(f)){if(Om&&!p.relatedTarget){if(!c.current&&!Fr(f))return}else if(!Qr(f))return}let S=Jr(p.relatedTarget,e.context.triggerElements),{nativeEvent:g,currentTarget:h}=p;if(e.select("open")&&S||!r){e.setOpen(!0,Re(sa,g,h));return}u.start(r,()=>{if(s.current)return;e.setOpen(!0,Re(sa,g,h))})},onBlur(p){m();let{relatedTarget:d,nativeEvent:f}=p,S=Ve(d)&&d.hasAttribute(yr("focus-guard"))&&d.getAttribute("data-type")==="outside";u.start(0,()=>{let g=e.select("domReferenceElement"),h=st(Ee(g));if(!d&&h===g)return;if(le(a.current.floatingContext?.refs.floating.current,h)||le(g,h)||S)return;if(Jr(d??h,e.context.triggerElements))return;e.setOpen(!1,Re(sa,f))})}}},[a,r,e,u]);return vr.useMemo(()=>o?{reference:l,trigger:l}:{},[o,l])}import*as Bm from"react";class Nm{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new eo;restTimeout=new eo;handleCloseOptions=void 0;static create(){return new Nm}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var Dc=new WeakMap;function xa(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Dc.get(t)===e)e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Dc.delete(t);e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Fc(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,a=Dc.get(o);if(a&&a!==e)xa(a);xa(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,Dc.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function wa(e){let t=e.context.dataRef.current,o=Xe(()=>t.hoverInteractionState??Nm.create()).current;if(!t.hoverInteractionState)t.hoverInteractionState=o;return Yr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function As(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,a=e.useState("open"),s=e.useState("floatingElement"),i=e.useState("domReferenceElement"),{dataRef:c}=e.context,u=fo(),l=Do(),m=wa(e),p=Je(),d=re(()=>fc(c.current.openEvent?.type,m.interactedInside)),f=re(()=>qd(c.current.openEvent?.type)),S=re(()=>{xa(m)});z(()=>{if(!a)m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,S()},[a,m,S]),Bm.useEffect(()=>S,[S]),z(()=>{if(!o)return;if(a&&m.handleCloseOptions?.blockPointerEvents&&f()&&Ve(i)&&s){let g=i,h=s,x=Ee(s),b=u?.nodesRef.current.find((w)=>w.id===l)?.context?.elements.floating;if(b)b.style.pointerEvents="";let C=m.pointerEventsScopeElement!==h?m.pointerEventsScopeElement:null,I=b!==h?b:null,y=m.handleCloseOptions?.getScope?.()??C??I??rr(g,"[data-rootownerid]")??x.body;return Fc(m,{scopeElement:y,referenceElement:g,floatingElement:h}),()=>{S()}}return},[o,a,i,s,m,f,u,l,S]),Bm.useEffect(()=>{if(!o)return;function g(){return!!(u&&l&&qo(u.nodesRef.current,l).length>0)}function h(w){let v=Or(r,"close",m.pointerType),R=()=>{e.setOpen(!1,Re(Yt,w)),u?.events.emit("floating.closed",w)};if(v)m.openChangeTimeout.start(v,R);else m.openChangeTimeout.clear(),R()}function x(w){let v=Ze(w);if(!om(v)){m.interactedInside=!1;return}m.interactedInside=rr(v,"[aria-haspopup]")!=null}function b(){m.openChangeTimeout.clear(),p.clear(),u?.events.off("floating.closed",I),S()}function C(w){if(g()&&u){u.events.on("floating.closed",I);return}if(Jr(w.relatedTarget,e.context.triggerElements))return;let v=c.current.floatingContext?.nodeId??n,R=w.relatedTarget;if(u&&v&&Ve(R)&&qo(u.nodesRef.current,v,!1).some((U)=>le(U.context?.elements.floating,R)))return;if(m.handler){m.handler(w);return}if(S(),f()&&!d())h(w)}function I(w){if(!u||!l||g())return;p.start(0,()=>{u.events.off("floating.closed",I),e.setOpen(!1,Re(Yt,w)),u.events.emit("floating.closed",w)})}let y=s;return to(y&&Ae(y,"mouseenter",b),y&&Ae(y,"mouseleave",C),y&&Ae(y,"pointerdown",x,!0),()=>{u?.events.off("floating.closed",I)})},[o,s,e,c,r,n,f,d,S,m,u,l,p])}import*as an from"react";import*as Z0 from"react-dom";var rS={current:null};function Ms(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:a=!1,restMs:s=0,move:i=!0,triggerElementRef:c=rS,externalTree:u,isActiveTrigger:l=!0,getHandleCloseContext:m,isClosing:p,shouldOpen:d,guardStaleOpen:f=!1}=t,{dataRef:S,events:g}=e.context,h=fo(u),x=wa(e),b=an.useRef(!1),C=ct(n),I=ct(r),y=ct(s),w=ct(o),v=ct(d),R=ct(p),L=re(()=>fc(S.current.openEvent?.type,x.interactedInside)),U=re(()=>v.current?.()!==!1),E=re((P,N,j)=>{let T=e.context.triggerElements;if(T.hasElement(N))return!P||!le(P,N);if(!Ve(j))return!1;let B=j;return T.hasMatchingElement((W)=>le(W,B))&&(!P||!le(P,B))}),O=re(()=>{if(!x.handler)return;Ee(e.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),k=re(()=>{xa(x)});if(l)x.handleCloseOptions=n?.__options;return an.useEffect(()=>O,[O]),an.useEffect(()=>{if(!o)return;function P(N){if(!N.open)b.current=N.reason===Yt,O(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1;else b.current=!1}return g.on("openchange",P),()=>{g.off("openchange",P)}},[o,g,x,O]),an.useEffect(()=>{if(!o)return;function P(X,A=!0){let ue=Or(I.current,"close",x.pointerType);if(ue)x.openChangeTimeout.start(ue,()=>{e.setOpen(!1,Re(Yt,X)),h?.events.emit("floating.closed",X)});else if(A)x.openChangeTimeout.clear(),e.setOpen(!1,Re(Yt,X)),h?.events.emit("floating.closed",X)}let N=c.current??(l?e.select("domReferenceElement"):null);if(!Ve(N))return;function j(X){if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,a&&!ko(x.pointerType))return;let A=rm(y.current),ue=Or(I.current,"open",x.pointerType),V=Ze(X),G=X.currentTarget??null,Z=e.select("domReferenceElement"),oe=G;if(Ve(V)&&!e.context.triggerElements.hasElement(V)){for(let Ce of e.context.triggerElements.elements())if(le(Ce,V)){oe=Ce;break}}if(Ve(G)&&Ve(Z)&&!e.context.triggerElements.hasElement(G)&&le(G,Z))oe=Z;let Pe=oe==null?!1:E(Z,oe,V),ee=e.select("open"),ie=R.current?.()??e.select("transitionStatus")==="ending",me=!ee&&ie&&b.current,fe=!Pe&&Ve(oe)&&Ve(Z)&&le(Z,oe)&&me,be=A>0&&!ue,ne=Pe&&(ee||me)||fe,we=!ee||Pe;if(ne){if(U())e.setOpen(!0,Re(Yt,X,oe));return}if(be)return;if(ue)x.openChangeTimeout.start(ue,()=>{if(we&&U())e.setOpen(!0,Re(Yt,X,oe))});else if(we){if(U())e.setOpen(!0,Re(Yt,X,oe))}}function T(X){if(L()){k();return}O();let A=e.select("domReferenceElement"),ue=Ee(A);x.restTimeout.clear(),x.restTimeoutPending=!1;let V=S.current.floatingContext??m?.();if(Jr(X.relatedTarget,e.context.triggerElements))return;if(C.current&&V){if(!e.select("open"))x.openChangeTimeout.clear();let Z=c.current;x.handler=C.current({...V,tree:h,x:X.clientX,y:X.clientY,onClose(){if(k(),O(),w.current&&!L()&&Z===e.select("domReferenceElement"))P(X,!0)}}),ue.addEventListener("mousemove",x.handler),x.handler(X);return}if(x.pointerType==="touch"?!le(e.select("floatingElement"),X.relatedTarget):!0)P(X)}function B(X){if(le(N,X.relatedTarget))return;x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1}let W=f?Ae(N,"mouseout",B):void 0;if(i)return to(Ae(N,"mousemove",j,{once:!0}),Ae(N,"mouseenter",j),Ae(N,"mouseleave",T),W);return to(Ae(N,"mouseenter",j),Ae(N,"mouseleave",T),W)},[O,k,S,I,e,o,C,x,l,E,L,a,i,y,c,h,w,m,R,U,f]),an.useMemo(()=>{if(!o)return;function P(N){x.pointerType=N.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(N){let{nativeEvent:j}=N,T=N.currentTarget,B=e.select("domReferenceElement"),W=e.select("open"),X=E(B,T,N.target);if(a&&!ko(x.pointerType))return;if(W&&X&&x.handleCloseOptions?.blockPointerEvents){let V=e.select("floatingElement");if(V){let G=x.handleCloseOptions?.getScope?.()??T.ownerDocument.body;Fc(x,{scopeElement:G,referenceElement:T,floatingElement:V})}}let A=rm(y.current);if(W&&!X||A===0)return;if(!X&&x.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;x.restTimeout.clear();function ue(){if(x.restTimeoutPending=!1,L())return;let V=e.select("open");if(!x.blockMouseMove&&(!V||X)&&U())e.setOpen(!0,Re(Yt,j,T))}if(x.pointerType==="touch")Z0.flushSync(()=>{ue()});else if(X&&W)ue();else x.restTimeoutPending=!0,x.restTimeout.start(A,ue)}}},[o,x,L,E,a,e,y,U])}import*as io from"react";function $0(e){return Lr.webkit&&e.movementX===0&&e.movementY===0}function Nc(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function Oc(e,t){return Nc(t,e===tm||e===uc,e===ss||e===is)}function Hm(e,t,o){return Nc(t,e===uc,o?e===ss:e===is)||e==="Enter"||e===" "||e===""}function nS(e,t,o){return Nc(t,o?e===ss:e===is,e===uc)}function aS(e,t,o,r){let n=o?e===is:e===ss,a=e===tm;if(t==="both"||t==="horizontal"&&r)return e==="Escape";return Nc(t,n,a)}function Vm(e,t){let{listRef:o,activeIndex:r,onNavigate:n=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:i=!1,loopFocus:c=!1,nested:u=!1,rtl:l=!1,virtual:m=!1,focusItemOnOpen:p="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:f=!0,disabledIndices:S=void 0,orientation:g="vertical",triggerOrientation:h=g,parentOrientation:x,id:b,resetOnPointerLeave:C=!0,externalTree:I,nestedReturnFocusRef:y,grid:w}=t,v=w!=null,R=e.useState("open"),L=e.useState("floatingElement"),U=e.useState("domReferenceElement"),E=e.context.dataRef,O=us(L),k=ls(U),P=ct(O),N=Do(),j=fo(I),T=io.useRef(p),B=io.useRef(s??-1),W=io.useRef(null),X=io.useRef(!0),A=re((M)=>{n(B.current===-1?null:B.current,M)}),ue=io.useRef(!!L),V=io.useRef(R),G=io.useRef(!1),Z=io.useRef(!1),oe=io.useRef(null),Pe=ct(S),ee=ct(R),ie=ct(s),me=ct(C),fe=Dr(),be=Dr(),ne=re(()=>{fe.cancel();function M(se){if(!m)oe.current=ma(se,{sync:G.current,preventScroll:!0})}let _=o.current[B.current],Se=Z.current;if(_)M(_);(G.current?(se)=>se():(se)=>fe.request(se))(()=>{let se=o.current[B.current]||_;if(!se)return;if(!_)M(se);if(Y&&(Se||!X.current))se.scrollIntoView?.({block:"nearest",inline:"nearest"})})});z(()=>{E.current.orientation=g},[E,g]),z(()=>{if(!R)W.current=null;if(!R||p!=="auto")T.current=p},[R,p]),z(()=>{if(!a)return;if(R&&L){if(B.current=s??-1,T.current&&s!=null)Z.current=!0,A()}else if(ue.current)B.current=-1,A()},[a,R,L,s,A]),z(()=>{if(!a)return;if(!R){G.current=!1;return}if(!L)return;if(r==null){if(G.current=!1,ie.current!=null)return;if(ue.current)B.current=-1,ne();if((!V.current||!ue.current)&&T.current&&(W.current!=null||T.current===!0&&W.current==null)){let M=0,_=()=>{if(o.current[0]==null){if(M<2)(M?(J)=>be.request(J):queueMicrotask)(_);M+=1}else B.current=W.current==null||Hm(W.current,h,l)||u?Sc(o):am(o),W.current=null,A()};_()}}else if(!Cc(o.current,r))B.current=r,ne(),Z.current=!1},[a,R,L,r,ie,u,o,h,l,A,ne,be]),z(()=>{if(!a||L||!j||m||!ue.current)return;let M=j.nodesRef.current,_=M.find((se)=>se.id===N)?.context?.elements.floating,Se=st(Ee(U??_??null)),J=M.some((se)=>se.context&&le(se.context.elements.floating,Se));if(_&&!J&&X.current)_.focus({preventScroll:!0})},[a,L,U,j,N,m]),z(()=>{V.current=R,ue.current=!!L});let we=r!=null,Ce=re((M)=>{if(!ee.current)return;let _=o.current.indexOf(M.currentTarget);if(_!==-1&&(B.current!==_||r!==_))B.current=_,A(M)}),De=re(()=>x??j?.nodesRef.current.find((M)=>M.id===N)?.context?.dataRef?.current.orientation),Q=re(()=>Sc(o,Pe.current)),H=re((M)=>{if(X.current=!1,G.current=!0,M.which===229)return;if(!ee.current&&M.currentTarget===P.current)return;if(u&&aS(M.key,g,l,v)){if(!Oc(M.key,De()))Mo(M);e.setOpen(!1,Re(ec,M.nativeEvent));let se=y?.current??U;if(je(se))se.focus();return}if(r!=null&&r!==B.current&&!Cc(o.current,r))B.current=r;let _=B.current,Se=Sc(o,S),J=am(o,S);if(!k){if(M.key==="Home")Mo(M),B.current=Se,A(M);if(M.key==="End")Mo(M),B.current=J,A(M)}if(w!=null){let se=w(M,B.current,o,g,c,l,S,Se,J);if(se!=null&&se!==B.current)B.current=se,A(M);if(g==="both")return}if(Oc(M.key,g)){Mo(M);let se=st(M.currentTarget.ownerDocument);if(R&&!m&&le(M.currentTarget,se)&&!o.current.some((Ie)=>Ie!=null&&le(Ie,se))){if(B.current=Hm(M.key,g,l)?Se:J,A(M),r===B.current)ne();return}let{index:ge,wrapped:he}=e0(o.current,_,{decrement:!Hm(M.key,g,l),loopFocus:c,allowEscape:i,disabledIndices:S,minIndex:Se,maxIndex:J});if(he)G.current=!1;B.current=ge,A(M)}}),Y=io.useMemo(()=>({onFocus(_){G.current=!0,Ce(_)},onClick({currentTarget:_}){if(!m)_.focus({preventScroll:!0})},onMouseMove(_){if($0(_))return;if(G.current=!0,Z.current=!1,d)Ce(_)},onPointerLeave(_){if(!ee.current||!X.current||_.pointerType==="touch")return;G.current=!0;let Se=_.relatedTarget;if(!d||o.current.includes(Se))return;if(!me.current)return;if(oe.current?.(),oe.current=null,B.current=-1,A(_),!m){let J=P.current,se=st(Ee(J));if(J&&le(J,se))J.focus({preventScroll:!0})}}}),[Ce,ee,P,d,o,A,me,m]),D=io.useMemo(()=>m&&R&&we&&{"aria-activedescendant":`${b}-${r}`},[m,R,we,b,r]),de=io.useMemo(()=>({...!k?D:{},onKeyDown(M){if(M.key==="Tab"&&M.shiftKey&&R&&!m){let _=Ze(M.nativeEvent);if(_&&!le(P.current,_))return;Mo(M);let Se=Re(ia,M.nativeEvent);e.setOpen(!1,Se);let J=y?.current??U;if(!Se.isCanceled&&je(J))J.focus();return}H(M)},onPointerMove(M){if($0(M))return;X.current=!0}}),[D,H,P,k,e,R,m,U,y]),K=io.useMemo(()=>{function M(J){e.setOpen(!0,Re(ec,J.nativeEvent,J.currentTarget))}function _(J){if(p==="auto"&&Kr(J.nativeEvent))T.current=!m}function Se(J){if(T.current=p,p==="auto"&&ua(J.nativeEvent))T.current=!0}return{onKeyDown(J){let se=e.select("open");X.current=!1;let ge=J.key.startsWith("Arrow"),he=nS(J.key,De(),l),Ie=Oc(J.key,se?g:h),Ne=(u?he:Ie)||J.key==="Enter"||J.key.trim()==="";if(m&&se&&(!u||Fr(J.currentTarget)))return H(J);if(!se&&!f&&ge)return;if(Ne){let Qe=Oc(J.key,De());W.current=u&&Qe?null:J.key}if(u){if(he)if(Mo(J),se){if(B.current=Q(),A(J),m)P.current?.focus()}else M(J);return}if(Ie){if(ie.current!=null)B.current=ie.current;if(Mo(J),!se&&f)M(J);else H(J);if(se)A(J)}return},onFocus(J){if(J.target!==J.currentTarget)return;if(e.select("open")&&!m)B.current=-1,A(J)},onPointerDown:Se,onPointerEnter:Se,onMouseDown:_,onClick:_}},[H,p,Q,u,A,e,f,g,h,De,l,ie,m,P]),pe=io.useMemo(()=>({...D,...K}),[D,K]);return io.useMemo(()=>a?{reference:pe,floating:de,item:Y,trigger:K}:{},[a,pe,de,K,Y])}import*as Nn from"react";function Um(e,t){let{listRef:o,elementsRef:r,activeIndex:n,onMatch:a,disabledIndices:s,onTyping:i,enabled:c=!0,resetMs:u=750,selectedIndex:l=null}=t,m=re(i),p=e.useState("open"),d=Je(),f=Nn.useRef(""),S=Nn.useRef(l??n??-1),g=Nn.useRef(null),h=re((C)=>{function I(k){return r?.current[k]}function y(k){let P=I(k);if(P&&!Mn(P)||P?.matches(":disabled"))return!1;return s==null||!im(Mr,k,s)}function w(k,P,N=0){if(k.length===0)return-1;let j=(N%k.length+k.length)%k.length,T=P.toLowerCase();for(let B=0;B<k.length;B+=1){let W=(j+B)%k.length;if(!k[W]?.toLowerCase().startsWith(T)||!y(W))continue;return W}return-1}let v=o.current;if(f.current.length>0&&C.key===" ")Mo(C),m?.(!0);if(f.current.length>0&&f.current[0]!==" "){if(w(v,f.current)===-1&&C.key!==" ")m?.(!1)}if(v==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;if(p&&C.key!==" ")Mo(C),m?.(!0);let R=f.current==="";if(R)S.current=l??n??-1;if(v.every((k,P)=>k&&y(P)?k[0]?.toLowerCase()!==k[1]?.toLowerCase():!0)&&f.current===C.key)f.current="",S.current=g.current;f.current+=C.key,d.start(u,()=>{f.current="",S.current=g.current,m?.(!1)});let E=((R?l??n??-1:S.current)??0)+1,O=w(v,f.current,E);if(O!==-1)a?.(O,C),g.current=O;else if(C.key!==" ")f.current="",m?.(!1)}),x=re((C)=>{let I=C.relatedTarget,y=e.select("domReferenceElement"),w=e.select("floatingElement");if(le(y,I)||le(w,I))return;d.clear(),f.current="",S.current=g.current,m?.(!1)});z(()=>{if(!p&&l!==null)return;if(d.clear(),g.current=null,f.current!=="")f.current="",m?.(!1)},[p,l,d,m]);let b=Nn.useMemo(()=>({onKeyDown:h,onBlur:x}),[h,x]);return Nn.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var q0=0.1,sS=q0*q0,ot=0.5;function Bc(e,t,o,r,n,a){return r>=t!==a>=t&&e<=(n-o)*(t-r)/(a-r)+o}function Hc(e,t,o,r,n,a,s,i,c,u){let l=!1;if(Bc(e,t,o,r,n,a))l=!l;if(Bc(e,t,n,a,s,i))l=!l;if(Bc(e,t,s,i,c,u))l=!l;if(Bc(e,t,c,u,o,r))l=!l;return l}function iS(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function Vc(e,t,o,r,n,a){let s=Math.min(o,n),i=Math.max(o,n),c=Math.min(r,a),u=Math.max(r,a);return e>=s&&e<=i&&t>=c&&t<=u}function ks(e={}){let{blockPointerEvents:t=!1}=e,o=new eo,r=({x:n,y:a,placement:s,elements:i,onClose:c,nodeId:u,tree:l})=>{let m=s?.split("-")[0],p=!1,d=null,f=null,S=typeof performance<"u"?performance.now():0;function g(x,b){let C=performance.now(),I=C-S;if(d===null||f===null||I===0)return d=x,f=b,S=C,!1;let y=x-d,w=b-f,v=y*y+w*w,R=I*I*sS;return d=x,f=b,S=C,v<R}function h(){o.clear(),c()}return function(b){o.clear();let{domReference:C,floating:I}=i;if(!C||!I||m==null||n==null||a==null)return;let{clientX:y,clientY:w}=b,v=Ze(b),R=b.type==="mouseleave",L=le(I,v),U=le(C,v);if(L){if(p=!0,!R)return}if(U){if(p=!1,!R){p=!0;return}}if(R&&Ve(b.relatedTarget)&&le(I,b.relatedTarget))return;function E(){return Boolean(l&&qo(l.nodesRef.current,u).length>0)}function O(){if(!E())h()}if(E())return;let k=C.getBoundingClientRect(),P=I.getBoundingClientRect(),N=n>P.right-P.width/2,j=a>P.bottom-P.height/2,T=P.width>k.width,B=P.height>k.height,W=(T?k:P).left,X=(T?k:P).right,A=(B?k:P).top,ue=(B?k:P).bottom;if(m==="top"&&a>=k.bottom-1||m==="bottom"&&a<=k.top+1||m==="left"&&n>=k.right-1||m==="right"&&n<=k.left+1){O();return}let V=!1;switch(m){case"top":V=Vc(y,w,W,k.top+1,X,P.bottom-1);break;case"bottom":V=Vc(y,w,W,P.top+1,X,k.bottom-1);break;case"left":V=Vc(y,w,P.right-1,ue,k.left+1,A);break;case"right":V=Vc(y,w,k.right-1,ue,P.left+1,A);break;default:}if(V)return;if(p&&!iS(y,w,k)){O();return}if(!R&&g(y,w)){O();return}let G=!1;switch(m){case"top":{let Z=T?ot/2:ot*4,oe=T?n+Z:N?n+Z:n-Z,Pe=T?n-Z:N?n+Z:n-Z,ee=a+ot+1,ie=N?P.bottom-ot:T?P.bottom-ot:P.top,me=N?T?P.bottom-ot:P.top:P.bottom-ot;G=Hc(y,w,oe,ee,Pe,ee,P.left,ie,P.right,me);break}case"bottom":{let Z=T?ot/2:ot*4,oe=T?n+Z:N?n+Z:n-Z,Pe=T?n-Z:N?n+Z:n-Z,ee=a-ot,ie=N?P.top+ot:T?P.top+ot:P.bottom,me=N?T?P.top+ot:P.bottom:P.top+ot;G=Hc(y,w,oe,ee,Pe,ee,P.left,ie,P.right,me);break}case"left":{let Z=B?ot/2:ot*4,oe=B?a+Z:j?a+Z:a-Z,Pe=B?a-Z:j?a+Z:a-Z,ee=n+ot+1,ie=j?P.right-ot:B?P.right-ot:P.left,me=j?B?P.right-ot:P.left:P.right-ot;G=Hc(y,w,ie,P.top,me,P.bottom,ee,oe,ee,Pe);break}case"right":{let Z=B?ot/2:ot*4,oe=B?a+Z:j?a+Z:a-Z,Pe=B?a-Z:j?a+Z:a-Z,ee=n-ot,ie=j?P.left+ot:B?P.left+ot:P.right,me=j?B?P.left+ot:P.right:P.left+ot;G=Hc(y,w,ee,oe,ee,Pe,ie,P.top,me,P.bottom);break}default:}if(!G)O();else if(!p)o.start(40,O);return}};return r.__options={...e,blockPointerEvents:t},r}function j0(e,t,o){let{reference:r,floating:n}=e,a=Ro(t),s=gs(t),i=ds(s),c=wo(t),u=a==="y",l=r.x+r.width/2-n.width/2,m=r.y+r.height/2-n.height/2,p=r[i]/2-n[i]/2,d;switch(c){case"top":d={x:l,y:r.y-n.height};break;case"bottom":d={x:l,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:m};break;case"left":d={x:r.x-n.width,y:m};break;default:d={x:r.x,y:r.y}}let f=Lo(t);if(f)d[s]+=p*(f==="end"?1:-1)*(o&&u?-1:1);return d}async function X0(e,t){var o;if(t===void 0)t={};let{x:r,y:n,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:m="floating",altBoundary:p=!1,padding:d=0}=wr(t,e),f=bc(d),g=i[p?m==="floating"?"reference":"floating":m],h=An(await a.getClippingRect({element:((o=await(a.isElement==null?void 0:a.isElement(g)))!=null?o:!0)?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),x=m==="floating"?{x:r,y:n,width:s.floating.width,height:s.floating.height}:s.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),C=await(a.isElement==null?void 0:a.isElement(b))&&await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},I=An(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:b,strategy:c}):x);return{top:(h.top-I.top+f.top)/C.y,bottom:(I.bottom-h.bottom+f.bottom)/C.y,left:(h.left-I.left+f.left)/C.x,right:(I.right-h.right+f.right)/C.x}}var cS=50,Y0=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:s}=o,i=s.detectOverflow?s:{...s,detectOverflow:X0},c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:l,y:m}=j0(u,r,c),p=r,d=0,f={};for(let S=0;S<a.length;S++){let g=a[S];if(!g)continue;let{name:h,fn:x}=g,{x:b,y:C,data:I,reset:y}=await x({x:l,y:m,initialPlacement:r,placement:p,strategy:n,middlewareData:f,rects:u,platform:i,elements:{reference:e,floating:t}});if(l=b!=null?b:l,m=C!=null?C:m,f[h]={...f[h],...I},y&&d<cS){if(d++,typeof y==="object"){if(y.placement)p=y.placement;if(y.rects)u=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):y.rects;({x:l,y:m}=j0(u,p,c))}S=-1}}return{x:l,y:m,placement:p,strategy:n,middlewareData:f}};var K0=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:S=!0,...g}=wr(e,t);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let h=wo(n),x=Ro(i),b=wo(i)===i,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),I=p||(b||!S?[ms(i)]:Jd(i)),y=f!=="none";if(!p&&y)I.push(...Qd(i,S,f,C));let w=[i,...I],v=await c.detectOverflow(t,g),R=[],L=((r=a.flip)==null?void 0:r.overflows)||[];if(l)R.push(v[h]);if(m){let k=Kd(n,s,C);R.push(v[k[0]],v[k[1]])}if(L=[...L,{placement:n,overflows:R}],!R.every((k)=>k<=0)){var U,E;let k=(((U=a.flip)==null?void 0:U.index)||0)+1,P=w[k];if(P){if(!(m==="alignment"?x!==Ro(P):!1)||L.every((T)=>Ro(T.placement)===x?T.overflows[0]>0:!0))return{data:{index:k,overflows:L},reset:{placement:P}}}let N=(E=L.filter((j)=>j.overflows[0]<=0).sort((j,T)=>j.overflows[1]-T.overflows[1])[0])==null?void 0:E.placement;if(!N)switch(d){case"bestFit":{var O;let j=(O=L.filter((T)=>{if(y){let B=Ro(T.placement);return B===x||B==="y"}return!0}).map((T)=>[T.placement,T.overflows.filter((B)=>B>0).reduce((B,W)=>B+W,0)]).sort((T,B)=>T[1]-B[1])[0])==null?void 0:O[0];if(j)N=j;break}case"initialPlacement":N=i;break}if(n!==N)return{reset:{placement:N}}}return{}}}};var J0=new Set(["left","top"]);async function lS(e,t){let{placement:o,platform:r,elements:n}=e,a=await(r.isRTL==null?void 0:r.isRTL(n.floating)),s=wo(o),i=Lo(o),c=Ro(o)==="y",u=J0.has(s)?-1:1,l=a&&c?-1:1,m=wr(t,e),{mainAxis:p,crossAxis:d,alignmentAxis:f}=typeof m==="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};if(i&&typeof f==="number")d=i==="end"?f*-1:f;return c?{x:d*l,y:p*u}:{x:p*u,y:d*l}}var Q0=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:a,placement:s,middlewareData:i}=t,c=await lS(t,e);if(s===((o=i.offset)==null?void 0:o.placement)&&(r=i.arrow)!=null&&r.alignmentOffset)return{};return{x:n+c.x,y:a+c.y,data:{...c,placement:s}}}}},eg=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:(x)=>{let{x:b,y:C}=x;return{x:b,y:C}}},...u}=wr(e,t),l={x:o,y:r},m=await a.detectOverflow(t,u),p=Ro(n),d=Ic(p),f=l[d],S=l[p],g=(x,b)=>hc(b+m[x==="y"?"top":"left"],b,b-m[x==="y"?"bottom":"right"]);if(s)f=g(d,f);if(i)S=g(p,S);let h=c.fn({...t,[d]:f,[p]:S});return{...h,data:{x:h.x-o,y:h.y-r,enabled:{[d]:s,[p]:i}}}}}},tg=function(e){if(e===void 0)e={};return{options:e,fn(t){var o,r;let{x:n,y:a,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:l=!0,crossAxis:m=!0}=wr(e,t),p={x:n,y:a},d=Ro(s),f=Ic(d),S=p[f],g=p[d],h=wr(u,t),x=typeof h==="number"?{mainAxis:h,crossAxis:0}:{mainAxis:(o=h.mainAxis)!=null?o:0,crossAxis:(r=h.crossAxis)!=null?r:0};if(l){let I=f==="y"?"height":"width",y=i.reference[f]-i.floating[I]+x.mainAxis,w=i.reference[f]+i.reference[I]-x.mainAxis;if(S<y)S=y;else if(S>w)S=w}if(m){var b,C;let I=f==="y"?"width":"height",y=J0.has(wo(s)),w=i.reference[d]-i.floating[I]+(y?((b=c.offset)==null?void 0:b[d])||0:0)+(y?0:x.crossAxis),v=i.reference[d]+i.reference[I]+(y?0:((C=c.offset)==null?void 0:C[d])||0)-(y?x.crossAxis:0);if(g<w)g=w;else if(g>v)g=v}return{[f]:S,[d]:g}}}},og=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:o,rects:r,platform:n,elements:a}=t,{apply:s=()=>{},...i}=wr(e,t),c=await n.detectOverflow(t,i),u=wo(o),l=Lo(o),m=Ro(o)==="y",{width:p,height:d}=r.floating,f,S;if(u==="top"||u==="bottom")f=u,S=l===(await(n.isRTL==null?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right";else S=u,f=l==="end"?"top":"bottom";let g=d-c.top-c.bottom,h=p-c.left-c.right,x=en(d-c[f],g),b=en(p-c[S],h),C=t.middlewareData.shift,I=!C,y=x,w=b;if(C!=null&&C.enabled.x)w=h;if(C!=null&&C.enabled.y)y=g;if(I&&!l)if(m)w=p-2*ar(c.left,c.right);else y=d-2*ar(c.top,c.bottom);await s({...t,availableWidth:w,availableHeight:y});let v=await n.getDimensions(a.floating);if(p!==v.width||d!==v.height)return{reset:{rects:!0}};return{}}}};function ag(e){let t=no(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=je(e),a=n?e.offsetWidth:o,s=n?e.offsetHeight:r,i=fs(o)!==a||fs(r)!==s;if(i)o=a,r=s;return{width:o,height:r,$:i}}function Wm(e){return!Ve(e)?e.contextElement:e}function ya(e){let t=Wm(e);if(!je(t))return xr(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:a}=ag(t),s=(a?fs(o.width):o.width)/r,i=(a?fs(o.height):o.height)/n;if(!s||!Number.isFinite(s))s=1;if(!i||!Number.isFinite(i))i=1;return{x:s,y:i}}var uS=xr(0);function sg(e){let t=qe(e);if(!Wi()||!t.visualViewport)return uS;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mS(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===qe(e)}function Bn(e,t,o,r){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),a=Wm(e),s=xr(1);if(t)if(r){if(Ve(r))s=ya(r)}else s=ya(e);let i=mS(a,o,r)?sg(a):xr(0),c=(n.left+i.x)/s.x,u=(n.top+i.y)/s.y,l=n.width/s.x,m=n.height/s.y;if(a&&r){let p=qe(a),d=Ve(r)?qe(r):r,f=p,S=zi(f);while(S&&d!==f){let g=ya(S),h=S.getBoundingClientRect(),x=no(S),b=h.left+(S.clientLeft+parseFloat(x.paddingLeft))*g.x,C=h.top+(S.clientTop+parseFloat(x.paddingTop))*g.y;c*=g.x,u*=g.y,l*=g.x,m*=g.y,c+=b,u+=C,f=qe(S),S=zi(f)}}return An({width:l,height:m,x:c,y:u})}function Uc(e,t){let o=qa(e).scrollLeft;if(!t)return Bn(br(e)).left+o;return t.left+o}function ig(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Uc(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function fS(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=br(r),i=t?$a(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},u=xr(1),l=xr(0),m=je(r);if(m||!a){if(Nt(r)!=="body"||wn(s))c=qa(r);if(m){let d=Bn(r);u=ya(r),l.x=d.x+r.clientLeft,l.y=d.y+r.clientTop}}let p=s&&!m&&!a?ig(s,c):xr(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+l.x+p.x,y:o.y*u.y-c.scrollTop*u.y+l.y+p.y}}function pS(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dS(e){let t=qa(e),o=e.ownerDocument.body,r=ar(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=ar(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-t.scrollLeft+Uc(e),s=-t.scrollTop;if(no(o).direction==="rtl")a+=ar(e.clientWidth,o.clientWidth)-r;return{width:r,height:n,x:a,y:s}}var gS=25;function hS(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=qe(e),a=br(e),s=n.visualViewport,{clientWidth:i,clientHeight:c}=a,u=0,l=0;if(s){let p=!Wi()||t==="fixed";if(r){if(!p)u=-s.offsetLeft,l=-s.offsetTop}else if(i=s.width,c=s.height,p)u=s.offsetLeft,l=s.offsetTop}if(Uc(a)<=0){let p=a.ownerDocument,d=p.body,f=getComputedStyle(d),S=p.compatMode==="CSS1Compat"?parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0:0,g=Math.abs(a.clientWidth-d.clientWidth-S),h=getComputedStyle(a).scrollbarGutter==="stable both-edges"?g/2:g;if(h<=gS)i-=h}return{width:i,height:c,x:u,y:l}}function IS(e,t){let o=Bn(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,a=ya(e),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=n*a.x,u=r*a.y;return{width:s,height:i,x:c,y:u}}function rg(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=hS(e,o,t);else if(t==="document")r=dS(br(e));else if(Ve(t))r=IS(t,o);else{let n=sg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return An(r)}function bS(e,t){let o=t.get(e);if(o)return o;let r=qr(e,[],!1).filter((i)=>Ve(i)&&Nt(i)!=="body"),n=null,a=no(e).position==="fixed",s=a?zo(e):e;while(Ve(s)&&!Go(s)){let i=no(s),c=_i(s),u=n?n.position:a?"fixed":"";if(!c&&(u==="fixed"||u==="absolute"&&i.position==="static"))r=r.filter((m)=>m!==s);else n=i;s=zo(s)}return t.set(e,r),r}function CS(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?$a(t)?[]:bS(t,this._c):[].concat(o),r],i=rg(t,s[0],n),{top:c,right:u,bottom:l,left:m}=i;for(let p=1;p<s.length;p++){let d=rg(t,s[p],n);c=ar(d.top,c),u=en(d.right,u),l=en(d.bottom,l),m=ar(d.left,m)}return{width:u-m,height:l-c,x:m,y:c}}function SS(e){let{width:t,height:o}=ag(e);return{width:t,height:o}}function xS(e,t,o){let r=je(t),n=br(t),a=o==="fixed",s=Bn(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=xr(0);if(r||!a){if(Nt(t)!=="body"||wn(n))i=qa(t);if(r){let p=Bn(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}}if(!r&&n)c.x=Uc(n);let u=n&&!r&&!a?ig(n,i):xr(0),l=s.left+i.scrollLeft-c.x-u.x,m=s.top+i.scrollTop-c.y-u.y;return{x:l,y:m,width:s.width,height:s.height}}function _m(e){return no(e).position==="static"}function ng(e,t){if(!je(e)||no(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(br(e)===o)o=o.ownerDocument.body;return o}function cg(e,t){let o=qe(e);if($a(e))return o;if(!je(e)){let n=zo(e);while(n&&!Go(n)){if(Ve(n)&&!_m(n))return n;n=zo(n)}return o}let r=ng(e,t);while(r&&fd(r)&&_m(r))r=ng(r,t);if(r&&Go(r)&&_m(r)&&!_i(r))return o;return r||pd(e)||o}var wS=async function(e){let t=this.getOffsetParent||cg,o=this.getDimensions,r=await o(e.floating);return{reference:xS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yS(e){return no(e).direction==="rtl"}var zm={convertOffsetParentRelativeRectToViewportRelativeRect:fS,getDocumentElement:br,getClippingRect:CS,getOffsetParent:cg,getElementRects:wS,getClientRects:pS,getDimensions:SS,getScale:ya,isElement:Ve,isRTL:yS};function lg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vS(e,t,o){let r=null,n,a=br(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,m){if(l===void 0)l=!1;if(m===void 0)m=1;s();let p=e.getBoundingClientRect(),{left:d,top:f,width:S,height:g}=p;if(!l)t();if(!S||!g)return;let h=ps(f),x=ps(a.clientWidth-(d+S)),b=ps(a.clientHeight-(f+g)),C=ps(d),y={rootMargin:-h+"px "+-x+"px "+-b+"px "+-C+"px",threshold:ar(0,en(1,m))||1},w=!0;function v(R){let L=R[0].intersectionRatio;if(!lg(p,e.getBoundingClientRect()))return i();if(L!==m){if(!w)return i();if(!L)n=setTimeout(()=>{i(!1,0.0000001)},1000);else i(!1,L)}w=!1}try{r=new IntersectionObserver(v,{...y,root:a.ownerDocument})}catch(R){r=new IntersectionObserver(v,y)}r.observe(e)}let c=qe(e),u=()=>i(o);return c.addEventListener("resize",u),i(!0),()=>{c.removeEventListener("resize",u),s()}}function Ls(e,t,o,r){if(r===void 0)r={};let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:i=typeof IntersectionObserver==="function",animationFrame:c=!1}=r,u=Wm(e),l=n||a?[...u?qr(u):[],...t?qr(t):[]]:[];l.forEach((h)=>{n&&h.addEventListener("scroll",o),a&&h.addEventListener("resize",o)});let m=u&&i?vS(u,o,a):null,p=-1,d=null;if(s){if(d=new ResizeObserver((h)=>{let[x]=h;if(x&&x.target===u&&d&&t)d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=d)==null||b.observe(t)});o()}),u&&!c)d.observe(u);if(t)d.observe(t)}let f,S=c?Bn(e):null;if(c)g();function g(){let h=Bn(e);if(S&&!lg(S,h))o();S=h,f=requestAnimationFrame(g)}return o(),()=>{var h;if(l.forEach((x)=>{n&&x.removeEventListener("scroll",o),a&&x.removeEventListener("resize",o)}),m==null||m(),(h=d)==null||h.disconnect(),d=null,c)cancelAnimationFrame(f)}}var ug=Q0;var mg=eg,fg=K0,pg=og;var dg=tg,_c=(e,t,o)=>{let r=new Map,n=o!=null?o:{},a={...zm,...n.platform,_c:r};return Y0(e,t,{...n,platform:a})};import*as qt from"react";import{useLayoutEffect as PS}from"react";import*as hg from"react-dom";var TS=typeof document<"u",ES=function(){},Wc=TS?PS:ES;function zc(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let o,r,n;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!zc(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let a=n[r];if(a==="_owner"&&e.$$typeof)continue;if(!zc(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Ig(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gg(e,t){let o=Ig(e);return Math.round(t*o)/o}function Gm(e){let t=qt.useRef(e);return Wc(()=>{t.current=e}),t}function bg(e){if(e===void 0)e={};let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,m]=qt.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=qt.useState(r);if(!zc(p,r))d(r);let[f,S]=qt.useState(null),[g,h]=qt.useState(null),x=qt.useCallback((T)=>{if(T!==y.current)y.current=T,S(T)},[]),b=qt.useCallback((T)=>{if(T!==w.current)w.current=T,h(T)},[]),C=a||f,I=s||g,y=qt.useRef(null),w=qt.useRef(null),v=qt.useRef(l),R=c!=null,L=Gm(c),U=Gm(n),E=Gm(u),O=qt.useCallback(()=>{if(!y.current||!w.current)return;let T={placement:t,strategy:o,middleware:p};if(U.current)T.platform=U.current;_c(y.current,w.current,T).then((B)=>{let W={...B,isPositioned:E.current!==!1};if(k.current&&!zc(v.current,W))v.current=W,hg.flushSync(()=>{m(W)})})},[p,t,o,U,E]);Wc(()=>{if(u===!1&&v.current.isPositioned)v.current.isPositioned=!1,m((T)=>({...T,isPositioned:!1}))},[u]);let k=qt.useRef(!1);Wc(()=>(k.current=!0,()=>{k.current=!1}),[]),Wc(()=>{if(C)y.current=C;if(I)w.current=I;if(C&&I){if(L.current)return L.current(C,I,O);O()}},[C,I,O,L,R]);let P=qt.useMemo(()=>({reference:y,floating:w,setReference:x,setFloating:b}),[x,b]),N=qt.useMemo(()=>({reference:C,floating:I}),[C,I]),j=qt.useMemo(()=>{let T={position:o,left:0,top:0};if(!N.floating)return T;let B=gg(N.floating,l.x),W=gg(N.floating,l.y);if(i)return{...T,transform:"translate("+B+"px, "+W+"px)",...Ig(N.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:B,top:W}},[o,i,N.floating,l.x,l.y]);return qt.useMemo(()=>({...l,update:O,refs:P,elements:N,floatingStyles:j}),[l,O,P,N,j])}var Zm=(e,t)=>{let o=ug(e);return{name:o.name,fn:o.fn,options:[e,t]}},$m=(e,t)=>{let o=mg(e);return{name:o.name,fn:o.fn,options:[e,t]}},qm=(e,t)=>({fn:dg(e).fn,options:[e,t]}),jm=(e,t)=>{let o=fg(e);return{name:o.name,fn:o.fn,options:[e,t]}},Xm=(e,t)=>{let o=pg(e);return{name:o.name,fn:o.fn,options:[e,t]}};import*as Gc from"react";var AS=Gc.createContext(void 0);function Cg(e){let t=Gc.useContext(AS);if(t===void 0&&!e)throw Error(Ge(69));return t}var MS="ArrowUp",kS="ArrowDown",LS="ArrowLeft",DS="ArrowRight",FS="Home",OS="End";var Zc=new Set([MS,kS,LS,DS,FS,OS]);function va(e){return e==="starting"?h0:Ue}import*as $c from"react";var NS=$c.createContext(void 0);function Sg(){return $c.useContext(NS)}import*as qc from"react";function BS(e,t){let o=Za(e.render);if(qc.isValidElement(o)){let r=o.props;if(Object.hasOwn(r,"id"))return r.id??""}return e.id??t}function xg(e,t,o){let r=BS(e,t),n=r===t?void 0:r,a=qc.useCallback((s)=>o?.(s?n:void 0),[n,o]);return[r,a]}import*as wg from"react";function yg(e,t,o){let r=Za(e.render),n=wg.isValidElement(r)?r.props:void 0,a=e["aria-label"]??n?.["aria-label"],s=e["aria-labelledby"]??n?.["aria-labelledby"];if(s==null&&!a)s=t?t.id||void 0:o||void 0;return s}import{jsx as vg}from"react/jsx-runtime";var HS=Hn.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,id:i,initialFocus:c,...u}=t,{store:l,defaultFloatingId:m,setRenderedFloatingId:p,virtualFocus:d,orientation:f}=vo(),S=Sg(),{side:g,align:h}=Sd(),x=Cg(!0)!=null,b=l.useState("open"),C=l.useState("transitionStatus"),I=l.useState("popupProps"),y=l.useState("mounted"),w=l.useState("instantType"),v=l.useState("activeTriggerElement"),R=l.useState("parent"),L=l.useState("lastOpenChangeReason"),U=l.useState("rootId"),E=l.useState("floatingRootContext"),O=l.useState("floatingTreeRoot"),k=l.useState("closeDelay"),P=l.useState("hoverEnabled"),N=l.useState("disabled"),j=l.useState("openMethod"),T=l.useState("activeTriggerId"),B=l.useState("listElement"),[W,X]=xg(t,m,p),A=yg(t,v,T),ue=R.type==="menu"?S:void 0,V=R.type==="context-menu",G=c??R.type!=="menu";if(c===void 0&&B&&R.type!=="menu")G=()=>{if(l.state.activeIndex!==null)return!1;return B};$o({open:b,ref:l.context.popupRef,onComplete(){if(b)l.context.onOpenChangeComplete?.(!0)}}),Hn.useEffect(()=>{function ne(we){l.setOpen(!1,Re(we.reason,we.domEvent))}return O.events.on("close",ne),()=>{O.events.off("close",ne)}},[O.events,l]),As(E,{enabled:P&&!N&&!V&&R.type!=="menubar",closeDelay:k});let Z=l.useStateSetter("popupElement"),oe=Hn.useContext(zu)?.useParentHandoff??US,{parentVirtualFocusRef:Pe,handleFocus:ee}=oe(l,R,b,d),ie={transitionStatus:C,side:g,align:h,open:b,nested:R.type==="menu",instant:w},me=ve("div",t,{state:ie,ref:[o,l.context.popupRef,Z,X],stateAttributesMapping:ra,props:[I,{id:W,...B?{role:"presentation"}:{role:"menu","aria-orientation":f==="horizontal"?"horizontal":void 0,"aria-labelledby":A},onKeyDown(ne){if(ue?.onPopupKeyDown?.(ne),x&&Zc.has(ne.key))ne.stopPropagation()},onFocus:ee},va(C),u,{"data-rootownerid":U}]}),fe=R.type===void 0||V;if(v||R.type==="menubar"&&L!==Uu)fe=!0;let be=ue?.getReturnElement??Pe;return vg(ws,{context:E,openInteractionType:j,modal:V,disabled:!y,returnFocus:s??be??fe,explicitReturnFocus:s===void 0&&be?!1:void 0,initialFocus:G,restoreFocus:!0,getInsideElements:R.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:R.type!=="menubar"?O:void 0,previousFocusableElement:v,nextFocusableElement:R.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:me})}),VS={parentVirtualFocusRef:void 0,handleFocus:void 0};function US(){return VS}var Rg=Hn.forwardRef(function(t,o){let r=Gu()?.Popup??HS;return vg(r,{...t,ref:o})});import*as Eg from"react";import*as jc from"react";var Ym=jc.createContext(void 0);function Pg(){let e=jc.useContext(Ym);if(e===void 0)throw Error(Ge(32));return e}import{jsx as Tg}from"react/jsx-runtime";var Ag=Eg.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,{store:a,parent:s}=vo();if(!(a.useState("mounted")||r))return null;let u=s.type==="menu"||s.type==="menubar"?"group":void 0;return Tg(Ym.Provider,{value:r,children:Tg(Ss,{ref:o,...n,portalOwnerRole:u})})});import*as sn from"react";function Ra(e){if(Kn(19))return e;return e?"true":void 0}import*as Fo from"react";import*as jo from"react";function Mg(e){let{nodeId:t,externalTree:o,rootContext:r}=e,n=r.useState("referenceElement"),a=r.useState("floatingElement"),s=r.useState("domReferenceElement"),i=r.useState("open"),c=r.useState("floatingId"),[u,l]=jo.useState(null),m=jo.useRef(null),p=fo(o),d=jo.useMemo(()=>({reference:n,floating:a,domReference:s}),[n,a,s]),f=bg({...e,elements:{...d,...u&&{reference:u}}}),S=jo.useCallback((b)=>{let C=Ve(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;l(C),f.refs.setReference(C)},[f.refs]),g=jo.useMemo(()=>({...f.refs,setPositionReference:S,domReference:m}),[f.refs,S]),h=jo.useMemo(()=>({...f.elements,domReference:s}),[f.elements,s]),x=jo.useMemo(()=>({...f,dataRef:r.context.dataRef,open:i,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:h,nodeId:t,rootStore:r}),[f,g,h,t,r,i,c]);return z(()=>{if(s)m.current=s},[s]),z(()=>{r.context.dataRef.current.floatingContext=x;let b=p?.nodesRef.current.find((C)=>C.id===t);if(b)b.context=x}),jo.useMemo(()=>({...f,context:x,refs:g,elements:h,rootStore:r}),[f,g,h,x,r])}import*as Xc from"react";var _S=Xc.createContext(void 0);function Yc(){return Xc.useContext(_S)?.direction??"ltr"}var WS=(e)=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=wr(e,t)||{};if(u==null)return{};let m=bc(l),p={x:o,y:r},d=gs(n),f=ds(d),S=await s.getDimensions(u),g=d==="y",h=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",C=a.reference[f]+a.reference[d]-p[d]-a.floating[f],I=p[d]-a.reference[d],y=i.floating[b]||a.floating[f],w=C/2-I/2,v=y/2-S[f]/2-1,R=Math.min(m[h],v),L=Math.min(m[x],v),U=R,E=y-S[f]-L,O=y/2-S[f]/2+w,k=hc(U,O,E),P=!c.arrow&&Lo(n)!=null&&O!==k&&a.reference[f]/2-(O<U?R:L)-S[f]/2<0,N=P?O<U?O-U:O-E:0;return{[d]:p[d]+N,data:{[d]:k,centerOffset:O-k-N,...P&&{alignmentOffset:N}},reset:P}}}),kg=(e,t)=>{let{name:o,fn:r}=WS(e);return{name:o,fn:r,options:[e,t]}};var Lg={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,a=t===0&&o===0&&r===0&&n===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-o>=0||s.right-t>=0||s.bottom-o>=0||s.left-t>=0||a}}}};var Dg={sideX:"left",sideY:"top"};var Fg="--available-width",Og="--available-height",Ng="--anchor-width",Bg="--anchor-height",Hg="--transform-origin";var Vg=Fg,Ug=Og;function zg(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function _g(e,t,o){let{rects:r,placement:n}=e;return{side:zg(t,wo(n),o),align:Lo(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Kc(e){return GS(e,Mg)}function GS(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,inline:d,keepMounted:f=!1,floatingRootContext:S,mounted:g,collisionAvoidance:h,shift:x,nodeId:b,adaptiveOrigin:C,lazyFlip:I=!1,externalTree:y}=e,w=h.side||"flip",v=h.align||"flip",R=h.fallbackAxisSide||"end",L=x?.crossAxis??!1,U=x?.rootBoundary,E=typeof o==="function"?o:void 0,O=re(E),k=E?O:o,P=ct(o),N=ct(g),T=Yc()==="rtl",[B,W]=Fo.useState(null);if(!g&&B!==null)W(null);let X=I==="placement",A=B?wo(B):null,ue=B&&X?Lo(B)||"center":null,V=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":T?"left":"right","inline-start":T?"right":"left"}[n],G=ue||s,Z=G==="center"?V:`${V}-${G}`,oe=u;if(typeof oe==="number")oe={top:oe,right:oe,bottom:oe,left:oe};else if(oe)oe={top:oe.top||0,right:oe.right||0,bottom:oe.bottom||0,left:oe.left||0};let Pe=1,ee=n==="bottom"?Pe:0,ie=n==="top"?Pe:0,me=n==="right"?Pe:0,fe=n==="left"?Pe:0,be={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:oe},ne=Fo.useRef(null),we=ct(a),Ce=ct(i),De=typeof a!=="function"?a:0,Q=typeof i!=="function"?i:0,H=[];if(d)H.push(d);H.push(Zm(($e)=>{let Zt=_g($e,n,T),ye=typeof we.current==="function"?we.current(Zt):we.current,Me=typeof Ce.current==="function"?Ce.current(Zt):Ce.current;return{mainAxis:ye,crossAxis:Me,alignmentAxis:Me}},[De,Q,T,n]));let Y=v==="none"&&w!=="shift",D=!Y&&(l||L||w==="shift"),de=w==="none"?null:jm({...be,padding:{top:oe.top+Pe+ee,right:oe.right+Pe+fe,bottom:oe.bottom+Pe+ie,left:oe.left+Pe+me},mainAxis:!L&&w==="flip",crossAxis:v==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),K=Y?null:$m({...be,rootBoundary:U,mainAxis:v!=="none",crossAxis:D,limiter:l||L?void 0:qm(($e)=>{if(!ne.current)return{};let{width:Zt,height:ye}=ne.current.getBoundingClientRect(),Me=Ro(wo($e.placement)),We=Me==="y"?Zt:ye,$t=Me==="y"?oe.left+oe.right:oe.top+oe.bottom;return{offset:We/2+$t/2}})},[be,l,L,U,oe,v]);if(w==="shift"||v==="shift"||G==="center")H.push(K,de);else H.push(de,K);H.push(Xm({...be,apply({elements:{floating:$e},availableWidth:Zt,availableHeight:ye,rects:Me}){if(!N.current)return;let We=$e.style;We.setProperty(Vg,`${Zt}px`),We.setProperty(Ug,`${ye}px`);let $t=qe($e).devicePixelRatio||1,{x:Jt,y:So,width:jt,height:Eo}=Me.reference,Ko=(Math.round((Jt+jt)*$t)-Math.round(Jt*$t))/$t,No=(Math.round((So+Eo)*$t)-Math.round(So*$t))/$t;We.setProperty(Ng,`${Ko}px`),We.setProperty(Bg,`${No}px`)}}),kg(($e)=>({element:ne.current||Ee($e.elements.floating).createElement("div"),padding:ne.current?m:0}),[m]),{name:"transformOrigin",fn($e){let{elements:{floating:Zt},middlewareData:ye,placement:Me,platform:We,rects:$t,y:Jt}=$e,So=wo(Me),jt=Lo(Me),Eo=Ro(So)==="y",Ko=ne.current,No=typeof a==="function"?a(_g($e,n,T)):a,$n;if(!Ko&&jt&&Math.abs(Eo?ye.shift?.x||0:ye.shift?.y||0)<=1)$n=jt==="start"===(Eo&&We.isRTL?.(Zt)===!0)?"100%":"0%";else{let dn=Eo?ye.arrow?.x||0:ye.arrow?.y||0,gn=Eo?Ko?.clientWidth||0:Ko?.clientHeight||0;$n=`${dn+gn/2}px`}let pr=So==="top"||So==="left"?`calc(100% + ${No}px)`:`${-No}px`;if(D&&Eo&&Math.abs(ye.shift?.y||0)>No)pr=`${$t.reference.y+$t.reference.height/2-Jt}px`;return Zt.style.setProperty(Hg,Eo?`${$n} ${pr}`:`${pr} ${$n}`),{}}},Lg,C),z(()=>{if(!g&&S)S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,S]);let pe=Fo.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:M,elements:_,x:Se,y:J,middlewareData:se,update:ge,placement:he,context:Ie,isPositioned:Ne,floatingStyles:Qe}=t({rootContext:S,open:f?g:void 0,placement:Z,middleware:H,strategy:r,whileElementsMounted:f?void 0:(...$e)=>Ls(...$e,pe),nodeId:b,externalTree:y}),{sideX:gt,sideY:bo}=se.adaptiveOrigin||Dg,Co=Ne?r:"fixed",Yo=Fo.useMemo(()=>{let $e;if(!Ne)$e={position:Co,top:0,left:0};else if(C)$e={position:Co,[gt]:Se,[bo]:J};else $e={...Qe,position:Co};if($e[Vg]="100vw",$e[Ug]="100vh",!Ne)$e.opacity=0;return $e},[C,Co,gt,Se,bo,J,Qe,Ne]),oo=Fo.useRef(null);z(()=>{if(!g)return;let $e=P.current,Zt=typeof $e==="function"?$e():$e,Me=(Wg(Zt)?Zt.current:Zt)||null||null;if(Me!==oo.current)M.setPositionReference(Me),oo.current=Me},[g,M,k,P]),Fo.useEffect(()=>{if(!g)return;let $e=P.current;if(typeof $e==="function")return;if(Wg($e)&&$e.current!==oo.current)M.setPositionReference($e.current),oo.current=$e.current},[g,M,k,P]),Fo.useEffect(()=>{if(f&&g&&_.reference&&_.floating)return Ls(_.reference,_.floating,ge,pe);return},[f,g,_,ge,pe]);let Kt=wo(he),yo=zg(n,Kt,T),To=Lo(he)||"center",uo=Boolean(se.hide?.referenceHidden);z(()=>{if(I&&g&&Ne&&(Kt!==V||X&&To!==G))W(he)},[I,X,g,Ne,he,Kt,To,V,G]);let fn=Fo.useMemo(()=>({position:"absolute",top:se.arrow?.y,left:se.arrow?.x}),[se.arrow]),pn=se.arrow?.centerOffset!==0;return Fo.useMemo(()=>({positionerStyles:Yo,arrowStyles:fn,arrowRef:ne,arrowUncentered:pn,side:yo,align:To,physicalSide:Kt,anchorHidden:uo,refs:M,context:Ie,isPositioned:Ne,update:ge}),[Yo,fn,ne,pn,yo,To,Kt,uo,M,Ie,Ne,ge])}function Wg(e){return e!=null&&"current"in e}import*as Br from"react";import{jsx as ZS}from"react/jsx-runtime";function Gg(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=re(n),[,s]=Br.useState(0),i=Xe(qS).current,c=Xe($S).current,u=Br.useRef(0),l=Br.useRef(!0),m=Br.useRef(null),p=Br.useRef(null),d=re(()=>{if(l.current)return;l.current=!0,s((I)=>I+1)}),f=re((I,y)=>{c.set(I,y),d()}),S=re((I)=>{c.delete(I),d()}),g=re((I)=>{let y=new Map;if(o.current.length=0,r)r.current.length=0;return I.forEach((w)=>{if(y.set(w.element,{...w.registration.metadata??{},index:w.index}),o.current[w.index]=w.element,r)r.current[w.index]=w.registration.label!==void 0?w.registration.label:w.registration.textRef?.current?.textContent??w.element.textContent}),u.current=o.current.length,y});function h(I){if(p.current?.disconnect(),p.current=null,typeof MutationObserver!=="function"||I.length<2)return;let y=new MutationObserver((v)=>{if(!YS(v))return;let R=null;for(let L of I){if(!L.isConnected)continue;if(R&&Zg(R,L)>0){y.disconnect(),d();return}R=L}});p.current=y;let w=new Set;for(let v=1;v<I.length;v+=1){let R=XS(I[v-1],I[v]);if(R)w.add(R)}w.forEach((v)=>y.observe(v,{childList:!0}))}let x=re(()=>{let[I,y]=jS(c),w=g(I),v=m.current,R=!v||v.length!==I.length||I.some((L,U)=>{let E=v[U];return L.index!==E.index||L.element!==E.element||L.registration.index!==E.registration.index||L.registration.metadata!==E.registration.metadata});if(h(y),m.current=I,l.current=!1,!R)return;i.forEach((L)=>L(w)),a(w)});z(()=>{if(!l.current&&m.current)g(m.current);return()=>{if(o.current=[],r)r.current=[]}},[o,r,g]),z(()=>{if(l.current)x()}),z(()=>()=>{p.current?.disconnect(),l.current=!0},[]);let b=re((I)=>(i.add(I),()=>{i.delete(I)})),C=Br.useMemo(()=>({register:f,unregister:S,subscribeMapChange:b,nextIndexRef:u}),[f,S,b,u]);return ZS(Xu.Provider,{value:C,children:t})}function $S(){return new Map}function qS(){return new Set}function jS(e){let t=new Set,o=[],r=[];e.forEach((a,s)=>{if(!s.isConnected)return;let i=a.index,c={index:i??-1,element:s,registration:a};if(i===null)r.push(c);else if(i>=0)t.add(i),o.push(c)});let n=0;if(r.sort((a,s)=>Zg(a.element,s.element)),r.forEach((a)=>{while(t.has(n))n+=1;a.index=n,o.push(a),n+=1}),t.size>0)o.sort((a,s)=>a.index-s.index);return[o,r.map((a)=>a.element)]}function XS(e,t){let o=e.parentElement;while(o&&!o.contains(t))o=o.parentElement;return o}function YS(e){for(let t of e)for(let o=0;o<t.removedNodes.length;o+=1)if(t.removedNodes[o].isConnected)return!0;return!1}function Zg(e,t){if(e.nextElementSibling===t)return-1;if(t.nextElementSibling===e)return 1;return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}import*as $g from"react";import{jsx as KS}from"react/jsx-runtime";var Jc=$g.forwardRef(function(t,o){let{cutout:r,...n}=t,a;if(r){let s=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${s.left}px ${s.top}px,${s.left}px ${s.bottom}px,${s.right}px ${s.bottom}px,${s.right}px ${s.top}px,${s.left}px ${s.top}px)`}return KS("div",{ref:o,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});import*as Km from"react";function qg(e){let{store:t,domReference:o,positionerElement:r,open:n}=e,a=Km.useRef(null),s=Km.useRef(null),i=la(r);z(()=>{if(n)return;if(s.current?.abort(),s.current=null,t.state.instantType==="trigger-change")t.set("instantType",void 0)},[n,t]),z(()=>{let c=o,u=a.current;if(c)a.current=c;if(!u||!c||c===u)return;if(!t.select("open"))return;t.set("instantType",void 0);let l=new AbortController;return s.current=l,i(()=>{if(t.select("open"))t.set("instantType","trigger-change")},l.signal),()=>{l.abort()}},[o,i,t])}function Qc(e,t,{styles:o,transitionStatus:r,props:n,refs:a,hidden:s,inert:i=!1}){let c={...o};if(i)c.pointerEvents="none";return ve("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:s,style:c},va(r),n],stateAttributesMapping:vn})}import*as Qg from"react";var jg={},Xg={},Yg="";function el(e,t){return wn(e)?e:t}function Kg(e,t,o){return/hidden|clip/.test(e.getComputedStyle(el(t,o)).overflowY)}function JS(e){if(typeof document>"u")return!1;let t=Ee(e);return qe(t).innerWidth-t.documentElement.clientWidth>0}function QS(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let o=Ee(e),{documentElement:r,body:n}=o,a=el(r,n),s=a.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";let c=a.offsetWidth;a.style.overflowY="hidden";let u=a.offsetWidth;return a.style.overflowY=s,r.style.scrollbarGutter=i,c===u}function ex(e){let t=Ee(e),{documentElement:o,body:r}=t,n=el(o,r),a={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(n.style,a)}}function tx(e){let t=Ee(e),{documentElement:o,body:r}=t,n=qe(o),a=0,s=0,i=!1,c=Zo.create();if(Lr.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function u(){let d=n.getComputedStyle(o),f=n.getComputedStyle(r),h=(d.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=o.scrollTop,s=o.scrollLeft,jg={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},Yg=o.style.scrollBehavior,Xg={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let x=o.scrollHeight>o.clientHeight,b=o.scrollWidth>o.clientWidth,C=d.overflowY==="scroll"||f.overflowY==="scroll",I=d.overflowX==="scroll"||f.overflowX==="scroll",y=Math.max(0,n.innerWidth-r.clientWidth),w=Math.max(0,n.innerHeight-r.clientHeight),v=parseFloat(f.marginTop)+parseFloat(f.marginBottom),R=parseFloat(f.marginLeft)+parseFloat(f.marginRight),L=el(o,r);if(i=QS(e),i){o.style.scrollbarGutter=h,L.style.overflowY="hidden",L.style.overflowX="hidden";return}if(Object.assign(o.style,{scrollbarGutter:h,overflowY:"hidden",overflowX:"hidden"}),x||C)o.style.overflowY="scroll";if(b||I)o.style.overflowX="scroll";Object.assign(r.style,{position:"relative",height:v||w?`calc(100dvh - ${v+w}px)`:"100dvh",width:R||y?`calc(100vw - ${R+y}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=s,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function l(){if(Object.assign(o.style,jg),Object.assign(r.style,Xg),!i)o.scrollTop=a,o.scrollLeft=s,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=Yg}function m(){l(),c.request(u)}u();let p=Ae(n,"resize",m);return()=>{if(c.cancel(),l(),typeof n.removeEventListener==="function")p()}}class Jg{lockCount=0;restore=null;timeoutLock=eo.create();timeoutUnlock=eo.create();acquire(e){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(e));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Ee(e),{documentElement:o,body:r}=t,n=qe(o);if(Kg(n,o,r)){let s=new n.MutationObserver(()=>{if(Kg(n,o,r))return;s.disconnect(),this.restore=null,this.lock(e)}),i={attributes:!0};s.observe(o,i),s.observe(r,i),this.restore=()=>s.disconnect();return}let a=kr.ios||!JS(e);this.restore=a?ex(e):tx(e)}}var ox=new Jg;function tl(e=!0,t=null){z(()=>{if(!e)return;return ox.acquire(t)},[e,t])}var rx=20;function e1(e,t,o,r){let[n,a]=Qg.useState(!1);z(()=>{if(!e||!t||o==null){a(!1);return}let s=Ee(o).documentElement.clientWidth,i=o.offsetWidth;a(s>0&&i>0&&i>=s-rx)},[e,t,o]),tl(e&&(!t||n),r)}import{jsx as Jm,jsxs as nx}from"react/jsx-runtime";var t1=sn.forwardRef(function(t,o){let{anchor:r,positionMethod:n="absolute",className:a,render:s,side:i,align:c,sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:p=5,arrowPadding:d=5,sticky:f=!1,disableAnchorTracking:S=!1,collisionAvoidance:g=C0,style:h,...x}=t,{store:b,virtualFocus:C,syncHighlightedItem:I}=vo(),y=Pg(),w=na(!0),v=b.useState("parent"),R=b.useState("floatingRootContext"),L=b.useState("floatingTreeRoot"),U=b.useState("mounted"),E=b.useState("open"),O=b.useState("modal"),k=b.useState("openMethod"),P=b.useState("activeTriggerElement"),N=b.useState("transitionStatus"),j=b.useState("positionerElement"),T=b.useState("instantType"),B=b.useState("adaptiveOrigin"),W=b.useState("lastOpenChangeReason"),X=b.useState("floatingNodeId"),A=b.useState("floatingParentNodeId"),ue=R.useState("domReferenceElement"),V=r,G=u,Z=l,oe=c,Pe=g;if(v.type==="context-menu"){if(V=r??v.context?.anchor,oe=oe??"start",!i&&oe!=="center")Z=t.alignOffset??2,G=t.sideOffset??-5}let ee=i,ie=oe;if(v.type==="menu")ee=ee??"inline-end",ie=ie??"start",Pe=t.collisionAvoidance??Pc;else if(v.type==="menubar")ee=ee??(v.context.orientation==="vertical"?"inline-end":"bottom"),ie=ie??"start";let me=v.type==="context-menu",fe=Kc({anchor:V,floatingRootContext:R,positionMethod:w?"fixed":n,mounted:U,side:ee,sideOffset:G,align:ie,alignOffset:Z,arrowPadding:me?0:d,collisionBoundary:m,collisionPadding:p,sticky:f,nodeId:X,keepMounted:y,disableAnchorTracking:S,collisionAvoidance:Pe,shift:me?{crossAxis:!(("side"in Pe)&&Pe.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:B,lazyFlip:C?"placement":!1});sn.useEffect(()=>{function Y(D){if(D.open){if(D.parentNodeId===X)b.set("hoverEnabled",!1);if(D.nodeId!==X&&D.parentNodeId===b.select("floatingParentNodeId"))b.setOpen(!1,Re(ts))}}return L.events.on("menuopenchange",Y),()=>{L.events.off("menuopenchange",Y)}},[b,L.events,X]),sn.useEffect(()=>{if(b.select("floatingParentNodeId")==null)return;function Y(D){if(D.open||D.nodeId!==b.select("floatingParentNodeId"))return;let de=D.reason??ts;b.setOpen(!1,Re(de))}return L.events.on("menuopenchange",Y),()=>{L.events.off("menuopenchange",Y)}},[L.events,b]);let be=Je();sn.useEffect(()=>{if(!E)be.clear()},[E,be]),sn.useEffect(()=>{function Y(D){if(!E||D.nodeId!==b.select("floatingParentNodeId"))return;if(D.target&&P&&P!==D.target){let de=b.select("closeDelay");if(de>0){if(!be.isStarted())be.start(de,()=>{b.setOpen(!1,Re(ts))})}else b.setOpen(!1,Re(ts))}else be.clear()}return L.events.on("itemhover",Y),()=>{L.events.off("itemhover",Y)}},[L.events,E,P,b,be]),sn.useEffect(()=>{let Y={open:E,nodeId:X,parentNodeId:A,reason:b.select("lastOpenChangeReason")};L.events.emit("menuopenchange",Y)},[L.events,E,b,X,A]),qg({store:b,domReference:ue,positionerElement:j,open:E});let ne={open:E,side:fe.side,align:fe.align,anchorHidden:fe.anchorHidden,nested:v.type==="menu",instant:T},we=v.type==="menubar"&&v.context.modal,Ce=O&&W!==Yt;e1(E&&(we||Ce),k==="touch",j,P);let De=Qc(t,ne,{styles:fe.positionerStyles,transitionStatus:N,props:x,refs:[o,b.useStateSetter("positionerElement")],hidden:!U,inert:!E}),Q=U&&v.type!=="menu"&&(v.type!=="menubar"&&O&&W!==Yt||v.type==="menubar"&&v.context.modal),H=null;if(v.type==="menubar")H=v.context.contentElement;else if(v.type===void 0)H=P;return nx(Nu.Provider,{value:fe,children:[Q&&Jm(Jc,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Ra(!E),cutout:H}),Jm(Sm,{id:X,children:Jm(Gg,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:I,children:De})})]})});import*as lt from"react";import*as ol from"react";var ax=ol.createContext(null);function rl(e){let t=ol.useContext(ax);if(t===null&&!e)throw Error(Ge(5));return t}import*as Fs from"react";import*as Ds from"react";function o1(e){let t=Ds.useRef(""),o=Ds.useCallback((n)=>{if(n.defaultPrevented)return;t.current=n.pointerType,e(n,n.pointerType)},[e]);return{onClick:Ds.useCallback((n)=>{if(n.detail===0){e(n,"keyboard");return}if("pointerType"in n)e(n,n.pointerType);else e(n,t.current);t.current=""},[e]),onPointerDown:o}}import*as r1 from"react";function nl(e,t){let o=r1.useRef(e),r=re(t);z(()=>{if(o.current!==e)r(o.current);o.current=e},[e,r])}function Qm(e,t){let o=re((a,s)=>{if(!(typeof e==="function"?e():e))t(s||(kr.ios?"touch":""))}),{onClick:r,onPointerDown:n}=o1(o);return Fs.useMemo(()=>({onClick:r,onPointerDown:n}),[r,n])}function n1(e){let[t,o]=Fs.useState(null),r=Qm(e,o);return nl(e,(n)=>{if(n&&!e)o(null)}),Fs.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function a1(e){if(e==null)return Rn;if(e.type.startsWith("key"))return Rd;if(e.type.startsWith("mouse")||e.type.startsWith("pointer"))return _b;return Rn}import*as Pa from"react";var sx={...nn,disabled:(e)=>e.parent.type==="menubar"?e.parent.context.disabled||e.disabled:e.disabled,modal:(e)=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:(e)=>e.openMethod,keyboardOpen:(e)=>e.keyboardOpen,allowMouseEnter:(e)=>e.allowMouseEnter,highlightItemOnHover:(e)=>e.highlightItemOnHover,parent:(e)=>e.parent,rootId:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("rootId");return e.parent.type!==void 0?e.parent.context.rootId:e.rootId},activeIndex:(e)=>e.activeIndex,listElement:(e)=>e.listElement,triggerControlsId:(e,t)=>{let o=nn.triggerPopupId(e,t);return o?e.listElement?.id||o:void 0},filterTriggerProps:(e)=>e.filterTriggerProps,inputProps:(e)=>e.inputProps,webkitAriaSelected:(e,t)=>Lr.webkit&&e.inputFocused&&t?!0:void 0,highlightedItemId:(e)=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:(e)=>e.hoverEnabled,instantType:(e)=>e.instantType==="trigger-change"&&!nn.open(e)?void 0:e.instantType,lastOpenChangeReason:(e)=>e.openChangeReason,floatingTreeRoot:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("floatingTreeRoot");return e.floatingTreeRoot},floatingNodeId:(e)=>e.floatingNodeId,floatingParentNodeId:(e)=>e.floatingParentNodeId,itemProps:(e)=>e.itemProps,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin,keyboardEventRelay:(e)=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay");return}};class ef extends ir{constructor(e,t,o=!1){let r=new Dn,n=cx(r,t,o,e);super(n,ix(r),sx);this.observe("parent",(a)=>{if(a.type==="menu")this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;else if(a.type!==void 0)this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!=="menu")return;let t=e.store.select("rootId"),o=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return e.store.subscribe(()=>{let n=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),s=e.store.select("keyboardEventRelay");if(t===n&&o===a&&r===s)return;t=n,o=a,r=s,this.notifyAll()})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}setActiveIndex(e,t,o){if(this.state.activeIndex!==e){let n=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=n?"none":t,this.context.highlightEvent=n?void 0:o}this.set("activeIndex",e)}highlightItem(e,t,o){let r=this.context.itemDomElements.current.indexOf(e);if(r>-1)this.setActiveIndex(r,t,o)}}function ix(e){return{positionerRef:Pa.createRef(),popupRef:Pa.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Pa.createRef(),beforeTriggerFocusGuardRef:Pa.createRef(),beforeContentFocusGuardRef:Pa.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function cx(e,t,o=!1,r){return{...Ca(e,t,o),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Ue,inputProps:Ue,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new kn,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ue,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}import*as s1 from"react";var tf=s1.createContext(null);function of(e,t){return(e===aa||e===_u)&&t?.detail===0}function i1(e,t){return e===ec||of(e,t)}import{jsx as Os,jsxs as lx}from"react/jsx-runtime";var ux=Fn(function(t){let{children:o,open:r,onOpenChange:n,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:i=!1,disabled:c=!1,modal:u,loopFocus:l=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:d=!1,handle:f,triggerId:S,defaultTriggerId:g=null,highlightItemOnHover:h=!0,isSubmenu:x=!1,virtualFocus:b=!1,virtualFocusRef:C,allowEscape:I=!0,resetOnPointerLeave:y=!0}=t,w=na(!0),v=vo(!0),R=rl(!0),L=v?.store,U=v?.virtualFocus??!1,E=lt.useMemo(()=>{if(x&&L)return{type:"menu",store:L};if(R)return{type:"menubar",context:R};if(w&&!L)return{type:"context-menu",context:w};return{type:void 0}},[w,L,R,x]),O=ao(),k=ao(),[P,N]=lt.useState(void 0),j=(P??k)||void 0,T=Do(),B=E.type==="menu"?E.store:void 0,W=(r??i)&&B?.state.transitionStatus==="starting",X=Xe(()=>W?B?.state.instantType:void 0).current,A=Xe(()=>{let ye=new ef({open:i,openProp:r,activeTriggerId:g,triggerIdProp:S,parent:E,disabled:c,highlightItemOnHover:h,modal:E.type===void 0?u:void 0,rootId:O,instantType:X},j,T!=null);return ye.context.virtualFocusRef=C,ye}).current;A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",S),A.useContextCallback("onOpenChangeComplete",a);let ue=A.useState("floatingTreeRoot"),V=xs(ue),G=A.useState("open"),Z=A.useState("activeTriggerElement"),oe=A.useState("positionerElement"),Pe=A.useState("hoverEnabled"),ee=A.useState("disabled"),ie=A.useState("lastOpenChangeReason"),me=A.useState("parent"),fe=A.useState("activeIndex"),be=A.useState("keyboardOpen"),ne=A.useState("payload"),we=A.useState("floatingParentNodeId"),Ce=lt.useRef(null),De=lt.useRef(me.type!=="context-menu"),Q=Je(),H=lt.useRef(!0),Y=Je(),D=we!=null,{openMethod:de,triggerProps:K}=n1(G);A.useSyncedValues({disabled:c,highlightItemOnHover:h,modal:me.type===void 0?u:void 0,openMethod:de,rootId:O}),ga(A);let{forceUnmount:pe,transitionStatus:M}=ha(G,A,()=>{A.set("allowMouseEnter",!1)},W),_=la(A.context.popupRef);lt.useEffect(()=>{if(X===void 0)return;let ye=()=>{if(A.state.instantType===X)A.set("instantType",void 0)};if(!G){ye();return}if(M!==void 0)return;if(A.context.popupRef.current==null){ye();return}let Me=new AbortController;return _(ye,Me.signal),()=>{Me.abort()}},[X,G,M,_,A]),z(()=>{if(w&&!v)A.update({parent:{type:"context-menu",context:w},floatingNodeId:V,floatingParentNodeId:T});else if(v||!A.select("activeTriggerElement"))A.update({floatingNodeId:V,floatingParentNodeId:T})},[w,v,V,T,Z,A]),lt.useEffect(()=>{if(!G)Ce.current=null;if(me.type!=="context-menu")return;if(!G){Q.clear(),De.current=!1;return}Q.start(500,()=>{De.current=!0})},[Q,G,me.type]),z(()=>{if(!G&&!Pe)A.set("hoverEnabled",!0)},[G,Pe,A]);let Se=re((ye,Me)=>{let We=Me.reason;if(!ye&&!A.select("open"))return;if(G===ye&&Me.trigger===Z&&ie===We)return;let $t=Pm(Me);if(!ye&&Me.trigger==null)Me.trigger=Z??void 0;if(n?.(ye,Me),Me.isCanceled)return;A.state.floatingRootContext.dispatchOpenChange(ye,Me);let Jt=Me.event;if(ye===!1&&We!==_u&&Jt?.type==="click"&&Jt.pointerType==="touch"&&!H.current)return;if(ye&&We===sa)H.current=!1,Y.start(300,()=>{H.current=!0});else H.current=!0,Y.clear();let So=!ye&&(We===Qi||We==null);Ce.current=Me.event;let jt=Ps(A.state,ye,Me.trigger,$t());if(jt.openChangeReason=We,jt.keyboardOpen=ye&&i1(We,Jt),me.type==="menubar"&&(We===sa||We===ia||We===Yt||We===ec||We===ts))jt.instantType="group";else if(of(We,Jt))jt.instantType="click";else if(So)jt.instantType="dismiss";else jt.instantType=void 0;A.update(jt)}),J=Rs({popupStore:A,floatingRootContext:A.state.floatingRootContext,floatingId:j,nested:T!=null,onOpenChange:Se}),se=J.context.events;z(()=>{let ye=({open:Me,eventDetails:We})=>Se(Me,We);return se.on("setOpen",ye),()=>{se?.off("setOpen",ye)}},[se,Se]),z(()=>A.subscribeToParentMenu(),[A]);let ge=lt.useCallback(()=>{A.setOpen(!1,Re(Wu))},[A]);lt.useImperativeHandle(p,()=>({unmount:pe,close:ge}),[pe,ge]);let he;if(me.type==="context-menu")he=me.context;lt.useImperativeHandle(he?.positionerRef,()=>oe,[oe]),lt.useImperativeHandle(he?.actionsRef,()=>({setOpen:Se}),[Se]);let Ie=Ln(J,{enabled:!ee,bubbles:{escapeKey:d&&me.type==="menu"},outsidePress(){if(me.type!=="context-menu"||Ce.current?.type==="contextmenu")return!0;return De.current},externalTree:D?ue:void 0}),Ne=Yc(),Qe=Vm(J,{enabled:!ee,listRef:A.context.itemDomElements,activeIndex:fe,virtual:b,nested:me.type==="menubar"||!b&&me.type!==void 0,parentOrientation:me.type==="menubar"?me.context.orientation:void 0,loopFocus:l,focusItemOnOpen:b?be:void 0,allowEscape:b&&l&&I,orientation:m,triggerOrientation:b?"vertical":m,rtl:Ne==="rtl",disabledIndices:Mr,onNavigate(ye,Me){A.setActiveIndex(ye,a1(Me),Me?.nativeEvent)},openOnArrowKeyDown:me.type!=="context-menu"&&!(b&&x),externalTree:!b&&D?ue:void 0,nestedReturnFocusRef:B?.context.virtualFocusRef,focusItemOnHover:h,resetOnPointerLeave:y}),gt=lt.useCallback((ye)=>{A.context.typingRef.current=ye},[A]),bo=Um(J,{enabled:!ee&&!b,listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:fe,resetMs:d0,onMatch:(ye,Me)=>{if(G&&ye!==fe)A.setActiveIndex(ye,Rd,Me.nativeEvent)},onTyping:gt}),Co=re(s),Yo=lt.useRef(-1),oo=re(()=>{let ye=A.state.activeIndex,Me=ye===null?void 0:A.context.itemDomElements.current[ye]??void 0;if(Me?.isConnected===!1)return;let We=Me===void 0?-1:ye;if(Yo.current===We&&A.context.reportedItem===Me)return;if(Yo.current=We,A.context.reportedItem=Me,b)A.set("highlightedItem",Me);let{highlightReason:$t,highlightEvent:Jt}=A.context;if(A.context.highlightReason=Rn,A.context.highlightEvent=void 0,!s)return;Co(Me,Hd($t,Jt,{label:Me===void 0?void 0:A.context.itemLabels.current[We]??void 0}))});z(()=>{oo()},[fe,oo]);let Kt=lt.useMemo(()=>{if(!b)return Qe.reference;if(!Qe.trigger)return Ue;let{onFocus:ye,...Me}=Qe.trigger;return Me},[b,Qe.reference,Qe.trigger]);A.useSyncedValue("inputProps",b?Qe.reference??Ue:Ue);let yo=lt.useMemo(()=>{let ye=Ot(bo.reference,Kt,Ie.reference,{onMouseMove(){A.set("allowMouseEnter",!0)}},K);return ye["aria-haspopup"]="menu",ye["aria-expanded"]=G,ye},[A,bo.reference,Kt,Ie.reference,K,G]),To=lt.useMemo(()=>{let ye=Ot(Qe.trigger,Ie.trigger,K);return ye["aria-haspopup"]="menu",ye["aria-expanded"]=!1,ye},[Qe.trigger,Ie.trigger,K]);Xe(()=>(A.update({inactiveTriggerProps:To}),null));let uo=lt.useMemo(()=>Ot(fa,{onMouseMove(){if(A.set("allowMouseEnter",!0),me.type==="menu")A.set("hoverEnabled",!1)},onClick(){if(A.select("hoverEnabled"))A.set("hoverEnabled",!1)},onKeyDown(ye){let Me=A.select("keyboardEventRelay");if(Me&&!ye.isPropagationStopped())Me(ye)}},bo.floating,Qe.floating,Ie.floating),[me.type,A,bo.floating,Qe.floating,Ie.floating]),fn=Qe.item??Ue;Ia(A,{floatingRootContext:J,activeTriggerProps:yo,inactiveTriggerProps:To,popupProps:uo,itemProps:fn});let pn=lt.useMemo(()=>({store:A,parent:E,orientation:m,loopFocus:l,allowEscape:I,defaultFloatingId:k,setRenderedFloatingId:N,virtualFocus:b,parentVirtualFocus:U,syncHighlightedItem:oo}),[A,E,m,l,I,k,b,U,oo]),$e=typeof o==="function"?o({payload:ne}):o,Zt=lx(Qa.Provider,{value:pn,children:[f&&Os(pa,{handle:f,store:A}),$e]});if(me.type===void 0||me.type==="context-menu")Zt=Os(xm,{externalTree:ue,children:Zt});return Zt});function c1(e){let t=lt.useContext(tf);if(t===null)return Os(ux,{...e});let o=t.Root;return Os(tf.Provider,{value:null,children:Os(o,{...t.options,...e})})}import*as go from"react";var al=5;function l1(e,t){let o=mx(t);return e.clientX>=o.left-al&&e.clientX<=o.right+al&&e.clientY>=o.top-al&&e.clientY<=o.bottom+al}function mx(e){let t=e.getBoundingClientRect(),o=qe(e);if(rs.jsdom)return t;let r=o.getComputedStyle(e,"::before"),n=o.getComputedStyle(e,"::after");if(!(r.content!=="none"||n.content!=="none"))return t;let s=parseFloat(r.width)||0,i=parseFloat(r.height)||0,c=parseFloat(n.width)||0,u=parseFloat(n.height)||0,l=Math.max(t.width,s,c),m=Math.max(t.height,i,u),p=l-t.width,d=m-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-d/2,bottom:t.bottom+d/2}}import*as u1 from"react";function m1(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:r}=Qn(),{ref:n,index:a}=oc(e),s=o===a,i=u1.useRef(null),c=Wo(n,i);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let l=i.current;if(!t||!l)return;let m=l.hasAttribute("disabled")||l.ariaDisabled==="true";if(!s&&!m)l.focus()}},compositeRef:c,index:a}}function f1(e){let{render:t,className:o,style:r,state:n=Ue,props:a=Mr,refs:s=Mr,metadata:i,stateAttributesMapping:c,tag:u="div",...l}=e,{compositeProps:m,compositeRef:p}=m1({metadata:i});return ve(u,e,{state:n,ref:[p,...s],props:[m,...a,l],stateAttributesMapping:c})}function rf(e){if(je(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(Go(e))return;return rf(zo(e))}import*as p1 from"react-dom";function d1(e,t){function o(a,s,i){let c=a.currentTarget;p1.flushSync(()=>{e.setOpen(!1,Re(ia,a.nativeEvent,c))}),i0(c.isConnected?c:t.current,s,i)?.focus()}function r(a){o(a,-1,e.select("positionerElement"))}function n(a){let s=e.select("positionerElement");if(s&&Nr(a,s))e.context.beforeContentFocusGuardRef.current?.focus();else o(a,1,s)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:n}}import*as sl from"react";function g1(e){let{enabled:t=!0,mouseDownAction:o,open:r}=e,n=sl.useRef(!1);return sl.useMemo(()=>{if(!t)return Ue;return{onMouseDown:(a)=>{if(o==="open"&&!r||o==="close"&&r)n.current=!0,Ee(a.currentTarget).addEventListener("click",()=>{n.current=!1},{once:!0})},onClick:(a)=>{if(n.current)n.current=!1,a.preventBaseUIHandler()}}},[t,o,r])}import{jsx as Ns,jsxs as fx}from"react/jsx-runtime";var h1=ba(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,openOnHover:u,delay:l=100,closeDelay:m=0,handle:p,payload:d,...f}=t,S=vo(!0),h=Sa(p)??S?.store;if(!h)throw Error(Ge(85));let x=ao(c),b=h.useState("isTriggerActive",x),C=h.useState("floatingRootContext"),I=h.useState("isOpenedByTrigger",x),y=h.useState("triggerControlsId",x),w=go.useRef(null),v=dx(),R=Qn(!0),L=fo(),U=go.useMemo(()=>L??new kn,[L]),E=xs(U),O=Do(),{registerTrigger:k,isMountedByThisTrigger:P}=da(x,w,h,{payload:d,closeDelay:m,parent:v,floatingTreeRoot:U,floatingNodeId:E,floatingParentNodeId:O,keyboardEventRelay:R?.relayKeyboardEvent}),N=v.type==="menubar",j=h.useState("disabled"),T=s||j||N&&v.context.disabled,{getButtonProps:B,buttonRef:W}=xo({disabled:T,native:i});go.useEffect(()=>{if(!I&&v.type===void 0)h.context.allowMouseUpTriggerRef.current=!1},[h,I,v.type]);let X=go.useRef(null),A=Je(),ue=re((Y)=>{if(!X.current)return;A.clear(),h.context.allowMouseUpTriggerRef.current=!1;let D=Y.target;if(le(X.current,D)||le(h.select("positionerElement"),D)||D===X.current)return;if(D!=null&&rf(D)===h.select("rootId"))return;if(l1(Y,X.current))return;U.events.emit("close",{domEvent:Y,reason:Wb})});go.useEffect(()=>{let Y=Ee(X.current);if(I&&h.select("lastOpenChangeReason")===Yt)return Y.addEventListener("mouseup",ue,{once:!0}),()=>{Y.removeEventListener("mouseup",ue)};return},[I,ue,h]);let V=N&&v.context.hasSubmenuOpen,Z=Ms(C,{enabled:(u??V)&&!T&&(!N||V&&!P),handleClose:ks({blockPointerEvents:!N}),mouseOnly:!0,move:!1,restMs:v.type===void 0?l:void 0,delay:{close:m},triggerElementRef:w,externalTree:U,isActiveTrigger:b,isClosing:()=>h.select("transitionStatus")==="ending"}),oe=px(I,h.select("lastOpenChangeReason")),Pe=vs(C,{enabled:!T,event:I&&N?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?oe:!1}),ee=Es(C,{enabled:!T&&V}),ie=g1({open:I,enabled:N,mouseDownAction:"open"}),me=go.useMemo(()=>Ot(ee.reference,Pe.reference),[ee.reference,Pe.reference]),fe=h.useState("triggerProps",P),be=h.useState("filterTriggerProps"),{handlePreFocusGuardFocus:ne,handleFocusTargetFocus:we}=d1(h,w),Ce={disabled:T,open:I},De=[X,o,W,k,w],Q=[me,Z??Ue,fe,{"aria-haspopup":"menu","aria-controls":y,id:x,onMouseDown:(Y)=>{if(h.select("open"))return;A.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Ee(Y.currentTarget).addEventListener("mouseup",ue,{once:!0})}},be,N?{role:"menuitem"}:{},ie,f,B],H=ve("button",t,{enabled:!N,stateAttributesMapping:Vu,state:Ce,ref:De,props:Q});if(N)return Ns(f1,{tag:"button",render:r,className:n,style:a,state:Ce,refs:De,props:Q,stateAttributesMapping:Vu});if(I)return fx(go.Fragment,{children:[Ns(nr,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:ne},`${x}-pre-focus-guard`),Ns(go.Fragment,{children:H},x),Ns(nr,{ref:h.context.triggerFocusTargetRef,onFocus:we},`${x}-post-focus-guard`)]});return Ns(go.Fragment,{children:H},x)});function px(e,t){let o=Je(),[r,n]=go.useState(!1);return z(()=>{if(e&&t===Yt)n(!0),o.start(g0,()=>{n(!1)});else if(!e)o.clear(),n(!1)},[e,t,o]),r}function dx(){let e=rl(!0);return go.useMemo(()=>{if(e)return{type:"menubar",context:e};return{type:void 0}},[e])}import*as I1 from"react";var b1=I1.forwardRef(function(t,o){let{className:r,render:n,orientation:a="horizontal",style:s,...i}=t;return ve("div",t,{state:{orientation:a},ref:o,props:[{role:"separator","aria-orientation":a},i]})});import{jsx as Vn,jsxs as JYe}from"react/jsx-runtime";function S1({...e}){return Vn(c1,{"data-slot":"dropdown-menu",...e})}function x1({...e}){return Vn(h1,{"data-slot":"dropdown-menu-trigger",...e})}function w1({align:e="start",alignOffset:t=0,side:o="bottom",sideOffset:r=4,className:n,portalContainer:a,...s}){return Vn(Ag,{container:a,children:Vn(t1,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:o,sideOffset:r,children:Vn(Rg,{"data-slot":"dropdown-menu-content",className:ce("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 transition-[opacity,scale] duration-[180ms] ease-[var(--ease-out)] outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100",n),...s})})})}function Bs({className:e,inset:t,variant:o="default",...r}){return Vn(Wd,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:ce("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function y1({className:e,...t}){return Vn(b1,{"data-slot":"dropdown-menu-separator",className:ce("-mx-1 my-1 h-px bg-border",e),...t})}import*as O1 from"react";import*as il from"react";var v1="data-valid",R1="data-invalid";var P1={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},hx={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},T1={disabled:!1,...hx},E1={valid(e){if(e===null)return null;if(e)return{[v1]:""};return{[R1]:""}}};var Ix={invalid:void 0,name:void 0,validityData:{state:P1,errors:[],error:"",value:"",initialValue:null},setValidityData:Ye,disabled:void 0,setTouched:Ye,setDirty:Ye,setFilled:Ye,setFocused:Ye,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:T1,registerFieldControl:Ye,validation:{getValidationProps:(e,t=Ue)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ye,getInputControl:()=>null,commit:async()=>{},change:Ye}},bx=il.createContext(Ix);function Ta(e=!0){let t=il.useContext(bx);if(t.setValidityData===Ye&&!e)throw Error(Ge(28));return t}import*as cl from"react";var Cx=cl.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitCountRef:{current:0}});function A1(){return cl.useContext(Cx)}import*as ll from"react";var Sx=ll.createContext({controlId:void 0,registerControlId:Ye,resetControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:(e)=>e});function ul(){return ll.useContext(Sx)}import*as ml from"react";function M1(e,t,o){let{setFocused:r,focusOwnerRef:n}=Ta(),a=re((s)=>{if(s?!e:n.current===a)n.current=s&&a,o?.(s),r(s)});return z(()=>{let s=t.current;if(s?.getRootNode()?.activeElement===s)a(!0);return()=>a(!1)},[e,t,a]),a}function k1(e,t,o,r,n=!0,a){let{registerFieldControl:s}=Ta(),i=Xe(()=>Symbol());z(()=>{let c=i.current;if(!n){s(c,void 0);return}s(c,{controlRef:e,getValue:r,id:t,name:a,value:o})},[e,n,r,t,a,s,i,o]),z(()=>{let c=i.current;return()=>{s(c,void 0)}},[s,i])}import*as nf from"react";function L1(e={}){let{id:t,enabled:o=!0}=e,{controlId:r,registerControlId:n,resetControlId:a}=ul(),s=ao(),i=Xe(()=>Symbol()),c=nf.useRef(!1),u=nf.useRef(!1),l=re(()=>{if(!c.current||n===Ye)return;c.current=!1,n(i.current,void 0)});return z(()=>{if(!o||n===Ye){l();return}let m;if(t!==void 0)u.current=!0,m=t;else if(u.current)m=s;else{a();return}if(m===void 0){l();return}c.current=!0,n(i.current,m);return},[t,o,n,a,s,i,l]),z(()=>l,[l]),(o?r:void 0)??t??s}var D1=ml.forwardRef(function(t,o){let{render:r,className:n,id:a,name:s,value:i,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:m=!1,style:p,...d}=t,{state:f,name:S,disabled:g,setTouched:h,setDirty:x,validityData:b,setFilled:C,validationMode:I,validation:y}=Ta(),{clearErrors:w,elementRef:v,submitCountRef:R}=A1(),L=g||c,U=S??s,E={...f,disabled:L},{labelId:O}=ul(),k=L1({id:a}),P=i!==void 0,N=i==null?void 0:String(i),j=re(()=>y.inputRef.current?.value);k1(y.inputRef,k,N,j,!L,s),z(()=>{let A=N??y.inputRef.current?.value;if(A!==void 0)C(A!=="")},[N,l,y.inputRef,C]),nl(N,()=>{if(N===void 0)return;w(U),x(N!==(b.initialValue??"")),y.change(N)});let T=ml.useRef(null),B=M1(L,T),W=Je();return ve("input",t,{ref:[o,T],state:E,props:[{id:k,disabled:L,name:U,ref:y.inputRef,"aria-labelledby":O,autoFocus:m,...P?{value:i}:{defaultValue:l},onChange(A){let ue=A.currentTarget.value,V=Re(Rn,A.nativeEvent);if(u?.(ue,V),P)return;if(x(ue!==(b.initialValue??"")),C(ue!==""),!A.nativeEvent.defaultPrevented&&!V.isCanceled)w(U),y.change(ue)},onFocus(){B(!0)},onBlur(A){if(h(!0),B(!1),I==="onBlur"){let ue=A.currentTarget.value;if(y.commit(ue),P)queueMicrotask(()=>{let V=y.inputRef.current?.value;if(V!==void 0&&V!==ue&&V!==(b.initialValue??""))y.commit(V)})}},onKeyDown(A){if(A.currentTarget.tagName==="INPUT"&&A.key==="Enter"){h(!0);let ue=A.currentTarget.value,V=A.currentTarget.form;if(V&&V===v.current&&!A.defaultPrevented){let G=A.currentTarget,Z=R.current;W.start(0,()=>{if(R.current===Z)y.commit(G.value)})}else y.commit(ue)}}},d,(A)=>y.getValidationProps(L,A)],stateAttributesMapping:E1})});import{jsx as xx}from"react/jsx-runtime";var af=O1.forwardRef(function(t,o){return xx(D1,{ref:o,...t})});import{jsx as wx}from"react/jsx-runtime";function sf({className:e,type:t,...o}){return wx(af,{type:t,"data-slot":"input",className:ce("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...o})}import{jsx as yx}from"react/jsx-runtime";function N1({className:e,...t}){return yx("textarea",{"data-slot":"textarea",className:ce("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}import{jsx as fl}from"react/jsx-runtime";function B1({className:e,...t}){return fl("div",{"data-slot":"input-group",role:"group",className:ce("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}var vx=ro("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function H1({className:e,align:t="inline-start",...o}){return fl("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:ce(vx({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var Rx=ro("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function cf({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return fl(mt,{type:t,"data-size":r,variant:o,className:ce(Rx({size:r}),e),...n})}function V1({className:e,...t}){return fl(N1,{"data-slot":"input-group-control",className:ce("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",e),...t})}import{jsx as rt,jsxs as co}from"react/jsx-runtime";function U1({send:e,upload:t,sendDisabled:o=!1,showPoweredBy:r=!1,assetBaseUrl:n,body:a,onBodyChange:s,inputRef:i}){let[c,u]=Hs(!1),[l,m]=Hs(""),[p,d]=Hs([]),[f,S]=Hs(!1),g=Tx(null),[h,x]=Hs(null);Px(()=>{x(g.current?.closest("[data-coristen-widget]")??null)},[]);async function b(I){let y=Array.from(I.target.files??[]).slice(0,Math.max(0,5-p.length));if(I.target.value="",!y.length)return;S(!0),m("");try{let w=[];for(let v of y)w.push(await t(v));d((v)=>[...v,...w].slice(0,5))}catch(w){m(w instanceof Error?w.message:"File upload failed. Try again.")}finally{S(!1)}}async function C(I){I.preventDefault();let y=a.trim();if(!y&&!p.length||c||f||o)return;u(!0),m("");try{await e(y,p),s(""),d([])}catch{m("Message could not be sent. Try again.")}finally{u(!1)}}return co("form",{onSubmit:(I)=>void C(I),className:"w-full",children:[rt("input",{ref:g,type:"file",multiple:!0,className:"sr-only",onChange:(I)=>void b(I)}),(p.length>0||f)&&co($i,{className:"px-2 pb-2",children:[p.map((I)=>co(oa,{size:"xs",children:[rt(Xa,{children:rt(Cn,{})}),co(Ya,{className:"max-w-32",children:[rt(Ka,{title:I.name,children:I.name}),co(Ja,{children:[(I.size/1024).toFixed(0)," KB"]})]}),rt(Zi,{children:rt(Cd,{type:"button","aria-label":`Remove ${I.name}`,onClick:()=>d((y)=>y.filter((w)=>w.storageId!==I.storageId)),children:rt(Uo,{})})})]},I.storageId)),f&&co(oa,{size:"xs",state:"uploading",children:[rt(Xa,{children:rt(Cn,{})}),co(Ya,{children:[rt(Ka,{children:"Uploading file"}),rt(Ja,{children:"Please wait"})]})]})]}),co(B1,{className:"has-disabled:opacity-100",children:[rt(V1,{ref:i,"aria-label":"Message",placeholder:"Write a message...",value:a,onChange:(I)=>s(I.target.value),maxLength:2000,rows:2,onKeyDown:(I)=>{if(I.key==="Enter"&&!I.shiftKey)I.preventDefault(),I.currentTarget.form?.requestSubmit()}}),co(H1,{align:"block-end",className:"pt-1",children:[co(S1,{children:[rt(x1,{render:rt(cf,{type:"button",variant:"outline",size:"icon-sm","aria-label":"More message options"}),children:rt(Yn,{className:"size-5"})}),co(w1,{portalContainer:h,align:"start",side:"top",className:"w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",children:[co(Bs,{onClick:()=>g.current?.click(),children:[rt(Mi,{}),"Add Photos & Files"]}),rt(y1,{}),co(Bs,{children:[rt(Pi,{}),"Create Image"]}),co(Bs,{children:[rt(mi,{}),"Deep Research"]}),co(Bs,{children:[rt(wi,{}),"Web Search"]})]})]}),r&&rt("div",{className:"mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",children:r&&rt("a",{href:"https://coristen.com",target:"_blank",rel:"noreferrer",className:"transition-colors hover:text-foreground",children:co("span",{className:"inline-flex items-center gap-1",children:["Powered by",co("span",{className:"relative size-4 shrink-0",children:[rt("img",{src:`${n}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),rt("img",{src:`${n}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),rt("span",{className:"font-medium",children:"Coristen"})]})})}),rt(cf,{type:"submit",variant:"default",size:"icon-sm",className:r?void 0:"ml-auto","aria-label":"Send message",disabled:c||f||o||!a.trim()&&!p.length,children:rt(ai,{})})]})]}),l&&rt("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:l})]})}import{jsx as Un}from"react/jsx-runtime";function lf({className:e,size:t="default",...o}){return Un("div",{"data-slot":"card","data-size":t,className:ce("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...o})}function uf({className:e,...t}){return Un("div",{"data-slot":"card-header",className:ce("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function mf({className:e,...t}){return Un("div",{"data-slot":"card-title",className:ce("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function ff({className:e,...t}){return Un("div",{"data-slot":"card-description",className:ce("text-sm text-muted-foreground",e),...t})}function _1({className:e,...t}){return Un("div",{"data-slot":"card-action",className:ce("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function W1({className:e,...t}){return Un("div",{"data-slot":"card-content",className:ce("px-(--card-spacing)",e),...t})}function pl({className:e,...t}){return Un("div",{"data-slot":"card-footer",className:ce("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}import{jsx as Ax}from"react/jsx-runtime";var Ex=ro("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});function pf({variant:e="default",align:t="start",className:o,...r}){return Ax("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:ce(Ex({variant:e}),o),...r})}function df({className:e,render:t,...o}){return Jn({defaultTagName:"div",props:Ot({className:ce("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},o),render:t,state:{slot:"bubble-content"}})}var MJe=ro("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}});import{jsx as dl}from"react/jsx-runtime";function z1({className:e,...t}){return dl("div",{"data-slot":"empty",className:ce("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",e),...t})}function G1({className:e,...t}){return dl("div",{"data-slot":"empty-header",className:ce("flex max-w-sm flex-col items-center gap-2",e),...t})}var OJe=ro("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default"}});function Z1({className:e,...t}){return dl("div",{"data-slot":"empty-title",className:ce("font-heading text-sm font-medium tracking-tight",e),...t})}function $1({className:e,...t}){return dl("div",{"data-slot":"empty-description",className:ce("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}import{jsx as Vs}from"react/jsx-runtime";function q1({className:e,align:t="start",...o}){return Vs("div",{"data-slot":"message","data-align":t,className:ce("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",e),...o})}function j1({className:e,...t}){return Vs("div",{"data-slot":"message-avatar",className:ce("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",e),...t})}function X1({className:e,...t}){return Vs("div",{"data-slot":"message-content",className:ce("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",e),...t})}function Y1({className:e,...t}){return Vs("div",{"data-slot":"message-header",className:ce("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",e),...t})}function K1({className:e,...t}){return Vs("div",{"data-slot":"message-footer",className:ce("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",e),...t})}import*as gl from"react";import*as Bt from"react";var J1=new Map([["bold",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Bt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var gf=gl.forwardRef((e,t)=>gl.createElement(Le,{ref:t,...e,weights:J1}));gf.displayName="ArrowCounterClockwiseIcon";import*as hl from"react";import*as Ht from"react";var Q1=new Map([["bold",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),Ht.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]);var hf=hl.forwardRef((e,t)=>hl.createElement(Le,{ref:t,...e,weights:Q1}));hf.displayName="DownloadSimpleIcon";import{useState as Tl}from"react";import*as eh from"react";import*as Il from"react";var If=Il.createContext(void 0);function ho(e){let t=Il.useContext(If);if(!e&&t===void 0)throw Error(Ge(27));return t}var th=eh.forwardRef(function(t,o){let{render:r,className:n,style:a,forceRender:s=!1,...i}=t,c=ho(),u=c.useState("open"),l=c.useState("nested"),m=c.useState("mounted"),p=c.useState("transitionStatus");return ve("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,o],stateAttributesMapping:ra,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});import*as oh from"react";var bf=oh.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,...c}=t,u=ho(),l=u.useState("open"),{getButtonProps:m,buttonRef:p}=xo({disabled:s,native:i}),d={disabled:s};function f(S){if(l)u.setOpen(!1,Re(Ub,S.nativeEvent))}return ve("button",t,{state:d,ref:[o,p],props:[{onClick:f},c,m]})});import*as rh from"react";var nh=rh.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=ho(),u=ao(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),ve("p",t,{ref:o,props:[{id:u},i]})});import*as lh from"react";import*as bl from"react";var Cf=bl.createContext(void 0);function ah(){let e=bl.useContext(Cf);if(e===void 0)throw Error(Ge(26));return e}var sh="--nested-dialogs";var dQe=Bu,gQe=Hu,hQe=Lb,IQe=Db;var ih="data-nested-dialog-open";var ch={...vn,...Xr,nestedDialogOpen(e){return e?{[ih]:""}:null}};import{jsx as Lx}from"react/jsx-runtime";var uh=lh.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,initialFocus:i,...c}=t,u=ho(),l=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),d=u.useState("popupProps"),f=u.useState("modal"),S=u.useState("mounted"),g=u.useState("nested"),h=u.useState("nestedOpenDialogCount"),x=u.useState("open"),b=u.useState("openMethod"),C=u.useState("titleElementId"),I=u.useState("transitionStatus"),y=u.useState("role"),w=p.useState("floatingId");ah(),$o({open:x,ref:u.context.popupRef,onComplete(){if(x)u.context.onOpenChangeComplete?.(!0)}});let v=i===void 0?O0(u.context.popupRef):i,R=h>0,L=u.useStateSetter("popupElement"),E=ve("div",t,{state:{open:x,nested:g,transitionStatus:I,nestedDialogOpen:R},props:[d,{id:w,"aria-labelledby":C,"aria-describedby":l,role:y,...fa,hidden:!S,onKeyDown(O){if(Zc.has(O.key))O.stopPropagation()},style:{[sh]:h}},c],ref:[o,u.context.popupRef,L],stateAttributesMapping:ch});return Lx(ws,{context:p,openInteractionType:b,disabled:!S,closeOnFocusOut:!m,initialFocus:v,returnFocus:s,modal:f!==!1,restoreFocus:"popup",children:E})});import*as fh from"react";import{jsx as mh,jsxs as Dx}from"react/jsx-runtime";var ph=fh.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,a=ho(),s=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");if(!(s||r))return null;return mh(Cf.Provider,{value:r,children:Dx(Ss,{ref:o,...n,children:[s&&i===!0&&mh(Jc,{ref:a.context.internalBackdropRef,inert:Ra(!c)}),t.children]})})});import*as hh from"react";import*as Sf from"react";function dh({store:e,parentContext:t,isDrawer:o}){let r=e.useState("open"),n=e.useState("mounted"),a=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,l]=Sf.useState(0),[m,p]=Sf.useState(0),d=u===0,f=Ln(c,{outsidePressEvent(){if(e.context.internalBackdropRef.current||e.context.backdropRef.current)return"intentional";return{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in S&&S.button!==0)return!1;if("touches"in S){if(S.type==="touchend"){if(S.changedTouches.length!==1||S.touches.length!==0)return!1}else if(S.touches.length!==1)return!1}let g=Ze(S);if(d&&!a){if(s){let h=e.context.internalBackdropRef.current,x=e.context.backdropRef.current;return h||x?h===g||x===g||le(g,i)&&!g?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:d});return tl(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(S,g)=>{if(!e.select("open")&&!e.select("mounted"))return;l(S),p(g)}),z(()=>{if(!r&&!n)l(0),p(0)},[r,n]),z(()=>{if(t?.onNestedDialogOpen){if(r)t.onNestedDialogOpen(u+1,m+(o?1:0))}return()=>{if(t?.onNestedDialogOpen&&r)t.onNestedDialogOpen(0,0)}},[o,r,u,m,t]),Ia(e,{activeTriggerProps:f.reference,inactiveTriggerProps:f.trigger,popupProps:f.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:m}),null}import*as Cl from"react";var Fx={...nn,modal:(e)=>e.modal,nested:(e)=>e.nested,nestedOpenDialogCount:(e)=>e.nestedOpenDialogCount,nestedOpenDrawerCount:(e)=>e.nestedOpenDrawerCount,disablePointerDismissal:(e)=>e.disablePointerDismissal,openMethod:(e)=>e.openMethod,descriptionElementId:(e)=>e.descriptionElementId,titleElementId:(e)=>e.titleElementId,viewportElement:(e)=>e.viewportElement,role:(e)=>e.role};class xf extends ir{constructor(e,t,o){let r=new Dn,n=Ox(e,r,t,o);super(n,Nx(r),Fx)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null)t.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Ps(this.state,e,t.trigger))}}function Ox(e,t,o,r=!1){return{...Ca(t,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function Nx(e){return{popupRef:Cl.createRef(),backdropRef:Cl.createRef(),internalBackdropRef:Cl.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}import{jsx as gh,jsxs as Bx}from"react/jsx-runtime";function Ih(e,t){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:m,defaultTriggerId:p=null}=t,d=e==="drawer",f=e==="alert-dialog",S=f?!0:c,g=f||i,h=f?"alertdialog":"dialog",x=ho(!0),b=x!=null,C={modal:S,disablePointerDismissal:g,nested:b,role:h},I=Ac((U,E)=>new xf({open:n,openProp:r,activeTriggerId:p,triggerIdProp:m,...C},U,E),!0);I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",m),I.useSyncedValues(C),I.useContextCallback("onOpenChange",a),I.useContextCallback("onOpenChangeComplete",s);let y=I.useState("open"),w=I.useState("mounted"),v=I.useState("payload");B0(I,y),ga(I);let{forceUnmount:R}=ha(y,I);hh.useImperativeHandle(u,()=>({unmount:R,close:()=>I.setOpen(!1,Re(Wu))}),[R,I]);let L=y||w||l!=null;return Bx(If.Provider,{value:I,children:[l&&gh(pa,{handle:l,store:I}),L&&gh(dh,{store:I,parentContext:x?.context,isDrawer:d}),typeof o==="function"?o({payload:v}):o]})}var bh=Fn(function(t){return Ih("dialog",t)});import*as Ch from"react";var Sh=Ch.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=ho(),u=ao(s);return c.useSyncedValueWithCleanup("titleElementId",u),ve("h2",t,{ref:o,props:[{id:u},i]})});import*as xh from"react";var wh=ba(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...m}=t,p=ho(!0),f=Sa(l)??p;if(!f)throw Error(Ge(79));let S=ao(c),g=f.useState("floatingRootContext"),h=f.useState("isOpenedByTrigger",S),x=f.useState("triggerPopupId",S),b=xh.useRef(null),{registerTrigger:C,isMountedByThisTrigger:I}=da(S,b,f,{payload:u}),{getButtonProps:y,buttonRef:w}=xo({disabled:s,native:i}),v=vs(g),R=Qm(()=>f.select("open"),(E)=>{f.set("openMethod",E)}),L={disabled:s,open:h},U=f.useState("triggerProps",I);return ve("button",t,{state:L,ref:[w,o,C,b],props:[v.reference,U,R,{[Rc]:"",id:S,"aria-haspopup":"dialog","aria-expanded":h,"aria-controls":x},m,y],stateAttributesMapping:Ki})});import{jsx as cr,jsxs as wf}from"react/jsx-runtime";function yf({...e}){return cr(bh,{"data-slot":"dialog",...e})}function vh({...e}){return cr(wh,{"data-slot":"dialog-trigger",...e})}function Hx({...e}){return cr(ph,{"data-slot":"dialog-portal",...e})}function Rh({...e}){return cr(bf,{"data-slot":"dialog-close",...e})}function Vx({className:e,...t}){return cr(th,{"data-slot":"dialog-overlay",className:ce("fixed inset-0 isolate z-50 bg-black/10 transition-opacity duration-250 ease-[var(--ease-out)] data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:duration-150",e),...t})}function vf({className:e,children:t,showCloseButton:o=!0,...r}){return wf(Hx,{children:[cr(Vx,{}),wf(uh,{"data-slot":"dialog-content",className:ce("squircle fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-hidden rounded-(--radius-dialog) bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 transition-[opacity,scale] duration-250 ease-[var(--ease-out)] outline-none ring-inset data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100 sm:max-w-sm",e),...r,children:[t,o&&wf(bf,{"data-slot":"dialog-close",render:cr(mt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[cr(Uo,{}),cr("span",{className:"sr-only",children:"Close"})]})]})]})}function Rf({className:e,...t}){return cr(Sh,{"data-slot":"dialog-title",className:ce("font-heading text-base leading-none font-medium",e),...t})}function Pf({className:e,...t}){return cr(nh,{"data-slot":"dialog-description",className:ce("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}async function Ph(e,t){let o=await fetch(e);if(!o.ok)throw Error("Download failed");let r=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=r,n.download=t;try{document.body.append(n),n.click()}finally{n.remove(),setTimeout(()=>URL.revokeObjectURL(r),1000)}}var Ux=ro("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Sl({className:e,variant:t="default",render:o,...r}){return Jn({defaultTagName:"span",props:Ot({className:ce(Ux({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as Wx}from"react/jsx-runtime";var _x=ro("group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",{variants:{variant:{default:"",separator:"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",border:"border-b border-border pb-2"}}});function Th({className:e,variant:t="default",render:o,...r}){return Jn({defaultTagName:"div",props:Ot({className:ce(_x({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function Eh({className:e,...t}){return Wx("span",{"data-slot":"marker-content",className:ce("min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function Ah(e,t=new Date){let o=new Date(e);if(o.toDateString()===t.toDateString())return"Today";let r=new Date(t);if(r.setDate(r.getDate()-1),o.toDateString()===r.toDateString())return"Yesterday";return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:o.getFullYear()===t.getFullYear()?void 0:"numeric"}).format(o)}import*as Ea from"react";function Mh({defaultTagName:e,props:t,render:o,state:r={},stateAttributesMapping:n}){let a=xl(zx(r,n),t);if(!o)return Ea.createElement(e,a);if(typeof o=="function")return o(a,r);if(!Ea.isValidElement(o))return null;let s=o.props,i={...xl(a,s),ref:Aa(a.ref,s.ref)};return Ea.cloneElement(o,i)}function xl(...e){let t={};for(let o of e){if(!o)continue;let r=o;for(let n of Object.keys(r)){let a=r[n];if(a===void 0)continue;let s=t[n];n==="className"?t[n]=[s,a].filter(Boolean).join(" "):n==="style"?t[n]={...s,...a}:n==="ref"?t[n]=Aa(s,a):Zx(n)&&typeof s=="function"&&typeof a=="function"?t[n]=Gx(a,s):t[n]=a}}return t}function zx(e,t){let o={};for(let r of Object.keys(e)){let n=e[r],a=t?.[r]?.(n);if(a){Object.assign(o,a);continue}if(r==="slot"){o["data-slot"]=n;continue}let s=`data-${String(r).replace(/[A-Z]/g,(i)=>`-${i.toLowerCase()}`)}`;typeof n=="boolean"?o[s]=n?"":void 0:n!=null&&(o[s]=String(n))}return o}function Gx(e,t){return function(o){e(o),o.defaultPrevented||t(o)}}function Zx(e){return/^on[A-Z]/.test(e)}function Aa(...e){let t=e.filter(Boolean);if(t.length!==0)return(o)=>{for(let r of t)typeof r=="function"?r(o):r&&(r.current=o)}}import*as te from"react";import{jsx as Ma,jsxs as Dh}from"react/jsx-runtime";var $x=8,qx=64,jx=0,vl=0.5,Xx=180,Yx=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),Fh={start:!1,end:!1},Kx=[],Rl={currentAnchorId:null,visibleMessageIds:Kx};function Jx({content:e,scrollEdgeThreshold:t,spacer:o,viewport:r}){if(!r||!e)return Fh;let n=Ef({content:e,spacer:o,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function Qx({content:e,scrollMargin:t,scrollPreviousItemPeek:o,spacer:r,viewport:n,visibleMessageIds:a}){if(!e||!n)return Rl;let s=n.getBoundingClientRect(),i=s.top+t+o,c=typeof IntersectionObserver>"u",u=[],l=null;for(let m of Us(e,r)){let p=m.dataset.messageId;if(!p)continue;let d=m.dataset.scrollAnchor==="true",f=d||c?m.getBoundingClientRect():null;(c&&f?f.bottom>i&&f.top<s.bottom:a.has(p))&&u.push(p),d&&f&&f.top<=i+vl&&(l=p)}return u.length===0&&l===null?Rl:{currentAnchorId:l,visibleMessageIds:u}}function Us(e,t){return Array.from(e.children).filter((o)=>o instanceof HTMLElement&&o!==t)}function e8(e,t){for(let o=t;o<e.length;o++){let r=e[o];if(r?.dataset.scrollAnchor==="true")return r}return null}function t8(e,t){for(let o of e)if(o.dataset.scrollAnchor==="true"&&!t.has(o))return o;return null}function o8(e,t){let o=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(o+=1,o>1))return!0;return!1}function r8(e){for(let t=e.length-1;t>=0;t--){let o=e[t];if(o?.dataset.scrollAnchor==="true")return o}return null}function n8({content:e,spacer:t,viewport:o}){let r=o.getBoundingClientRect();for(let n of Us(e,t)){if(!n.dataset.messageId)continue;let a=n.getBoundingClientRect();if(a.bottom>r.top&&a.top<r.bottom)return n}return null}function a8({align:e,element:t,scrollMargin:o,spacer:r,viewport:n}){let a=Oh(t,n),s=t.getBoundingClientRect().height,i=c8(r);if(e==="center"){let c=Math.max(0,n.clientHeight-i.start-i.end);return a-i.start-(c-s)/2-o}if(e==="end")return a-n.clientHeight+s+i.end+o;if(e==="nearest"){let c=a+s,u=n.scrollTop+i.start,l=n.scrollTop+n.clientHeight-i.end;return a>=u&&c<=l?n.scrollTop:a<u?a-i.start-o:c-n.clientHeight+i.end+o}return a-i.start-o}function Oh(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top+t.scrollTop}function wl(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function s8({content:e,scrollTop:t,spacer:o,viewport:r}){let n=Ef({content:e,spacer:o,viewport:r});return t+r.clientHeight-n}function Ef({content:e,spacer:t,viewport:o}){let r=Us(e,t),n=Nh(e),a=o.getBoundingClientRect(),s=o.scrollTop,i=n.start+n.end;for(let c of r){let u=c.getBoundingClientRect();i=Math.max(i,u.bottom-a.top+s+n.end)}return i}function i8(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Nh(e){let t=window.getComputedStyle(e);return{end:Tf(t.paddingBlockEnd||t.paddingBottom),start:Tf(t.paddingBlockStart||t.paddingTop)}}function c8(e){let t=e?.parentElement;return t?Nh(t):{end:0,start:0}}function l8(e){if(!e)return 0;let t=window.getComputedStyle(e),o=t.rowGap==="normal"?t.gap:t.rowGap;return Tf(o)}function Tf(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Bh(e,t){let o=e,r=new Set;return{getSnapshot:()=>o,hasListeners:()=>r.size>0,setSnapshot:(n)=>{t(o,n)||(o=n,r.forEach((a)=>a()))},subscribe:(n,a,s)=>{let i=r.size===0;return r.add(n),i&&a?.(),()=>{r.delete(n),r.size===0&&s?.()}}}}function kh(e,t){return Bh(e,t)}function u8(){return Bh(Rl,f8)}function m8(e,t){return e.start===t.start&&e.end===t.end}function f8(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((o,r)=>o===t.visibleMessageIds[r])}function p8({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:r,scrollPreviousItemPeek:n}){let a=te.useRef(e),s=te.useRef(!1),i=te.useRef(null),c=te.useRef(!1),u=te.useRef(o),l=te.useRef(0),m=te.useRef(null),p=te.useRef(0),d=te.useRef(e?"following-bottom":"free-scrolling"),f=te.useRef(new Map),S=te.useRef(null),g=te.useRef(null),h=te.useRef(null),x=te.useRef(n),b=te.useRef(!0),C=te.useRef(null),I=te.useRef(r),y=te.useRef(null),w=te.useRef(0),v=te.useRef(0),R=te.useRef(null),L=te.useRef(null),U=te.useRef(null),E=te.useRef(null),O=te.useRef(null),k=te.useRef(null),P=te.useRef(null),N=te.useRef(null),j=te.useRef(null),T=te.useRef(new Set),B=te.useRef(new WeakSet);return U.current===null&&(U.current=kh(t==="end"||t==="last-anchor",(W,X)=>W===X)),E.current===null&&(E.current=kh(Fh,m8)),j.current===null&&(j.current=u8()),a.current=e,u.current=o,I.current=r,x.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:O,streamingTurnRef:h,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:m,itemCountRef:l,lastScrollTopRef:p,messageElementsRef:f,modeRef:d,pendingScrollFrameRef:y,pendingScrollToMessageRef:S,prependRestoreRef:g,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:U.current,rootRef:C,scrollEdgeThresholdRef:u,scrollMarginRef:I,scrollPreviousItemPeekRef:x,spacerGapRef:w,spacerHeightRef:v,spacerRef:R,stateFrameRef:L,stateStore:E.current,viewportRef:k,visibilityFrameRef:P,visibilityObserverRef:N,visibilityStore:j.current,visibleMessageIdsRef:T,handledScrollAnchorsRef:B}}function Hh(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function yl(e){e.defaultScrollPositionAppliedRef.current=!0,Hh(e)}function d8({refs:e,commitScrollState:t,scheduleStateCommit:o,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:u,messageElementsRef:l,modeRef:m,pendingScrollToMessageRef:p,prependRestoreRef:d,scrollMarginRef:f,scrollPreviousItemPeekRef:S,spacerGapRef:g,spacerHeightRef:h,spacerRef:x,viewportRef:b}=e,C=te.useCallback((E)=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current!==E&&(s.current=E,t()),E&&(i.current=window.setTimeout(()=>{i.current=null,s.current=!1,t()},Xx))},[t]),I=te.useCallback((E)=>{let O=x.current;if(!O)return;let k=Math.max(0,Math.ceil(E));h.current!==k&&(h.current=k,O.hidden=k===0,O.style.height=`${k}px`,O.style.marginTop=k>0?`${-g.current}px`:"")},[]),y=te.useCallback((E,{behavior:O="auto",autoscrolling:k=!1}={})=>{let P=b.current;if(!P)return;let N=Math.max(0,E);if(Math.abs(P.scrollTop-N)<=vl){P.scrollTop=N,t();return}k&&C(!0),P.scrollTo({top:N,behavior:O}),o()},[t,o,C]),w=te.useCallback(({behavior:E="auto"}={})=>b.current?(I(0),n.current=null,m.current="free-scrolling",y(0,{behavior:E}),r(),!0):!1,[r,y,I]),v=te.useCallback(({behavior:E="auto"}={})=>{let O=b.current;return O?(I(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",y(i8(O),{autoscrolling:!0,behavior:E}),r(),!0):!1},[r,y,I]),R=te.useCallback((E,{align:O="start",behavior:k="auto",scrollMargin:P=f.current}={},{keepPreviousPeek:N=!1}={})=>{let j=c.current,T=b.current;if(!j||!T||!j.contains(E))return!1;let B=a8({align:O,element:E,scrollMargin:N?P+S.current:P,spacer:x.current,viewport:T}),W=s8({content:j,scrollTop:B,spacer:x.current,viewport:T});return I(W),d.current={element:E,viewportTop:wl(E,T)},m.current=N?"anchored-to-message":"settling-jump",n.current=N?E:null,y(B,{behavior:k}),r(),!0},[r,y,I]),L=te.useCallback(()=>{let E=n.current;return!E||!E.isConnected||m.current!=="anchored-to-message"?!1:R(E,{align:"start"},{keepPreviousPeek:!0})},[R]),U=te.useCallback((E,O)=>{let k=l.current.get(E);return k?(yl(e),R(k,O)?(p.current=null,!0):(p.current={messageId:E,options:O},!0)):u.current===0?(p.current={messageId:E,options:O},yl(e),!0):!1},[R]);return{flushPendingScrollToMessage:te.useCallback(()=>{let E=p.current;if(!E)return!1;let O=l.current.get(E.messageId);return!O||!R(O,E.options)?!1:(p.current=null,yl(e),!0)},[R]),reanchorToAnchoredMessage:L,scrollToElement:R,scrollToEnd:v,scrollToMessage:U,scrollToStart:w}}function Lh(e,t){return te.useCallback((o)=>{e.current=o,o&&t()},[e,t])}function g8({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=$x,scrollPreviousItemPeek:r=qx,scrollMargin:n=jx}){let a=p8({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:i,autoscrollingRef:c,autoscrollingTimeoutRef:u,contentRef:l,defaultScrollPositionAppliedRef:m,firstItemRef:p,itemCountRef:d,lastScrollTopRef:f,messageElementsRef:S,modeRef:g,pendingScrollFrameRef:h,pendingScrollToMessageRef:x,prependRestoreRef:b,preserveScrollOnPrependRef:C,pendingDefaultScrollStore:I,rootRef:y,scrollEdgeThresholdRef:w,scrollMarginRef:v,scrollPreviousItemPeekRef:R,spacerGapRef:L,spacerHeightRef:U,spacerRef:E,stateFrameRef:O,stateStore:k,viewportRef:P,visibilityFrameRef:N,visibilityObserverRef:j,visibilityStore:T,visibleMessageIdsRef:B,handledScrollAnchorsRef:W}=a,X=te.useRef(t);X.current!==t&&(X.current=t,m.current=!1);let A=te.useCallback((ge)=>{let he=y.current,Ie=P.current,Ne=[ge.start&&"start",ge.end&&"end"].filter(Boolean).join(" "),Qe=c.current;for(let gt of[he,Ie])gt&&(Ne?gt.setAttribute("data-scrollable",Ne):gt.removeAttribute("data-scrollable"),gt.toggleAttribute("data-autoscrolling",Qe))},[]),ue=te.useCallback((ge)=>{let he=P.current?.scrollTop??0,Ie=he<f.current-vl;f.current=he,i.current&&!ge.end&&g.current!=="settling-jump"&&g.current!=="anchored-to-message"?g.current="following-bottom":g.current==="following-bottom"&&ge.end&&Ie&&!c.current&&(g.current="free-scrolling")},[]),V=te.useCallback(()=>{let ge=Jx({content:l.current,scrollEdgeThreshold:w.current,spacer:E.current,viewport:P.current});ue(ge);let he=g.current==="following-bottom"?{...ge,end:!1}:ge;A(he),k.setSnapshot(he)},[ue,k,A]),G=te.useCallback(()=>{O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,V()}))},[V]),Z=te.useCallback(()=>{T.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,T.hasListeners()&&T.setSnapshot(Qx({content:l.current,scrollMargin:v.current,scrollPreviousItemPeek:R.current,spacer:E.current,viewport:P.current,visibleMessageIds:B.current}))}))},[T]),{flushPendingScrollToMessage:oe,reanchorToAnchoredMessage:Pe,scrollToElement:ee,scrollToEnd:ie,scrollToMessage:me,scrollToStart:fe}=d8({refs:a,commitScrollState:V,scheduleStateCommit:G,scheduleVisibilitySync:Z}),be=te.useCallback(()=>{let ge=b.current,he=P.current;if(!ge||!he||!ge.element.isConnected)return!1;let Ie=wl(ge.element,he)-ge.viewportTop;return Math.abs(Ie)<=vl?!1:(he.scrollTop+=Ie,ge.viewportTop=wl(ge.element,he),G(),Z(),!0)},[G,Z]),ne=te.useCallback(()=>{let ge=l.current,he=P.current;if(!ge||!he){b.current=null;return}let Ie=n8({content:ge,spacer:E.current,viewport:he});b.current=Ie?{element:Ie,viewportTop:wl(Ie,he)}:null},[]),we=te.useCallback(()=>{h.current===null&&(h.current=window.requestAnimationFrame(()=>{h.current=null,oe()&&ne()}))},[ne,oe]),Ce=te.useCallback(()=>{if(!t||m.current||d.current===0)return!1;let ge=!1;if(t==="last-anchor"){let he=l.current,Ie=P.current,Ne=he&&Ie?r8(Us(he,E.current)):null;if(!he||!Ie||!Ne)ge=ie({behavior:"auto"});else{let Qe=Oh(Ne,Ie);ge=Ef({content:he,spacer:E.current,viewport:Ie})-Qe<=Ie.clientHeight?ie({behavior:"auto"}):ee(Ne,{align:"start"},{keepPreviousPeek:!0})}}else ge=t==="end"?ie({behavior:"auto"}):fe({behavior:"auto"});return ge?(yl(a),!0):!1},[t,ee,ie,fe]),De=te.useCallback(()=>{let ge=l.current;if(!ge)return;let he=Us(ge,E.current),Ie=d.current,Ne=p.current;d.current=he.length,p.current=he[0]??null,(()=>{if(oe())return;if(Ie===0){if(Ce()||he.length>0&&i.current&&ie({behavior:"auto"}))return;V(),Z();return}let Qe=Ne?he.indexOf(Ne):-1;if(C.current&&Qe>0){be();return}if(he.length>Ie){let gt=e8(he,Ie);if(gt){if(i.current&&g.current==="following-bottom"&&o8(he,Ie)){ie({behavior:"auto"});return}ee(gt,{align:"start"},{keepPreviousPeek:!0}),W.current.add(gt);return}}if(he.length===Ie){let gt=t8(he,W.current);if(gt){ee(gt,{align:"start"},{keepPreviousPeek:!0}),W.current.add(gt);return}}g.current==="following-bottom"&&i.current?ie({behavior:"auto"}):(V(),Z())})(),ne()},[Ce,ne,V,oe,be,Z,ee,ie]),Q=te.useCallback(()=>{if(g.current==="following-bottom"&&i.current){ie({behavior:"auto"});return}let ge=U.current;if(Pe()){i.current&&ge>0&&U.current===0&&ie({behavior:"auto"});return}G(),Z()},[Pe,G,Z,ie]),H=te.useCallback(()=>{let ge=P.current;if(!(!ge||!T.hasListeners())){if(typeof IntersectionObserver>"u"){Z();return}j.current||(j.current=new IntersectionObserver((he)=>{for(let Ie of he){let Ne=Ie.target.dataset.messageId;Ne&&(Ie.isIntersecting?B.current.add(Ne):B.current.delete(Ne))}Z()},{root:ge,rootMargin:`${-(v.current+R.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),S.current.forEach((he)=>{j.current?.observe(he)}),Z()}},[Z,T]),Y=te.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),j.current?.disconnect(),j.current=null,B.current.clear(),T.setSnapshot(Rl)},[T]),D=te.useCallback((ge,he,Ie)=>{if(he){S.current.set(ge,he),j.current?.observe(he),Z(),x.current?.messageId===ge&&we();return}Ie&&S.current.get(ge)===Ie&&(S.current.delete(ge),B.current.delete(ge),j.current?.unobserve(Ie),Z())},[we,Z]),de=te.useCallback(()=>{(g.current==="following-bottom"||g.current==="anchored-to-message"||g.current==="settling-jump")&&(s.current=null,g.current="free-scrolling")},[]),K=te.useCallback(()=>A(k.getSnapshot()),[k,A]),pe=Lh(y,K),M=Lh(P,K),_=te.useCallback((ge)=>{l.current=ge},[]),Se=te.useCallback((ge)=>{E.current=ge,L.current=l8(ge?.parentElement??null)},[]),J=te.useCallback(()=>{V(),Z(),ne()},[ne,V,Z]),se=te.useMemo(()=>({handleContentChange:De,handleResize:Q,observeVisibility:H,pendingDefaultScrollStore:I,preserveScrollOnPrependRef:C,scrollToEnd:ie,scrollToMessage:me,scrollToStart:fe,setContentElement:_,setRootElement:pe,setSpacerElement:Se,setViewportElement:M,stateStore:k,syncAfterScroll:J,unobserveVisibility:Y,userScrollIntent:de,viewportRef:P,visibilityStore:T}),[De,Q,H,I,ie,me,fe,_,pe,Se,M,k,J,Y,de,T]);return te.useLayoutEffect(()=>{Ce()||d.current===0&&Hh(a)},[Ce]),te.useEffect(()=>()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),j.current?.disconnect(),j.current=null},[]),te.useLayoutEffect(()=>{if(e&&g.current==="following-bottom"&&d.current>0){ie({behavior:"auto"});return}V()},[e,V,ie]),{context:se,registerMessage:D}}function h8(e){let t=te.useRef(e);return t.current=e,t}var Vh=te.createContext(null),Uh=te.createContext(null);function _s(){let e=te.useContext(Vh);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function I8(){let e=te.useContext(Uh);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function b8({autoScroll:e=!1,children:t,defaultScrollPosition:o="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a}){let{context:s,registerMessage:i}=g8({autoScroll:e,defaultScrollPosition:o,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a});return Ma(Vh.Provider,{value:s,children:Ma(Uh.Provider,{value:i,children:t})})}function _h(){let{pendingDefaultScrollStore:e}=_s();return te.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function C8({children:e,...t}){let{setRootElement:o}=_s(),r=_h();return Ma("div",{ref:o,...t,...r?{"data-pending-scroll":""}:null,children:e})}function S8({"aria-label":e,children:t,onKeyDown:o,onScroll:r,onTouchMove:n,onWheel:a,preserveScrollOnPrepend:s=!0,ref:i,role:c,tabIndex:u,...l}){let{handleResize:m,preserveScrollOnPrependRef:p,setViewportElement:d,syncAfterScroll:f,userScrollIntent:S,viewportRef:g}=_s(),h=_h();p.current=s;let x=te.useCallback((w)=>{d(w),Aa(i)?.(w)},[i,d]);function b(w){f(),r?.(w)}function C(w){S(),a?.(w)}function I(w){S(),n?.(w)}function y(w){Yx.has(w.key)&&S(),o?.(w)}return te.useEffect(()=>{let w=g.current;if(!w||typeof ResizeObserver>"u")return;let v=0,R=new ResizeObserver(()=>{window.cancelAnimationFrame(v),v=window.requestAnimationFrame(m)});return R.observe(w),()=>{window.cancelAnimationFrame(v),R.disconnect()}},[m,g]),Ma("div",{ref:x,role:c??"region","aria-label":e??"Messages",tabIndex:u??0,onKeyDown:y,onScroll:b,onTouchMove:I,onWheel:C,...l,...h?{"data-pending-scroll":""}:null,children:t})}function x8({"aria-relevant":e,children:t,ref:o,role:r,spacerClassName:n,...a}){let{handleContentChange:s,handleResize:i,setContentElement:c,setSpacerElement:u}=_s(),l=te.useRef(null),m=te.useCallback((p)=>{l.current=p,c(p),Aa(o)?.(p)},[o,c]);return te.useLayoutEffect(()=>{let p=l.current;if(!p||(s(),typeof MutationObserver>"u"))return;let d=new MutationObserver(()=>{s()});return d.observe(p,{childList:!0}),()=>d.disconnect()},[s]),te.useEffect(()=>{let p=l.current;if(!p||typeof ResizeObserver>"u")return;let d=0,f=new ResizeObserver(()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(i)});return f.observe(p),()=>{window.cancelAnimationFrame(d),f.disconnect()}},[i]),Dh("div",{ref:m,role:r??"log","aria-relevant":e??"additions",...a,children:[t,Ma("div",{ref:u,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function w8({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=I8(),a=te.useRef(null),s=te.useCallback((i)=>{let c=a.current;a.current=i,e&&n(e,i,c),Aa(t)?.(i)},[e,t,n]);return Ma("div",{ref:s,"data-message-id":e,"data-scroll-anchor":o?"true":"false",...r})}function y8({behavior:e="smooth",children:t,direction:o="end",onClick:r,render:n,tabIndex:a,type:s="button",...i}){let{scrollToEnd:c,scrollToStart:u,stateStore:l}=_s(),m=h8(r),p=te.useCallback((g)=>l.subscribe(g),[l]),d=te.useCallback(()=>{let g=l.getSnapshot();return o==="start"?g.start:g.end},[o,l]),f=te.useSyncExternalStore(p,d,d),S=te.useCallback((g)=>{f&&(m.current?.(g),g.defaultPrevented||(g.currentTarget.blur(),o==="start"?u({behavior:e}):c({behavior:e})))},[e,o,f,m,c,u]);return Mh({defaultTagName:"button",props:xl({type:s,inert:!f,tabIndex:f?a:-1,children:t??Dh("span",{children:["Scroll to ",o]}),onClick:S},i),render:n,state:{active:f,direction:o},stateAttributesMapping:{active:(g)=>({"data-active":g?"true":"false"})}})}var _n={Provider:b8,Root:C8,Viewport:S8,Content:x8,Item:w8,Button:y8};import*as Pl from"react";import*as Vt from"react";var Wh=new Map([["bold",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Vt.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]);var Af=Pl.forwardRef((e,t)=>Pl.createElement(Le,{ref:t,...e,weights:Wh}));Af.displayName="ArrowDownIcon";import{jsx as Hr,jsxs as R8,Fragment as v8}from"react/jsx-runtime";function zh(e){return Hr(_n.Provider,{...e})}function Gh({className:e,...t}){return Hr(_n.Root,{"data-slot":"message-scroller",className:ce("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function Zh({className:e,...t}){return Hr(_n.Viewport,{"data-slot":"message-scroller-viewport",className:ce("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible",e),...t})}function $h({className:e,...t}){return Hr(_n.Content,{"data-slot":"message-scroller-content",className:ce("flex h-max min-h-full flex-col gap-6",e),...t})}function qh({className:e,scrollAnchor:t=!1,...o}){return Hr(_n.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:ce("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...o})}function jh({direction:e="end",className:t,children:o,render:r,variant:n="secondary",size:a="icon-sm",...s}){return Hr(_n.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":a,direction:e,className:ce("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",t),render:r??Hr(mt,{variant:n,size:a}),...s,children:o??R8(v8,{children:[Hr(Af,{}),Hr("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}import{jsx as He,jsxs as Io}from"react/jsx-runtime";function P8(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Xh({attachment:e}){let[t,o]=Tl(!1),[r,n]=Tl(!1);return Io("div",{className:"flex flex-col items-end gap-1",children:[He(mt,{variant:"secondary",size:"icon-sm",disabled:t,"aria-busy":t,"aria-label":`Download ${e.name}`,title:t?"Downloading…":"Download",onClick:async()=>{if(!e.url)return;o(!0),n(!1);try{await Ph(e.url,e.name)}catch{n(!0)}finally{o(!1)}},children:He(hf,{})}),r&&He("span",{role:"alert",className:"text-xs text-destructive",children:"Download failed. Try again."})]})}function T8({attachments:e,allowDownloads:t=!1}){let[o,r]=Tl(null),[n,a]=Tl(!1);if(!e?.length)return null;return Io(yf,{onOpenChange:(s)=>{if(!s)r(null)},children:[He($i,{className:"max-w-full flex-wrap gap-2",children:e.map((s)=>{if(s.type.startsWith("image/")&&s.url)return He(oa,{className:"min-w-0 border-0 bg-transparent p-0 has-[>a,>button]:hover:bg-transparent",children:He(vh,{render:He("button",{type:"button",className:"block max-w-48 overflow-hidden rounded-lg focus-visible:outline-2 focus-visible:outline-ring"}),"aria-label":`Preview ${s.name}`,onClick:()=>{a(!1),r(s)},children:He("img",{src:s.url,alt:s.name,loading:"lazy",className:"max-h-40 max-w-full object-contain"})})},s.storageId);return Io(oa,{className:"min-w-52",children:[He(Xa,{children:He(Cn,{})}),Io(Ya,{className:"max-w-44",children:[He(Ka,{title:s.name,children:s.name}),Io(Ja,{children:[s.type||"File"," ·"," ",P8(s.size)]})]}),t&&s.url&&He(Zi,{children:He(Xh,{attachment:s})})]},s.storageId)})}),Io(vf,{showCloseButton:!1,className:"w-fit max-w-[calc(100%-2rem)] gap-3 rounded-none bg-transparent p-0 shadow-none ring-0 sm:max-w-[calc(100%-4rem)]",children:[He(Rf,{className:"sr-only",children:o?.name??"Image preview"}),He(Pf,{className:"sr-only",children:"Expanded image preview"}),Io("div",{className:"flex items-start justify-end gap-2",children:[t&&o?.url&&He(Xh,{attachment:o},o.storageId),He(Rh,{render:He(mt,{variant:"secondary",size:"icon-sm"}),"aria-label":"Close image preview",children:He(Uo,{})})]}),n?He("p",{role:"alert",className:"text-sm text-foreground",children:"Image preview unavailable."}):o?.url&&He("img",{src:o.url,alt:o.name,className:"max-h-[75dvh] max-w-full object-contain",onError:()=>a(!0)})]})]})}function Mf({messages:e,ownSender:t,ownVariant:o="default",plainOther:r=!1,ownAvatar:n,otherAvatar:a,onRetry:s,showMetadata:i=!1}){return He(zh,{children:Io(Gh,{children:[He(Zh,{children:Io($h,{className:"p-4",children:[e?.length===0&&He(z1,{children:Io(G1,{children:[He(Z1,{children:"No messages yet"}),He($1,{children:"Send a message to get started."})]})}),e?.map((c,u)=>{let l=c.sender===t,m=c._creationTime===void 0?void 0:new Date(c._creationTime),p=e[u-1]?._creationTime,d=i&&m&&(p===void 0||m.toDateString()!==new Date(p).toDateString()),f=c.sender==="merchant"&&!!(c.isAi||c.generationStatus);return Io(qh,{messageId:c._id,scrollAnchor:l,children:[d&&He(Th,{className:"mb-5 justify-center",children:He(Eh,{children:Ah(m.getTime())})}),Io(q1,{align:l?"end":"start",children:[(l?n:a)&&He(j1,{className:"size-7 min-w-7",children:l?n:a}),Io(X1,{children:[i&&Io(Y1,{className:"gap-2",children:[c.sender==="customer"?"You":f?"Ten":"Support",f&&He(Sl,{variant:"secondary",children:"AI"})]}),He(T8,{attachments:c.attachments}),c.generationStatus==="generating"&&!c.body&&He(pf,{variant:"muted",children:He(df,{className:"animate-pulse text-muted-foreground",children:"Thinking…"})}),c.body&&(!l&&r?He("p",{className:"leading-relaxed whitespace-pre-wrap",children:c.body}):He(pf,{variant:l?o:"secondary",children:He(df,{children:c.body})})),c.citations&&c.citations.length>0&&He("div",{className:"flex max-w-sm flex-wrap gap-1",children:c.citations.map((S)=>S.url?He("a",{href:S.url,target:"_blank",rel:"noreferrer",className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:S.title},S.sourceId):He("span",{className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground",children:S.title},S.sourceId))}),c.generationStatus==="failed"&&Io("div",{className:"flex max-w-sm min-w-0 items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[He("span",{className:"min-w-0 flex-1 text-xs leading-relaxed break-words text-destructive",children:c.generationError??"The agent could not respond."}),c.inReplyTo&&s&&Io(mt,{type:"button",size:"xs",variant:"outline",className:"shrink-0",onClick:()=>s(c.inReplyTo),children:[He(gf,{}),"Retry"]})]}),i&&m&&He(K1,{children:He("time",{dateTime:m.toISOString(),title:m.toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(m)})})]})]})]},c._id)})]})}),He(jh,{})]})})}import{jsx as E8}from"react/jsx-runtime";function Yh({className:e,...t}){return E8("label",{"data-slot":"label",className:ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}import{jsx as A8}from"react/jsx-runtime";function lr({className:e,...t}){return A8("div",{"data-slot":"skeleton",className:ce("animate-pulse rounded-md bg-muted",e),...t})}import*as La from"react";import*as El from"react";var kf=El.createContext(void 0);function Al(){let e=El.useContext(kf);if(e===void 0)throw Error(Ge(13));return e}var ka={imageLoadingStatus:()=>null};import{jsx as M8}from"react/jsx-runtime";var Kh=La.forwardRef(function(t,o){let{className:r,render:n,style:a,...s}=t,[i,c]=La.useState("idle"),u={imageLoadingStatus:i},l=La.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:c}),[i,c]),m=ve("span",t,{state:u,ref:o,props:s,stateAttributesMapping:ka});return M8(kf.Provider,{value:l,children:m})});import*as Ws from"react";import*as Jh from"react";function Qh(e,{referrerPolicy:t,crossOrigin:o,sizes:r,srcSet:n},a){let s=Jh.useState("idle"),i=s[1];return z(()=>{if(!a)return Ye;if(!e&&!n)return i("error"),Ye;let c=!0,u=new window.Image,l=(m)=>()=>{if(!c)return;i(m)};if(i("loading"),u.onload=l("loaded"),u.onerror=l("error"),t)u.referrerPolicy=t;if(u.crossOrigin=o??null,r)u.sizes=r;if(n)u.srcset=n;if(e)u.src=e;if(u.complete)i(u.naturalWidth>0?"loaded":"error");return()=>{c=!1}},[a,e,n,r,o,t,i]),s}var k8={...ka,...Xr},e2=Ws.forwardRef(function(t,o){let{className:r,render:n,onLoadingStatusChange:a,keepMounted:s=!1,style:i,sizes:c,srcSet:u,src:l,...m}=t,{setImageLoadingStatus:p}=Al(),[d,f]=Qh(l,t,!s),S=d==="loaded",{mounted:g,transitionStatus:h,setMounted:x}=cc(S),b=Ws.useRef(null),C=Ws.useRef(!0);z(()=>{if(!s)return;let U=C.current;C.current=!1;let E=b.current;if(!E)return;if(!E.complete){f("loading");return}let O=E.naturalWidth>0?"loaded":"error";if(f(O),O==="loaded"&&U)x(!0)},[s,l,u,c,m.crossOrigin,m.referrerPolicy,n,f,x]);let I=s?{"data-loading":d==="loading"?"":void 0,"data-error":d==="error"?"":void 0,"aria-hidden":d!=="loaded"||void 0,onLoad(){f("loaded")},onError(){f("error")}}:void 0,y=re((U)=>{a?.(U),p(U)});z(()=>{if(d!=="idle")y(d)},[d,y]),z(()=>()=>p("idle"),[p]),$o({enabled:!S,open:S,ref:b,onComplete(){if(!S)x(!1)}});let w={imageLoadingStatus:d,transitionStatus:s&&h==="ending"?void 0:h},v=s||g,R={};if(c!==void 0)R.sizes=c;if(u!==void 0)R.srcSet=u;if(l!==void 0)R.src=l;let L=ve("img",t,{state:w,ref:[o,b],props:[I,m,R],stateAttributesMapping:k8,enabled:v});if(!v)return null;return L});import*as Da from"react";var t2=Da.forwardRef(function(t,o){let{className:r,render:n,delay:a=0,style:s,...i}=t,{imageLoadingStatus:c}=Al(),[u,l]=Da.useState(a===0),m=Je();return Da.useEffect(()=>{if(a>0)m.start(a,()=>l(!0));else l(!0);return m.clear},[m,a]),ve("span",t,{state:{imageLoadingStatus:c},ref:o,props:i,stateAttributesMapping:ka,enabled:c!=="loaded"&&(a===0||u)})});import{jsx as Of}from"react/jsx-runtime";function Lf({className:e,size:t="default",...o}){return Of(Kh,{"data-slot":"avatar","data-size":t,className:(r)=>ce("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full bg-muted select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",r.imageLoadingStatus==="loading"&&"animate-pulse",typeof e==="function"?e(r):e),...o})}function Df({className:e,...t}){return Of(e2,{"data-slot":"avatar-image",className:ce("aspect-square size-full rounded-full object-cover",e),...t})}function Ff({className:e,...t}){return Of(t2,{"data-slot":"avatar-fallback",className:(o)=>ce("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",o.imageLoadingStatus==="loading"&&"opacity-0",typeof e==="function"?e(o):e),...t})}var Fa=Math.PI*2,Fe=(e)=>Math.round(e*100)/100,ke=(e,t)=>t[Math.floor(e()*t.length)];function Nf(e){let t=2166136261;for(let o=0;o<e.length;o++)t^=e.charCodeAt(o),t=Math.imul(t,16777619);return t>>>0}function Bf(e){let t=e;return()=>{t=t+1831565813|0;let o=Math.imul(t^t>>>15,1|t);return o=o+Math.imul(o^o>>>7,61|o)^o,((o^o>>>14)>>>0)/4294967296}}var kl=[{name:"rose",bg:"#E8608A",fg:"#FFE3C2"},{name:"marigold",bg:"#F6CD5E",fg:"#D9416F"},{name:"mint",bg:"#8EDBC4",fg:"#1D6448"},{name:"cobalt",bg:"#3D7FE6",fg:"#C7E3FF"},{name:"lilac",bg:"#C9B6F4",fg:"#E0477E"},{name:"meadow",bg:"#2E9D52",fg:"#F9E07A"},{name:"sky",bg:"#9CC9F5",fg:"#24418F"},{name:"butter",bg:"#FBE38E",fg:"#3A62D6"},{name:"forest",bg:"#1F6B4A",fg:"#9BE3C9"},{name:"plum",bg:"#6E3A8E",fg:"#F0D9FF"},{name:"peach",bg:"#FFC4A3",fg:"#C23B5B"},{name:"tangerine",bg:"#F28A4B",fg:"#FFF0D6"},{name:"teal",bg:"#2BA3A0",fg:"#FFF3C4"},{name:"slate",bg:"#56637F",fg:"#FFD3B0"}],r2=36,L8=["bright","soft","deep"],D8=["tonal","complement","triad"],F8={tonal:0,complement:180,triad:120},O8={bright:0.7,soft:0.87,deep:0.48},N8={bright:0.16,soft:0.085,deep:0.12};function Ml(e,t,o){let r=(s)=>{let i=s*Math.cos(o*Math.PI/180),c=s*Math.sin(o*Math.PI/180),u=(e+0.3963377774*i+0.2158037573*c)**3,l=(e-0.1055613458*i-0.0638541728*c)**3,m=(e-0.0894841775*i-1.291485548*c)**3;return[4.0767416621*u-3.3077115913*l+0.2309699292*m,-1.2684380046*u+2.6097574011*l-0.3413193965*m,-0.0041960863*u-0.7034186147*l+1.707614701*m]},n=t,a=r(n);while(n>0&&a.some((s)=>s<-0.0001||s>1.0001))n-=0.004,a=r(Math.max(n,0));return`#${a.map((s)=>{let i=Math.min(1,Math.max(0,s)),c=i<=0.0031308?12.92*i:1.055*i**0.4166666666666667-0.055;return Math.round(c*255).toString(16).padStart(2,"0")}).join("")}`}function B8(e,t,o){let r=(e.match(/\w\w/g)??[]).map((a)=>parseInt(a,16)),n=(t.match(/\w\w/g)??[]).map((a)=>parseInt(a,16));return`#${r.map((a,s)=>Math.round(a+(n[s]-a)*o).toString(16).padStart(2,"0")).join("")}`}function H8(e){let t=Math.floor(e()*r2)*(360/r2),o=t>=50&&t<=130,r=ke(e,L8),n=o&&r==="deep"?"bright":r,a=ke(e,D8),s=(t+F8[a])%360,i=n==="bright"&&o?0.86:O8[n],c=N8[n],u=i<0.8,l=u?Ml(0.96,0.05,s):Ml(0.4,0.15,s),m=Ml(i,c,t),p=Ml(i+(u?-0.06:0.045),c,t);return{name:`${Math.round(t)}° ${n} ${a}`,bg:m,fg:l,bg2:p}}function Hf(e,t,o){let r=H8(o),n=ke(o,kl),a=t==="curated"?n:r;if(typeof e==="number"){let s=kl.length;a=kl[(e%s+s)%s]}if(e&&typeof e==="object"&&e.bg&&e.fg)a=e;return{...a,bg2:a.bg2??B8(a.bg,a.fg,0.14)}}var n2=Math.PI*2,Wn=0.000000001,Oo=50,Dl=(e,t,o)=>({x:e.x+t*Math.cos(o),y:e.y+t*Math.sin(o)}),Vf=(e)=>e.kind==="line"?e.from:Dl(e.c,e.r,e.from),Uf=(e)=>e.kind==="line"?e.to:Dl(e.c,e.r,e.to),a2=(e,t)=>Math.abs(e.x-t.x)<0.000001&&Math.abs(e.y-t.y)<0.000001;function V8(e){if(!e.square)return[{kind:"arc",c:{x:Oo,y:Oo},r:Oo,from:-Math.PI,to:Math.PI}];let t=Math.min(Math.max(e.radius,0),Oo),o=100-t;return[{kind:"line",from:{x:t,y:0},to:{x:o,y:0}},{kind:"arc",c:{x:o,y:t},r:t,from:-Math.PI/2,to:0},{kind:"line",from:{x:100,y:t},to:{x:100,y:o}},{kind:"arc",c:{x:o,y:o},r:t,from:0,to:Math.PI/2},{kind:"line",from:{x:o,y:100},to:{x:t,y:100}},{kind:"arc",c:{x:t,y:o},r:t,from:Math.PI/2,to:Math.PI},{kind:"line",from:{x:0,y:o},to:{x:0,y:t}},{kind:"arc",c:{x:t,y:t},r:t,from:Math.PI,to:3*Math.PI/2}].filter((n)=>n.kind==="arc"?n.r>Wn:!a2(n.from,n.to))}function U8(e,t){let o=(m)=>t.nx*m.x+t.ny*m.y-t.d;if(e.kind==="line"){let m=o(e.from),p=o(e.to);if(m<=Wn&&p<=Wn)return[e];if(m>-Wn&&p>-Wn)return[];let d=m/(m-p),f={x:e.from.x+d*(e.to.x-e.from.x),y:e.from.y+d*(e.to.y-e.from.y)};return[m<0?{kind:"line",from:e.from,to:f}:{kind:"line",from:f,to:e.to}]}let{c:r,r:n,from:a,to:s}=e,i=(t.d-t.nx*r.x-t.ny*r.y)/n,c=[];if(Math.abs(i)<1){let m=Math.atan2(t.ny,t.nx),p=Math.acos(i);for(let d of[m-p,m+p]){let f=d;while(f<a)f+=n2;while(f>s)f-=n2;if(f>a+Wn&&f<s-Wn)c.push(f)}}let u=[a,...c.sort((m,p)=>m-p),s],l=[];for(let m=0;m<u.length-1;m++){let p=u[m],d=u[m+1];if(o(Dl(r,n,(p+d)/2))<=0)l.push({kind:"arc",c:r,r:n,from:p,to:d})}return l}function _8(e,t){let o=e.flatMap((n)=>U8(n,t));if(o.length===0)return[];let r=[];for(let n=0;n<o.length;n++){let a=o[n];r.push(a);let s=o[(n+1)%o.length];if(!a2(Uf(a),Vf(s)))r.push({kind:"line",from:Uf(a),to:Vf(s)})}return r}var Ll=(e)=>`${Fe(e.x)} ${Fe(e.y)}`;function W8(e){if(e.length===0)return"";let t=`M${Ll(Vf(e[0]))}`;for(let o of e){if(o.kind==="line"){t+=`L${Ll(o.to)}`;continue}let r=o.to-o.from;if(r>Math.PI*1.999){let n=(o.from+o.to)/2;t+=`A${Fe(o.r)} ${Fe(o.r)} 0 0 1 ${Ll(Dl(o.c,o.r,n))}`}t+=`A${Fe(o.r)} ${Fe(o.r)} 0 ${r>Math.PI&&r<=Math.PI*1.999?1:0} 1 ${Ll(Uf(o))}`}return`${t}Z`}function zn(e,t,o,r){let n=r*Math.PI/180,a=e*Math.cos(n)-t*Math.sin(n),s=e*Math.sin(n)+t*Math.cos(n);return{nx:a,ny:s,d:o+a*Oo+s*Oo}}function zs(e,t){let o=V8(e);for(let r of t)o=_8(o,r);return W8(o)}function s2(e,t,o,r){if(!e.square)return Math.hypot(t-Oo,o-Oo)+r<=Oo;let n=Oo-r,a=Math.max(Math.min(Math.max(e.radius,0),Oo)-r,0),s=Math.max(Math.abs(t-Oo)-(n-a),0),i=Math.max(Math.abs(o-Oo)-(n-a),0);return Math.hypot(s,i)<=a}var Gn=["solid","split","quarter","ring","halo","stripes","horizon","polka"],z8=(e,t,o,r)=>`<circle cx="${Fe(e)}" cy="${Fe(t)}" r="${Fe(o)}" fill="${r}"/>`,Fl=(e,t)=>e?`<path d="${e}" fill="${t}"/>`:"";function i2(e,t,o,r,n){let{bg:a,bg2:s}=o,i=Math.floor(e()*8)*45,c=Math.floor(e()*4)*90,u=r(a);if(t==="split")return u+Fl(zs(n,[zn(-1,0,0,i)]),s);if(t==="quarter")return u+Fl(zs(n,[zn(-1,0,0,c),zn(0,-1,0,c)]),s);if(t==="ring")return r(s)+`<g transform="translate(50 50) scale(0.84) translate(-50 -50)">${u}</g>`;if(t==="halo")return u+`<circle cx="50" cy="50" r="34" fill="${s}"/>`;if(t==="stripes"){let l=i%180===0?45:135,m=[];for(let p=-4;p<=4;p++){let d=p*16;m.push(zs(n,[zn(-1,0,-(d-4),l),zn(1,0,d+4,l)]))}return u+Fl(m.join(""),s)}if(t==="horizon")return u+Fl(zs(n,[zn(0,-1,-16,c)]),s);if(t==="polka"){let l="";for(let m=0;m<6;m++)for(let p=0;p<6;p++){let d=8+p*17+m%2*8.5,f=8+m*17;if(s2(n,d,f,2.6))l+=z8(d,f,2.6,s)}return u+l}return u}var Zn=(e,t)=>e[t],dt=(e,t,o,r)=>`<circle cx="${Fe(e)}" cy="${Fe(t)}" r="${Fe(o)}" fill="${r}"/>`,ur=(e,t)=>`<polygon points="${e.map((o)=>o.map(Fe).join(",")).join(" ")}" fill="${t}"/>`,ut=(e,t)=>{if(!e)return t;return`<g transform="rotate(${e} 50 50)">${t}</g>`},Ol={dots(e,{fg:t}){let o=ke(e,[2,3,3,4,4]),r=Zn({2:20,3:28,4:30},o),n=Zn({2:7.5,3:5,4:3.6},o),a=Zn({2:["full","diag"],3:["full","plus","x","ring","linked"],4:["full","ring","x","diag","center"]},o),s=ke(e,a),i=e()<0.3?45:0,c=r/(o-1),u=50-r/2,l="";if(s==="linked"){let p="";for(let d=0;d<o;d++){let f=u+d*c;p+=`M${u} ${f}H${u+r}M${f} ${u}V${u+r}`}l+=`<path d="${p}" stroke="${t}" stroke-width="1.6" fill="none"/>`}let m=(p,d)=>{let f=p===0||d===0||p===o-1||d===o-1,S=(p===0||p===o-1)&&(d===0||d===o-1);if(s==="plus")return p!==1&&d!==1;if(s==="x")return(p+d)%2===1;if(s==="ring")return o===3?p===1&&d===1:!f;if(s==="diag")return o===2?p!==d:p!==d&&p+d!==o-1;if(s==="center")return f&&!S;return!1};for(let p=0;p<o;p++)for(let d=0;d<o;d++){if(m(p,d))continue;l+=dt(u+p*c,u+d*c,s==="linked"?3.6:n,t)}return ut(i,l)},flower(e,{fg:t,bg:o}){let r=ke(e,[4,4,5,6,8]),[n,a]=Zn({4:[11,12],5:[12,10],6:[13,9],8:[15,7]},r),s=e()<0.5?0:Math.PI/r,i=ke(e,["fill","hole","none"]),c="";for(let u=0;u<r;u++){let l=u/r*Fa+s-Math.PI/2;c+=dt(50+Math.cos(l)*n,50+Math.sin(l)*n,a,t)}if(i==="fill")c+=dt(50,50,n,t);if(i==="hole")c+=dt(50,50,a*0.5,o);return c},burst(e,{fg:t}){let o=ke(e,[5,6,8,10,12]),r=e()<0.6,n=ke(e,["dot","ring","none"]),a=r?17:22,s="",i="";for(let c=0;c<o;c++){let u=c/o*Fa-Math.PI/2,l=Math.cos(u),m=Math.sin(u);if(s+=`M${Fe(50+l*8)} ${Fe(50+m*8)}L${Fe(50+l*a)} ${Fe(50+m*a)}`,r)i+=dt(50+l*22,50+m*22,3.4,t)}if(n==="dot")i+=dt(50,50,4.5,t);if(n==="ring")i+=`<circle cx="50" cy="50" r="4.5" fill="none" stroke="${t}" stroke-width="2.5"/>`;return`<path d="${s}" stroke="${t}" stroke-width="3" stroke-linecap="round"/>${i}`},stairs(e,{fg:t}){let o=ke(e,[2,3,4]),r=Math.floor(e()*4)*90,[n,a,s,i]=[29,29,71,71],c=(s-n)/o,u=(i-a)/o,l=[[n,i],[s,i],[s,a]];for(let p=1;p<o;p++)l.push([s-p*c,a+(p-1)*u],[s-p*c,a+p*u]);l.push([n,a+(o-1)*u]);let m=e()<0.5?`<rect x="29" y="29" width="42" height="42" fill="${t}" opacity="0.35"/>`:"";return ut(r,m+ur(l,t))},hourglass(e,{fg:t}){let o=ke(e,[3,6]),n=e()<0.6?[[30,28],[70,28],[70,34],[50+o,50],[70,66],[70,72],[30,72],[30,66],[50-o,50],[30,34]]:[[30,28],[70,28],[50+o,50],[70,72],[30,72],[50-o,50]];return ut(ke(e,[0,45,90,135]),ur(n,t))},plus(e,{fg:t,bg:o}){let r=ke(e,[14,18,22]),n=ke(e,[0,3]),a=50-r/2,s=`<rect x="${a}" y="28" width="${r}" height="44" rx="${n}" fill="${t}"/><rect x="28" y="${a}" width="44" height="${r}" rx="${n}" fill="${t}"/>`,i=e()<0.25?45:0;if(r===22&&e()<0.6)for(let c of[-5.5,5.5])for(let u of[-5.5,5.5])s+=dt(50+c,50+u,2.2,o);return ut(i,s)},leaves(e,{fg:t,bg:o}){let r=ke(e,[2,3,4,4,6]),n=`<path d="M50 50C40 42 40 28 50 22C60 28 60 42 50 50Z" fill="${t}"/>`,a=e()<0.5?0:180/r,s="";for(let i=0;i<r;i++)s+=ut(360/r*i+a,n);if(e()<0.4)s+=dt(50,50,3.5,o);return s},rings(e,{fg:t}){let o=ke(e,[2,3,4]),r=o===4?5.5:7,n=o===4?2.8:3.5,a=e()<0.35,s="";for(let i=0;i<o;i++){let c=22-i*r,u=a?50+(22-c):50;s+=`<circle cx="50" cy="${u}" r="${c}" fill="none" stroke="${t}" stroke-width="${n}"/>`}if(e()<0.5){let i=22-o*r;s+=dt(50,a?50+(22-i):50,Math.max(2.5,Math.min(6,i-2)),t)}return s},checker(e,{fg:t}){let o=ke(e,[2,3,4,5]),r=e()<0.5?0:1,n=40/o,a="";for(let s=0;s<o;s++)for(let i=0;i<o;i++){if((s+i)%2!==r)continue;a+=`<rect x="${Fe(30+s*n)}" y="${Fe(30+i*n)}" width="${Fe(n)}" height="${Fe(n)}" fill="${t}"/>`}return ut(e()<0.4?45:0,a)},sparkle(e,{fg:t}){let o=(s,i,c)=>{let u=c*0.14,l=(m,p)=>`${Fe(m)} ${Fe(p)}`;return`<path d="M${l(s,i-c)}Q${l(s+u,i-u)} ${l(s+c,i)}Q${l(s+u,i+u)} ${l(s,i+c)}Q${l(s-u,i+u)} ${l(s-c,i)}Q${l(s-u,i-u)} ${l(s,i-c)}Z" fill="${t}"/>`},r=e()<0.4,a=ke(e,[[[50,50,24]],[[46,54,18],[65,34,8]],[[44,56,15],[64,42,9],[42,31,6]]]).map(([s,i,c],u)=>{if(r&&u===0)return`<g transform="rotate(45 ${s} ${i})">${o(s,i,c*0.55)}</g>${o(s,i,c)}`;return o(s,i,c)}).join("");return ut(ke(e,[0,90]),a)},arch(e,{fg:t,bg:o}){let r=ke(e,[[26,13],[26,18,10]]),n="";return r.forEach((a,s)=>{n+=`<path d="M${50-a} 63A${a} ${a} 0 0 1 ${50+a} 63Z" fill="${s%2?o:t}"/>`}),ut(Math.floor(e()*4)*90,n)},pinwheel(e,{fg:t}){let o=ke(e,[[[28,28],[50,28],[50,50]],[[28,28],[50,28],[28,50]],[[50,50],[50,26],[33.7,33.7]]]),r="";for(let n=0;n<4;n++)r+=ut(n*90,ur(o,t));if(e()<0.4)r+=dt(50,50,4,t);return ut(e()<0.5?0:45,r)},waves(e,{fg:t}){let o=ke(e,[[43,57],[38,50,62],[33.5,44.5,55.5,66.5]]),r=o.length===4?3.5:4,n=e()<0.5,a=7.333333333333333,s="";for(let i of o){if(n){s+=`M28 ${i}Q${Fe(31.666666666666668)} ${i-r*1.6} ${Fe(35.333333333333336)} ${i}`;for(let c=2;c<=6;c++)s+=`T${Fe(28+c*7.333333333333333)} ${i}`;continue}s+=`M28 ${i+r}`;for(let c=1;c<=6;c++)s+=`L${Fe(28+c*7.333333333333333)} ${i+(c%2?-r:r)}`}return ut(ke(e,[0,45,90,135]),`<path d="${s}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>`)},halves(e,{fg:t}){let o=ke(e,[3,5]),r=`<path d="M${50-o} 28A22 22 0 0 0 ${50-o} 72Z" fill="${t}"/><path d="M${50+o} 28A22 22 0 0 1 ${50+o} 72Z" fill="${t}"/>`;return ut(ke(e,[0,45,90,135]),r)},diamond(e,{fg:t,bg:o}){let r=ke(e,[2,8]),n=`<rect x="34" y="34" width="32" height="32" rx="${r}" fill="${t}"/>`,a=ke(e,["none","hole","dot","nest"]);if(a==="hole")n+=`<rect x="43" y="43" width="14" height="14" rx="${r/2}" fill="${o}"/>`;if(a==="dot")n+=dt(50,50,5,o);if(a==="nest")n+=`<rect x="40" y="40" width="20" height="20" rx="${r/2}" fill="${o}"/><rect x="45" y="45" width="10" height="10" rx="${r/4}" fill="${t}"/>`;return ut(e()<0.7?45:0,n)},moon(e,{fg:t}){let o=Math.floor(e()*8)*45-22,r=ke(e,[10,14]),n=21,a=18,s=(117+r*r)/(2*r),i=Math.sqrt(441-s*s),c=`${Fe(50+s)} ${Fe(50-i)}`,u=`${Fe(50+s)} ${Fe(50+i)}`,l=`<path d="M${c}A21 21 0 1 0 ${u}A18 18 0 ${s-r>0?1:0} 1 ${c}Z" fill="${t}"/>`;if(e()<0.4)l+=dt(50+r+3,43,3,t);return ut(o,l)},eye(e,{fg:t,bg:o}){let r=ke(e,[10,14]),n=`<path d="M26 50Q50 ${50-r*2} 74 50Q50 ${50+r*2} 26 50Z" fill="${t}"/>`;if(n+=dt(50,50,r*0.75,o),e()<0.5)n+=dt(50,50,r*0.35,t);return ut(e()<0.5?0:90,n)},triangle(e,{fg:t,bg:o}){let r=ke(e,["solid","hole","split"]),n=(s,i,c,u=1)=>{let l=c*0.866;return[[s,i-u*2*l/3],[s+c/2,i+u*l/3],[s-c/2,i+u*l/3]]},a=ur(n(50,53,46),t);if(r==="hole")a+=ur(n(50,53,18),o);if(r==="split")a+=ur(n(50,53,23,-1),o);return ut(Math.floor(e()*4)*90,a)},bars(e,{fg:t}){let o=ke(e,[3,4,5]),r=Zn({3:9,4:7,5:5.6},o),n=(44-o*r)/(o-1),a=ke(e,["center","bottom"]),s="";for(let i=0;i<o;i++){let c=ke(e,[14,20,26,32,38,44]),u=a==="center"?50-c/2:72-c;s+=`<rect x="${Fe(28+i*(r+n))}" y="${u}" width="${r}" height="${c}" rx="${r/2}" fill="${t}"/>`}return ut(e()<0.5?0:90,s)},pixels(e,{fg:t}){let o=ke(e,[3,4,5]),r=e()<0.35,n=44/o,a=Math.ceil(o/2),s=[];for(let i=0;i<o;i++)for(let c=0;c<a;c++)if(e()<0.6)s.push([c,i],[o-1-c,i]);if(s.length<o*o*0.45){let i=Math.floor(o/2);for(let c=0;c<o;c++)s.push([i,c],[c,i])}return s.map(([i,c])=>{if(r)return dt(28+i*n+n/2,28+c*n+n/2,n*0.4,t);return`<rect x="${Fe(28+i*n)}" y="${Fe(28+c*n)}" width="${Fe(n+0.4)}" height="${Fe(n+0.4)}" fill="${t}"/>`}).join("")},chain(e,{fg:t}){let o=ke(e,[2,3,4]),r=ke(e,[0,45,90,135]),n=Zn({2:7,3:7.5,4:9},o),a=Zn({2:13,3:12,4:11},o),s="";for(let i=0;i<o;i++){let c=i/o*Fa;s+=`<circle cx="${Fe(50+Math.cos(c)*n)}" cy="${Fe(50+Math.sin(c)*n)}" r="${a}" fill="none" stroke="${t}" stroke-width="${o===4?3.5:4}"/>`}return ut(r,s)},gear(e,{fg:t,bg:o}){let r=ke(e,[6,8,10,12]),n=dt(50,50,16,t);for(let s=0;s<r;s++)n+=`<rect x="46.5" y="27" width="7" height="10" rx="1.5" fill="${t}" transform="rotate(${Fe(360/r*s)} 50 50)"/>`;let a=ke(e,[0,5,8]);if(a)n+=dt(50,50,a,o);return n},orbit(e,{fg:t}){let o=Math.floor(e()*8)*45,r=ke(e,[7,9]),n=e()<0.4,a=`<circle cx="50" cy="50" r="19" fill="none" stroke="${t}" stroke-width="3"/>`+dt(50,50,r,t),s=(i)=>{let c=i*Math.PI/180;return dt(50+Math.cos(c)*19,50+Math.sin(c)*19,4.5,t)};if(a+=s(o),n)a+=s(o+180);return a},truchet(e,{fg:t}){let r="";for(let n=0;n<2;n++)for(let a=0;a<2;a++){let s=e()<0.5?0:1,i=e()<0.5?0:1,c=28+a*22+s*22,u=28+n*22+i*22,l=s?-1:1,m=i?-1:1;r+=`<path d="M${c} ${u}L${c+l*22} ${u}A22 22 0 0 ${l*m>0?1:0} ${c} ${u+m*22}Z" fill="${t}"/>`}return r},chevrons(e,{fg:t}){let r=ke(e,[[43,57],[38,50,62]]).map((n)=>`M30 ${n+6}L50 ${n-6}L70 ${n+6}`).join("");return ut(Math.floor(e()*4)*90,`<path d="${r}" fill="none" stroke="${t}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>`)},drop(e,{fg:t,bg:o}){let r=`<path d="M50 24C56 32 69 43 69 54A19 19 0 0 1 31 54C31 43 44 32 50 24Z" fill="${t}"/>`,n=ke(e,["none","dot","ring"]);if(n==="dot")r+=dt(50,55,6,o);if(n==="ring")r+=dt(50,55,9,o)+dt(50,55,4,t);return ut(Math.floor(e()*8)*45,r)},spiral(e,{fg:t}){let o=ke(e,[2,2.75]),r=e()<0.5?1:-1,n=o*Fa,a="";for(let s=0;s<=n;s+=0.2){let i=1+21*s/n;a+=`${a?"L":"M"}${Fe(50+Math.cos(s*r)*i)} ${Fe(50+Math.sin(s*r)*i)}`}return ut(Math.floor(e()*4)*90,`<path d="${a}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>`)},stripes(e,{fg:t}){let o=ke(e,[3,4,5]),r=23,n=46/(o+1),a="";for(let s=0;s<o;s++){let i=-23+n*(s+1),c=Math.sqrt(529-i*i);a+=`M${Fe(50-c)} ${Fe(50+i)}H${Fe(50+c)}`}return ut(ke(e,[0,45,90,135]),`<path d="${a}" stroke="${t}" stroke-width="4.5" stroke-linecap="round"/>`)},cube(e,{fg:t}){let o=[50,28],r=[69.05,39],n=[69.05,61],a=[50,72],s=[30.95,61],i=[30.95,39],c=[50,50],u=e()<0.2,l=ke(e,[[1,0.5,0.75],[1,0.75,0.5],[0.5,1,0.75],[0.75,0.5,1],[1,0.45,0],[1,0,0.45],[0,1,0.5]]),m="";if(u){let p=(d)=>d.map(Fe).join(" ");m=`<path d="M${p(o)}L${p(r)}L${p(n)}L${p(a)}L${p(s)}L${p(i)}ZM${p(i)}L${p(c)}L${p(r)}M${p(c)}L${p(a)}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/>`}if(!u)[[o,r,c,i],[c,r,n,a],[i,c,a,s]].forEach((p,d)=>{if(!l[d])return;m+=ur(p,t).replace("/>",l[d]<1?` opacity="${l[d]}"/>`:"/>")});return ut(e()<0.5?0:180,m)},peaks(e,{fg:t}){let o=e()<0.6,r=e()<0.5,n=o?ur([[50,66],[61,46],[72,66]],t).replace("/>",' opacity="0.6"/>')+ur([[28,66],[46,34],[64,66]],t):ur([[28,66],[50,32],[72,66]],t);if(r)n+=dt(o?64:66,34,5,t);if(e()<0.5)return`<g transform="matrix(-1 0 0 1 100 0)">${n}</g>`;return n},hex(e,{fg:t,bg:o}){let r=e()<0.5?0:30,n=(c)=>Array.from({length:6},(u,l)=>{let m=l/6*Fa-Math.PI/2;return[50+Math.cos(m)*c,50+Math.sin(m)*c]}),a=(c,u)=>ur(n(c),u),s=ke(e,["none","hole","dot","nested","outline"]);if(s==="outline")return ut(r,`<polygon points="${n(21).map((c)=>c.map(Fe).join(",")).join(" ")}" fill="none" stroke="${t}" stroke-width="4" stroke-linejoin="round"/>${a(8,t)}`);let i=a(23,t);if(s==="hole")i+=a(11,o);if(s==="dot")i+=dt(50,50,7,o);if(s==="nested")i+=a(15,o)+a(8,t);return ut(r,i)},bubbles(e,{fg:t}){let o=ke(e,[[[44,46,15],[63,60,8],[61,37,5]],[[50,42,13],[37,63,7],[63,63,7]],[[40,58,12],[60,44,9],[52,30,4]]]);return ut(Math.floor(e()*4)*90,o.map(([r,n,a])=>dt(r,n,a,t)).join(""))}},_f=Object.keys(Ol);var l2=1,c2=`v${l2}:`;function Nl(e){if(!e.startsWith(c2))return null;let[t,o,r,n]=e.slice(c2.length).split(":");if(!t)return null;let a={seed:decodeURIComponent(t)};if(o)a.colorSeed=decodeURIComponent(o);if(r&&Gn.includes(r))a.background=r;if(n==="c")a.colors="curated";return a}var G8=(e)=>e.replace(/[&<>"]/g,(t)=>({"&":"&","<":"<",">":">",'"':"""})[t]),u2=(e)=>Gn.includes(e),m2=(e)=>typeof e==="string"&&(e in Ol);function f2(e,t,o){let r=e?.filter(t)??[];return r.length>0?r:o}function Z8(e,t){let o=Bf(Nf(e)),r=Hf(t.palette,t.colors,o);if(t.colorSeed&&t.palette===void 0)r=Hf(void 0,t.colors,Bf(Nf(t.colorSeed)));let n=ke(o,f2(t.backgrounds,u2,Gn)),a=u2(t.background)?t.background:n,s=m2(t.glyph)?t.glyph:ke(o,f2(t.glyphs,m2,_f)),i=Ol[s](o,r),c=t.size??64,u=t.shape==="square",l=t.radius??24,p=i2(o,a,r,(S)=>u?`<rect width="100" height="100" rx="${l}" fill="${S}"/>`:`<circle cx="50" cy="50" r="50" fill="${S}"/>`,{square:u,radius:l}),d=t.title?` role="img"><title>${G8(t.title)}</title>`:' aria-hidden="true">';return{svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="${c}" height="${c}" style="display:block;width:100%;height:100%"${d}${p}${i}</svg>`,glyph:s,palette:r,background:a}}function Wf(e,t={}){let o=typeof e==="string"?Nl(e):null,r=o??(typeof e==="string"?{seed:e}:e),n={...t};if(o)n.colors="generated";if(r.colorSeed!==void 0)n.colorSeed=r.colorSeed;if(r.background!==void 0)n.background=r.background;if(r.colors!==void 0)n.colors=r.colors;return Z8(r.seed,n)}function zf(e,t){return Wf(e,t).svg}import{jsx as j8}from"react/jsx-runtime";function Rr(e){let{value:t,size:o=40,alt:r,glyph:n,glyphs:a,colors:s,colorSeed:i,palette:c,background:u,backgrounds:l,shape:m,radius:p,className:d,style:f,...S}=e,g=zf(t,{glyph:n,glyphs:a,colors:s,colorSeed:i,palette:c,background:u,backgrounds:l,shape:m,radius:p,size:o,title:r});return j8("span",{...S,className:["overflow-hidden [&>svg]:block [&>svg]:size-full",d].filter(Boolean).join(" "),style:{display:"inline-block",width:o,height:o,minWidth:o,lineHeight:0,flexShrink:0,...f},dangerouslySetInnerHTML:{__html:g}})}import{createContext as nw,useCallback as qnt,useContext as aw,useEffect as jnt,useRef as Xnt,useState as Ynt}from"react";import*as Oa from"react";import*as Bl from"react";var Gf=Bl.createContext(void 0);function Pr(e){let t=Bl.useContext(Gf);if(t===void 0&&!e)throw Error(Ge(72));return t}import*as p2 from"react";var X8={...nn,disabled:(e)=>e.disabled,instantType:(e)=>e.instantType,isInstantPhase:(e)=>e.isInstantPhase,trackCursorAxis:(e)=>e.trackCursorAxis,disableHoverablePopup:(e)=>e.disableHoverablePopup,lastOpenChangeReason:(e)=>e.openChangeReason,closeOnClick:(e)=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin};class Zf extends ir{constructor(e,t,o){let r=new Dn;super(Y8(e,r,t,o),K8(r),X8)}setOpen=(e,t)=>{N0(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Re(aa,e))}}function Y8(e,t,o,r=!1){return{...Ca(t,o,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function K8(e){return{popupRef:p2.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}import{jsx as d2,jsxs as J8}from"react/jsx-runtime";var g2=Fn(function(t){let{disabled:o=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:a=!1,trackCursorAxis:s="none",actionsRef:i,onOpenChange:c,onOpenChangeComplete:u,handle:l,triggerId:m,defaultTriggerId:p=null,children:d}=t,f=Ac((U,E)=>new Zf({open:r,openProp:n,activeTriggerId:p,triggerIdProp:m},U,E));f.useControlledProp("openProp",n),f.useControlledProp("triggerIdProp",m),f.useContextCallback("onOpenChange",c),f.useContextCallback("onOpenChangeComplete",u);let S=f.useState("open"),g=!o&&S,h=f.useState("activeTriggerId"),x=f.useState("mounted"),b=f.useState("payload");f.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:a,disabled:o}),ga(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:C,transitionStatus:I}=ha(g,f),y=f.useState("isInstantPhase"),w=f.useState("instantType"),v=f.useState("lastOpenChangeReason"),R=Oa.useRef(null);z(()=>{if(S&&o)f.setOpen(!1,Re(zb))},[S,o,f]),z(()=>{if(I==="ending"&&v===Rn||I!=="ending"&&y){if(w!=="delay")R.current=w;f.set("instantType","delay")}else if(R.current!==null)f.set("instantType",R.current),R.current=null},[I,y,v,w,f]),z(()=>{if(g){if(h==null)f.set("payload",void 0)}},[f,h,g]),Oa.useImperativeHandle(i,()=>({unmount:C,close:()=>f.setOpen(!1,Re(Wu))}),[C,f]);let L=g||x||!o&&s!=="none";return J8(Gf.Provider,{value:f,children:[l&&d2(pa,{handle:l,store:f}),L&&d2(Q8,{store:f,disabled:o,trackCursorAxis:s}),typeof d==="function"?d({payload:b}):d]})});function Q8({store:e,disabled:t,trackCursorAxis:o}){let r=e.useState("floatingRootContext"),n=Ln(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=ym(r,{enabled:!t&&o!=="none",axis:o==="none"?void 0:o}),s=Oa.useMemo(()=>Ot(a.reference,n.reference),[a.reference,n.reference]);return Ia(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:n.floating??Ue}),null}import*as Vl from"react";import*as Hl from"react";var ew=Hl.createContext(void 0);function h2(){return Hl.useContext(ew)}var I2=600;var b2="data-base-ui-tooltip-trigger";function C2(e){let t=Ze(e);return Ve(t)?t:null}var S2=ba(function(t,o){let{render:r,className:n,style:a,handle:s,payload:i,disabled:c,delay:u,closeOnClick:l=!0,closeDelay:m,id:p,...d}=t,f=Pr(!0),g=Sa(s)??f;if(!g)throw Error(Ge(82));let h=ao(p),x=g.useState("isTriggerActive",h),b=g.useState("isOpenedByTrigger",h),C=g.useState("floatingRootContext"),I=Vl.useRef(null),y=m??0,{registerTrigger:w,isMountedByThisTrigger:v}=da(h,I,g,{payload:i,closeOnClick:l,closeDelay:y}),R=h2(),{activeIdRef:L,delayRef:U,isInstantPhase:E,hasProvider:O}=nm(C,{open:b}),k=wa(C);g.useSyncedValue("isInstantPhase",E);let P=g.useState("disabled"),N=c??P,j=ct(N),T=g.useState("trackCursorAxis"),B=g.useState("disableHoverablePopup"),W=Vl.useRef(!1),X=Je(),A=Vl.useRef(void 0);function ue(){if(O&&L.current!=null)return 0;return u??R??I2}function V(fe){let be=I.current;if(!be||!fe)return!1;let ne=rr(fe,`[${b2}]`);return ne!==null&&ne!==be&&le(be,ne)}function G(fe){let be=V(fe);if(W.current=be,be)k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,X.clear();return be}let Z=Ms(C,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!B&&T!=="both"?ks():null,restMs:ue,delay(){if(m==null&&O)return{close:Or(U.current,"close")};return{close:y}},triggerElementRef:I,isActiveTrigger:x,isClosing:()=>g.select("transitionStatus")==="ending",shouldOpen(){return!W.current}}),oe=Es(C,{enabled:!N}).reference,Pe=(fe)=>{let be=W.current,ne=C2(fe),we=G(ne),Ce=I.current,De=Ce&&ne&&le(Ce,ne);if(we&&g.select("open")&&g.select("lastOpenChangeReason")===Yt){g.setOpen(!1,Re(Yt,fe));return}if(be&&!we&&De&&!j.current&&!g.select("open")&&Ce&&ko(A.current)){let Q=()=>{if(!W.current&&!j.current&&!g.select("open"))g.setOpen(!0,Re(Yt,fe,Ce))},H=ue();if(H===0)X.clear(),Q();else X.start(H,Q)}},ee=g.useState("appliedTriggerProps",v||T!=="none");return ve("button",t,{state:{open:b},ref:[o,w,I],props:[Z,oe,ee,{onMouseOver(fe){Pe(fe.nativeEvent)},onFocus(fe){if(V(C2(fe.nativeEvent)))fe.preventBaseUIHandler()},onMouseLeave(){W.current=!1,X.clear(),A.current=void 0},onPointerEnter(fe){A.current=fe.pointerType},onPointerDown(fe){if(A.current=fe.pointerType,g.set("closeOnClick",l),l&&!g.select("open"))g.cancelPendingOpen(fe.nativeEvent)},onClick(fe){if(l&&!g.select("open"))g.cancelPendingOpen(fe.nativeEvent)},id:h,[cs]:N?"":void 0,[b2]:N?void 0:""},d],stateAttributesMapping:Ki})});import*as v2 from"react";import*as Ul from"react";var $f=Ul.createContext(void 0);function x2(){let e=Ul.useContext($f);if(e===void 0)throw Error(Ge(70));return e}import*as _l from"react";import*as w2 from"react-dom";import{jsxs as tw}from"react/jsx-runtime";var Wl=_l.forwardRef(function(t,o){let{children:r,container:n,className:a,render:s,style:i,...c}=t,{node:u,subtree:l}=Tc({container:n,ref:o,componentProps:t,elementProps:c});if(!l&&!u)return null;return tw(_l.Fragment,{children:[l,u&&w2.createPortal(r,u)]})});import{jsx as y2}from"react/jsx-runtime";var R2=v2.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t;if(!(Pr().useState("mounted")||r))return null;return y2($f.Provider,{value:r,children:y2(Wl,{ref:o,...n})})});import*as Zl from"react";import*as zl from"react";var qf=zl.createContext(void 0);function Gl(){let e=zl.useContext(qf);if(e===void 0)throw Error(Ge(71));return e}import{jsx as ow}from"react/jsx-runtime";var P2=Zl.forwardRef(function(t,o){let{render:r,className:n,anchor:a,positionMethod:s="absolute",side:i="top",align:c="center",sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:p=5,arrowPadding:d=5,sticky:f=!1,disableAnchorTracking:S=!1,collisionAvoidance:g=Pc,style:h,...x}=t,b=Pr(),C=x2(),I=b.useState("open"),y=b.useState("mounted"),w=b.useState("trackCursorAxis"),v=b.useState("disableHoverablePopup"),R=b.useState("floatingRootContext"),L=b.useState("instantType"),U=b.useState("transitionStatus"),E=b.useState("adaptiveOrigin"),O=Kc({anchor:a,positionMethod:s,floatingRootContext:R,mounted:y,side:i,sideOffset:u,align:c,alignOffset:l,collisionBoundary:m,collisionPadding:p,sticky:f,arrowPadding:d,disableAnchorTracking:S,keepMounted:C,collisionAvoidance:g,adaptiveOrigin:E}),k=Zl.useMemo(()=>({open:I,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:w!=="none"?"tracking-cursor":L}),[I,O.side,O.align,O.anchorHidden,w,L]),P=Qc(t,k,{styles:O.positionerStyles,transitionStatus:U,props:x,refs:[o,b.useStateSetter("positionerElement")],hidden:!y,inert:!I||w==="both"||v});return ow(qf.Provider,{value:O,children:P})});import*as T2 from"react";var E2=T2.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,i=Pr(),{side:c,align:u}=Gl(),l=i.useState("open"),m=i.useState("instantType"),p=i.useState("transitionStatus"),d=i.useState("popupProps"),f=i.useState("floatingRootContext"),S=i.useState("disabled"),g=i.useState("closeDelay");$o({open:l,ref:i.context.popupRef,onComplete(){if(l)i.context.onOpenChangeComplete?.(!0)}}),As(f,{enabled:!S,closeDelay:g});let h=i.useStateSetter("popupElement");return ve("div",t,{state:{open:l,side:c,align:u,instant:m,transitionStatus:p},ref:[o,i.context.popupRef,h],props:[fa,d,va(p),s],stateAttributesMapping:ra})});import*as A2 from"react";var M2=A2.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,i=Pr(),{arrowRef:c,side:u,align:l,arrowUncentered:m,arrowStyles:p}=Gl(),d=i.useState("open"),f=i.useState("instantType");return ve("div",t,{state:{open:d,side:u,align:l,uncentered:m,instant:f},ref:[o,c],props:[{style:p,"aria-hidden":!0},s],stateAttributesMapping:vn})});import{jsx as Gs,jsxs as rw}from"react/jsx-runtime";function L2({...e}){return Gs(g2,{"data-slot":"tooltip",...e})}function D2({...e}){return Gs(S2,{"data-slot":"tooltip-trigger",...e})}function F2({className:e,side:t="top",sideOffset:o=4,align:r="center",alignOffset:n=0,children:a,...s}){return Gs(R2,{children:Gs(P2,{align:r,alignOffset:n,side:t,sideOffset:o,className:"isolate z-50",children:rw(E2,{"data-slot":"tooltip-content",className:ce("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s,children:[a,Gs(M2,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}import{useInsertionEffect as Vnt}from"react";import{jsx as cn,jsxs as N2,Fragment as fw}from"react/jsx-runtime";var sw=nw(null);function iw(){let e=aw(sw);if(!e)throw Error("useAvatarPicker and the AvatarPicker parts must be used inside <AvatarPickerRoot>.");return e}function O2(){return iw()}function $l(e,t,o,r,n,a=!1){function s(i){let{className:c,children:u,onClick:l,...m}=i,p=O2(),d=n(p),f=(h)=>{if(l?.(h),h.defaultPrevented)return;d()},S=a?"ga-ghost":"ga-icon",g=cn(mt,{type:"button",variant:"ghost",size:a?"default":"icon","aria-label":u?void 0:o,...m,className:c?`${S} ${c}`:S,"data-part":t,onClick:f,children:u??r});if(a)return g;return N2(L2,{children:[cn(D2,{render:g}),cn(F2,{children:o})]})}return s.displayName=e,s}var cw=$l("AvatarPickerShuffle","shuffle","Shuffle",N2(fw,{children:[cn(Di,{}),cn("span",{className:"ga-label",children:"Shuffle"})]}),(e)=>e.shuffle,!0),lw=$l("AvatarPickerNewShape","new-shape","New shape",cn(vi,{}),(e)=>e.newShape),uw=$l("AvatarPickerNewColors","new-colors","New colors",cn(Ei,{}),(e)=>e.newColors),mw=$l("AvatarPickerNewBackground","new-background","New background",cn(Ii,{}),(e)=>e.newBackground);import{jsx as xe,jsxs as ht}from"react/jsx-runtime";function dw(e){if(/Edg\//.test(e))return"Microsoft Edge";if(/Chrome\//.test(e))return"Google Chrome";if(/Safari\//.test(e)&&!/Chrome\//.test(e))return"Safari";if(/Firefox\//.test(e))return"Firefox";return"Unknown browser"}function H2({workspaceId:e,initialSettings:t,sessionToken:o,expanded:r,onExpandedChange:n,canExpand:a,onClose:s,onSettingsChange:i,theme:c,assetBaseUrl:u,welcome:l}){let m=$s(_o.workspace,{workspaceId:e}),p=m===void 0?t:m,d=B2("");Zs(()=>{if(!m)return;let D=JSON.stringify(m);if(d.current===D)return;d.current=D,i(m)},[i,m]);let f=p?{...p,theme:c}:p,S=Na(_o.openWebsite),g=Na(_o.startCustomer),h=Na(_o.sendCustomer),x=Na(_o.retryAgentResponse),b=Na(_o.generateAttachmentUploadUrl),C=Na(_o.markCustomerRead),[I,y]=Vr(""),[w,v]=Vr(),[R,L]=Vr(""),[U,E]=Vr(""),O=B2(null),[k,P]=Vr(!1),[N,j]=Vr(""),[T,B]=Vr(),[W,X]=Vr("chat"),[A,ue]=Vr(),V=!!o,G=$s(_o.visitorProfile,I&&V?{workspaceId:e,visitorId:I,sessionToken:o}:"skip"),Z=$s(_o.welcomeSuggestions,(G||f?.collectEmail===!1)&&l?.suggestions===void 0?{workspaceId:e,sessionToken:o}:"skip");Zs(()=>{let D=`coristen:${e}`,de=localStorage.getItem(D)??crypto.randomUUID();localStorage.setItem(D,de),y(de);let K=navigator.userAgent;ue({currentPage:window.location.href,referrer:document.referrer,browser:dw(K),device:/Mobi|Android|iPhone|iPad/i.test(K)?"Mobile":navigator.platform||"Desktop"})},[e]);async function oe(D){if(D.preventDefault(),!A||!o||k)return;P(!0),j("");try{let de=R.split("@")[0]?.replace(/[._-]+/g," ").trim()||"Visitor",K=await S({workspaceId:e,visitorId:I,sessionToken:o,name:de,email:R,...A,newConversation:!0});v(K??void 0),X("chat")}catch{j("We couldn't save your email. Please try again.")}finally{P(!1)}}async function Pe(){if(!G){X("chat");return}if(!A||k)return;P(!0),j("");try{let D=await S({workspaceId:e,visitorId:I,sessionToken:o,...G,...A,newConversation:!0});v(D??void 0),X("chat")}catch{j("We couldn't start a new conversation. Please try again.")}finally{P(!1)}}async function ee(D,de){if(G===void 0)throw Error("Customer details are still loading");if(f?.collectEmail!==!1&&!G)throw Error("Enter your email before sending a message");if(w)return await h({conversationId:w,visitorId:I,sessionToken:o,body:D,attachments:de});if(!A)throw Error("Chat is still loading");await S({workspaceId:e,visitorId:I,sessionToken:o,...G??{},...A,newConversation:!0});let K=await g({workspaceId:e,visitorId:I,sessionToken:o,body:D,attachments:de});return B({body:D,attachments:de.map((pe)=>({...pe,url:null})),createdAt:Date.now()}),v(K),K}let ie=$s(_o.customerMessages,w&&I&&V?{conversationId:w,visitorId:I,sessionToken:o}:"skip"),me=$s(_o.visitorConversations,I&&V?{workspaceId:e,visitorId:I,sessionToken:o}:"skip"),fe=ie?.at(-1);if(Zs(()=>{if(ie!==void 0)B(void 0)},[ie]),Zs(()=>{if(W==="chat"&&V&&w&&I&&fe?.sender==="merchant")C({conversationId:w,visitorId:I,sessionToken:o}).catch(()=>{})},[w,W,fe?._id,fe?.sender,C,o,V,I]),Zs(()=>{let D=(de)=>{if(de.key==="Escape"&&!de.defaultPrevented)s()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[s]),f===void 0||!o)return null;if(f===null||f.enabled===!1)return xe(lf,{className:"w-full max-w-md",children:ht(uf,{children:[xe(mf,{children:"Chat unavailable"}),xe(ff,{children:f?"This chat is currently offline.":"This chat is no longer available."})]})});let be=f.collectEmail!==!1&&G===null,we=`${{none:0,sm:6,md:10,lg:16}[f?.radius??"lg"]}px`,Ce=f?.accentEnabled?f.brandColor:"var(--foreground)",De=f.theme==="dark"?`color-mix(in oklch, ${Ce} 20%, white)`:Ce,Q=ht(Lf,{children:[xe(Df,{src:f.agentImageUrl||void 0,alt:f.agentName}),xe(Ff,{children:xe(Rr,{value:f.agentName,size:32,className:"size-8"})})]}),H=ht("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 overflow-y-auto px-8 py-10 text-center",children:[ht(Lf,{className:"size-12",children:[xe(Df,{src:f.agentImageUrl||void 0,alt:f.agentName}),xe(Ff,{children:xe(Rr,{value:f.agentName,size:48,className:"size-12"})})]}),ht("div",{className:"flex flex-col gap-1.5",children:[xe("p",{className:"text-base font-semibold",children:`Hi, I’m ${f.agentName}`}),xe("p",{className:"max-w-72 text-sm text-muted-foreground",children:!be?l?.message??f.welcomeMessage:"Enter your email below so we can keep your conversation and share replies with you."})]}),!be&&xe("div",{className:"flex w-full max-w-72 flex-col gap-1 pt-3",children:l?.suggestions===void 0&&Z===void 0?xe("div",{className:"flex flex-col items-center gap-3","aria-label":"Loading suggestions","aria-busy":"true",children:["w-4/5","w-3/5","w-2/3"].map((D)=>xe(lr,{className:`h-10 rounded-lg ${D}`},D))}):(l?.suggestions??(Z?.length?Z:[{title:"Tell me what you can help with",message:"What can you help me with, and where should I start?"},{title:"Help me understand my options",message:"Can you explain the options available and help me decide what to do next?"},{title:"I need help with something",message:"I need help with something and would like guidance on the next step."}])).map((D,de)=>xe(mt,{type:"button",variant:"ghost",className:"h-auto min-h-10 w-full justify-center px-2.5 py-2 text-center text-sm font-medium whitespace-normal",disabled:k,onClick:()=>{P(!0),j(""),ee(D.message.slice(0,2000),[]).catch(()=>j("Your message couldn't be sent. Please try again.")).finally(()=>P(!1))},children:xe("span",{className:"min-w-0 break-words",children:D.title})},`${de}:${D.title}`))})]}),Y=W==="history"?"history":w?`conversation:${w}`:be?"contact":"new";return xe("div",{className:f.theme==="dark"?"dark flex h-full w-full flex-col text-foreground":"flex h-full w-full flex-col text-foreground",children:ht(lf,{className:"squircle relative h-full w-full gap-0 rounded-(--configured-radius) bg-background text-foreground shadow-none",style:{"--primary":f.accentSendIcon?f.theme==="dark"?De:Ce:void 0,"--primary-foreground":f.accentSendIcon&&f.theme==="dark"?"var(--background)":void 0,"--configured-radius":we,backgroundColor:f?.tintedGrayscale?`color-mix(in oklch, ${Ce} 4%, var(--background))`:void 0},children:[ht(uf,{className:"shrink-0 gap-1 pb-5 select-none",style:f?.accentEnabled&&f.accentHeader?{color:De}:void 0,children:[ht(mf,{className:"flex min-w-0 items-center gap-2",children:[f.logoUrl?xe("img",{src:f.logoUrl,alt:"",className:"size-6 shrink-0 object-contain"}):xe(Rr,{value:f.name,size:24,className:"size-6"}),xe("span",{className:"truncate",children:f.name})]}),W==="history"&&xe(ff,{className:"text-current opacity-85",children:"Continue a previous conversation"}),ht(_1,{className:"flex gap-1",children:[ht(mt,{variant:"ghost",size:"sm",onClick:()=>X(W==="chat"?"history":"chat"),children:[W==="chat"?xe(Ci,{weight:"duotone","data-icon":"inline-start"}):xe(pi,{weight:"duotone","data-icon":"inline-start"}),W==="chat"?"Messages":"Chat"]}),a&&xe(mt,{variant:"ghost",size:"icon-sm",className:"hidden sm:inline-flex","aria-label":r?"Restore chat size":"Expand chat","aria-pressed":r,onClick:()=>n(!r),children:r?xe(ii,{}):xe(li,{})}),xe(mt,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:s,children:xe(Uo,{weight:"duotone"})})]})]}),N&&G!==null&&xe("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:N}),xe(W1,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:W==="history"?xe("div",{className:"flex min-h-0 w-full flex-col",children:ht("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto p-4",children:[me===void 0&&Array.from({length:3}).map((D,de)=>ht("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[xe(lr,{className:"h-4 w-4/5"}),xe(lr,{className:"h-3 w-2/5"})]},de)),me?.map((D)=>ht(mt,{type:"button",variant:"ghost",className:"h-auto w-full justify-start gap-3 border border-transparent p-3 text-left whitespace-normal hover:border-border",onClick:()=>{v(D._id),X("chat")},children:[f.agentImageUrl?xe("img",{src:f.agentImageUrl,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):xe(Rr,{value:f.agentName,size:32,className:"size-8"}),ht("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[ht("span",{className:"flex items-center justify-between gap-2",children:[xe("span",{className:"text-sm font-medium",children:"Conversation"}),xe("time",{className:"shrink-0 text-xs text-muted-foreground",dateTime:new Date(D.lastMessageAt).toISOString(),children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(D.lastMessageAt)})]}),xe("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:D.lastMessagePreview||"Attachment"}),!!D.customerUnreadCount&&ht(Sl,{variant:"secondary",children:[D.customerUnreadCount," unread"]})]}),xe(gi,{className:"size-4 shrink-0 text-muted-foreground"})]},D._id)),me?.length===0&&xe("p",{className:"flex flex-1 items-center justify-center py-8 text-center text-sm text-muted-foreground",children:"No conversations yet"})]})}):G===void 0&&!w?ht("div",{className:"flex min-h-0 w-full flex-col p-(--surface-inset-md)",children:[ht("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-center",children:[xe(lr,{className:"size-12 rounded-full"}),xe(lr,{className:"h-5 w-28"}),ht("div",{className:"flex w-full max-w-72 flex-col items-center gap-2",children:[xe(lr,{className:"h-4 w-full"}),xe(lr,{className:"h-4 w-4/5"})]})]}),ht("div",{className:"flex flex-col gap-3",children:[ht("div",{className:"flex flex-col gap-2",children:[xe(lr,{className:"h-4 w-24"}),xe(lr,{className:"h-8 w-full rounded-lg"})]}),xe(lr,{className:"h-9 w-full rounded-lg"})]})]}):be&&!w?xe("div",{className:"flex min-h-0 w-full flex-col",children:H}):w&&ie===void 0&&T?xe(Mf,{messages:[{_id:"pending-first-message",_creationTime:T.createdAt,sender:"customer",body:T.body,attachments:T.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:xe(Rr,{value:I,size:32,className:"size-8"}),otherAvatar:Q}):!w||ie===void 0||ie.length===0?H:xe(Mf,{messages:ie,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:xe(Rr,{value:I,size:32,className:"size-8"}),otherAvatar:Q,onRetry:(D)=>{j(""),x({conversationId:w,visitorId:I,customerMessageId:D,sessionToken:o}).catch(()=>j("The reply couldn't be retried. Please try again."))}},w)},Y),W==="history"&&xe(pl,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:ht(mt,{variant:"secondary",size:"lg",className:"w-full",disabled:k||G===void 0,onClick:()=>void Pe(),children:[xe(Yn,{"data-icon":"inline-start"}),"Start a conversation"]})}),be&&!w&&W==="chat"&&xe(pl,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:ht("form",{className:"flex w-full flex-col gap-3",onSubmit:(D)=>void oe(D),children:[ht("div",{className:"flex flex-col gap-2",children:[xe(Yh,{htmlFor:"customer-email",children:"Email address"}),xe(sf,{id:"customer-email",type:"email",value:R,onChange:(D)=>L(D.target.value),autoComplete:"email",placeholder:"you@example.com",maxLength:254,required:!0})]}),N&&xe("p",{role:"alert",className:"text-xs text-destructive",children:N}),xe(mt,{type:"submit",size:"lg",className:"w-full",disabled:k||!A,children:k?"Continuing...":"Continue"})]})}),!be&&G!==void 0&&W==="chat"&&V&&xe(pl,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:xe(U1,{body:U,onBodyChange:E,inputRef:O,sendDisabled:!A,showPoweredBy:f.showPoweredBy,assetBaseUrl:u,upload:async(D)=>{if(D.size>f.maxAttachmentSizeMb*1024*1024)throw Error(`Files must be ${f.maxAttachmentSizeMb} MB or smaller`);if(!f.allowedAttachmentTypes.some((M)=>D.type===M||D.type.startsWith(M)))throw Error("This file type is not allowed");let de=await b({workspaceId:e,visitorId:I,sessionToken:o}),K=await fetch(de,{method:"POST",headers:{"Content-Type":D.type||"application/octet-stream"},body:D});if(!K.ok)throw Error("Upload failed");let{storageId:pe}=await K.json();return{storageId:pe,name:D.name,type:D.type||"application/octet-stream",size:D.size}},send:ee})})]})})}function V2(e){let t=e.message.toLowerCase();if(t.includes("valid coristen api key"))return"A Coristen public key is required. Pass an apiKey that starts with coristen_pk_.";if(t.includes("domain")||t.includes("origin"))return"This website is not allowed to use this support widget.";if(t.includes("key")||t.includes("not found"))return"This Coristen public key is invalid or no longer active.";if(t.includes("security is not configured"))return"Support chat is not configured yet.";return"Support chat is temporarily unavailable. Please try again."}import*as _2 from"react";import*as ql from"react";var jf=ql.createContext(void 0);function ln(){let e=ql.useContext(jf);if(!e)throw Error(Ge(73));return e}var U2=0;function jl(e){return U2+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${U2}`}function Xl(e,t){if(typeof e==="string")return{description:e};if(typeof e==="function"){let o=e(t);return typeof o==="string"?{description:o}:o}return e}function Xf(e){let t=new Map,o=0,r=0;return e.forEach((n,a)=>{let s=n.transitionStatus==="ending";if(t.set(n.id,{value:n,domIndex:a,visibleIndex:s?-1:o,offsetY:r}),r+=n.height||0,!s)o+=1}),t}function Yf(e,t){let o=0;return e.map((r)=>{if(r.transitionStatus==="ending")return r;let n=o>=t;return o+=1,r.limited===n?r:{...r,limited:n}})}var mr={toasts:(e)=>e.toasts,isEmpty:(e)=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:(e)=>e.focused,expanded:(e)=>e.hovering||e.focused,expandedOrOutOfFocus:(e)=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:(e)=>e.prevFocusElement};class Kf extends ir{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Xf(e.toasts)},{},mr)}setViewport=(e)=>{this.set("viewport",e)};syncProviderProps(e,t){let o=this.state.limit!==t;if(this.state.timeout===e&&!o)return;let r={timeout:e,limit:t};if(o){let n=Yf(this.state.toasts,t);r.toasts=n,r.toastMetadata=Xf(n)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let o=mr.toastIndex(this.state,e);if(o===-1)return;let r=this.state.toasts[o];if(!t)r?.onRemove?.();let n=[...this.state.toasts];n.splice(o,1),this.setToasts(n)}addToast=(e)=>{let{timeout:t,limit:o}=this.state,r=e.id||jl("toast");if(e.id){let i=mr.toast(this.state,e.id);if(i)if(i.transitionStatus==="ending")this.removeToast(e.id,!0);else{let{id:c,transitionStatus:u,...l}=e;return this.updateToastInternal(e.id,l,!0,!0),e.id}}let n={...e,id:r,updateKey:0,transitionStatus:"starting"},a=[n,...this.state.toasts];this.setToasts(Yf(a,o));let s=n.timeout??t;if(n.type!=="loading"&&s>0)this.scheduleTimer(r,s,()=>this.closeToast(r));if(mr.expandedOrOutOfFocus(this.state))this.pauseTimers();return r};updateToast=(e,t)=>{let o=mr.toast(this.state,e);if(!o||o.transitionStatus==="ending")return;this.updateToastInternal(e,typeof t==="function"?t(o):t,!1,!0)};updateToastInternal=(e,t,o=!1,r=!1)=>{let{timeout:n,toasts:a}=this.state,s=mr.toast(this.state,e);if(!s)return;if(s.transitionStatus==="ending")return;let i={...s,...t,...r&&{updateKey:s.updateKey+1}};this.setToasts(a.map((S)=>S.id===e?i:S));let c=i.timeout??n,u=s.timeout??n,l=Object.hasOwn(t,"timeout"),m=i.transitionStatus!=="ending"&&i.type!=="loading"&&c>0,p=this.timers.has(e),d=u!==c,f=s.type==="loading";if(!m&&p){this.clearTimer(e);return}if(m&&(!p||d||l||f||o)){if(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),mr.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=(e)=>{let t=e===void 0,{limit:o,toasts:r}=this.state,n;if(t)n=r,this.clearTimers();else{let i=mr.toast(this.state,e);if(!i)return;n=[i],this.clearTimer(e)}let a=r.map((i)=>t||i.id===e?{...i,transitionStatus:"ending",height:0}:i),s=Yf(a,o);this.setToasts(s,!s.some((i)=>i.transitionStatus!=="ending")),n.forEach((i)=>{if(i.transitionStatus!=="ending")i.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let o=Xl(t.loading),r=this.addToast({...o,type:"loading"}),n=e.then((a)=>{let s=Xl(t.success,a);return this.updateToast(r,{...s,type:"success",timeout:s.timeout}),a}).catch((a)=>{let s=Xl(t.error,a);return this.updateToast(r,{...s,type:"error",timeout:s.timeout}),Promise.reject(a)});if({}.hasOwnProperty.call(t,"setPromise"))t.setPromise(n);return n};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach((e)=>{if(e.timeout)e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=eo.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=(e)=>{if(e.pointerType!=="touch")return;let t=Ze(e);if(le(this.state.viewport,t))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer(e,t,o){let r=Date.now(),a=!mr.expandedOrOutOfFocus(this.state)?eo.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:a,start:r,delay:t,remaining:t,callback:o})}clearTimers(){this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts(e,t=e.length===0){let o={toasts:e,toastMetadata:Xf(e)};if(t)o.hovering=!1,o.focused=!1;this.update(o)}handleFocusManagement(e){let t=st(Ee(this.state.viewport));if(!this.state.viewport||!le(this.state.viewport,t)||!Qr(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let o=mr.toasts(this.state),r=mr.toastIndex(this.state,e),n=(s,i)=>{for(let c=s;c>=0&&c<o.length;c+=i)if(o[c].transitionStatus!=="ending")return o[c];return null},a=n(r+1,1)??n(r-1,-1);if(a)a.ref?.current?.focus();else this.restoreFocusToPrevElement()}}import{jsx as gw,jsxs as hw}from"react/jsx-runtime";var W2=function(t){let{children:o,timeout:r=5000,limit:n=3,toastManager:a}=t,s=Xe(()=>new Kf({timeout:r,limit:n,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Yr(s.disposeEffect),_2.useEffect(function(){if(!a)return;return a[" subscribe"](({action:u,options:l})=>{let m=l.id;if(u==="promise"&&l.promise)s.promiseToast(l.promise,l);else if(u==="update"&&m)s.updateToast(m,l.updates);else if(u==="close")s.closeToast(m);else s.addToast(l)})},[s,a]),hw(jf.Provider,{value:s,children:[gw(Iw,{store:s,timeout:r,limit:n}),o]})};function Iw(e){let{store:t,timeout:o,limit:r}=e;return z(()=>{t.syncProviderProps(o,r)},[t,o,r]),null}import*as Xo from"react";var z2="--toast-frontmost-height";import{jsx as Yl,jsxs as Jf}from"react/jsx-runtime";var G2=Xo.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,...i}=t,c=ln(),u=Je(),l=Xo.useRef(!1),m=Xo.useRef(!1),p=Xo.useRef(!1),d=c.useState("isEmpty"),f=c.useState("toasts"),S=c.useState("focused"),g=c.useState("expanded"),h=c.useState("prevFocusElement"),x=f[0]?.height,b=f.some((T)=>T.transitionStatus==="ending"),C=f.filter((T)=>T.priority==="high");Xo.useEffect(()=>{let T=c.state.viewport;if(!T||d)return;let B=qe(T),W=Ee(T);function X(V){if(V.key==="F6"&&Ze(V)!==T)V.preventDefault(),c.set("prevFocusElement",st(W)),T?.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0)}function A(V){if(Ze(V)!==B)return;c.set("isWindowFocused",!1),c.pauseTimers()}function ue(V){if(V.relatedTarget)return;let G=Ze(V),Z=st(Ee(T));if(G===B||!le(T,G)||!Qr(Z))c.resumeTimers();u.start(0,()=>c.set("isWindowFocused",!0))}return to(Ae(B,"keydown",X),Ae(B,"blur",A,!0),Ae(B,"focus",ue,!0),Ae(W,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,d]);function I(T){l.current=!0;let B=T.relatedTarget===c.state.viewport?f.find((W)=>W.transitionStatus!=="ending"&&!W.limited):void 0;if(B)B.ref?.current?.focus();else c.restoreFocusToPrevElement()}function y(T){if(T.key==="Tab"&&T.shiftKey&&Ze(T.nativeEvent)===c.state.viewport)T.preventDefault(),c.restoreFocusToPrevElement()}function w(){if(c.state.toasts.some((B)=>B.transitionStatus==="ending")||p.current||!m.current)return;if(c.set("hovering",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers();m.current=!1}Xo.useEffect(w,[b,c]);function v(){c.pauseTimers(),c.set("hovering",!0),m.current=!1}function R(){m.current=!0,w()}function L(T){if(T.pointerType==="touch")p.current=!0}function U(T){if(T.pointerType!=="touch")return;p.current=!1,w()}function E(){if(l.current){l.current=!1;return}if(S)return;if(Qr(st(Ee(c.state.viewport))))c.set("focused",!0),c.pauseTimers()}function O(T){if(!S||le(c.state.viewport,T.relatedTarget))return;if(c.set("focused",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers()}let k={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:v,onMouseMove:v,onMouseLeave:R,onFocus:E,onBlur:O,onKeyDown:y,onClick:E,onPointerDown:L,onPointerUp:U,onPointerCancel:U,style:{[z2]:x?`${x}px`:void 0}},P={expanded:g},N=!d&&h&&Yl(nr,{onFocus:I}),j=ve("div",t,{ref:[o,c.setViewport],state:P,props:[k,i,{children:Jf(Xo.Fragment,{children:[N,s,N]})}]});return Jf(Xo.Fragment,{children:[N,j,!S&&C.length>0&&Yl("div",{style:pc,children:C.map((T)=>Jf("div",{role:"alert","aria-atomic":!0,children:[Yl("div",{children:T.title}),Yl("div",{children:T.description})]},T.id))})]})});import*as nt from"react";import*as eI from"react-dom";import*as Kl from"react";var Qf=Kl.createContext(void 0);function un(){let e=Kl.useContext(Qf);if(!e)throw Error(Ge(66));return e}import*as ep from"react";function Z2(e,t){let o=(t??qe(e).getComputedStyle(e)).transform,r=0,n=0,a=1;if(o&&o!=="none"){let s=o.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){let i=s[1].split(", ").map(parseFloat);if(i.length===6)r=i[4],n=i[5],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]);else if(i.length===16)r=i[12],n=i[13],a=i[0]}}return{x:r,y:n,scale:a}}function Jl(e,t,o){switch(e){case"up":return-o;case"down":return o;case"left":return-t;case"right":return t;default:return 0}}var $2="--toast-index",q2="--toast-offset-y",j2="--toast-height",X2="--toast-swipe-movement-x",Y2="--toast-swipe-movement-y";var K2="data-swipe-direction",Sst=yn,xst=es;import{jsx as xw}from"react/jsx-runtime";var ww={...Xr,swipeDirection(e){return e?{[K2]:e}:null}},J2=40,yw=10,Q2=0.5,vw=1,Rw=`${I0},${b0}`,tI=nt.forwardRef(function(t,o){let{toast:r,render:n,className:a,swipeDirection:s=["down","right"],style:i,...c}=t,u=r.positionerProps?.anchor!==void 0,l=[];if(!u)l=Array.isArray(s)?s:[s];let m=l.length>0,p=ln(),[d,f]=nt.useState(void 0),[S,g]=nt.useState(!1),[h,x]=nt.useState(!1),[b,C]=nt.useState({x:0,y:0}),[I,y]=nt.useState({x:0,y:0,scale:1}),[w,v]=nt.useState(),[R,L]=nt.useState(),[U,E]=nt.useState(null),O=nt.useRef(null),k=nt.useRef(void 0),P=nt.useRef({x:0,y:0}),N=nt.useRef({x:0,y:0,scale:1}),j=nt.useRef(void 0),T=nt.useRef(0),B=nt.useRef(!1),W=nt.useRef({x:0,y:0}),X=nt.useRef(!1),A=nt.useRef({x:0,y:0}),ue=nt.useRef(null),V=nt.useRef(null),G=p.useState("toastIndex",r.id),Z=p.useState("toastVisibleIndex",r.id),oe=p.useState("toastOffsetY",r.id),Pe=p.useState("focused"),ee=p.useState("expanded");$o({open:r.transitionStatus!=="ending",ref:O,onComplete(){if(r.transitionStatus==="ending")p.removeToast(r.id)}});let ie=re((K=!1)=>{let pe=O.current;if(!pe)return;let M=pe.style.height;pe.style.height="auto";let _=pe.offsetHeight;pe.style.height=M;function Se(){p.updateToastInternal(r.id,{ref:O,height:_,transitionStatus:void 0})}if(K)eI.flushSync(Se);else Se()});z(()=>{let K=k.current;if(r.transitionStatus!=="starting"&&K===r.id)return;if(K!==void 0)f(void 0),y({x:0,y:0,scale:1}),me({x:0,y:0});k.current=r.id,ie()},[ie,r.id,r.transitionStatus]);function me(K){A.current=K,C(K)}z(()=>()=>{V.current?.abort()},[]);function fe(K,pe){let M=(J)=>J>0?J**Q2:-(Math.abs(J)**Q2),_=K>0&&!l.includes("right")||K<0&&!l.includes("left"),Se=pe>0&&!l.includes("down")||pe<0&&!l.includes("up");return{x:_?M(K):K,y:Se?M(pe):pe}}let be=re((K)=>{if(K.pointerId!==ue.current)return;ue.current=null,V.current?.abort(),V.current=null,g(!1),x(!1),E(null);let pe=N.current;if(K.type==="pointercancel"||B.current){me({x:pe.x,y:pe.y}),f(void 0);return}let M=A.current,_=M.x-pe.x,Se=M.y-pe.y,J;for(let se of l)if(Jl(se,_,Se)>J2){J=se;break}if(J)f(J),p.closeToast(r.id);else me({x:pe.x,y:pe.y}),f(void 0)});function ne(K){if(K.button!==0)return;if(K.pointerType==="touch")p.pauseTimers();let pe=Ze(K.nativeEvent);if(rr(pe,`button,a,input,textarea,[role="button"],${Rw}`))return;B.current=!1,j.current=void 0,T.current=0,ue.current=K.pointerId,P.current={x:K.clientX,y:K.clientY},W.current=P.current;let _=K.currentTarget,Se=Z2(_);N.current=Se,y(Se),me({x:Se.x,y:Se.y}),p.set("hovering",!0),g(!0),x(!1),E(null),X.current=!0,V.current?.abort();let J=new AbortController;V.current=J;let se=Ee(_);se.addEventListener("pointerup",be,{signal:J.signal}),se.addEventListener("pointercancel",be,{signal:J.signal}),_.setPointerCapture?.(K.pointerId)}function we(K){if(K.pointerId!==ue.current)return;if(K.preventDefault(),X.current)P.current={x:K.clientX,y:K.clientY},X.current=!1;let{clientY:pe,clientX:M,movementX:_,movementY:Se}=K;if(Se<0&&pe>W.current.y||Se>0&&pe<W.current.y)W.current={x:W.current.x,y:pe};if(_<0&&M>W.current.x||_>0&&M<W.current.x)W.current={x:M,y:W.current.y};let J=M-P.current.x,se=pe-P.current.y,ge=pe-W.current.y,he=M-W.current.x,Ie=U;if(!h){if(Math.sqrt(J*J+se*se)>=vw){x(!0);let Kt=l.includes("left")||l.includes("right"),yo=l.includes("up")||l.includes("down");if(Kt&&yo){let To=Math.abs(J),uo=Math.abs(se);Ie=To>uo?"horizontal":"vertical",E(Ie)}}}let Ne;if(!j.current){if(Ie==="vertical"){if(se>0)Ne="down";else if(se<0)Ne="up"}else if(Ie==="horizontal"){if(J>0)Ne="right";else if(J<0)Ne="left"}else if(Math.abs(J)>=Math.abs(se))Ne=J>0?"right":"left";else Ne=se>0?"down":"up";if(Ne&&l.includes(Ne))j.current=Ne,T.current=Jl(Ne,J,se),f(Ne)}else{let oo=j.current,Kt=Jl(oo,he,ge);if(Kt>J2)B.current=!1,f(oo);else if(!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&T.current-Kt>=yw)B.current=!0}let Qe=fe(J,se),gt=N.current.x,bo=N.current.y,Co=l.includes("left")||l.includes("right"),Yo=l.includes("up")||l.includes("down");if(Ie!=="vertical"&&Co)gt+=Qe.x;if(Ie!=="horizontal"&&Yo)bo+=Qe.y;me({x:gt,y:bo})}function Ce(K){if(K.key==="Escape"){if(!O.current||!le(O.current,st(Ee(O.current))))return;p.closeToast(r.id)}}nt.useEffect(()=>{let K=O.current;if(!m||!K)return;function pe(M){if(ue.current===null||!le(K,Ze(M)))return;M.preventDefault()}return Ae(K,"touchmove",pe,{passive:!1})},[m]);function De(){let K=b.x-I.x,pe=b.y-I.y;return{transition:S?"none":void 0,transform:S?`translateX(${b.x}px) translateY(${b.y}px) scale(${I.scale})`:void 0,[X2]:`${K}px`,[Y2]:`${pe}px`}}let Q=r.priority==="high",H={role:Q?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":R,"aria-hidden":Q&&!Pe?!0:void 0,onPointerDown:m?ne:void 0,onPointerMove:m?we:void 0,onPointerUp:m?be:void 0,onPointerCancel:m?be:void 0,onKeyDown:Ce,inert:Ra(r.limited),style:{...De(),[$2]:r.transitionStatus==="ending"?G:Z,[q2]:`${oe}px`,[j2]:r.height?`${r.height}px`:void 0}},Y=nt.useMemo(()=>({toast:r,setTitleId:v,setDescriptionId:L,recalculateHeight:ie,visibleIndex:Z,expanded:ee}),[r,v,L,ie,Z,ee]),D={transitionStatus:r.transitionStatus,expanded:ee,limited:r.limited||!1,type:r.type,swiping:S,swipeDirection:d},de=ve("div",t,{ref:[o,O],state:D,stateAttributesMapping:ww,props:[H,c]});return xw(Qf.Provider,{value:Y,children:de})});import*as Ql from"react";var oI=Ql.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=un(),l=Ql.useRef(null);z(()=>{u();let d=l.current;if(!d||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let f=new ResizeObserver(()=>u(!0)),S=new MutationObserver(()=>u(!0));return f.observe(d),S.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>{f.disconnect(),S.disconnect()}},[u]);let m=i>0;return ve("div",t,{ref:[o,l],state:{expanded:c,behind:m},props:s})});import*as aI from"react";import*as rI from"react";function nI(e){if(e==null||typeof e==="boolean"||e==="")return!1;if(Array.isArray(e))return e.some(nI);return!0}function eu(e){return rI.isValidElement(e)&&nI(e.props.children)}function tu(e,t,o){let{toast:r,setTitleId:n,setDescriptionId:a}=un(),s=o==="title"?n:a,i=t??(o==="title"?r.title:r.description);return{id:Cr(e),children:i,type:r.type,setId:s}}function ou(e,t,o){let r=eu(e);return z(()=>{if(!r)return;return o(t),()=>{o((n)=>n===t?void 0:n)}},[r,t,o]),r?e:null}var sI=aI.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=tu(s,i,"description"),f=ve("p",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return ou(f,u,p)});import*as iI from"react";var cI=iI.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=tu(s,i,"title"),f=ve("h2",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return ou(f,u,p)});import*as ru from"react";var lI=ru.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,u=ln(),{toast:l,expanded:m}=un(),[p,d]=ru.useState(!1),{getButtonProps:f,buttonRef:S}=xo({disabled:s,native:i}),g={type:l.type};return ve("button",t,{ref:[o,S],state:g,props:[{"aria-hidden":!m&&!p,onClick(){u.closeToast(l.id)},onFocus(){d(!0)},onBlur(){d(!1)}},c,f]})});import*as uI from"react";var mI=uI.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=un(),l=u.actionProps?.children??c.children,{getButtonProps:m,buttonRef:p}=xo({disabled:s,native:i}),d={type:u.type},f=ve("button",t,{ref:[o,p],state:d,props:[c,u.actionProps,m,{children:l}]});return eu(f)?f:null});import*as fI from"react";import{jsx as Pw}from"react/jsx-runtime";var pI=fI.forwardRef(function(t,o){return Pw(Wl,{ref:o,...t})});import*as dI from"react";function tp(){let e=ln(),t=e.useState("toasts");return dI.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function op(){let e=new Set;function t(o){e.forEach((r)=>r(o))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(o){let r=o.id||jl("toast"),n={...o,id:r,transitionStatus:"starting"};return t({action:"add",options:n}),r},close(o){t({action:"close",options:{id:o}})},update(o,r){t({action:"update",options:{id:o,updates:r}})},promise(o,r){let n=o;return t({action:"promise",options:{...r,promise:o,setPromise(a){n=a}}}),n}}}import*as nu from"react";import*as Ut from"react";var hI=new Map([["bold",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ut.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var rp=nu.forwardRef((e,t)=>nu.createElement(Le,{ref:t,...e,weights:hI}));rp.displayName="CheckCircleIcon";import*as au from"react";import*as _t from"react";var II=new Map([["bold",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),_t.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]);var np=au.forwardRef((e,t)=>au.createElement(Le,{ref:t,...e,weights:II}));np.displayName="CircleNotchIcon";import*as su from"react";import*as Wt from"react";var bI=new Map([["bold",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Wt.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var ap=su.forwardRef((e,t)=>su.createElement(Le,{ref:t,...e,weights:bI}));ap.displayName="InfoIcon";import*as iu from"react";import*as zt from"react";var CI=new Map([["bold",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),zt.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]);var sp=iu.forwardRef((e,t)=>iu.createElement(Le,{ref:t,...e,weights:CI}));sp.displayName="WarningIcon";import*as cu from"react";import*as Gt from"react";var SI=new Map([["bold",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Gt.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var ip=cu.forwardRef((e,t)=>cu.createElement(Le,{ref:t,...e,weights:SI}));ip.displayName="XCircleIcon";import{jsx as it,jsxs as cp}from"react/jsx-runtime";var Tw=op();function Ew({...e}){return it(W2,{...e})}function Aw({...e}){return it(pI,{"data-slot":"toast-portal",...e})}function Mw({className:e,...t}){return it(G2,{"data-slot":"toast-viewport",className:ce("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",e),...t})}function kw({className:e,...t}){return it(tI,{"data-slot":"toast",className:ce("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-border focus-visible:ring-1 focus-visible:ring-border","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",e),...t})}function Lw({className:e,...t}){return it(oI,{"data-slot":"toast-content",className:ce("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",e),...t})}function Dw({className:e,...t}){return it(cI,{"data-slot":"toast-title",className:ce("text-sm font-medium",e),...t})}function Fw({className:e,...t}){return it(sI,{"data-slot":"toast-description",className:ce("text-sm text-muted-foreground",e),...t})}function Ow({className:e,render:t=it(mt,{variant:"outline",size:"sm"}),...o}){return it(mI,{"data-slot":"toast-action",render:t,className:ce("shrink-0",e),...o})}function Nw({className:e,children:t,render:o=it(mt,{variant:"ghost",size:"icon-sm"}),...r}){return it(lI,{"data-slot":"toast-close","aria-label":"Close toast",render:o,className:ce("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",e),...r,children:t??it(Uo,{"aria-hidden":"true"})})}function Bw({type:e}){let t=null;if(e==="success")t=it(rp,{"aria-hidden":"true"});if(e==="info")t=it(ap,{"aria-hidden":"true"});if(e==="warning")t=it(sp,{"aria-hidden":"true"});if(e==="error")t=it(ip,{className:"text-destructive","aria-hidden":"true"});if(e==="loading")t=it(np,{className:"animate-spin","aria-hidden":"true"});if(!t)return null;return it("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:t})}function Hw(){let{toasts:e}=tp();return e.map((t)=>it(kw,{toast:t,children:cp(Lw,{children:[it(Bw,{type:t.type}),cp("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[it(Dw,{}),it(Fw,{})]}),it(Ow,{}),it(Nw,{})]})},t.id))}function lu({children:e,toastManager:t=Tw,container:o,...r}){return cp(Ew,{toastManager:t,...r,children:[e,it(Aw,{container:o,children:it(Mw,{children:it(Hw,{})})})]})}var xI=op,hct=tp;import{jsx as lo,jsxs as js}from"react/jsx-runtime";var Gw="https://coristen-three.vercel.app",Ba=xI(),Zw=["--background","--foreground","--card","--card-foreground","--popover","--popover-foreground","--primary","--primary-foreground","--secondary","--secondary-foreground","--muted","--muted-foreground","--accent","--accent-foreground","--destructive","--border","--input","--ring","--radius-small","--radius-medium","--radius-control","--radius-card","--radius-panel","--radius-dialog","--radius-display","--surface-inset-sm","--surface-inset-md","--surface-inset-lg"],$w={name:"Coristen",logoUrl:null,agentName:"Ten",agentImageUrl:null,brandColor:"#171717",welcomeMessage:"",privacyPolicyUrl:"",position:"right",enabled:!0,theme:"light",tintedGrayscale:!1,accentEnabled:!1,accentHeader:!1,accentSendIcon:!1,radius:"lg",bubbleIcon:"chat-text",bubbleColor:"#171717",showPoweredBy:!0,collectEmail:!0,maxAttachmentSizeMb:10,allowedAttachmentTypes:[]};class wI extends Vw{state={error:!1};static getDerivedStateFromError(){return{error:!0}}componentDidCatch(e,t){this.props.onError(e),console.error("[Coristen widget] Runtime error",e,t)}render(){if(!this.state.error)return this.props.children;return null}}function up({identity:e,apiKey:t,apiUrl:o=Gw,mode:r="floating",renderTrigger:n,open:a,onOpenChange:s,defaultOpen:i=!1,welcome:c,fontSize:u,appearance:l,onReady:m,onError:p}){let d=o.replace(/\/$/,""),[f,S]=fr(),[g,h]=fr(""),[x,b]=fr(""),[C,I]=fr(),[y,w]=fr(i),v=a??y,R=lp((Q)=>{if(a===void 0)w(Q);s?.(Q)},[a,s]),[L,U]=fr(0),[E,O]=fr(!1),[k,P]=fr({}),[N,j]=fr(!1),[T,B]=fr(),W=qs(null),X=qs(void 0),A=qs(!1),ue=qs(m),V=qs(p);ue.current=m,V.current=p,mn(()=>{let Q=document.querySelector('meta[name="viewport"]'),H=!Q;if(!Q)Q=document.createElement("meta"),Q.name="viewport",document.head.append(Q);let Y=Q.content;return Q.content=(Y?Y.split(","):["width=device-width","initial-scale=1"]).map((D)=>D.trim()).filter((D)=>!/^maximum-scale\s*=/i.test(D)).concat("maximum-scale=1").filter(Boolean).join(", "),()=>{if(H)Q.remove();else Q.content=Y}},[]),mn(()=>{let Q=window.visualViewport,H=()=>{W.current?.style.setProperty("--coristen-viewport-height",`${Q?.height??window.innerHeight}px`),W.current?.style.setProperty("--coristen-viewport-top",`${Q?.offsetTop??0}px`)};return H(),Q?.addEventListener("resize",H),Q?.addEventListener("scroll",H),window.addEventListener("resize",H),()=>{Q?.removeEventListener("resize",H),Q?.removeEventListener("scroll",H),window.removeEventListener("resize",H)}},[]);let G=lp(async(Q)=>{let H=t,Y;if(e){if(!e.startsWith("/")||e.startsWith("//"))throw Error("Coristen identity must be a same-origin path");let K=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});if(!K.ok){let M=Error("Authentication required");throw M.status=K.status,M}let pe=await K.json();if(H=pe.publishableKey,Y=pe.identityToken,!Y)throw Error("Invalid Coristen identity response")}if(!H?.startsWith("coristen_pk_"))throw Error("A valid Coristen API key is required");let D=await fetch(`${d}/api/widget-session`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({publishableKey:H,identityToken:Y,previousToken:Q})});if(!D.ok){let K=Error(await D.text());throw K.status=D.status,K}let de=await D.json();if(e&&!de.identity)throw Error("Verified identity required");return de},[t,d,e]);mn(()=>{let Q=!0,H,Y="",D=async()=>{try{let de=await G(Y||void 0);if(!Q)return;Y=de.token,S(de),h(""),ue.current?.(),H=window.setTimeout(D,Math.max(5000,de.expiresAt-Date.now()-30000))}catch(de){if(!Q)return;let K=de instanceof Error?de:Error("Widget failed to load");h(V2(K)),S((M)=>M&&M.expiresAt>Date.now()?M:void 0),V.current?.(K),console.error("[Coristen widget] Failed to initialize",K);let pe=K.status;if(!pe||pe===429||pe>=500)H=window.setTimeout(D,5000)}};return D(),()=>{if(Q=!1,H)window.clearTimeout(H);if(Y)fetch(`${d}/api/widget-session`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({sessionToken:Y}),keepalive:!0})}},[d,G,L]),mn(()=>{let Q=g||x;if(!Q)return;let H=Ba.add({title:"Support chat couldn't load",description:Q,type:"error",timeout:6000,priority:"high",actionProps:{children:"Try again",onClick:()=>{Ba.close(H),h(""),b(""),U((Y)=>Y+1)}}});return()=>Ba.close(H)},[g,x]),mn(()=>{let Q=()=>U((D)=>D+1),H=()=>R(!0),Y=()=>R(!1);return window.addEventListener("coristen:reset",Q),window.addEventListener("coristen:open",H),window.addEventListener("coristen:close",Y),()=>{window.removeEventListener("coristen:reset",Q),window.removeEventListener("coristen:open",H),window.removeEventListener("coristen:close",Y)}},[r,R]),mn(()=>{if(f)I(f.settings)},[f]),mn(()=>{if(!T)return;let Q=()=>B((H)=>{if(!H)return H;let Y=window.innerWidth<640?12:20;return{left:Math.min(Math.max(H.left,Y),window.innerWidth-56-Y),top:Math.min(Math.max(H.top,Y),window.innerHeight-56-Y)}});return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[T]),mn(()=>{let Q=()=>{let D=getComputedStyle(document.documentElement),de=W.current?.parentElement??document.body,K=getComputedStyle(de);j(document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||D.colorScheme==="dark"),P({...Object.fromEntries(Zw.flatMap((pe)=>{let M=D.getPropertyValue(pe).trim();return M?[[pe,M]]:[]})),"--coristen-host-font-family":K.fontFamily,"--coristen-host-font-size":K.fontSize})};Q();let H=new MutationObserver(Q);H.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]});let Y=W.current?.parentElement??document.body;if(Y!==document.documentElement)H.observe(Y,{attributes:!0,attributeFilter:["class","style"]});return()=>H.disconnect()},[]);let Z=_w(()=>f?new zw(f.convexUrl):void 0,[f?.convexUrl]),oe={...C??f?.settings??$w,...l,theme:l?.theme??(N?"dark":"light")};if(oe.enabled===!1)return null;let Pe=oe.position==="left"?"left":"right",ee=T&&typeof window<"u"?T.left+28<window.innerWidth/2?"left":"right":Pe,ie=T&&typeof window<"u"?T.top+28<window.innerHeight/2?"top":"bottom":"bottom",me={none:0,sm:6,md:10,lg:16}[oe.radius],be={...r!=="floating"?{}:T?{left:`${T.left}px`,top:`${T.top}px`,right:"auto",bottom:"auto"}:Pe==="left"?{left:"20px"}:{right:"20px"},...k,"--coristen-radius":`${me}px`,"--coristen-bubble-color":oe.bubbleColor,"--radius-small":`${Math.max(0,me-10)}px`,"--radius-medium":`${Math.max(0,me-8)}px`,"--radius-control":`${Math.max(0,me-8)}px`,"--radius-card":`${Math.max(0,me-4)}px`,"--radius-panel":`${me}px`,"--radius-dialog":`${me}px`,"--radius-display":`${me}px`,...u?{"--coristen-font-size":u}:{}},ne=(Q)=>{if(r!=="floating"||v||Q.button!==0)return;let H=Q.currentTarget.getBoundingClientRect();X.current={pointerId:Q.pointerId,startX:Q.clientX,startY:Q.clientY,left:H.left,top:H.top,moved:!1},Q.currentTarget.setPointerCapture(Q.pointerId)},we=(Q)=>{let H=X.current;if(!H||H.pointerId!==Q.pointerId)return;if(!H.moved&&Math.hypot(Q.clientX-H.startX,Q.clientY-H.startY)<=4)return;H.moved=!0;let Y=window.innerWidth<640?12:20;B({left:Math.min(Math.max(H.left+Q.clientX-H.startX,Y),window.innerWidth-56-Y),top:Math.min(Math.max(H.top+Q.clientY-H.startY,Y),window.innerHeight-56-Y)})},Ce=(Q)=>{let H=X.current;if(!H||H.pointerId!==Q.pointerId)return;if(H.moved){A.current=!0;let Y=window.innerWidth<640?12:20;B((D)=>D?{left:D.left+28<window.innerWidth/2?Y:window.innerWidth-56-Y,top:D.top}:D)}X.current=void 0},De=()=>{R(!v)};if(g&&(!f||!Z))return js("div",{ref:W,"data-coristen-widget":"","data-mode":r,className:oe.theme==="dark"?"dark":void 0,style:be,children:[lo(lu,{toastManager:Ba,container:W}),n&&lo("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:De})})]});if(!f||!Z)return js("div",{ref:W,"data-coristen-widget":"","data-mode":r,className:oe.theme==="dark"?"dark":void 0,style:be,children:[lo(lu,{toastManager:Ba,container:W}),n&&lo("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:De})})]});return js("div",{ref:W,"data-coristen-widget":"","data-open":v||void 0,"data-expanded":E||void 0,"data-mode":r,"data-position":ee,"data-vertical":ie,className:oe.theme==="dark"?"dark":void 0,style:be,children:[lo(lu,{toastManager:Ba,container:W}),r==="modal"&&v&&lo("button",{type:"button",className:"coristen-backdrop","aria-label":"Close chat",onClick:()=>R(!1)}),f&&Z&&lo("div",{className:"coristen-panel",role:"dialog","aria-modal":r==="modal"?!0:void 0,"aria-label":`${oe.name} chat`,"aria-hidden":!v,inert:!v,children:lo(wI,{onError:(Q)=>{b("Chat ran into a problem. Please try again."),V.current?.(Q)},children:lo(Ww,{client:Z,children:lo(H2,{workspaceId:f.workspaceId,initialSettings:oe,sessionToken:f.token,expanded:E,onExpandedChange:O,canExpand:r==="floating",onClose:()=>R(!1),onSettingsChange:I,theme:oe.theme,assetBaseUrl:d,welcome:c})})},L)}),n?lo("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:De})}):r==="floating"?lo("button",{type:"button",className:"coristen-launcher","aria-label":v?"Close chat":"Open chat","aria-expanded":v,"aria-busy":!f,onPointerDown:ne,onPointerMove:we,onPointerUp:Ce,onPointerCancel:Ce,onClick:()=>{if(A.current){A.current=!1;return}De()},children:lo("img",{src:`${d}/widget-icons/${oe.bubbleIcon||"chat-text"}.svg`,alt:"",draggable:!1})}):null]})}function yI(e,t,o){return Uw(e,{"aria-expanded":t,onClick:(r)=>{if(e.props.onClick?.(r),!r.defaultPrevented)o()}})}function vct(e){return lo(up,{...e,mode:"floating"})}function Rct({trigger:e,...t}){return lo(up,{...t,mode:"modal",renderTrigger:({open:o,toggle:r})=>yI(e,o,r)})}function Pct({children:e,side:t="right",trigger:o,open:r,onOpenChange:n,defaultOpen:a=!1,appearance:s,...i}){let[c,u]=fr(a),l=r??c,m=lp((p)=>{if(r===void 0)u(p);n?.(p)},[r,n]);return js("div",{className:"coristen-dock","data-side":t,"data-open":l||void 0,children:[js("div",{className:"coristen-dock-content",children:[e,!l&&lo("div",{className:"coristen-dock-trigger",children:yI(o,l,()=>m(!0))})]}),lo(up,{...i,mode:"embedded",open:l,onOpenChange:m,appearance:{...s,position:t}})]})}var Tct={open(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:open"))},close(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:close"))},reset(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:reset"))}};export{Pct as CoristenDock,Rct as CoristenModal,vct as CoristenWidget,Tct as coristenWidget};
|
|
2
|
+
var TI=Object.create;var{getPrototypeOf:EI,defineProperty:Ru,getOwnPropertyNames:AI}=Object;var Ip=Object.prototype.hasOwnProperty;function MI(e){return this[e]}var kI,LI,bp=(e,t,o)=>{var r=e!=null&&typeof e==="object";if(r){var n=t?kI??=new WeakMap:LI??=new WeakMap,a=n.get(e);if(a)return a}o=e!=null?TI(EI(e)):{};let s=t||!e||!e.__esModule||!Ip.call(e,"default")?Ru(o,"default",{value:e,enumerable:!0}):o;if(e&&typeof e==="object"||typeof e==="function"){for(let i of AI(e))if(!Ip.call(s,i))Ru(s,i,{get:MI.bind(e,i),enumerable:!0})}if(r)n.set(e,s);return s};var DI=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var FI=(e)=>e;function OI(e,t){this[e]=FI.bind(null,t)}var ri=(e,t)=>{for(var o in t)Ru(e,o,{get:t[o],enumerable:!0,configurable:!0,set:OI.bind(t,o)})};import*as sr from"react";var Mc=DI(function(VC){function MC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kC=typeof Object.is==="function"?Object.is:MC,LC=sr.useState,DC=sr.useEffect,FC=sr.useLayoutEffect,OC=sr.useDebugValue;function NC(e,t){var o=t(),r=LC({inst:{value:o,getSnapshot:t}}),n=r[0].inst,a=r[1];return FC(function(){n.value=o,n.getSnapshot=t,Tm(n)&&a({inst:n})},[e,o,t]),DC(function(){return Tm(n)&&a({inst:n}),e(function(){Tm(n)&&a({inst:n})})},[e]),OC(o),o}function Tm(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!kC(e,o)}catch(r){return!0}}function BC(e,t){return t()}var HC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?BC:NC;VC.useSyncExternalStore=sr.useSyncExternalStore!==void 0?sr.useSyncExternalStore:HC});var kr={};ri(kr,{android:()=>Ad,apple:()=>$u,ios:()=>Zu,linux:()=>Yb,mac:()=>Md,windows:()=>Xb});var Lr={};ri(Lr,{blink:()=>Jb,gecko:()=>Kb,webkit:()=>qu});var ju={};ri(ju,{voiceOver:()=>Qb});var rs={};ri(rs,{jsdom:()=>eC});import{Component as Vw,cloneElement as Uw,useCallback as lp,useEffect as mn,useMemo as _w,useRef as qs,useState as fr}from"react";import{ConvexProvider as Ww,ConvexReactClient as zw}from"convex/react";import{useEffect as Zs,useRef as B2,useState as Vr}from"react";import{useMutation as Na,useQuery as $s}from"convex/react";import*as ni from"react";import*as bn from"react";import{createContext as NI}from"react";var Cp=NI({color:"currentColor",size:"1em",weight:"regular",mirrored:!1});var Le=bn.forwardRef((e,t)=>{let{alt:o,color:r,size:n,weight:a,mirrored:s,children:i,weights:c,...u}=e,{color:l="currentColor",size:m,weight:p="regular",mirrored:d=!1,...f}=bn.useContext(Cp);return bn.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:n!=null?n:m,height:n!=null?n:m,fill:r!=null?r:l,viewBox:"0 0 256 256",transform:s||d?"scale(-1, 1)":void 0,...f,...u},!!o&&bn.createElement("title",null,o),i,c.get(a!=null?a:p))});Le.displayName="IconBase";import*as bt from"react";var Sp=new Map([["bold",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),bt.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",bt.createElement(bt.Fragment,null,bt.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var ai=ni.forwardRef((e,t)=>ni.createElement(Le,{ref:t,...e,weights:Sp}));ai.displayName="ArrowUpIcon";import*as si from"react";import*as Ct from"react";var xp=new Map([["bold",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M216.49,56.48,177,96h19a12,12,0,0,1,0,24H148a12,12,0,0,1-12-12V60a12,12,0,0,1,24,0V79l39.51-39.52a12,12,0,0,1,17,17ZM108,136H60a12,12,0,0,0,0,24H79L39.51,199.51a12,12,0,0,0,17,17L96,177v19a12,12,0,0,0,24,0V148A12,12,0,0,0,108,136Z"}))],["duotone",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),Ct.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["fill",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M120,144v48a8,8,0,0,1-13.66,5.66L88,179.31,53.66,213.66a8,8,0,0,1-11.32-11.32L76.69,168,58.34,149.66A8,8,0,0,1,64,136h48A8,8,0,0,1,120,144ZM213.66,42.34a8,8,0,0,0-11.32,0L168,76.69,149.66,58.34A8,8,0,0,0,136,64v48a8,8,0,0,0,8,8h48a8,8,0,0,0,5.66-13.66L179.31,88l34.35-34.34A8,8,0,0,0,213.66,42.34Z"}))],["light",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M212.24,52.24,158.48,106H192a6,6,0,0,1,0,12H144a6,6,0,0,1-6-6V64a6,6,0,0,1,12,0V97.52l53.76-53.76a6,6,0,0,1,8.48,8.48ZM112,138H64a6,6,0,0,0,0,12H97.52L43.76,203.76a6,6,0,1,0,8.48,8.48L106,158.48V192a6,6,0,0,0,12,0V144A6,6,0,0,0,112,138Z"}))],["regular",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"}))],["thin",Ct.createElement(Ct.Fragment,null,Ct.createElement("path",{d:"M210.83,50.83,153.66,108H192a4,4,0,0,1,0,8H144a4,4,0,0,1-4-4V64a4,4,0,0,1,8,0v38.34l57.17-57.17a4,4,0,1,1,5.66,5.66ZM112,140H64a4,4,0,0,0,0,8h38.34L45.17,205.17a4,4,0,0,0,5.66,5.66L108,153.66V192a4,4,0,0,0,8,0V144A4,4,0,0,0,112,140Z"}))]]);var ii=si.forwardRef((e,t)=>si.createElement(Le,{ref:t,...e,weights:xp}));ii.displayName="ArrowsInSimpleIcon";import*as ci from"react";import*as St from"react";var wp=new Map([["bold",St.createElement(St.Fragment,null,St.createElement("path",{d:"M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z"}))],["duotone",St.createElement(St.Fragment,null,St.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z",opacity:"0.2"}),St.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["fill",St.createElement(St.Fragment,null,St.createElement("path",{d:"M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z"}))],["light",St.createElement(St.Fragment,null,St.createElement("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"}))],["regular",St.createElement(St.Fragment,null,St.createElement("path",{d:"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z"}))],["thin",St.createElement(St.Fragment,null,St.createElement("path",{d:"M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z"}))]]);var li=ci.forwardRef((e,t)=>ci.createElement(Le,{ref:t,...e,weights:wp}));li.displayName="ArrowsOutSimpleIcon";import*as ui from"react";import*as xt from"react";var yp=new Map([["bold",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M241,150.65s0,0,0-.05a51.33,51.33,0,0,0-2.53-5.9L196.93,50.18a12,12,0,0,0-2.5-3.65,36,36,0,0,0-50.92,0A12,12,0,0,0,140,55V76H116V55a12,12,0,0,0-3.51-8.48,36,36,0,0,0-50.92,0,12,12,0,0,0-2.5,3.65L17.53,144.7A51.33,51.33,0,0,0,15,150.6s0,0,0,.05A52,52,0,1,0,116,168V100h24v68a52,52,0,1,0,101-17.35ZM80,62.28a12,12,0,0,1,12-1.22v63.15a51.9,51.9,0,0,0-35.9-7.62ZM64,196a28,28,0,1,1,28-28A28,28,0,0,1,64,196ZM164,61.06a12.06,12.06,0,0,1,12,1.22l23.87,54.31a51.9,51.9,0,0,0-35.9,7.62ZM192,196a28,28,0,1,1,28-28A28,28,0,0,1,192,196Z"}))],["duotone",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M104,168a40,40,0,1,1-40-40A40,40,0,0,1,104,168Zm88-40a40,40,0,1,0,40,40A40,40,0,0,0,192,128Z",opacity:"0.2"}),xt.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["fill",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M237.22,151.9l0-.1a1.42,1.42,0,0,0-.07-.22,48.46,48.46,0,0,0-2.31-5.3L193.27,51.8a8,8,0,0,0-1.67-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,8,8,0,0,0-1.67,2.44L21.2,146.28a48.46,48.46,0,0,0-2.31,5.3,1.72,1.72,0,0,0-.07.21s0,.08,0,.11a48,48,0,0,0,90.32,32.51,47.49,47.49,0,0,0,2.9-16.59V96h32v71.83a47.49,47.49,0,0,0,2.9,16.59,48,48,0,0,0,90.32-32.51Zm-143.15,27a32,32,0,0,1-60.2-21.71l1.81-4.13A32,32,0,0,1,96,167.88V168h0A32,32,0,0,1,94.07,178.94ZM203,198.07A32,32,0,0,1,160,168h0v-.11a32,32,0,0,1,60.32-14.78l1.81,4.13A32,32,0,0,1,203,198.07Z"}))],["light",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M233,147.24,191.43,52.6a6,6,0,0,0-1.25-1.83,30,30,0,0,0-42.42,0A6,6,0,0,0,146,55V82H110V55a6,6,0,0,0-1.76-4.25,30,30,0,0,0-42.42,0,6,6,0,0,0-1.25,1.83L23,147.24A46,46,0,1,0,110,168V94h36v74a46,46,0,1,0,87-20.76ZM64,202a34,34,0,1,1,34-34A34,34,0,0,1,64,202Zm0-80a45.77,45.77,0,0,0-18.55,3.92L75.06,58.54A18,18,0,0,1,98,57.71V137A45.89,45.89,0,0,0,64,122Zm94-64.28a18,18,0,0,1,22.94.83l29.61,67.37A45.9,45.9,0,0,0,158,137ZM192,202a34,34,0,1,1,34-34A34,34,0,0,1,192,202Z"}))],["regular",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M237.2,151.87v0a47.1,47.1,0,0,0-2.35-5.45L193.26,51.8a7.82,7.82,0,0,0-1.66-2.44,32,32,0,0,0-45.26,0A8,8,0,0,0,144,55V80H112V55a8,8,0,0,0-2.34-5.66,32,32,0,0,0-45.26,0,7.82,7.82,0,0,0-1.66,2.44L21.15,146.4a47.1,47.1,0,0,0-2.35,5.45v0A48,48,0,1,0,112,168V96h32v72a48,48,0,1,0,93.2-16.13ZM76.71,59.75a16,16,0,0,1,19.29-1v73.51a47.9,47.9,0,0,0-46.79-9.92ZM64,200a32,32,0,1,1,32-32A32,32,0,0,1,64,200ZM160,58.74a16,16,0,0,1,19.29,1l27.5,62.58A47.9,47.9,0,0,0,160,132.25ZM192,200a32,32,0,1,1,32-32A32,32,0,0,1,192,200Z"}))],["thin",xt.createElement(xt.Fragment,null,xt.createElement("path",{d:"M231.22,148.09,189.6,53.41a3.94,3.94,0,0,0-.83-1.22,28,28,0,0,0-39.6,0A4,4,0,0,0,148,55V84H108V55a4,4,0,0,0-1.17-2.83,28,28,0,0,0-39.6,0,3.94,3.94,0,0,0-.83,1.22L24.78,148.09A44,44,0,1,0,108,168V92h40v76a44,44,0,1,0,83.22-19.91ZM64,204a36,36,0,1,1,36-36A36,36,0,0,1,64,204Zm0-80a43.78,43.78,0,0,0-22.66,6.3L73.4,57.35a20,20,0,0,1,26.6-.59v86A44,44,0,0,0,64,124Zm92-67.23a20,20,0,0,1,26.6.59l32.06,72.94A43.92,43.92,0,0,0,156,142.74ZM192,204a36,36,0,1,1,36-36A36,36,0,0,1,192,204Z"}))]]);var mi=ui.forwardRef((e,t)=>ui.createElement(Le,{ref:t,...e,weights:yp}));mi.displayName="BinocularsIcon";import*as fi from"react";import*as wt from"react";var vp=new Map([["bold",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),wt.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",wt.createElement(wt.Fragment,null,wt.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]);var pi=fi.forwardRef((e,t)=>fi.createElement(Le,{ref:t,...e,weights:vp}));pi.displayName="CaretLeftIcon";import*as di from"react";import*as yt from"react";var Rp=new Map([["bold",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),yt.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",yt.createElement(yt.Fragment,null,yt.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]);var gi=di.forwardRef((e,t)=>di.createElement(Le,{ref:t,...e,weights:Rp}));gi.displayName="CaretRightIcon";import*as hi from"react";import*as vt from"react";var Pp=new Map([["bold",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"}))],["duotone",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z",opacity:"0.2"}),vt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"}))],["fill",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"}))],["light",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"}))],["regular",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"}))],["thin",vt.createElement(vt.Fragment,null,vt.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"}))]]);var Ii=hi.forwardRef((e,t)=>hi.createElement(Le,{ref:t,...e,weights:Pp}));Ii.displayName="CircleHalfIcon";import*as bi from"react";import*as Rt from"react";var Tp=new Map([["bold",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Rt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",Rt.createElement(Rt.Fragment,null,Rt.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]);var Ci=bi.forwardRef((e,t)=>bi.createElement(Le,{ref:t,...e,weights:Tp}));Ci.displayName="ClockCounterClockwiseIcon";import*as Si from"react";import*as Pt from"react";var Ep=new Map([["bold",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z"}))],["duotone",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),Pt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["fill",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z"}))],["light",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"}))],["regular",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"}))],["thin",Pt.createElement(Pt.Fragment,null,Pt.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z"}))]]);var Cn=Si.forwardRef((e,t)=>Si.createElement(Le,{ref:t,...e,weights:Ep}));Cn.displayName="FileTextIcon";import*as xi from"react";import*as Tt from"react";var Ap=new Map([["bold",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"}))],["duotone",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Tt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["fill",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["light",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"}))],["regular",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"}))],["thin",Tt.createElement(Tt.Fragment,null,Tt.createElement("path",{d:"M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"}))]]);var wi=xi.forwardRef((e,t)=>xi.createElement(Le,{ref:t,...e,weights:Ap}));wi.displayName="GlobeIcon";import*as yi from"react";import*as Et from"react";var Mp=new Map([["bold",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM212,173.44l-84,46-84-46V82.56l84-46,84,46Z"}))],["duotone",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M224,80.18v95.64a8,8,0,0,1-4.16,7l-88,48.18a8,8,0,0,1-7.68,0l-88-48.18a8,8,0,0,1-4.16-7V80.18a8,8,0,0,1,4.16-7l88-48.18a8,8,0,0,1,7.68,0l88,48.18A8,8,0,0,1,224,80.18Z",opacity:"0.2"}),Et.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM216,175.82,128,224,40,175.82V80.18L128,32h0l88,48.17Z"}))],["fill",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M232,80.18v95.64a16,16,0,0,1-8.32,14l-88,48.17a15.88,15.88,0,0,1-15.36,0l-88-48.17a16,16,0,0,1-8.32-14V80.18a16,16,0,0,1,8.32-14l88-48.17a15.88,15.88,0,0,1,15.36,0l88,48.17A16,16,0,0,1,232,80.18Z"}))],["light",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M222.72,67.91l-88-48.18a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.91ZM218,175.82a2,2,0,0,1-1,1.75l-88,48.18a2,2,0,0,1-1.92,0L39,177.57a2,2,0,0,1-1-1.75V80.18a2,2,0,0,1,1-1.75l88-48.18a2,2,0,0,1,1.92,0l88,48.18a2,2,0,0,1,1,1.75Z"}))],["regular",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM216,175.82,128,224,40,175.82V80.18L128,32h0l88,48.17Z"}))],["thin",Et.createElement(Et.Fragment,null,Et.createElement("path",{d:"M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM220,175.82a4,4,0,0,1-2.08,3.5l-88,48.18a4,4,0,0,1-3.84,0l-88-48.18a4,4,0,0,1-2.08-3.5V80.18a4,4,0,0,1,2.08-3.5l88-48.18a3.94,3.94,0,0,1,3.84,0l88,48.18a4,4,0,0,1,2.08,3.5Z"}))]]);var vi=yi.forwardRef((e,t)=>yi.createElement(Le,{ref:t,...e,weights:Mp}));vi.displayName="HexagonIcon";import*as Ri from"react";import*as At from"react";var kp=new Map([["bold",At.createElement(At.Fragment,null,At.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",At.createElement(At.Fragment,null,At.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),At.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",At.createElement(At.Fragment,null,At.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]);var Pi=Ri.forwardRef((e,t)=>Ri.createElement(Le,{ref:t,...e,weights:kp}));Pi.displayName="ImageIcon";import*as Ti from"react";import*as Mt from"react";var Lp=new Map([["bold",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),Mt.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",Mt.createElement(Mt.Fragment,null,Mt.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]);var Ei=Ti.forwardRef((e,t)=>Ti.createElement(Le,{ref:t,...e,weights:Lp}));Ei.displayName="PaletteIcon";import*as Ai from"react";import*as kt from"react";var Dp=new Map([["bold",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),kt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",kt.createElement(kt.Fragment,null,kt.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var Mi=Ai.forwardRef((e,t)=>Ai.createElement(Le,{ref:t,...e,weights:Dp}));Mi.displayName="PaperclipIcon";import*as ki from"react";import*as Lt from"react";var Fp=new Map([["bold",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Lt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",Lt.createElement(Lt.Fragment,null,Lt.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]);var Yn=ki.forwardRef((e,t)=>ki.createElement(Le,{ref:t,...e,weights:Fp}));Yn.displayName="PlusIcon";import*as Li from"react";import*as Dt from"react";var Op=new Map([["bold",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M220,48V88a12,12,0,0,1-24,0V77L164.77,108.2a12,12,0,0,1-17-17L179,60H168a12,12,0,0,1,0-24h40A12,12,0,0,1,220,48ZM208,156a12,12,0,0,0-12,12v11L56.49,39.51a12,12,0,0,0-17,17L179,196H168a12,12,0,0,0,0,24h40a12,12,0,0,0,12-12V168A12,12,0,0,0,208,156ZM91.23,147.8,39.51,199.51a12,12,0,0,0,17,17l51.71-51.72a12,12,0,0,0-17-17Z"}))],["duotone",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M48,48l80,80L48,208Zm80,80,80,80V48Z",opacity:"0.2"}),Dt.createElement("path",{d:"M216,48V88a8,8,0,0,1-16,0V67.31L156.28,111A8,8,0,0,1,145,99.72L188.69,56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48Zm-8,112a8,8,0,0,0-8,8v20.69L53.66,42.34A8,8,0,0,0,42.34,53.66L188.69,200H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["fill",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M216,48V88a8,8,0,0,1-13.66,5.66L188,79.31,156.28,111A8,8,0,0,1,145,99.72L176.69,68,162.34,53.66A8,8,0,0,1,168,40h40A8,8,0,0,1,216,48Zm-4.94,112.61a8,8,0,0,0-8.72,1.73L188,176.69,53.66,42.34A8,8,0,0,0,42.34,53.66L176.69,188l-14.35,14.34A8,8,0,0,0,168,216h40a8,8,0,0,0,8-8V168A8,8,0,0,0,211.06,160.61ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["light",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M214,48V88a6,6,0,0,1-12,0V62.48l-47.13,47.14a6,6,0,0,1-8.49-8.49L193.52,54H168a6,6,0,0,1,0-12h40A6,6,0,0,1,214,48Zm-6,114a6,6,0,0,0-6,6v25.52L52.24,43.76a6,6,0,0,0-8.48,8.48L193.52,202H168a6,6,0,0,0,0,12h40a6,6,0,0,0,6-6V168A6,6,0,0,0,208,162ZM101.13,146.38,43.76,203.76a6,6,0,1,0,8.48,8.48l57.38-57.37a6,6,0,0,0-8.49-8.49Z"}))],["regular",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M216,48V88a8,8,0,0,1-16,0V67.31L156.28,111A8,8,0,0,1,145,99.72L188.69,56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48Zm-8,112a8,8,0,0,0-8,8v20.69L53.66,42.34A8,8,0,0,0,42.34,53.66L188.69,200H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM99.72,145,42.34,202.34a8,8,0,0,0,11.32,11.32L111,156.28A8,8,0,0,0,99.72,145Z"}))],["thin",Dt.createElement(Dt.Fragment,null,Dt.createElement("path",{d:"M212,48V88a4,4,0,0,1-8,0V57.66L153.46,108.2a4,4,0,1,1-5.66-5.66L198.34,52H168a4,4,0,0,1,0-8h40A4,4,0,0,1,212,48Zm-4,116a4,4,0,0,0-4,4v30.34L50.83,45.17a4,4,0,0,0-5.66,5.66L198.34,204H168a4,4,0,0,0,0,8h40a4,4,0,0,0,4-4V168A4,4,0,0,0,208,164ZM102.54,147.8,45.17,205.17a4,4,0,0,0,5.66,5.66l57.37-57.37a4,4,0,1,0-5.66-5.66Z"}))]]);var Di=Li.forwardRef((e,t)=>Li.createElement(Le,{ref:t,...e,weights:Op}));Di.displayName="ShuffleSimpleIcon";import*as Fi from"react";import*as Ft from"react";var Np=new Map([["bold",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),Ft.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",Ft.createElement(Ft.Fragment,null,Ft.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var Uo=Fi.forwardRef((e,t)=>Fi.createElement(Le,{ref:t,...e,weights:Np}));Uo.displayName="XIcon";import{makeFunctionReference as er}from"convex/server";var _o={welcomeSuggestions:er("conversations:welcomeSuggestions"),workspace:er("conversations:workspace"),visitorProfile:er("conversations:visitorProfile"),openWebsite:er("conversations:openWebsite"),visitorConversations:er("conversations:visitorConversations"),customerMessages:er("conversations:customerMessages"),startCustomer:er("conversations:startCustomer"),sendCustomer:er("conversations:sendCustomer"),retryAgentResponse:er("conversations:retryAgentResponse"),generateAttachmentUploadUrl:er("conversations:generateAttachmentUploadUrl"),markCustomerRead:er("conversations:markCustomerRead")};import{useEffect as Px,useRef as Tx,useState as Hs}from"react";function Wa(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t};return}var Bp={};function Ot(e,t,o,r,n){if(!o&&!r&&!n&&!e)return Oi(t);let a=Oi(e);if(t)a=za(a,t);if(o)a=za(a,o);if(r)a=za(a,r);if(n)a=za(a,n);return a}function Hp(e){if(e.length===0)return Bp;if(e.length===1)return Oi(e[0]);let t=Oi(e[0]);for(let o=1;o<e.length;o+=1)t=za(t,e[o]);return t}function Oi(e){if(Up(e))return{...e(Bp)};return BI(e)}function za(e,t){if(Up(t))return t(e);return HI(e,t)}function BI(e){let t={...e};for(let o in t){let r=t[o];if(Vp(o,r))t[o]=_p(r)}return t}function HI(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=Wa(e.style,r);break}case"className":{e[o]=Pu(e.className,r);break}default:if(Vp(o,r))e[o]=VI(e[o],r);else e[o]=r}}return e}function Vp(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t==="function"||typeof t>"u")}function Up(e){return typeof e==="function"}function VI(e,t){if(!t)return e;if(!e)return _p(t);return(...o)=>{let r=o[0];if(Wp(r)){let a=r;Ga(a);let s=t(...o);if(!a.baseUIHandlerPrevented)e?.(...o);return s}let n=t(...o);return e?.(...o),n}}function _p(e){if(!e)return e;return(...t)=>{let o=t[0];if(Wp(o))Ga(o);return e(...t)}}function Ga(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Pu(e,t){if(t){if(e)return t+" "+e;return t}return e}function Wp(e){return e!=null&&typeof e==="object"&&"nativeEvent"in e}import*as Zr from"react";import*as Gp from"react";var zp={};function Xe(e,t){let o=Gp.useRef(zp);if(o.current===zp)o.current=e(t);return o}function Wo(e,t,o,r){let n=Xe($p).current;if(UI(n,e,t,o,r))qp(n,[e,t,o,r]);return n.callback}function Zp(e){let t=Xe($p).current;if(_I(t,e))qp(t,e);return t.callback}function $p(){return{callback:null,cleanup:null,refs:[]}}function UI(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function _I(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function qp(e,t){if(e.refs=t,t.every((o)=>o==null)){e.callback=null;return}e.callback=(o)=>{if(e.cleanup)e.cleanup(),e.cleanup=null;if(o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=a(o);if(typeof s==="function")r[n]=s;break}case"object":{a.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;switch(typeof a){case"function":{let s=r[n];if(typeof s==="function")s();else a(null);break}case"object":{a.current=null;break}default:}}}}}}import*as Xp from"react";import*as jp from"react";var WI=parseInt(jp.version,10);function Kn(e){return WI>=e}function Tu(e){if(!Xp.isValidElement(e))return null;let t=e,o=t.props;return(Kn(19)?o?.ref:t.ref)??null}function Ye(){}var Mr=Object.freeze([]),Ue=Object.freeze({});function Yp(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let a=t[r](n);if(a!=null)Object.assign(o,a);continue}if(n===!0)o[`data-${r.toLowerCase()}`]="";else if(n)o[`data-${r.toLowerCase()}`]=n.toString()}return o}function Kp(e,t){return typeof e==="function"?e(t):e}function Jp(e,t){return typeof e==="function"?e(t):e}import{createElement as Qp}from"react";function ve(e,t,o={}){let r=t.render;if(o.enabled!==!1)r=Za(r);let n=zI(t,o,r);if(o.enabled===!1)return null;let a=o.state??Ue;return $I(e,r,n,a)}function zI(e,t,o){let{className:r,style:n}=e,{state:a=Ue,ref:s,props:i,stateAttributesMapping:c,enabled:u=!0}=t,l=u?Kp(r,a):void 0,m=u?Jp(n,a):void 0,p=u?Yp(a,c):Ue,d=u&&i?GI(i):void 0,f=u?Wa(p,d)??{}:Ue;if(typeof document<"u")if(!u)Wo(null,null);else if(Array.isArray(s))f.ref=Zp([f.ref,Tu(o),...s]);else f.ref=Wo(f.ref,Tu(o),s);if(!u)return Ue;if(l!==void 0)f.className=Pu(f.className,l);if(m!==void 0)f.style=Wa(f.style,m);return f}function GI(e){if(Array.isArray(e))return Hp(e);return Ot(void 0,e)}var ZI=Symbol.for("react.lazy");function Za(e){if(e?.$$typeof!==ZI)return e;let t=Zr.Children.toArray(e)[0];return Zr.isValidElement(t)?t:e}function $I(e,t,o,r){if(t){if(typeof t==="function")return t(o,r);let n=Ot(o,t.props);return n.ref=o.ref,Zr.cloneElement(t,n)}return qI(e,o)}function qI(e,t){if(e==="button")return Qp("button",{type:"button",...t,key:t.key});if(e==="img")return Qp("img",{alt:"",...t,key:t.key});return Zr.createElement(e,t)}function Jn(e){return ve(e.defaultTagName??"div",e,e)}function ed(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=ed(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function td(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=ed(e))&&(r&&(r+=" "),r+=t);return r}var od=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,rd=td,ro=(e,t)=>(o)=>{var r;if((t===null||t===void 0?void 0:t.variants)==null)return rd(e,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className);let{variants:n,defaultVariants:a}=t,s=Object.keys(n).map((u)=>{let l=o===null||o===void 0?void 0:o[u],m=a===null||a===void 0?void 0:a[u];if(l===null)return null;let p=od(l)||od(m);return n[u][p]}),i=o&&Object.entries(o).reduce((u,l)=>{let[m,p]=l;if(p===void 0)return u;return u[m]=p,u},{}),c=t===null||t===void 0?void 0:(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:m,className:p,...d}=l;return Object.entries(d).every((f)=>{let[S,g]=f;return Array.isArray(g)?g.includes({...a,...i}[S]):{...a,...i}[S]===g})?[...u,m,p]:u},[]);return rd(e,s,c,o===null||o===void 0?void 0:o.class,o===null||o===void 0?void 0:o.className)};var Ir=(e,t=0)=>{let o=new Int32Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r)-48-t;return o},Ni=(e)=>{let t=new Int32Array(e.length+1);for(let o=0;o<e.length;o++)t[o+1]=t[o]+e[o];return t},$r=(e)=>{let t=new Int32Array(e.length),o=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r)-48;o+=n>>>1^-(n&1),t[r]=o}return t};var jI=[],Sn=Ni(Ir("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),XI=Ni(Ir(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));var YI=(()=>{let e=Sn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let a=1,s=n+1;for(let i=Sn[n];i<Sn[n+1];i++)a+=t[s],s+=t[s];t[n]=a}let o=new Int32Array(Sn[e]),r=0;for(let n=0;n<e;n++){let a=n+1;for(let s=Sn[n];s<Sn[n+1];s++)o[r++]=a,a+=t[a]}return o})(),KI=Ir("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),JI=Ni(Ir("123333359346463635126536711576")),QI=Ir("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),eb=Ir("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),tb=$r("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),ob=(()=>{let e=new Int32Array(319).fill(-1),t=$r("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),o=$r("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=o[r];return e})(),rb="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((e)=>{let t=e.split(" "),o=t.shift();for(let r=0;r<t.length;r++)t[r]=o+t[r];return t}),nd=$r("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),nb=$r("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),ab=$r("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),ad=new Int32Array(995),sd=new Int32Array(995),id=new Int32Array(995),Eu="",Au=new Int32Array(1038);{let e=new Map,t=0,o=0;for(let r=0;r<nd.length;r++)for(let n of rb[ab[r]]){let a=e.get(n);if(a===void 0)a=t++,e.set(n,a),Au[a*2]=Eu.length,Au[a*2+1]=n.length,Eu+=n;ad[o]=nd[r],sd[o]=nb[r],id[o]=a,o++}}var sb=$r("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),ib=Ni(Ir("1::24444432:442:44:44>222222:44:4421322511111311111114")),cb=$r("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),lb=Ir("ij"),ub=Ir(""),mb=Ir("1"),fb="* ** after backdrop before details-content file first-letter first-line marker placeholder selection",cd={GROUP_COUNT:384,customValidatorNames:jI,edgeStart:Sn,labelStart:XI,labelText:"@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",edgeTarget:YI,nodeGroup:KI,nodeVlist:ob,vlistPat:JI,vlistOps:QI,vlistRef:eb,vlistGroup:tb,litAnchor:ad,litGroup:sd,litPool:id,poolOffsets:Au,poolText:Eu,adjGid:sb,adjStart:ib,adjTgt:cb,patGid:lb,patTgt:ub,postfixLookupGroups:mb,orderSensitiveModifiers:fb};var pb="line"in Error();var Mu=(e,t,o)=>{let r=2166136261;for(let n=t;n<o;n++)r=Math.imul(r^e.charCodeAt(n),16777619);return r},Bi=(e,t,o)=>{let r=o-t,n=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,s=r>>1;n=Math.imul(n^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),n=Math.imul(n^e.charCodeAt(t+s)<<8^e.charCodeAt(t+s+a)<<16^e.charCodeAt(o-3),3266489909),n^=e.charCodeAt(o-2)<<8^e.charCodeAt(o-1)<<16;for(let i=t+3,c=o-4;i<t+8&&i<c;i++,c--)n=Math.imul(n^e.charCodeAt(i)^e.charCodeAt(c)<<8,16777619)}return n^n>>>15|0},ld=(e,t,o={})=>{let{GROUP_COUNT:r,edgeStart:n,labelStart:a,labelText:s,edgeTarget:i,nodeGroup:c,nodeVlist:u,vlistPat:l,vlistOps:m,vlistRef:p,vlistGroup:d,litAnchor:f,litGroup:S,litPool:g,poolOffsets:h,poolText:x,adjGid:b,adjStart:C,adjTgt:I,patGid:y,patTgt:w,postfixLookupGroups:v,customValidatorNames:R,orderSensitiveModifiers:L}=e,U=new Int32Array(r).fill(-1);for(let F=0;F<b.length;F++)U[b[F]]=F;let E=0;for(let F=0;F+1<C.length;F++){let q=C[F+1]-C[F];if(q>E)E=q}let O=32;while(O<2*(1+E+y.length))O<<=1;let k=new Int32Array(p.length+1);for(let F=0;F<p.length;F++)k[F+1]=k[F]+l[p[F]+1]-l[p[F]];let P=new Uint8Array(r);for(let F=0;F<v.length;F++)P[v[F]]=1;let N=n.length-1,j=new Uint8Array(N),T=0,B=!0;for(let F=0;F<f.length;F++){j[f[F]]=1;let q=h[g[F]*2+1];if(q>T)T=q;let ae=x.charCodeAt(h[g[F]*2]);if(ae===91||ae===40)B=!1}let W=1;while(W<f.length*2)W<<=1;let X=new Int32Array(W).fill(-1);for(let F=0;F<f.length;F++){let q=h[g[F]*2],ae=(Mu(x,q,q+h[g[F]*2+1])^Math.imul(f[F],2654435761)|0)&W-1;while(X[ae]!==-1)ae=ae+1&W-1;X[ae]=F}let A=(F,q,ae,Te)=>{let _e=(Mu(q,ae,Te)^Math.imul(F,2654435761)|0)&W-1,Be=Te-ae;for(;;){let Ke=X[_e];if(Ke===-1)return-1;if(f[Ke]===F&&h[g[Ke]*2+1]===Be){let It=h[g[Ke]*2],tt=!0;for(let Oe=0;Oe<Be;Oe++)if(x.charCodeAt(It+Oe)!==q.charCodeAt(ae+Oe)){tt=!1;break}if(tt)return S[Ke]}_e=_e+1&W-1}},ue=o.cacheSize??8192,V=o.prefix??e.prefix??"",G=V===""?"":V+":",Z=G.length,ee=(R??[]).map((F)=>{let q=t&&t[F];if(!q)throw Error("cn: missing validator "+F);return q}),Pe=/\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$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,me=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fe=0,be=-1,ne=-1,we=-1,Ce=-1,De=(F)=>F>=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===95,Q=(F)=>/\s/.test(String.fromCharCode(F)),H=(F,q,ae)=>{if(fe=0,be=-1,ae-q<3)return;let Te=F.charCodeAt(q),_e=F.charCodeAt(ae-1);if(Te===91&&_e===93)fe=1;else if(Te===40&&_e===41)fe=2;else return;we=q+1,Ce=ae-1;let Be=q+1;if(De(F.charCodeAt(Be))){Be++;while(Be<ae-1){let Ke=F.charCodeAt(Be);if(!De(Ke)&&Ke!==45)break;Be++}if(Be<ae-2&&F.charCodeAt(Be)===58)be=q+1,ne=Be,we=Be+1}},Y=(F,q,ae,Te)=>{if(ae-q!==Te.length)return!1;for(let _e=0;_e<Te.length;_e++)if(F.charCodeAt(q+_e)!==Te.charCodeAt(_e))return!1;return!0},D=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,de=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K=(F)=>!!F&&!Number.isNaN(Number(F)),pe=(F,q,ae)=>{if(ae-q<11||!Y(F,q,q+10,"@container"))return!1;if(F.charCodeAt(q+10)===47)return ae-q>=12;let Te=F.charCodeAt(q+11);return Te===115&&ae-q>=17&&Y(F,q+10,q+16,"-size/")||Te===110&&ae-q>=19&&Y(F,q+10,q+18,"-normal/")},M=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],_="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map((F)=>F.split(" ")),Se=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],J=(F,q,ae,Te)=>{if(F>=10){if(F>=25)return ee[F-25](q.slice(ae,Te));let _e=F-10;if(fe!==M[_e])return!1;if(be>=0){for(let Be of _[_e])if(Y(q,be,ne,Be))return!0;return!1}switch(Se[_e]){case 0:return!1;case 1:return!0;case 2:{let Be=q.slice(we,Ce);return Pe.test(Be)&&!te.test(Be)}case 3:return K(q.slice(we,Ce));case 4:return me.test(q.slice(we,Ce));default:return ie.test(q.slice(we,Ce))}}switch(F){case 0:return!0;case 1:return fe===0;case 2:return fe===1;case 3:return fe===2;case 4:return D.test(q.slice(ae,Te));case 5:return K(q.slice(ae,Te));case 6:{let _e=q.slice(ae,Te);return!!_e&&Number.isInteger(Number(_e))}case 7:return Te>ae&&q.charCodeAt(Te-1)===37&&K(q.slice(ae,Te-1));case 8:return de.test(q.slice(ae,Te));default:return pe(q,ae,Te)}},se=new Set(typeof L==="string"?L.split(" "):L),ge=(F,q,ae,Te,_e,Be)=>{let Ke=Mu(q,ae,Te)^(_e?2654435769:0)|0,It=F.get(Ke);if(It!==void 0)e:for(let ze=0;ze<It.length;ze++){let et=It[ze];if(et.imp!==_e||et.k.length!==Te-ae)continue;for(let Xt=0;Xt<et.k.length;Xt++)if(et.k.charCodeAt(Xt)!==q.charCodeAt(ae+Xt))continue e;return et.id}else F.set(Ke,It=[]);let tt=q.slice(ae,Te),Oe=Be(tt);return It.push({k:tt,imp:_e,id:Oe}),Oe},he=new Map,Ie=new Map,Ne=2,Qe=4096,gt=(F,q)=>{let ae=[],Te=0,_e=0,Be=0;for(let Oe=0;Oe<F.length;Oe++){let ze=F.charCodeAt(Oe);if(Te===0&&_e===0&&ze===58)ae.push(F.slice(Be,Oe)),Be=Oe+1;else if(ze===91)Te++;else if(ze===93)Te--;else if(ze===40)_e++;else if(ze===41)_e--}ae.push(F.slice(Be));let Ke=ae[0];if(ae.length>1){let Oe=[],ze=[];for(let et of ae)if(et.charCodeAt(0)===91||se.has(et)){if(ze.length)Oe.push(...ze.sort()),ze=[];Oe.push(et)}else ze.push(et);if(ze.length)Oe.push(...ze.sort());Ke=Oe.join(":")}let It=q?Ke+" !":Ke,tt=Ie.get(It);if(tt===void 0)Ie.set(It,tt=Ne++);return tt},bo=new Map,Co=r,Yo=r+4096,oo=()=>Co++,Kt=2097152,yo=8192,To=new Int32Array(yo),uo=Array(yo).fill(null),fn=new Int32Array(yo),pn=new Int32Array(yo),$e=new Uint8Array(yo),Zt=0,ye=(F,q,ae,Te,_e,Be,Ke,It)=>{let tt=F;if(uo[F]!==null)if(uo[F|1]===null)tt=F|1;else if((Zt++&3)===0)tt=F|Zt>>2&1;else return;uo[tt]=q.slice(ae,Te),To[tt]=_e,fn[tt]=Be,pn[tt]=Ke,$e[tt]=It},Me=()=>uo.fill(null),We=256,$t=[new Int32Array(We),new Int32Array(We),new Int32Array(We),new Int32Array(We)],[Jt,So,jt,Eo]=$t,Ko=new Uint8Array(We),No=new Uint8Array(We),$n=()=>{We*=2,$t=$t.map((q)=>{let ae=new Int32Array(We);return ae.set(q),ae}),[Jt,So,jt,Eo]=$t;let F=new Uint8Array(We);F.set(Ko),Ko=F,No=new Uint8Array(We)},pr=64,dn=new Int32Array(pr),gn=new Int32Array(pr),uu=new Int32Array(r),Ur=2048,mp=21,mu=new Float64Array(Ur),Xs=new Int32Array(Ur),_r=0,fu=(F,q)=>{if(F===0&&q<r){if(uu[q]===_r)return 1;return uu[q]=_r,0}let ae=F*2097152+q+1,Te=Math.imul(ae,2654435761)>>>mp;for(;;){if(Xs[Te]!==_r)break;if(mu[Te]===ae)return 1;Te=Te+1&Ur-1}return mu[Te]=ae,Xs[Te]=_r,0},Ys=(F,q,ae,Te,_e)=>{if(ae-q>=2&&F.charCodeAt(q)===91&&F.charCodeAt(ae-1)===93){let Be=-1;for(let Ke=q+1;Ke<ae-1;Ke++)if(F.charCodeAt(Ke)===58){Be=Ke;break}if(Be===-1||Be===q+1)return-1;return ge(bo,F,q+1,Be,0,oo)}if(Te>=0&&c[Te]>=0)return c[Te];for(let Be=_e-1;Be>=0;Be--){let Ke=gn[Be];if(Ke>ae)continue;let It=dn[Be],tt=ae-Ke;if(j[It]===1&&tt>0&&tt<=T){let Qt=F.charCodeAt(Ke);if(B===!1||Qt!==91&&Qt!==40){let zr=A(It,F,Ke,ae);if(zr>=0)return zr}}let Oe=u[It];if(Oe<0)continue;let ze=p[Oe],et=l[ze],Xt=l[ze+1];if(et===Xt)continue;H(F,Ke,ae);let mo=k[Oe]-et;for(let Qt=et;Qt<Xt;Qt++)if(J(m[Qt],F,Ke,ae))return d[mo+Qt]}return-1},Ks=(F)=>{let q=F.length,ae=0,Te=0,_e=!1;if(Ne>Qe||he.size>Qe)he=new Map,Ie=new Map,Ne=2,Me();if(Co>Yo)bo=new Map,Co=r,Me();let Be=0;while(Be<q){let Oe=F.charCodeAt(Be);if(Oe===32||Oe>=9&&Oe<=13||Oe>=160&&Q(Oe)){if(Oe!==32)_e=!0;Be++;continue}let ze=Be,et=0;while(Be<q){if(Oe=F.charCodeAt(Be),Oe<=32){if(Oe===32)break;if(Oe>=9&&Oe<=13){_e=!0;break}}else if(Oe>=160&&Q(Oe)){_e=!0;break}et=Math.imul(et^Oe,16777619),Be++}let Xt=Be,mo=Xt-ze;if(ae===We)$n();let Qt=ae++;Jt[Qt]=ze,So[Qt]=Xt,Te+=mo,et^=Math.imul(mo,2654435761);let zr=et^et>>>15|0,dr=zr&8190;{let at=-1;if(To[dr]===zr&&uo[dr]!==null&&uo[dr].length===mo)at=dr;else if(To[dr|1]===zr&&uo[dr|1]!==null&&uo[dr|1].length===mo)at=dr|1;if(at>=0){let Qo=uo[at],Er=!0;for(let Ar=0;Ar<mo;Ar++)if(Qo.charCodeAt(Ar)!==F.charCodeAt(ze+Ar)){Er=!1;break}if(Er){jt[Qt]=fn[at],Eo[Qt]=pn[at],Ko[Qt]=$e[at];continue}}}let jn=ze;if(Z!==0){if(Xt-ze<=Z||!F.startsWith(G,ze)){jt[Qt]=-1,ye(dr,F,ze,Xt,zr,-1,0,0);continue}jn=ze+Z}let du=0,gu=0,Ua=-1,hu=-1;for(let at=jn;at<Xt;at++){let Qo=F.charCodeAt(at);if(du===0&&gu===0){if(Qo===58){Ua=at;continue}if(Qo===47){hu=at;continue}}if(Qo===91)du++;else if(Qo===93)du--;else if(Qo===40)gu++;else if(Qo===41)gu--}let dp=Ua>=jn?Ua+1:jn,Bo=dp,Ho=Xt,_a=!1,gp=0;if(Ho>Bo&&F.charCodeAt(Ho-1)===33)_a=!0,Ho--;else if(Ho>Bo&&F.charCodeAt(Bo)===33)_a=!0,Bo++,gp=1;let hn=-1;if(hu>dp){if(hn=hu+gp,hn>=Ho)hn=-1}let Iu=Bo;if(Ho-Bo>1&&F.charCodeAt(Bo)===45)Iu=Bo+1;let gr=0,Gr=0,Xn=0,hp=-1,hr=0;if(u[0]>=0||j[0]===1)dn[0]=0,gn[0]=Iu,hr=1;let bu=-1,Cu=0;for(let at=Iu;at<Ho;at++){if(at===hn)bu=Gr<Xn?-1:gr,Cu=hr;if(gr!==-1){let Qo=F.charCodeAt(at),Er=-1;if(Gr<Xn)if(s.charCodeAt(Gr)===Qo){if(Gr++,Gr===Xn)Er=gr=hp}else gr=-1;else{let Ar=n[gr],oi=n[gr+1],yu=-1;for(let In=Ar;In<oi;In++){let vu=a[In];if(s.charCodeAt(vu)===Qo){if(a[In+1]-vu===1)Er=yu=i[In];else Gr=vu+1,Xn=a[In+1],hp=i[In],yu=gr;break}}gr=yu}if(Er>=0&&(u[Er]>=0||j[Er]===1)&&at+1<Ho&&F.charCodeAt(at+1)===45){if(hr===pr){pr*=2;let Ar=new Int32Array(pr);Ar.set(dn),dn=Ar;let oi=new Int32Array(pr);oi.set(gn),gn=oi}dn[hr]=Er,gn[hr]=at+2,hr++}}}if(hn===Ho)bu=Gr<Xn?-1:gr,Cu=hr;let Su=Gr<Xn?-1:gr,Vo,ti=!1;if(hn>=0){if(ti=!0,Vo=Ys(F,Bo,hn,bu,Cu),Vo!==-1&&Vo<r&&P[Vo]){let at=Ys(F,Bo,Ho,Su,hr);if(at!==-1&&at!==Vo)Vo=at,ti=!1}else if(Vo===-1)Vo=Ys(F,Bo,Ho,Su,hr),ti=!1}else Vo=Ys(F,Bo,Ho,Su,hr);let xu=0,wu=0;if(Vo===-1)jt[Qt]=-1;else wu=ti?1:0,xu=jn>=Ua?_a?1:0:ge(he,F,jn,Ua,_a?1:0,(at)=>gt(at,_a)),jt[Qt]=Vo,Ko[Qt]=wu,Eo[Qt]=xu;ye(dr,F,ze,Xt,zr,Vo,xu,wu)}if(ae===0)return"";if(ae===1)return Jt[0]===0&&So[0]===q?F:F.slice(Jt[0],So[0]);if(ae*O>Ur){while(ae*O>Ur)Ur<<=1,mp--;mu=new Float64Array(Ur),Xs=new Int32Array(Ur)}if(Ne>=Kt||Co>=Kt)throw Error("cn: too many distinct classes in one merge");if(_r=_r+1|0,_r===0)uu.fill(0),Xs.fill(0),_r=1;let Ke=!1;for(let Oe=ae-1;Oe>=0;Oe--){let ze=jt[Oe];if(ze===-1){No[Oe]=1;continue}let et=Eo[Oe];if(fu(et,ze)===1){No[Oe]=0,Ke=!0;continue}if(No[Oe]=1,ze<r){let Xt=U[ze];if(Xt>=0)for(let mo=C[Xt];mo<C[Xt+1];mo++)fu(et,I[mo]);if(Ko[Oe]&1){for(let mo=0;mo<y.length;mo++)if(y[mo]===ze)fu(et,w[mo])}}}if(!Ke&&!_e&&q===Te+ae-1)return F;let It="",tt=0;while(tt<ae){if(!No[tt]){tt++;continue}let Oe=Jt[tt],ze=So[tt],et=tt+1;while(et<ae&&No[et]&&Jt[et]===ze+1&&F.charCodeAt(ze)===32)ze=So[et],et++;if(It.length>0)It+=" ";It+=F.slice(Oe,ze),tt=et}return It},Wr=16384,Tr=new Int32Array(Wr*2),Js=0,Jo=1,Ha=Object.create(null),fp=Object.create(null),qn=new Map,pp=new Map,Qs=0,ei=0,Va=()=>{Js^=Wr,Jo=Jo+1|0,ei=0},vI=(F)=>{let q=Ha[F];if(q!==void 0)return q;let ae=Bi(F,0,F.length),Te=(ae&16383)+Js,_e=Tr[Te]===(ae^Jo)||Tr[Te^Wr]===(ae^Jo-1);if(_e){if(q=fp[F],q!==void 0)return Ha[F]=q,q}if(q=Ks(F),_e){if(Ha[F]=q,++Qs>ue)Qs=0,fp=Ha,Ha=Object.create(null),Va()}else if(Tr[Te]=ae^Jo,++ei>Wr)Va();return q},RI=(F)=>{let q=qn.get(F);if(q!==void 0)return q;let ae=Bi(F,0,F.length),Te=(ae&16383)+Js,_e=Tr[Te]===(ae^Jo)||Tr[Te^Wr]===(ae^Jo-1);if(_e){if(q=pp.get(F),q!==void 0)return qn.set(F,q),q}if(q=Ks(F),_e){if(qn.set(F,q),++Qs>ue)Qs=0,pp=qn,qn=new Map,Va()}else if(Tr[Te]=ae^Jo,++ei>Wr)Va();return q},PI=(F)=>{let q=Bi(F,0,F.length),ae=(q&16383)+Js;if(Tr[ae]===(q^Jo)||Tr[ae^Wr]===(q^Jo-1))return!0;if(Tr[ae]=q^Jo,++ei>Wr)Va();return!1},pu=ue===0?Ks:pb?(F)=>{let q=qn.get(F);return q!==void 0?q:RI(F)}:vI;return{merge:function(){return arguments.length===1&&typeof arguments[0]==="string"?pu(arguments[0]):pu(ud.apply(null,arguments))},mergeString:pu,seenBefore:ue===0?()=>!1:PI,mergeUncached:Ks}},Hi=(e,t)=>{if(!e)return"";if(typeof e==="string")return e;let o="";if(typeof e.length==="number"&&(t?Array.isArray(e):!0)){let r=e;for(let n=0;n<r.length;n++){let a=r[n];if(!a)continue;let s=typeof a==="string"?a:Hi(a,t);if(s){if(o)o+=" ";o+=s}}return o}if(t){if(typeof e==="number")return""+e;if(typeof e==="object"){for(let r in e)if(e[r]){if(o)o+=" ";o+=r}}}return o},db=(e,t)=>{let o="";for(let r=0;r<e.length;r++){let n=e[r];if(!n)continue;let a=typeof n==="string"?n:Hi(n,t);if(a){if(o)o+=" ";o+=a}}return o},ud=function(){return db(arguments,!1)};var md=(e,t)=>{let o=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,n=new Map,a=new Map,s=0,i=null,c=null,u=[],l=[],m=0,p=(h,x,b)=>{if(c===null)c=Array(4096).fill(""),u=Array(4096).fill(""),l=Array(4096).fill("");let C=Bi(h,0,h.length)&4094;if(c[C]===h&&u[C]===x)return l[C];if(c[C|1]===h&&u[C|1]===x)return l[C|1];let I=e(b?x+" "+h:h),y=c[C]===""?C:C|(c[C|1]===""?1:m++&1);return c[y]=h,u[y]=x,l[y]=I,I},d=(h,x,b,C)=>{let I=0;if(x){if(x!==h.a0)return!1;I=1}if(b){if(b!==(I===0?h.a0:h.a1))return!1;I++}if(C){if(C!==(I===0?h.a0:I===1?h.a1:h.a2))return!1;I++}return I===h.t},f=(h,x)=>{let b=h.a,C=0;for(let I=0;I<x.length;I++){let y=x[I];if(!y)continue;if(y!==b[C])return!1;C++}return C===h.t},S=(h,x)=>{let b=h.length,C=i===null?null:i.n;if(!x){if(C!==null&&f(C,h))return i=C,C.r;if(i!==null&&i!==C&&f(i,h))return i.r}let I="",y=-1,w=0,v=!1;for(let U=0;U<b;U++){let E=h[U];if(!E)continue;if(typeof E!=="string"){if(E=h[U]=Hi(E,!0),!E)continue;v=!0}if(y<0)I=E,y=U;w++}if(w===0)return"";if(w===1)return e(I);if(v){if(C!==null&&f(C,h))return i=C,C.r;if(i!==null&&i!==C&&f(i,h))return i.r}let R=n.get(I);if(R===void 0){if(R=a.get(I),R!==void 0)n.set(I,R)}let L=null;if(R!==void 0){if(R.skip>0){R.skip--,i=null;let E=I;for(let O=y+1;O<b;O++){let k=h[O];if(k)E+=" "+k}return p(E,"",!1)}let U=R.e;e:for(let E=0;E<U.length;E++){let O=U[E];if(O.t!==w)continue;let k=O.a,P=1;for(let N=y+1;N<b;N++){let j=h[N];if(j&&j!==k[P++])continue e}L=O;break}if(L!==null)R.miss=0}if(L===null){let U=I,E=[I];for(let k=y+1;k<b;k++){let P=h[k];if(!P)continue;U+=" "+P,E.push(P)}if(!o(U))return r(U);if(L={r:e(U),t:E.length,a0:E[0],a1:E[1],a2:E[2]??"",a:E,n:null},R===void 0)n.set(I,R={e:[],miss:0,skip:0,at:0});else if(++R.miss>16)R.miss=16,R.skip=1024,R.e.length=0,R.at=0;let O=R.e;if(O.length<256)O.push(L);else O[R.at]=L,R.at=R.at+1&255;if(++s>1000)s=0,a=n,n=new Map}if(i!==null&&i!==L)i.n=L;return i=L,L.r},g=(h)=>Array.isArray(h)?S(h.slice(),!1):e(Hi(h,!0));return function(h,x,b){let C=arguments.length;if((C|1)===3){let w=i;if(w!==null){let v=w.n;if(v!==null&&d(v,h,x,b))return i=v,v.r;if(w!==v&&d(w,h,x,b))return w.r}if(C===2&&typeof x==="string"&&x!==""){let v=n.get(h);if(v!==void 0&&v.skip>0)return v.skip--,i=null,p(x,h,!0)}return S([h,x,b],!0)}if(C===1)return typeof h==="string"?e(h):g(h);let I=i;if(I!==null){let w=I.n;if(w!==null){let v=w.a,R=0,L=!0;for(let U=0;U<C;U++){let E=arguments[U];if(!E)continue;if(E!==v[R]){L=!1;break}R++}if(L&&R===w.t)return i=w,w.r}if(I!==w){let v=I.a,R=0,L=!0;for(let U=0;U<C;U++){let E=arguments[U];if(!E)continue;if(E!==v[R]){L=!1;break}R++}if(L&&R===I.t)return I.r}}let y=[];for(let w=0;w<C;w++)y.push(arguments[w]);return S(y,!0)}};var ku=ld(cd),ce=md(ku.mergeString,ku),tVe=ku.merge;import*as bd from"react";import*as ta from"react";function Vi(){return typeof window<"u"}function Nt(e){if(Ui(e))return(e.nodeName||"").toLowerCase();return"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function br(e){var t;return(t=(Ui(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ui(e){if(!Vi())return!1;return e instanceof Node||e instanceof qe(e).Node}function Ve(e){if(!Vi())return!1;return e instanceof Element||e instanceof qe(e).Element}function je(e){if(!Vi())return!1;return e instanceof HTMLElement||e instanceof qe(e).HTMLElement}function tr(e){if(!Vi()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}function wn(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=no(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function fd(e){return/^(table|td|th)$/.test(Nt(e))}function $a(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var gb=/transform|translate|scale|rotate|perspective|filter/,hb=/paint|layout|strict|content/,xn=(e)=>!!e&&e!=="none",Lu;function _i(e){let t=Ve(e)?no(e):e;return xn(t.transform)||xn(t.translate)||xn(t.scale)||xn(t.rotate)||xn(t.perspective)||!Wi()&&(xn(t.backdropFilter)||xn(t.filter))||gb.test(t.willChange||"")||hb.test(t.contain||"")}function pd(e){let t=zo(e);while(je(t)&&!Go(t)){if(_i(t))return t;else if($a(t))return null;t=zo(t)}return null}function Wi(){if(Lu==null)Lu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return Lu}function Go(e){return/^(html|body|#document)$/.test(Nt(e))}function no(e){return qe(e).getComputedStyle(e)}function qa(e){if(Ve(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zo(e){if(Nt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||tr(e)&&e.host||br(e);return tr(t)?t.host:t}function dd(e){let t=zo(e);if(Go(t))return(e.ownerDocument||e).body;if(je(t)&&wn(t))return t;return dd(t)}function qr(e,t,o){var r;if(t===void 0)t=[];if(o===void 0)o=!0;let n=dd(e),a=n===((r=e.ownerDocument)==null?void 0:r.body),s=qe(n);if(a){let i=zi(s);return t.concat(s,s.visualViewport||[],wn(n)?n:[],i&&o?qr(i):[])}else return t.concat(n,qr(n,[],o))}function zi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}import*as Ib from"react";var ja={...Ib};var Du=ja.useInsertionEffect,bb=Du&&Du!==ja.useLayoutEffect?Du:(e)=>e();function re(e){let t=Xe(Cb).current;return t.next=e,bb(t.effect),t.trampoline}function Cb(){let e={next:void 0,callback:Sb,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Sb(){}import*as gd from"react";var xb=()=>{},z=typeof document<"u"?gd.useLayoutEffect:xb;function wb(e,t){return function(r,...n){let a=new URL(e);return a.searchParams.set("code",r.toString()),n.forEach((s)=>a.searchParams.append("args[]",s)),`${t} error #${r}; visit ${a} for the full message.`}}var yb=wb("https://base-ui.com/production-error","Base UI"),Ge=yb;import*as Gi from"react";var vb=Gi.createContext(void 0);function Qn(e=!1){let t=Gi.useContext(vb);if(t===void 0&&!e)throw Error(Ge(16));return t}import*as hd from"react";function Id(e){let{focusableWhenDisabled:t,disabled:o,composite:r=!1,tabIndex:n=0,isNativeButton:a}=e,s=r&&t!==!1,i=r&&t===!1;return{props:hd.useMemo(()=>{let u={onKeyDown(l){if(o&&t&&l.key!=="Tab")l.preventDefault()}};if(!r){if(u.tabIndex=n,!a&&o)u.tabIndex=t?n:-1}if(a&&(t||s)||!a&&o)u["aria-disabled"]=o;if(a&&(!t||i))u.disabled=o;return u},[r,o,t,s,i,a,n])}}function Ee(e){return e?.ownerDocument||document}function ea(e,t,{detail:o=0,pointerType:r=""}={}){e.dispatchEvent(new(qe(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:o,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function xo(e={}){let{disabled:t=!1,focusableWhenDisabled:o,tabIndex:r=0,native:n=!0,composite:a}=e,s=ta.useRef(null),i=Qn(!0),c=a??i!==void 0,{props:u}=Id({focusableWhenDisabled:o,disabled:t,composite:c,tabIndex:r,isNativeButton:n}),l=ta.useCallback(()=>{let d=s.current;if(!Fu(d))return;if(c&&t&&u.disabled===void 0&&d.disabled)d.disabled=!1},[t,u.disabled,c]);z(l,[l]);let m=ta.useCallback((d={})=>{let{onClick:f,onMouseDown:S,onKeyUp:g,onKeyDown:h,onPointerDown:x,...b}=d;return Ot({onClick(C){if(t){C.preventDefault();return}f?.(C)},onMouseDown(C){if(!t)S?.(C)},onKeyDown(C){if(t)return;if(Ga(C),h?.(C),C.baseUIHandlerPrevented)return;let I=C.target===C.currentTarget,y=C.currentTarget,w=Fu(y),v=!n&&Rb(y),R=I&&(n?w:!v),L=C.key==="Enter",U=C.key===" ",E=y.getAttribute("role"),O=E?.startsWith("menuitem")||E==="option"||E==="gridcell";if(I&&c&&U){if(C.defaultPrevented&&O)return;if(C.preventDefault(),!n||w)C.preventBaseUIHandler(),ea(y,C);return}if(!R||n||!U&&!L){if(I&&v&&U)C.preventDefault();return}if(C.defaultPrevented)return;if(C.preventDefault(),L)C.preventBaseUIHandler(),ea(y,C)},onKeyUp(C){if(t)return;if(Ga(C),g?.(C),C.target===C.currentTarget&&n&&c&&Fu(C.currentTarget)&&C.key===" "){C.preventDefault();return}if(C.baseUIHandlerPrevented)return;if(C.target===C.currentTarget&&!n&&!c&&!C.defaultPrevented&&C.key===" ")C.preventBaseUIHandler(),ea(C.currentTarget,C)},onPointerDown(C){if(t){C.preventDefault();return}x?.(C)}},n?{type:"button"}:{role:"button"},u,b)},[t,u,c,n]),p=re((d)=>{s.current=d,l()});return{getButtonProps:m,buttonRef:p}}function Fu(e){return je(e)&&e.tagName==="BUTTON"}function Rb(e){return je(e)&&e.tagName==="A"&&Boolean(e.href)}var Ou=bd.forwardRef(function(t,o){let{render:r,className:n,disabled:a=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:c,...u}=t,{getButtonProps:l,buttonRef:m}=xo({disabled:a,focusableWhenDisabled:s,native:i});return ve("button",t,{state:{disabled:a},ref:[o,m],props:[u,l]})});import{jsx as Tb}from"react/jsx-runtime";var Pb=ro("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function mt({className:e,variant:t="default",size:o="default",...r}){return Tb(Ou,{"data-slot":"button",className:ce(Pb({variant:t,size:o,className:e})),...r})}import{jsx as jr}from"react/jsx-runtime";var Eb=ro("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",{variants:{size:{default:"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",sm:"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",xs:"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"},orientation:{horizontal:"min-w-40 items-center",vertical:"w-24 flex-col has-data-[slot=attachment-content]:w-30"}}});function oa({className:e,state:t="done",size:o="default",orientation:r="horizontal",...n}){return jr("div",{"data-slot":"attachment","data-state":t,"data-size":o,"data-orientation":r,className:ce(Eb({size:o,orientation:r}),e),...n})}var Ab=ro("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",{variants:{variant:{icon:"",image:"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"}},defaultVariants:{variant:"icon"}});function Xa({className:e,variant:t="icon",...o}){return jr("div",{"data-slot":"attachment-media","data-variant":t,className:ce(Ab({variant:t}),e),...o})}function Ya({className:e,...t}){return jr("div",{"data-slot":"attachment-content",className:ce("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",e),...t})}function Ka({className:e,...t}){return jr("span",{"data-slot":"attachment-title",className:ce("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",e),...t})}function Ja({className:e,...t}){return jr("span",{"data-slot":"attachment-description",className:ce("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80","max-w-full",e),...t})}function Zi({className:e,...t}){return jr("div",{"data-slot":"attachment-actions",className:ce("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",e),...t})}function Cd({className:e,variant:t,size:o="icon-xs",...r}){return jr(mt,{"data-slot":"attachment-action",variant:t??"ghost",size:o,className:ce(e),...r})}function $i({className:e,...t}){return jr("div",{"data-slot":"attachment-group",className:ce("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",e),...t})}import*as qi from"react";var Nu=qi.createContext(void 0);function Sd(e){let t=qi.useContext(Nu);if(t===void 0&&!e)throw Error(Ge(33));return t}import*as ji from"react";var Qa=ji.createContext(void 0);function vo(e){let t=ji.useContext(Qa);if(t===void 0&&!e)throw Error(Ge(36));return t}var yn="data-starting-style",es="data-ending-style";var Mb={[yn]:""},kb={[es]:""},Xr={transitionStatus(e){if(e==="starting")return Mb;if(e==="ending")return kb;return null}};var Bu="data-open",Hu="data-closed",Lb=yn,Db=es,xd="data-anchor-hidden";var Yi="data-popup-open",yd="data-pressed";var Fb={[Yi]:""},Ob={[Yi]:"",[yd]:""},Nb={[Bu]:""},Bb={[Hu]:""},Hb={[xd]:""},Ki={open(e){if(e)return Fb;return null}},Vu={open(e){if(e)return Ob;return null}},vn={open(e){if(e)return Nb;return Bb},anchorHidden(e){if(e)return Hb;return null}},ra={...vn,...Xr};import*as Ji from"react";var Vb=Ji.createContext(void 0);function na(e=!0){let t=Ji.useContext(Vb);if(t===void 0&&!e)throw Error(Ge(25));return t}var Rn="none",aa="trigger-press",Yt="trigger-hover",sa="trigger-focus",Uu="outside-press",_u="item-press",Ub="close-press";var ia="focus-out",Qi="escape-key";var ec="list-navigation",Rd="keyboard",_b="pointer";var Wb="cancel-open",ts="sibling-open",zb="disabled";var Wu="imperative-action";import*as os from"react";var zu=os.createContext(null);function Gu(e="root"){let t=os.useContext(zu),o=os.useContext(Qa);if(t===null||o===void 0)return null;return(e==="submenu-trigger"?o.virtualFocus||o.parentVirtualFocus:o.virtualFocus)?t:null}var Gb={visible:!0,ref:null};function Zb(){return Gb}function Pd(e,t,o="root"){let r=Gu(o),a=((o==="submenu-trigger"?r?.useSubmenuTrigger:r?.useItem)??Zb)({label:e.label,children:e.children,render:e.render}),s=Wo(t,a.ref);return{visible:a.visible,ref:s,props:a.props}}import*as ca from"react";import*as kd from"react";function $b(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:qb,platform:jb,maxTouchPoints:Td}=$b(),Pn=qb.toLowerCase(),Tn=jb.toLowerCase();var Zu=/^i(os$|p)/.test(Tn)||Tn==="macintel"&&Td>1,Ed="android",Ad=Tn===Ed||Pn.includes(Ed),Md=!Zu&&Tn.startsWith("mac"),Xb=Tn.startsWith("win"),Yb=!Ad&&/^(linux|chrome os)/.test(Tn),$u=Md||Zu;var qu=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),Kb=!qu&&Pn.includes("firefox"),Jb=!qu&&Pn.includes("chrom");var Qb=$u;var eC=/jsdom|happydom/.test(Pn);function tC(e){e.preventDefault()}function Ld(e){let{closeOnClick:t,highlighted:o,id:r,nodeId:n,store:a,typingRef:s,itemRef:i,itemMetadata:c}=e,u=vo(),l=na(!0),m=c.type==="submenu-trigger",p=m?u.parentVirtualFocus:u.virtualFocus,f=(m&&u.parent.type==="menu"?u.parent.store:u.store).useState("webkitAriaSelected",o),{events:S}=a.useState("floatingTreeRoot"),g=a.useState("open"),h=l!==void 0,x=!p&&g&&o?0:-1;return kd.useMemo(()=>({id:r,role:"menuitem",tabIndex:x,"aria-selected":f,onMouseDown:p?tC:void 0,onKeyDown(b){if(b.key===" "&&s?.current)b.preventDefault()},onMouseMove(b){if(!n)return;S.emit("itemhover",{nodeId:n,target:b.currentTarget})},onClick(b){if(t)S.emit("close",{domEvent:b.nativeEvent,reason:_u})},onMouseUp(b){if(l){let C=l.initialCursorPointRef.current;if(l.initialCursorPointRef.current=null,h&&C&&Math.abs(b.clientX-C.x)<=1&&Math.abs(b.clientY-C.y)<=1)return;if(h&&!kr.mac&&b.button===2)return}if(i.current&&a.context.allowMouseUpTriggerRef.current&&(!h||b.button===2)){if(c.type==="regular-item")ea(i.current,b,{detail:1,pointerType:"mouse"})}}}),[t,x,r,S,n,a.context.allowMouseUpTriggerRef,s,i,l,h,c.type,f,p])}var Dd={type:"regular-item"};function Fd(e){let{closeOnClick:t,disabled:o,highlighted:r,id:n,store:a,typingRef:s=a.context.typingRef,nativeButton:i,itemMetadata:c,nodeId:u}=e,l=ca.useRef(null),{getButtonProps:m,buttonRef:p}=xo({disabled:o,focusableWhenDisabled:!0,native:i,composite:!0}),d=Ld({closeOnClick:t,highlighted:r,id:n,nodeId:u,store:a,typingRef:s,itemRef:l,itemMetadata:c}),f=ca.useCallback((g)=>Ot(d,{onMouseEnter(h){if(c.type!=="submenu-trigger")return;c.setActive(h.nativeEvent)}},g,m),[d,m,c]),S=Wo(l,p);return ca.useMemo(()=>({getItemProps:f,itemRef:S}),[f,S])}import*as En from"react";import*as tc from"react";var Xu=tc.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Od(){return tc.useContext(Xu)}function oc(e={}){let{guess:t,label:o,metadata:r,textRef:n,index:a}=e,{register:s,unregister:i,subscribeMapChange:c,nextIndexRef:u}=Od(),l=En.useRef(-1),[m,p]=En.useState(a==null&&t?()=>{if(l.current===-1){let g=u.current;u.current+=1,l.current=g}return l.current}:-1),d=a??m,f=En.useRef(null),S=En.useCallback((g)=>{let h=f.current;if(h)i(h);if(f.current=g,g)s(g,{metadata:r??null,index:a??null,label:o,textRef:n})},[a,s,i,r,o,n]);return z(()=>{if(a!=null)return;return c((g)=>{let h=f.current?g.get(f.current)?.index:null;if(h!=null)p(h)})},[a,c]),{ref:S,index:d}}import*as ac from"react";import*as rc from"react";function nc(){let[,e]=rc.useState({});return rc.useCallback(()=>{e({})},[])}var Nd=0;function oC(e,t="mui"){let o=ac.useRef(void 0),r=nc(),n=e??o.current;return ac.useEffect(()=>{if(o.current==null){if(Nd+=1,o.current=`${t}-${Nd}`,e==null)r()}},[e,t,r]),n}var Bd=ja.useId;function Cr(e,t){if(Bd!==void 0){let o=Bd();return e??(t?`${t}-${o}`:o)}return oC(e,t)}function ao(e){return Cr(e,"base-ui")}function Re(e,t,o,r){let n=!1,a=!1,s=r??Ue;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){a=!0},get isCanceled(){return n},get isPropagationAllowed(){return a},trigger:o,...s}}function Hd(e,t,o){let r=o??Ue;return{reason:e,event:t??new Event("base-ui"),...r}}import*as Yu from"react";import*as Vd from"react";function Yr(e){Vd.useEffect(e,Mr)}var sc=null,NUe=globalThis.requestAnimationFrame;class Ud{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(e)=>{this.isScheduled=!1;let t=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let o=!1;if(!this.isScheduled||o)requestAnimationFrame(this.tick),this.isScheduled=!0;return t}cancel(e){let t=e-this.startId;if(t<0||t>=this.callbacks.length)return;if(this.callbacks[t]===null)return;this.callbacks[t]=null,this.callbacksCount-=1}}var ic=new Ud;class Zo{static create(){return new Zo}static request(e){return ic.request(e)}static cancel(e){return ic.cancel(e)}currentId=sc;request(e){this.cancel(),this.currentId=ic.request(()=>{this.currentId=sc,e()})}cancel=()=>{if(this.currentId!==sc)ic.cancel(this.currentId),this.currentId=sc};disposeEffect=()=>this.cancel}function Dr(){let e=Xe(Zo.create).current;return Yr(e.disposeEffect),e}function cc(e,t=!1,o=!1,r=!1){let[n,a]=Yu.useState(e&&t?"idle":void 0),[s,i]=Yu.useState(e&&!r);if(e&&!s)i(!0),a("starting");if(!e&&s&&n!=="ending"&&!o)a("ending");if(!e&&!s&&n==="ending")a(void 0);return z(()=>{if(!e&&s&&n!=="ending"&&o){let c=Zo.request(()=>{a("ending")});return()=>{Zo.cancel(c)}}return},[e,s,n,o]),z(()=>{if(!e||t||n===void 0)return;let c=Zo.request(()=>{a(void 0)});return()=>{Zo.cancel(c)}},[t,e,n]),z(()=>{if(!e||!t)return;if(e&&s&&n!=="idle")a("starting");let c=Zo.request(()=>{a("idle")});return()=>{Zo.cancel(c)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}import*as _d from"react";import*as Ju from"react-dom";function or(e){if(e==null)return e;return"current"in e?e.current:e}function Ku(e,t){return e.getAnimations(t).filter((o)=>{let r=o.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}var lc=null;function rC(e){if(!lc){let t=[];lc=t,queueMicrotask(()=>{lc=null,Ju.flushSync(()=>{for(let o of t)o()})})}lc.push(e)}function la(e,t=!1,o=!1){let r=Dr();return re((n,a=null)=>{r.cancel();let s=or(e);if(s==null)return;let i=s,c=()=>{if(!o){Ju.flushSync(n);return}rC(()=>{if(!a?.aborted)n()})};if(typeof i.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function u(){Promise.all(Ku(i).map((l)=>l.finished.then(Ye))).then(()=>{if(!a?.aborted)c()},()=>{if(a?.aborted)return;if(Ku(i).some((m)=>m.pending||m.playState!=="finished")){u();return}c()})}if(t){let l=yn;if(!i.hasAttribute(l)){r.request(u);return}let m=new MutationObserver(()=>{if(!i.hasAttribute(l))m.disconnect(),u()});m.observe(i,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(u)})}function $o(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:a}=e,s=re(a),i=la(r,o,n);_d.useEffect(()=>{if(!t)return;let c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,o,s,i])}import*as Qu from"react";import{jsx as nC}from"react/jsx-runtime";var aC=Qu.forwardRef(function(t,o){let{render:r,className:n,id:a,label:s,nativeButton:i=!1,disabled:c=!1,closeOnClick:u=!0,style:l,...m}=t,{store:p}=vo(),d=oc({guess:!0,label:s}),f=ao(a),S=p.useState("disabled"),g=p.useState("isActive",d.index),h=p.useState("floatingNodeId"),x=p.useState("itemProps"),b=c||S,{getItemProps:C,itemRef:I}=Fd({closeOnClick:u,disabled:b,highlighted:g,id:f,store:p,nativeButton:i,nodeId:h,itemMetadata:Dd});return ve("div",t,{state:{disabled:b,highlighted:g},props:[x,m,C],ref:[I,o,d.ref]})}),Wd=Qu.forwardRef(function(t,o){let r=Pd(t,o);if(!r.visible)return null;return nC(aC,{...t,ref:r.ref})});import*as Hn from"react";import*as Sr from"react";var ns=0;class eo{static create(){return new eo}currentId=ns;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ns,t()},e)}isStarted(){return this.currentId!==ns}clear=()=>{if(this.currentId!==ns)clearTimeout(this.currentId),this.currentId=ns};disposeEffect=()=>this.clear}function Je(){let e=Xe(eo.create).current;return Yr(e.disposeEffect),e}function Mo(e){e.preventDefault(),e.stopPropagation()}function zd(e){return"nativeEvent"in e}function Kr(e){if(e.pointerType===""&&e.isTrusted)return!0;if(kr.android&&e.pointerType)return e.type==="click"&&e.buttons===1;return e.detail===0&&!e.pointerType}function ua(e){if(rs.jsdom)return!1;return!kr.android&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(kr.android||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ko(e,t){let o=["mouse","pen"];if(!t)o.push("",void 0);return o.includes(e)}function Gd(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function st(e){let t=e.activeElement;while(t?.shadowRoot?.activeElement!=null)t=t.shadowRoot.activeElement;return t}function le(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&tr(o)){let r=t;while(r){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function rr(e,t){let o=e;while(o){if(Ve(o)&&o.matches(t))return o;o=o.assignedSlot??o.parentNode??(tr(o)?o.host:null)}return null}function Ze(e){if("composedPath"in e)return e.composedPath()[0]??e.target;return e.target}var as="data-base-ui-focusable";var em="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ss="ArrowLeft",is="ArrowRight",tm="ArrowUp",uc="ArrowDown";var g_e=Yi,cs="data-trigger-disabled";function Jr(e,t){if(!Ve(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(cs);for(let[,r]of t.entries())if(le(r,o))return!r.hasAttribute(cs);return!1}function mc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function $d(e){return e.matches("html,body")}function Fr(e){return je(e)&&e.matches(em)}function om(e){return rr(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${em}`)!=null}function ls(e){if(!e)return!1;return e.getAttribute("role")==="combobox"&&Fr(e)}function Qr(e){if(!e||rs.jsdom)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}}function us(e){if(!e)return null;return e.hasAttribute(as)?e:e.querySelector(`[${as}]`)||e}function sC(e,t){if(t!=null&&!ko(t))return 0;if(typeof e==="function")return e();return e}function Or(e,t,o){let r=sC(e,o);if(typeof r==="number")return r;return r?.[t]}function rm(e){if(typeof e==="function")return e();return e}function fc(e,t){return t||e==="click"||e==="mousedown"}function qd(e){return e?.includes("mouse")&&e!=="mousedown"}import{jsx as M_e}from"react/jsx-runtime";var iC=Sr.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new eo,currentIdRef:{current:null},currentContextRef:{current:null}});function cC(e,t){e.current=t.current}function nm(e,t={open:!1}){let{open:o}=t,r=e.useState("floatingId"),n=Sr.useContext(iC),{currentIdRef:a,delayRef:s,timeoutMs:i,initialDelayRef:c,currentContextRef:u,hasProvider:l,timeout:m}=n,[p,d]=Sr.useState(!1),f=Sr.useRef(o);return z(()=>{f.current=o},[o]),z(()=>{function S(){u.current?.setIsInstantPhase(!1),a.current=null,u.current=null,s.current=c.current,m.clear()}if(!a.current)return;if(!o&&a.current===r){if(d(!1),i){let g=r;return m.start(i,()=>{if(e.select("open")||a.current&&a.current!==g)return;S()}),()=>{if(f.current||a.current!==g)m.clear()}}S()}return},[o,r,a,s,i,c,u,m,e]),z(()=>{if(!o)return;let S=u.current,g=a.current;if(m.clear(),u.current={onOpenChange:e.setOpen,setIsInstantPhase:d},a.current=r,s.current={open:0,close:Or(c.current,"close")},g!==null&&g!==r)d(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,Re(Rn));else d(!1),S?.setIsInstantPhase(!1)},[o,r,e,a,s,c,u,m]),z(()=>()=>{if(a.current===r){if(u.current=null,!f.current)return;a.current=null,cC(s,c),m.clear()}},[u,a,s,r,c,m]),Sr.useMemo(()=>({activeIdRef:a,hasProvider:l,delayRef:s,isInstantPhase:p}),[a,l,s,p])}import*as so from"react";function Ae(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function to(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];if(o)o()}}}function ct(e){let t=Xe(lC,e).current;return t.next=e,z(t.effect),t}function lC(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}import*as dc from"react";var jd={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},pc={...jd,position:"fixed",margin:0,top:0,left:0},B_e={...jd,position:"absolute"};import{jsx as uC}from"react/jsx-runtime";var nr=dc.forwardRef(function(t,o){let[r,n]=dc.useState();return z(()=>{if(ju.voiceOver&&Lr.webkit)n("button")},[]),uC("span",{...t,ref:o,style:pc,"aria-hidden":r?void 0:!0,...{tabIndex:0,role:r},"data-base-ui-focus-guard":""})});var{min:en,max:ar,round:fs,floor:ps}=Math,xr=(e)=>({x:e,y:e}),mC={left:"right",right:"left",bottom:"top",top:"bottom"};function hc(e,t,o){return ar(e,en(t,o))}function wr(e,t){return typeof e==="function"?e(t):e}function wo(e){return e.split("-")[0]}function Lo(e){return e.split("-")[1]}function Ic(e){return e==="x"?"y":"x"}function ds(e){return e==="y"?"height":"width"}function Ro(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function gs(e){return Ic(Ro(e))}function Kd(e,t,o){if(o===void 0)o=!1;let r=Lo(e),n=gs(e),a=ds(n),s=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])s=ms(s);return[s,ms(s)]}function Jd(e){let t=ms(e);return[gc(e),t,gc(t)]}function gc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Xd=["left","right"],Yd=["right","left"],fC=["top","bottom"],pC=["bottom","top"];function dC(e,t,o){switch(e){case"top":case"bottom":if(o)return t?Yd:Xd;return t?Xd:Yd;case"left":case"right":return t?fC:pC;default:return[]}}function Qd(e,t,o,r){let n=Lo(e),a=dC(wo(e),o==="start",r);if(n){if(a=a.map((s)=>s+"-"+n),t)a=a.concat(a.map(gc))}return a}function ms(e){let t=wo(e);return mC[t]+e.slice(t.length)}function gC(e){var t,o,r,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function bc(e){return typeof e!=="number"?gC(e):{top:e,right:e,bottom:e,left:e}}function An(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function Cc(e,t){return t<0||t>=e.length}function Sc(e,t){return sm(e.current,{disabledIndices:t})}function am(e,t){return sm(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function e0(e,t,o){let{decrement:r,loopFocus:n,allowEscape:a,disabledIndices:s,minIndex:i,maxIndex:c}=o,u=()=>sm(e,{startingIndex:t,decrement:r,disabledIndices:s}),l,m=!1;if(!n)l=r?Math.max(i,u()):Math.min(c,u());else if(r?t<=i:t>=c){let p=r?-1:e.length;if(a&&t!==p)l=-1;else l=r?c:i,m=!0}else l=u();return{index:Cc(e,l)?-1:l,wrapped:m}}function sm(e,{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:n=1}={}){let a=t;do a+=o?-n:n;while(a>=0&&a<=e.length-1&&im(e,a,r));return a}function im(e,t,o){if(typeof o==="function"?o(t):o?.includes(t)??!1)return!0;let n=e[t];if(!n)return!1;if(!Mn(n))return!0;if(n.matches(":disabled"))return!0;return!o&&(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")}function hC(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Mn(e,t=e?no(e):null){if(!e||!e.isConnected||!t||hC(t))return!1;if(typeof e.checkVisibility==="function")return e.checkVisibility();return t.display!=="none"&&t.display!=="contents"}var IC='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function bC(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let o=e.getRootNode();return tr(o)?o.host:null}function lm(e){for(let t of Array.from(e.children))if(Nt(t)==="summary")return t;return null}function CC(e,t){let o=lm(t);return!!o&&(e===o||le(o,e))}function t0(e){let t=e?Nt(e):"";return e!=null&&e.matches(IC)&&(t!=="summary"||e.parentElement!=null&&Nt(e.parentElement)==="details"&&lm(e.parentElement)===e)&&(t!=="details"||lm(e)==null)&&(t!=="input"||e.type!=="hidden")}function um(e){if(!t0(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=bC(t)){let o=t!==e,r=Nt(t)==="slot";if(t.hasAttribute("inert"))return!1;if(o&&Nt(t)==="details"&&!t.open&&!CC(e,t)||t.hasAttribute("hidden")||!r&&!SC(t,o))return!1}return!0}function SC(e,t){let o=no(e);if(!t)return Mn(e,o);return o.display!=="none"}function o0(e){let t=e.tabIndex;if(t<0){let o=Nt(e);if(o==="details"||o==="audio"||o==="video"||je(e)&&e.isContentEditable)return 0}return t}function cm(e){if(Nt(e)!=="input")return null;let t=e;return t.type==="radio"&&t.name!==""?t:null}function r0(e,t){let o=cm(e);if(!o)return!0;let r=t.find((n)=>{let a=cm(n);return a?.name===o.name&&a.form===o.form&&a.checked});if(r)return r===o;return t.find((n)=>{let a=cm(n);return a?.name===o.name&&a.form===o.form})===o}function n0(e){if(je(e)&&Nt(e)==="slot"){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}if(je(e)&&e.shadowRoot)return Array.from(e.shadowRoot.children);return Array.from(e.children)}function mm(e,t){n0(e).forEach((o)=>{if(t0(o))t.push(o);mm(o,t)})}function a0(e,t,o){n0(e).forEach((r)=>{if(je(r)&&r.matches(t))o.push(r);a0(r,t,o)})}function hs(e){return um(e)&&o0(e)>=0}function fm(e){let t=[];return mm(e,t),t.filter(um)}function Is(e){let t=fm(e);return t.filter((o)=>o0(o)>=0&&r0(o,t))}function s0(e,t){let o=Is(e),r=o.length;if(r===0)return;let n=st(Ee(e)),a=o.indexOf(n),s=a===-1?t===1?0:r-1:a+t;return o[s]}function xc(e){return s0(Ee(e).body,1)||e}function wc(e){return s0(Ee(e).body,-1)||e}function i0(e,t,o){if(!e)return null;let r=[];mm(Ee(e).body,r);let n=r.indexOf(e);if(n===-1)return null;let a=r.filter(um);for(let s=1;s<r.length;s+=1){let i=r[(n+t*s+r.length)%r.length];if(!le(o,i)&&hs(i)&&r0(i,a))return i}return r[n]}function Nr(e,t){let o=t||e.currentTarget,r=e.relatedTarget;return!r||!le(o,r)}function c0(e){Is(e).forEach((o)=>{o.dataset.tabindex=o.getAttribute("tabindex")||"",o.setAttribute("tabindex","-1")})}function pm(e){let t=[];a0(e,"[data-tabindex]",t),t.forEach((o)=>{let r=o.dataset.tabindex;if(delete o.dataset.tabindex,r)o.setAttribute("tabindex",r);else o.removeAttribute("tabindex")})}function qo(e,t,o=!0){return e.filter((n)=>n.parentId===t).flatMap((n)=>[...!o||n.context?.open?[n]:[],...qo(e,n.id,o)])}function dm(e,t){let o=[],r=e.find((n)=>n.id===t)?.parentId;while(r){let n=e.find((a)=>a.id===r);if(r=n?.parentId,n)o=o.concat(n)}return o}function yr(e){return`data-base-ui-${e}`}var yc=0;function ma(e,t={}){let{preventScroll:o=!1,sync:r=!1,shouldFocus:n}=t;cancelAnimationFrame(yc);function a(){if(n&&!n())return;e?.focus({preventScroll:o})}if(r)return a(),Ye;let s=requestAnimationFrame(a);return yc=s,()=>{if(yc===s)cancelAnimationFrame(s),yc=0}}var l0="data-base-ui-inert",bs=new WeakMap,vc=new WeakSet,Cs=new WeakMap,gm=0;function p0(e){if(!e)return null;return tr(e)?e.host:p0(e.parentNode)}var u0=(e,t)=>t.map((o)=>{if(e.contains(o))return o;let r=p0(o);if(e.contains(r))return r;return null}).filter((o)=>o!=null),m0=(e)=>{let t=new Set;return e.forEach((o)=>{let r=o;while(r&&!t.has(r))t.add(r),r=r.parentNode}),t},f0=(e,t,o)=>{let r=[],n=(a)=>{if(!a||o.has(a))return;Array.from(a.children).forEach((s)=>{if(Nt(s)==="script")return;if(t.has(s))n(s);else r.push(s)})};return n(e),r};function xC(e,t,o,{mark:r=!0}){let n=u0(t,e),a=r?f0(t,m0(n),new Set(n)):[],s=[],i=[];if(o){let c=u0(t,Array.from(t.querySelectorAll("[aria-live]"))),u=n.concat(c);f0(t,m0(u),new Set(u)).forEach((m)=>{let p=m.getAttribute("aria-hidden"),d=p!==null&&p!=="false",f=(bs.get(m)||0)+1;if(bs.set(m,f),s.push(m),f===1&&d)vc.add(m);if(!d)m.setAttribute("aria-hidden","true")})}if(r)a.forEach((c)=>{let u=(Cs.get(c)||0)+1;if(Cs.set(c,u),i.push(c),u===1)c.setAttribute(l0,"")});return gm+=1,()=>{if(s.forEach((c)=>{let u=(bs.get(c)||0)-1;if(bs.set(c,u),!u){if(!vc.has(c))c.removeAttribute("aria-hidden");vc.delete(c)}}),r)i.forEach((c)=>{let u=(Cs.get(c)||0)-1;if(Cs.set(c,u),!u)c.removeAttribute(l0)});if(gm-=1,!gm)bs=new WeakMap,vc=new WeakSet,Cs=new WeakMap}}function hm(e,t={}){let{ariaHidden:o=!1,mark:r=!0}=t,n=Ee(e[0]).body;return xC(e,n,o,{mark:r})}import*as pt from"react";import*as bm from"react-dom";var d0=500,g0=500,h0={style:{transition:"none"}},Rc="data-base-ui-click-trigger";var I0="[data-base-ui-swipe-ignore]",b0="[data-swipe-ignore]",C0={fallbackAxisSide:"none"},Pc={fallbackAxisSide:"end"},S0={clipPath:"inset(50%)",position:"fixed",top:0,left:0};import{jsx as Im,jsxs as x0}from"react/jsx-runtime";var w0=pt.createContext(null),Cm=()=>pt.useContext(w0),wC=yr("portal");function Tc(e={}){let{ref:t,container:o,componentProps:r=Ue,elementProps:n}=e,a=Cr(),i=Cm()?.portalNode,[c,u]=pt.useState(null),[l,m]=pt.useState(null),p=re((g)=>{if(g!==null)m(g)}),d=pt.useRef(null);z(()=>{if(o===null){if(d.current)d.current=null,m(null),u(null);return}let g=(o&&(Ui(o)?o:o.current))??i??document.body;if(g==null){if(d.current)d.current=null,m(null),u(null);return}if(d.current!==g)d.current=g,m(null),u(g)},[o,i]);let f=ve("div",r,{ref:[t,p],props:[{id:a,[wC]:""},n]}),S=c&&f?bm.createPortal(f,c):null;return{node:l,nodeId:pt.isValidElement(f)?f.props.id:void 0,subtree:S}}var Ss=pt.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,container:i,portalOwnerRole:c,...u}=t,{node:l,nodeId:m,subtree:p}=Tc({container:i,ref:o,componentProps:t,elementProps:u}),d=pt.useRef(null),f=pt.useRef(null),S=pt.useRef(null),g=pt.useRef(null),[h,x]=pt.useState(null),b=pt.useRef(!1),C=h?.modal,I=h?.open,y=!!h&&!h.modal&&h.open&&!!l;pt.useEffect(()=>{if(!l||C)return;function v(R){if(l&&R.relatedTarget&&Nr(R))if(R.type==="focusin"){if(b.current)pm(l),b.current=!1}else c0(l),b.current=!0}return to(Ae(l,"focusin",v,!0),Ae(l,"focusout",v,!0))},[l,C]),z(()=>{if(!l||I!==!0||!b.current)return;pm(l),b.current=!1},[I,l]);let w=pt.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:S,afterInsideRef:g,portalNode:l,setFocusManagerState:x}),[l]);return x0(pt.Fragment,{children:[p,x0(w0.Provider,{value:w,children:[y&&l&&Im(nr,{"data-type":"outside",ref:d,onFocus:(v)=>{if(Nr(v,l))S.current?.focus();else{let R=h?h.domReference:null;wc(R)?.focus()}}}),y&&l&&Im("span",{role:c,"aria-owns":m,style:S0}),l&&bm.createPortal(s,l),y&&l&&Im(nr,{"data-type":"outside",ref:f,onFocus:(v)=>{if(Nr(v,l))g.current?.focus();else{let R=h?h.domReference:null;if(xc(R)?.focus(),h?.closeOnFocusOut)h?.onOpenChange(!1,Re(ia,v.nativeEvent))}}})]})]})});import*as tn from"react";function Ec(){let e=new Map;return{emit(t,o){e.get(t)?.forEach((r)=>r(o))},on(t,o){if(!e.has(t))e.set(t,new Set);e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}class kn{nodesRef={current:[]};events=Ec();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex((o)=>o===e);if(t!==-1)this.nodesRef.current.splice(t,1)}}import{jsx as y0}from"react/jsx-runtime";var v0=tn.createContext(null),R0=tn.createContext(null),Do=()=>tn.useContext(v0)?.id||null,fo=(e)=>{let t=tn.useContext(R0);return e??t};function xs(e){let t=Cr(),o=fo(e),r=Do();return z(()=>{if(!t)return;let n={id:t,parentId:r};return o?.addNode(n),()=>{o?.removeNode(n)}},[o,t,r]),t}function Sm(e){let{children:t,id:o}=e,r=Do();return y0(v0.Provider,{value:tn.useMemo(()=>({id:o,parentId:r}),[o,r]),children:t})}function xm(e){let{children:t,externalTree:o}=e,r=Xe(()=>o??new kn).current;return y0(R0.Provider,{value:r,children:t})}import{jsx as P0,jsxs as yC}from"react/jsx-runtime";function vC(e,t){let o=qe(Ze(e));if(e instanceof o.KeyboardEvent)return"keyboard";if(e instanceof o.FocusEvent)return t||"keyboard";if("pointerType"in e)return e.pointerType||(Kr(e)?"keyboard":t||"mouse");if("touches"in e)return"touch";if(e instanceof o.MouseEvent)return t||(e.detail===0?"keyboard":"mouse");return""}var T0=20,on=[];function wm(){on=on.filter((e)=>e.deref()?.isConnected)}function E0(e){if(wm(),e&&Nt(e)!=="body"){if(on.push(new WeakRef(e)),on.length>T0)on=on.slice(-T0)}}function A0(){return wm(),on[on.length-1]?.deref()}function RC(e){if(!e)return null;if(hs(e))return e;return Is(e)[0]||e}function M0(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;let o=fm(e).filter((n)=>{let a=n.getAttribute("data-tabindex")||"";return hs(n)||n.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");if(o.length===0){if(r!=="0")e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")}else if(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1")}function ws(e){let{context:t,children:o,disabled:r=!1,initialFocus:n=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:d,externalTree:f,getInsideElements:S}=e,g=t.useState("open"),h=t.useState("domReferenceElement"),x=t.useState("floatingElement"),{events:b,dataRef:C}=t.context,I=re(()=>C.current.floatingContext?.nodeId),y=n===!1,w=ls(h)&&y,v=ct(n),R=ct(a),L=ct(s),U=ct(l),E=ct(g),O=fo(f),k=Cm(),P=so.useRef(!1),N=so.useRef(!1),j=so.useRef(!1),T=so.useRef(null),B=so.useRef(""),W=so.useRef(""),X=so.useRef(null),A=so.useRef(null),ue=Wo(X,d,k?.beforeInsideRef),V=Wo(A,k?.afterInsideRef),G=Je(),Z=Je(),ee=Dr(),Pe=k!=null,te=us(x),ie=re((ne=te)=>ne?Is(ne):[]),me=re(()=>S?.().filter((ne)=>ne!=null)??[]);so.useEffect(()=>{if(r||!c)return;function ne(Ce){if(Ce.key==="Tab"){if(le(te,st(Ee(te)))&&ie().length===0&&!w)Mo(Ce)}}let we=Ee(te);return Ae(we,"keydown",ne)},[r,te,c,w,ie]),so.useEffect(()=>{if(r||!g)return;let ne=Ee(te);function we(){j.current=!1}function Ce(Q){let H=Ze(Q),Y=me(),D=le(x,H)||le(h,H)||le(k?.portalNode,H)||Y.some((de)=>de===H||le(de,H));if(j.current=!D,W.current=Q.pointerType||"keyboard",rr(H,`[${Rc}]`))N.current=!0,Z.start(0,()=>{N.current=!1})}function De(){W.current="keyboard"}return to(Ae(ne,"pointerdown",Ce,!0),Ae(ne,"pointerup",we,!0),Ae(ne,"pointercancel",we,!0),Ae(ne,"keydown",De,!0),we)},[r,x,h,te,g,k,Z,me]),so.useEffect(()=>{if(r||!u)return;let ne=Ee(te);function we(){N.current=!0,Z.start(0,()=>{N.current=!1})}function Ce(Y){let D=Ze(Y);if(hs(D))T.current=D}function De(Y){let{relatedTarget:D,currentTarget:de}=Y,K=Ze(Y);if(c&&D==null&&K!=null&&le(x,K))E0(K);queueMicrotask(()=>{let pe=I(),M=t.context.triggerElements,_=me(),Se=D?.hasAttribute(yr("focus-guard"))&&[X.current,A.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,or(p),or(m)].includes(D),J=!(le(h,D)||le(x,D)||le(D,x)||le(k?.portalNode,D)||_.some((se)=>se===D||le(se,D))||M.hasMatchingElement((se)=>le(se,D))||Se||O&&(qo(O.nodesRef.current,pe).find((se)=>le(se.context?.elements.floating,D)||le(se.context?.elements.domReference,D))||dm(O.nodesRef.current,pe).find((se)=>[se.context?.elements.floating,us(se.context?.elements.floating)].includes(D)||se.context?.elements.domReference===D)));if(de===h&&te)M0(te);if(i&&de!==h&&!Mn(K)&&st(ne)===ne.body){if(je(te)){if(te.focus(),i==="popup"){ee.request(()=>{te.focus()});return}}let se=ie(),ge=T.current,he=(ge&&se.includes(ge)?ge:null)||se[se.length-1]||te;if(je(he))he.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}if((w?!0:!c)&&D&&J&&!N.current&&(w||D!==A0()))P.current=!0,t.setOpen(!1,Re(ia,Y))})}function Q(){if(j.current)return;C.current.insideReactTree=!0,G.start(0,()=>{C.current.insideReactTree=!1})}let H=je(h)?h:null;if(!x&&!H)return;return to(H&&Ae(H,"focusout",De),H&&Ae(H,"pointerdown",we),x&&Ae(x,"focusin",Ce),x&&Ae(x,"focusout",De),x&&k&&Ae(x,"focusout",Q,!0))},[r,h,x,te,c,O,k,t,u,i,ie,w,I,C,G,Z,ee,m,p,me]),so.useEffect(()=>{if(r||!x||!g)return;let ne=Array.from(k?.portalNode?.querySelectorAll(`[${yr("portal")}]`)||[]),Ce=(O?dm(O.nodesRef.current,I()):[]).find((de)=>ls(de.context?.elements.domReference||null))?.context?.elements.domReference,Q=[...[x,...ne,X.current,A.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...me()],Ce,or(p),or(m),w?h:null].filter((de)=>de!=null),H=hm(Q,{ariaHidden:c||w,mark:!1}),Y=[x,...ne].filter((de)=>de!=null),D=hm(Y);return()=>{D(),H()}},[g,r,h,x,c,k,w,O,I,m,p,me]),z(()=>{if(!g||r||!je(te))return;B.current="",W.current="";let ne=Ee(te),we=st(ne);queueMicrotask(()=>{let Ce=v.current,De=typeof Ce==="function"?Ce(U.current||""):Ce;if(De===void 0||De===!1)return;if(le(te,we))return;let H=null,Y=()=>{if(H==null)H=ie(te);return H[0]||te},D;if(De===!0||De===null)D=Y();else D=or(De);D=D||Y();let de=le(te,st(ne)),K=C.current.openEvent,pe=K?.type==="mousedown"&&Kr(K);ma(D,{sync:pe,preventScroll:D===te,shouldFocus(){if(!E.current)return!1;if(de)return!0;let M=st(ne);return!(M!==D&&le(te,M))}})})},[r,g,te,ie,v,U,E,C]);let fe=so.useRef(null);z(()=>{if(r||!te){fe.current=null;return}if(fe.current)fe.current.cancelled=!0,fe.current=null;let ne=Ee(te),we=st(ne),Ce=U.current==null;E0(we);function De(H){if(!H.open)B.current=vC(H.nativeEvent,W.current);if(H.reason===ia&&H.triggerElement?.hasAttribute(yr("focus-guard"))||H.reason===Yt&&H.nativeEvent.type==="mouseleave")P.current=!0;if(H.reason!==Uu)return;if(H.nested)P.current=!1;else if(Kr(H.nativeEvent)||ua(H.nativeEvent))P.current=!1;else{let Y=!1;if(Ee(te).createElement("div").focus({get preventScroll(){return Y=!0,!1}}),Y)P.current=!1;else P.current=!0}}b.on("openchange",De);function Q(H){let Y=R.current,D=typeof Y==="function"?Y(H):Y;if(D===void 0||D===!1)return null;if(D===null)D=!0;let de=h?.isConnected?h:null,K=we?.isConnected&&Nt(we)!=="body"?we:null,pe=Ce?K||de:de||K;if(!pe)pe=A0()||null;if(typeof D==="boolean")return pe;return or(D)||pe||null}return()=>{b.off("openchange",De);let H=st(ne),Y=me(),D=le(x,H)||Y.some((_)=>_===H||le(_,H))||O&&qo(O.nodesRef.current,I(),!1).some((_)=>le(_.context?.elements.floating,H)),de=R.current,K=B.current,pe=Q(K),M={cancelled:!1};fe.current=M,queueMicrotask(()=>{if(fe.current===M)fe.current=null;let _=RC(pe),Se=L.current??typeof de!=="boolean";if(!M.cancelled&&de&&!P.current&&je(_)&&(!Se&&_!==H&&H!==ne.body?D:!0)){let J={preventScroll:!0};if(K==="keyboard")J.focusVisible=!0;_.focus(J)}P.current=!1})}},[r,x,te,R,L,U,b,O,h,I,me]),z(()=>{if(!Lr.webkit||g||!x)return;let ne=st(Ee(x));if(!je(ne)||!Fr(ne))return;if(le(x,ne))ne.blur()},[g,x]),z(()=>{if(r||!k)return;return k.setFocusManagerState({modal:c,closeOnFocusOut:u,open:g,onOpenChange:t.setOpen,domReference:h}),()=>{k.setFocusManagerState(null)}},[r,k,c,g,t,u,h]),z(()=>{if(r||!te)return;return M0(te),()=>{queueMicrotask(wm)}},[r,te]);let be=!r&&(c?!w:!0)&&(Pe||c);return yC(so.Fragment,{children:[be&&P0(nr,{"data-type":"inside",ref:ue,onFocus:(ne)=>{if(c){let we=ie();ma(we[we.length-1])}else if(k?.portalNode)if(P.current=!1,Nr(ne,k.portalNode))xc(h)?.focus();else or(p??k.beforeOutsideRef)?.focus()}}),o,be&&P0(nr,{"data-type":"inside",ref:V,onFocus:(ne)=>{if(c)ma(ie()[0]);else if(k?.portalNode){if(u)P.current=!0;if(Nr(ne,k.portalNode))wc(h)?.focus();else or(m??k.afterOutsideRef)?.focus()}}})]})}import*as ys from"react";function vs(e,t={}){let{enabled:o=!0,event:r="click",toggle:n=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:i=0,reason:c=aa}=t,u=e.context.dataRef,l=ys.useRef(void 0),m=Dr(),p=Je(),d=ys.useMemo(()=>{function f(g,h,x,b){let C=Re(c,h,x);if(g&&b==="touch"&&i>0)p.start(i,()=>{e.setOpen(!0,C)});else e.setOpen(g,C)}function S(g,h,x){let b=u.current.openEvent,C=e.select("domReferenceElement")!==h;if(g&&C)return!0;if(!g)return!0;if(!n)return!0;if(b&&(typeof s==="function"?s():s))return!x(b.type);return!1}return{onPointerDown(g){l.current=ko(g.pointerType,!0)&&ua(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){let h=l.current,x=g.nativeEvent,b=e.select("open");if(g.button!==0||r==="click"||ko(h,!0)&&a)return;let C=S(b,g.currentTarget,(v)=>v==="click"||v==="mousedown"),I=Ze(x),y=Fr(I);if(y||h==="virtual"){f(C,x,y?I:g.currentTarget,h);return}let w=g.currentTarget;m.request(()=>{f(C,x,w,h)})},onClick(g){if(r==="mousedown-only")return;let h=l.current;if(r==="mousedown"&&h){l.current=void 0;return}if(ko(h,!0)&&a)return;let x=e.select("open"),b=S(x,g.currentTarget,(C)=>C==="click"||C==="mousedown"||C==="keydown"||C==="keyup");f(b,g.nativeEvent,g.currentTarget,h)},onKeyDown(){l.current=void 0}}},[u,r,a,c,e,s,n,m,p,i]);return ys.useMemo(()=>o?{reference:d}:Ue,[o,d])}import*as Po from"react";function PC(e,t){let o=null,r=null,n=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},s=t.axis==="x"||t.axis==="both",i=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",u=t.axis==="y"?a.width:0,l=t.axis==="x"?a.height:0,{x:m,y:p}=a;if(o==null&&t.x&&s)o=a.x-t.x;if(r==null&&t.y&&i)r=a.y-t.y;if(m-=o||0,p-=r||0,!n||c)m=s&&t.x!=null?t.x:m,p=i&&t.y!=null?t.y:p;return n=!0,{width:u,height:l,x:m,y:p,top:p,right:m+u,bottom:p+l,left:m}}}}function k0(e){return e!=null&&e.clientX!=null}function ym(e,t={}){let{enabled:o=!0,axis:r="both"}=t,n=e.useState("open"),a=e.useState("floatingElement"),s=e.useState("domReferenceElement"),i=e.context.dataRef,c=Po.useRef(!1),u=Po.useRef(null),[l,m]=Po.useState(),[p,d]=Po.useState([]),f=re((b)=>{e.set("positionReference",b)}),S=re((b,C,I)=>{if(c.current)return;if(i.current.openEvent&&!k0(i.current.openEvent))return;e.set("positionReference",PC(I??s,{x:b,y:C,axis:r,dataRef:i,pointerType:l}))}),g=re((b)=>{if(!n)S(b.clientX,b.clientY,b.currentTarget);else if(!u.current)S(b.clientX,b.clientY,b.currentTarget),d([])}),h=ko(l)?a:n;Po.useEffect(()=>{if(!o){f(s);return}if(!h)return;function b(){u.current?.(),u.current=null}let C=qe(a);function I(y){let w=Ze(y);if(!le(a,w))S(y.clientX,y.clientY);else b()}if(!i.current.openEvent||k0(i.current.openEvent))u.current=Ae(C,"mousemove",I);else f(s);return b},[h,o,a,i,s,e,S,f,p]),Po.useEffect(()=>()=>{e.set("positionReference",null)},[e]),Po.useEffect(()=>{if(o&&!a)c.current=!1},[o,a]),Po.useEffect(()=>{if(!o&&n)c.current=!0},[o,n]);let x=Po.useMemo(()=>{function b(C){m(C.pointerType)}return{onPointerDown:b,onPointerEnter:b,onMouseMove:g,onMouseEnter:g}},[g]);return Po.useMemo(()=>o?{reference:x,trigger:x}:{},[o,x])}import*as po from"react";function TC(){return!1}function EC(e){return{escapeKey:typeof e==="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e==="boolean"?e:e?.outsidePress??!0}}function Ln(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:a="sloppy",referencePress:s=TC,bubbles:i,externalTree:c}=t,u=e.useState("open"),l=e.useState("floatingElement"),{dataRef:m,events:p}=e.context,d=fo(c),f=re(typeof n==="function"?n:()=>!1),S=typeof n==="function"?f:n,g=S!==!1,h=re(()=>a),{escapeKey:x,outsidePress:b}=EC(i),C=po.useRef(!1),I=po.useRef(!1),y=po.useRef(!1),w=po.useRef(!1),v=po.useRef(!1),R=po.useRef(""),L=po.useRef(null),U=Je(),E=Je(),O=Je(),k=re(()=>{E.clear(),m.current.insideReactTree=!1}),P=re((V)=>{let G=m.current.floatingContext?.nodeId;return(d?qo(d.nodesRef.current,G):[]).some((ee)=>ee.context?.open&&!ee.context.dataRef.current[V])}),N=re((V)=>mc(V,e.select("floatingElement"))||mc(V,e.select("domReferenceElement"))),j=re((V)=>{if(!s())return;e.setOpen(!1,Re(aa,V.nativeEvent))}),T=re((V)=>{if(!u||!o||!r||V.key!=="Escape")return;let G=zd(V)?V.nativeEvent:V;if(v.current||G.isComposing)return;if(!x&&P("__escapeKeyBubbles"))return;let Z=Re(Qi,G);if(e.setOpen(!1,Z),!Z.isCanceled)V.preventDefault();if(!x&&!Z.isPropagationAllowed)V.stopPropagation()}),B=re(()=>{m.current.insideReactTree=!0,E.start(0,k)}),W=re((V)=>{if(!u||!o||V.button!==0)return;let G=Ze(V.nativeEvent);if(!le(e.select("floatingElement"),G))return;if(!C.current)C.current=!0,I.current=!1}),X=re((V)=>{if(!u||!o)return;if(!(V.defaultPrevented||V.nativeEvent.defaultPrevented))return;if(C.current)I.current=!0});po.useEffect(()=>{function V(G){if(!G.open)w.current=!1}return p.on("openchange",V),()=>{p.off("openchange",V)}},[p]),po.useEffect(()=>k,[k]),po.useEffect(()=>{if(!u||!o){if(!u)w.current=!1,v.current=!1,R.current="",L.current=null;return k}m.current.__escapeKeyBubbles=x,m.current.__outsidePressBubbles=b;let V=new eo,G=Ee(l);function Z(){O.clear(),v.current=!0}function ee(){v.current=!0,O.start(Lr.webkit?5:0,()=>{v.current=!1})}function Pe(){y.current=!0,V.start(0,()=>{y.current=!1})}function te(){C.current=!1,I.current=!1}function ie(){let M=R.current,_=M==="pen"||!M?"mouse":M,Se=h(),J=typeof Se==="function"?Se():Se;if(typeof J==="string")return J;return J[_]}function me(M){let _=ie();return _==="intentional"&&M.type!=="click"||_==="sloppy"&&M.type==="click"}function fe(M){let _=m.current.floatingContext?.nodeId,Se=d&&qo(d.nodesRef.current,_).some((J)=>mc(M,J.context?.elements.floating));return N(M)||Se}function be(M){if(me(M)){if(M.type!=="click"&&!N(M))V.clear(),y.current=!1;k();return}if(m.current.insideReactTree){k();return}let _=Ze(M),Se=`[${yr("inert")}]`,J=Ve(_)?_.getRootNode():null,se=Array.from((tr(J)?J:Ee(e.select("floatingElement"))).querySelectorAll(Se)),ge=e.context.triggerElements;if(_&&(ge.hasElement(_)||ge.hasMatchingElement((Ie)=>le(Ie,_))))return;let he=Ve(_)?_:null;while(he&&!Go(he)){let Ie=zo(he);if(Go(Ie)||!Ve(Ie))break;he=Ie}if(se.length&&Ve(_)&&!$d(_)&&!le(_,e.select("floatingElement"))&&se.every((Ie)=>!le(he,Ie)))return;if(je(_)&&!("touches"in M)){let Ie=Go(_),Ne=no(_),Qe=/auto|scroll/,gt=Ie||Qe.test(Ne.overflowX),bo=Ie||Qe.test(Ne.overflowY),Co=gt&&_.clientWidth>0&&_.scrollWidth>_.clientWidth,Yo=bo&&_.clientHeight>0&&_.scrollHeight>_.clientHeight,oo=Ne.direction==="rtl",Kt=Yo&&(oo?M.offsetX<=_.offsetWidth-_.clientWidth:M.offsetX>_.clientWidth),yo=Co&&M.offsetY>_.clientHeight;if(Kt||yo)return}if(fe(M))return;if(ie()==="intentional"){if(M.detail!==0&&!Kr(M)&&!w.current)return;if(y.current){V.clear(),y.current=!1;return}}if(typeof S==="function"&&!S(M))return;if(P("__outsidePressBubbles"))return;e.setOpen(!1,Re(Uu,M)),k()}function ne(M){if(ie()!=="sloppy"||M.pointerType==="touch"||!e.select("open")||!o||N(M))return;be(M)}function we(M){if(ie()!=="sloppy"||!e.select("open")||!o||N(M))return;let _=M.touches[0];if(_)L.current={startTime:Date.now(),startX:_.clientX,startY:_.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},U.start(1000,()=>{if(L.current)L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1})}function Ce(M,_){let Se=Ze(M);if(!Se)return;let J=Ae(Se,M.type,()=>{_(M),J()})}function De(M){R.current="touch",Ce(M,we)}function Q(M){if(U.clear(),M.type==="pointerdown"){if(M.button===0)w.current=!0;R.current=M.pointerType}if(M.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;Ce(M,(_)=>{if(_.type==="pointerdown")ne(_);else be(_)})}function H(M){if(M.type==="pointercancel")w.current=!1;if(!C.current)return;let _=I.current;if(te(),ie()!=="intentional")return;if(M.type==="pointercancel"){if(_)Pe();return}if(fe(M))return;if(_){Pe();return}if(typeof S==="function"&&!S(M))return;V.clear(),y.current=!0,k()}function Y(M){if(ie()!=="sloppy"||!L.current||N(M))return;let _=M.touches[0];if(!_)return;let Se=Math.abs(_.clientX-L.current.startX),J=Math.abs(_.clientY-L.current.startY),se=Math.sqrt(Se*Se+J*J);if(se>5)L.current.dismissOnTouchEnd=!0;if(se>10)be(M),U.clear(),L.current=null}function D(M){Ce(M,Y)}function de(M){if(ie()!=="sloppy"||!L.current||N(M))return;if(L.current.dismissOnTouchEnd)be(M);U.clear(),L.current=null}function K(M){Ce(M,de)}let pe=to(r&&to(Ae(G,"keydown",T),Ae(G,"compositionstart",Z),Ae(G,"compositionend",ee)),g&&to(Ae(G,"click",Q,!0),Ae(G,"pointerdown",Q,!0),Ae(G,"pointerup",H,!0),Ae(G,"pointercancel",H,!0),Ae(G,"mousedown",Q,!0),Ae(G,"mouseup",H,!0),Ae(G,"touchstart",De,{capture:!0,passive:!0}),Ae(G,"touchmove",D,{capture:!0,passive:!0}),Ae(G,"touchend",K,{capture:!0,passive:!0})));return()=>{pe(),V.clear(),te(),y.current=!1}},[m,l,r,g,S,u,o,x,b,T,k,h,P,N,d,e,U,O]);let A=po.useMemo(()=>({onKeyDown:T,onPointerDown:j,onClick:j}),[T,j]),ue=po.useMemo(()=>({onKeyDown:T,onPointerDown:X,onMouseDown:X,onClickCapture:B,onMouseDownCapture(V){B(),W(V)},onPointerDownCapture(V){B(),W(V)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[T,B,W,X]);return po.useMemo(()=>o?{reference:A,floating:ue,trigger:A}:{},[o,A,ue])}import*as Rm from"react";import*as F0 from"react-dom";function Rs(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:a,onOpenChange:s}=e,i=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(o?"popupElement":"positionerElement"),l=s;return t.useSyncedValue("floatingId",n),z(()=>{let m={open:i,floatingId:n,referenceElement:c,floatingElement:u};if(Ve(c))m.domReferenceElement=c;if(r.state.positionReference===r.state.referenceElement)m.positionReference=c;r.update(m)},[i,n,c,u,r]),r.context.onOpenChange=l,r.context.nested=a,r}import*as vm from"react";function L0(e){let{open:t,ref:o,preventUnmountOnClose:r,setPreventUnmountOnClose:n,onUnmount:a,animateInitialOpen:s}=e,i=re(n),{mounted:c,setMounted:u,transitionStatus:l}=cc(t,!1,!1,s),m=t?!1:r;z(()=>{if(t)i(!1)},[t,i]);let p=vm.useRef(c),d=vm.useRef(!1),f=nc(),S=()=>{p.current=!1,u(!1),a()};z(()=>{if(p.current=c,d.current){if(d.current=!1,!t&&c)S()}});let g=re(()=>{if(!p.current)return;if(t){d.current=!0,f();return}S()});return $o({enabled:c&&!t&&!m,open:t,ref:o,onComplete(){if(!t)g()}}),{mounted:c,transitionStatus:l,preventUnmountingOnClose:m,forceUnmount:g}}var fa={tabIndex:-1,[as]:""};function O0(e){return(t)=>t==="touch"?e.current:!0}function Ac(e,t=!1){let o=Cr(),r=Do()!=null,n=Xe(()=>e(o,r)).current;return Rs({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function pa({handle:e,store:t}){return z(()=>e.attachStore(t),[e,t]),null}function D0(e){let t=e.context.triggerElements.size;if(e.select("open")&&e.state.triggerCount!==t)e.set("triggerCount",t)}function AC(e,t){let o=Rm.useRef(null);return re((r)=>{let n=o.current;if(n!==null){if(n.element===r&&n.store===t&&n.id===e)return;o.current=null;let a=n.store;if(a.context.triggerElements.getById(n.id)===n.element)a.context.triggerElements.delete(n.id),D0(a)}if(r!==null&&e!==void 0)o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),D0(t)})}function Ps(e,t,o,r=!1){let n=e.preventUnmountingOnClose;if(t)n=!1;else if(r)n=!0;let a=o?.id??null,{activeTriggerId:s,activeTriggerElement:i}=e;if(a||t)s=a,i=o??null;return{open:t,preventUnmountingOnClose:n,activeTriggerId:s,activeTriggerElement:i,openedWithoutTrigger:t?o==null:e.openedWithoutTrigger}}function Pm(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function N0(e,t,o,r={}){let n=o.reason,a=n===Yt,s=t&&n===sa,i=!t&&(n===aa||n===Qi),c=Pm(o);if(e.context.onOpenChange?.(t,o),o.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,o);let u=()=>{let l=Ps(e.state,t,o.trigger,c()),m={...r.extraState,...l};if(s)m.instantType="focus";else if(i)m.instantType="dismiss";else if(a)m.instantType=void 0;e.update(m)};if(a)F0.flushSync(u);else u()}function da(e,t,o,r){let n=o.useState("isMountedByTrigger",e),a=AC(e,o),s=re((c)=>{let u=o.select("open"),l=o.select("activeTriggerId");if(l===e){let m={activeTriggerElement:c,...u?r:null};o.update(m);return}if(l==null&&u&&!o.state.openedWithoutTrigger){let m={activeTriggerId:e??null,activeTriggerElement:c,...r};o.update(m)}}),i=re((c)=>{if(a(c),c)s(c)});return z(()=>(i(t.current),()=>i(null)),[i,t,o,e]),z(()=>{if(n){let c={activeTriggerElement:t.current,...r};o.update(c)}},[n,o,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:n}}function ga(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=Rm.useRef(null),n=e.useState("open"),a=e.useState("triggerCount"),s=e.useState("activeTriggerId"),i=e.useState("activeTriggerElement");z(()=>{if(!n){if(r.current=null,e.state.triggerCount!==0)e.set("triggerCount",0);if(e.state.openedWithoutTrigger)e.set("openedWithoutTrigger",!1);return}let c=e.context.triggerElements.size,u={};if(e.state.triggerCount!==c)u.triggerCount=c;let l=e.select("activeTriggerId"),m=null;if(l){let p=e.context.triggerElements.getById(l);if(!p){for(let[d,f]of e.context.triggerElements.entries())if(f===e.state.activeTriggerElement){u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d;break}if(u.activeTriggerId===void 0)if(r.current===l)m=l;else r.current=null}else if(r.current=l,p!==e.state.activeTriggerElement)u.activeTriggerElement=p}else r.current=null;if(!m&&!l&&!e.state.openedWithoutTrigger&&c===1){let p=e.context.triggerElements.entries().next();if(!p.done){let[d,f]=p.value;u.activeTriggerId=d,u.activeTriggerElement=f,r.current=d}}if(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)e.update(u);if(m){if(o)queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){let p=Re(Rn);if(e.setOpen(!1,p),!p.isCanceled)e.update({activeTriggerId:null,activeTriggerElement:null})}})}},[n,e,a,s,i,o])}function ha(e,t,o,r){let{mounted:n,transitionStatus:a,forceUnmount:s}=L0({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:(i)=>t.set("preventUnmountingOnClose",i),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)}});return Xe(()=>(t.set("mounted",n),null)),t.useSyncedValues({mounted:n,transitionStatus:a}),{forceUnmount:s,transitionStatus:a}}function Ia(e,t){e.useSyncedValues(t),z(()=>()=>{e.update({activeTriggerProps:Ue,inactiveTriggerProps:Ue,popupProps:Ue})},[e])}function B0(e,t){z(()=>{if(!t&&e.state.openMethod!==null)e.set("openMethod",null)},[t,e]),z(()=>()=>{if(e.state.openMethod!==null)e.set("openMethod",null)},[e])}class Dn{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var km=bp(Mc(),1);import*as _0 from"react";import*as rn from"react";var _C=Mc();function WC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zC=typeof Object.is==="function"?Object.is:WC,GC=_C.useSyncExternalStore,ZC=rn.useRef,$C=rn.useEffect,qC=rn.useMemo,jC=rn.useDebugValue;var Em=function(e,t,o,r,n){var a=ZC(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=qC(function(){function c(d){if(!u){if(u=!0,l=d,d=r(d),n!==void 0&&s.hasValue){var f=s.value;if(n(f,d))return m=f}return m=d}if(f=m,zC(l,d))return f;var S=r(d);if(n!==void 0&&n(f,S))return l=d,f;return l=d,m=S}var u=!1,l,m,p=o===void 0?null:o;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,o,r,n]);var i=GC(e,a[0],a[1]);return $C(function(){s.hasValue=!0,s.value=i},[i]),jC(i),i};import*as H0 from"react";var Am=[],Mm=void 0;function V0(){return Mm}function U0(e){Am.push(e)}function Fn(e){let t=(o,r)=>{let n=Xe(XC).current,a;try{Mm=n;for(let s of Am)s.before(n);a=e(o,r);for(let s of Am)s.after(n);n.didInitialize=!0}finally{Mm=void 0}return a};return t.displayName=e.displayName||e.name,t}function ba(e){return H0.forwardRef(Fn(e))}function XC(){return{didInitialize:!1}}var YC=Kn(19),KC=YC?QC:eS;function kc(e,t,o,r,n){return KC(e,t,o,r,n)}function JC(e,t,o,r,n){let a=_0.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return km.useSyncExternalStore(e.subscribe,a,a)}U0({before(e){if(e.syncIndex=0,!e.didInitialize)e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);if(!Object.is(r.value,n))t=!0,r.value=n}if(t)e.syncTick+=1;return e.syncTick}},after(e){if(e.syncHooks.length>0){if(e.didChangeStore)e.didChangeStore=!1,e.subscribe=(t)=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}};km.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}}});function QC(e,t,o,r,n){let a=V0();if(!a)return JC(e,t,o,r,n);let s=a.syncIndex;a.syncIndex+=1;let i;if(!a.didInitialize)i={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},a.syncHooks.push(i);else if(i=a.syncHooks[s],i.store!==e||i.selector!==t||!Object.is(i.a1,o)||!Object.is(i.a2,r)||!Object.is(i.a3,n)){if(i.store!==e)a.didChangeStore=!0;i.store=e,i.selector=t,i.a1=o,i.a2=r,i.a3=n,i.value=t(e.getSnapshot(),o,r,n)}return i.value}function eS(e,t,o,r,n){return Em(e.subscribe,e.getSnapshot,e.getSnapshot,(a)=>t(a,o,r,n))}class Lm{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=(e)=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let o of this.listeners){if(t!==this.updateTick)return;o(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){if(!Object.is(this.state[e],t))this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,o,r){return kc(this,e,t,o,r)}}import*as On from"react";class ir extends Lm{constructor(e,t={},o){super(e);this.context=t,this.selectors=o}useSyncedValue(e,t){On.useDebugValue(e);let o=this;z(()=>{if(o.state[e]!==t)o.set(e,t)},[o,e,t])}useSyncedValueWithCleanup(e,t){let o=this;z(()=>{if(o.state[e]!==t)o.set(e,t);return()=>{o.set(e,void 0)}},[o,e,t])}useSyncedValues(e){let t=this,o=Object.values(e);z(()=>{t.update(e)},[t,...o])}useControlledProp(e,t){On.useDebugValue(e);let o=this,r=t!==void 0;z(()=>{if(r&&!Object.is(o.state[e],t))o.setState({...o.state,[e]:t})},[o,e,t,r])}select(e,t,o,r){let n=this.selectors[e];return n(this.state,t,o,r)}useState(e,t,o,r){return On.useDebugValue(e),kc(this,this.selectors[e],t,o,r)}useContextCallback(e,t){On.useDebugValue(e);let o=re(t??Ye);this.context[e]=o}useStateSetter(e){let t=On.useRef(void 0);if(t.current===void 0)t.current=(o)=>{this.set(e,o)};return t.current}observe(e,t){let o;if(typeof e==="function")o=e;else o=this.selectors[e];let r=o(this.state);return t(r,r,this),this.subscribe((n)=>{let a=o(n);if(!Object.is(r,a)){let s=r;r=a,t(a,s,this)}})}}var tS={open:(e)=>e.open,transitionStatus:(e)=>e.transitionStatus,domReferenceElement:(e)=>e.domReferenceElement,referenceElement:(e)=>e.positionReference??e.referenceElement,floatingElement:(e)=>e.floatingElement,floatingId:(e)=>e.floatingId};class Dm extends ir{constructor(e){let{syncOnly:t,nested:o,onOpenChange:r,triggerElements:n,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ec(),nested:o,triggerElements:n},tS);this.syncOnly=t}syncOpenEvent=(e,t)=>{if(!e||!this.state.open||t!=null&&Gd(t))this.context.dataRef.current.openEvent=e?t:void 0};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let o={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",o)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}function Ca(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Dm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ue,inactiveTriggerProps:Ue,popupProps:Ue}}var Ts=(e)=>e.triggerIdProp??e.activeTriggerId,Lc=(e)=>e.openProp??e.open,W0=(e)=>(e.popupElement?.id??e.floatingId)||void 0;function z0(e,t){return t!==void 0&&Lc(e)&&Ts(e)===t}function oS(e,t){if(z0(e,t))return!0;return t!==void 0&&Lc(e)&&Ts(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var nn={open:Lc,mounted:(e)=>e.mounted,transitionStatus:(e)=>Lc(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:(e)=>e.floatingRootContext,triggerCount:(e)=>e.triggerCount,preventUnmountingOnClose:(e)=>e.preventUnmountingOnClose,payload:(e)=>e.payload,activeTriggerId:Ts,activeTriggerElement:(e)=>e.mounted?e.activeTriggerElement:null,popupId:W0,isTriggerActive:(e,t)=>t!==void 0&&Ts(e)===t,isOpenedByTrigger:(e,t)=>z0(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ts(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>oS(e,t)?W0(e):void 0,popupProps:(e)=>e.popupProps,popupElement:(e)=>e.popupElement,positionerElement:(e)=>e.positionerElement};var G0=bp(Mc(),1);import*as Fm from"react";function Sa(e){let t=Fm.useCallback((r)=>{if(e===void 0)return Ye;return e.subscribeStore(r)},[e]),o=Fm.useCallback(()=>e===void 0?void 0:e.store,[e]);return G0.useSyncExternalStore(t,o,()=>e?.serverStore)}import*as vr from"react";var Om=kr.mac&&Lr.webkit;function Es(e,t={}){let{enabled:o=!0,delay:r}=t,{events:n,dataRef:a}=e.context,s=vr.useRef(!1),i=vr.useRef(null),c=vr.useRef(!0),u=Je();vr.useEffect(()=>{let m=e.select("domReferenceElement");if(!o)return;let p=qe(m);function d(){let g=e.select("domReferenceElement");if(!e.select("open")&&je(g)&&g===st(Ee(g)))s.current=!0,i.current=g}function f(){c.current=!0}function S(){c.current=!1}return to(Ae(p,"blur",d),Om&&Ae(p,"keydown",f,!0),Om&&Ae(p,"pointerdown",S,!0))},[e,o]),vr.useEffect(()=>{if(!o)return;function m(p){if(p.reason===aa||p.reason===Qi){let d=e.select("domReferenceElement");if(Ve(d))i.current=d,s.current=!0}}return n.on("openchange",m),()=>{n.off("openchange",m)}},[n,o,e]);let l=vr.useMemo(()=>{function m(){s.current=!1,i.current=null}return{onMouseLeave(){m()},onFocus(p){let d=p.currentTarget;if(s.current){if(i.current===d)return;m()}let f=Ze(p.nativeEvent);if(Ve(f)){if(Om&&!p.relatedTarget){if(!c.current&&!Fr(f))return}else if(!Qr(f))return}let S=Jr(p.relatedTarget,e.context.triggerElements),{nativeEvent:g,currentTarget:h}=p;if(e.select("open")&&S||!r){e.setOpen(!0,Re(sa,g,h));return}u.start(r,()=>{if(s.current)return;e.setOpen(!0,Re(sa,g,h))})},onBlur(p){m();let{relatedTarget:d,nativeEvent:f}=p,S=Ve(d)&&d.hasAttribute(yr("focus-guard"))&&d.getAttribute("data-type")==="outside";u.start(0,()=>{let g=e.select("domReferenceElement"),h=st(Ee(g));if(!d&&h===g)return;if(le(a.current.floatingContext?.refs.floating.current,h)||le(g,h)||S)return;if(Jr(d??h,e.context.triggerElements))return;e.setOpen(!1,Re(sa,f))})}}},[a,r,e,u]);return vr.useMemo(()=>o?{reference:l,trigger:l}:{},[o,l])}import*as Bm from"react";class Nm{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new eo;restTimeout=new eo;handleCloseOptions=void 0;static create(){return new Nm}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var Dc=new WeakMap;function xa(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Dc.get(t)===e)e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Dc.delete(t);e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Fc(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,a=Dc.get(o);if(a&&a!==e)xa(a);xa(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,Dc.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function wa(e){let t=e.context.dataRef.current,o=Xe(()=>t.hoverInteractionState??Nm.create()).current;if(!t.hoverInteractionState)t.hoverInteractionState=o;return Yr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function As(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,a=e.useState("open"),s=e.useState("floatingElement"),i=e.useState("domReferenceElement"),{dataRef:c}=e.context,u=fo(),l=Do(),m=wa(e),p=Je(),d=re(()=>fc(c.current.openEvent?.type,m.interactedInside)),f=re(()=>qd(c.current.openEvent?.type)),S=re(()=>{xa(m)});z(()=>{if(!a)m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,S()},[a,m,S]),Bm.useEffect(()=>S,[S]),z(()=>{if(!o)return;if(a&&m.handleCloseOptions?.blockPointerEvents&&f()&&Ve(i)&&s){let g=i,h=s,x=Ee(s),b=u?.nodesRef.current.find((w)=>w.id===l)?.context?.elements.floating;if(b)b.style.pointerEvents="";let C=m.pointerEventsScopeElement!==h?m.pointerEventsScopeElement:null,I=b!==h?b:null,y=m.handleCloseOptions?.getScope?.()??C??I??rr(g,"[data-rootownerid]")??x.body;return Fc(m,{scopeElement:y,referenceElement:g,floatingElement:h}),()=>{S()}}return},[o,a,i,s,m,f,u,l,S]),Bm.useEffect(()=>{if(!o)return;function g(){return!!(u&&l&&qo(u.nodesRef.current,l).length>0)}function h(w){let v=Or(r,"close",m.pointerType),R=()=>{e.setOpen(!1,Re(Yt,w)),u?.events.emit("floating.closed",w)};if(v)m.openChangeTimeout.start(v,R);else m.openChangeTimeout.clear(),R()}function x(w){let v=Ze(w);if(!om(v)){m.interactedInside=!1;return}m.interactedInside=rr(v,"[aria-haspopup]")!=null}function b(){m.openChangeTimeout.clear(),p.clear(),u?.events.off("floating.closed",I),S()}function C(w){if(g()&&u){u.events.on("floating.closed",I);return}if(Jr(w.relatedTarget,e.context.triggerElements))return;let v=c.current.floatingContext?.nodeId??n,R=w.relatedTarget;if(u&&v&&Ve(R)&&qo(u.nodesRef.current,v,!1).some((U)=>le(U.context?.elements.floating,R)))return;if(m.handler){m.handler(w);return}if(S(),f()&&!d())h(w)}function I(w){if(!u||!l||g())return;p.start(0,()=>{u.events.off("floating.closed",I),e.setOpen(!1,Re(Yt,w)),u.events.emit("floating.closed",w)})}let y=s;return to(y&&Ae(y,"mouseenter",b),y&&Ae(y,"mouseleave",C),y&&Ae(y,"pointerdown",x,!0),()=>{u?.events.off("floating.closed",I)})},[o,s,e,c,r,n,f,d,S,m,u,l,p])}import*as an from"react";import*as Z0 from"react-dom";var rS={current:null};function Ms(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:a=!1,restMs:s=0,move:i=!0,triggerElementRef:c=rS,externalTree:u,isActiveTrigger:l=!0,getHandleCloseContext:m,isClosing:p,shouldOpen:d,guardStaleOpen:f=!1}=t,{dataRef:S,events:g}=e.context,h=fo(u),x=wa(e),b=an.useRef(!1),C=ct(n),I=ct(r),y=ct(s),w=ct(o),v=ct(d),R=ct(p),L=re(()=>fc(S.current.openEvent?.type,x.interactedInside)),U=re(()=>v.current?.()!==!1),E=re((P,N,j)=>{let T=e.context.triggerElements;if(T.hasElement(N))return!P||!le(P,N);if(!Ve(j))return!1;let B=j;return T.hasMatchingElement((W)=>le(W,B))&&(!P||!le(P,B))}),O=re(()=>{if(!x.handler)return;Ee(e.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),k=re(()=>{xa(x)});if(l)x.handleCloseOptions=n?.__options;return an.useEffect(()=>O,[O]),an.useEffect(()=>{if(!o)return;function P(N){if(!N.open)b.current=N.reason===Yt,O(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1;else b.current=!1}return g.on("openchange",P),()=>{g.off("openchange",P)}},[o,g,x,O]),an.useEffect(()=>{if(!o)return;function P(X,A=!0){let ue=Or(I.current,"close",x.pointerType);if(ue)x.openChangeTimeout.start(ue,()=>{e.setOpen(!1,Re(Yt,X)),h?.events.emit("floating.closed",X)});else if(A)x.openChangeTimeout.clear(),e.setOpen(!1,Re(Yt,X)),h?.events.emit("floating.closed",X)}let N=c.current??(l?e.select("domReferenceElement"):null);if(!Ve(N))return;function j(X){if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,a&&!ko(x.pointerType))return;let A=rm(y.current),ue=Or(I.current,"open",x.pointerType),V=Ze(X),G=X.currentTarget??null,Z=e.select("domReferenceElement"),ee=G;if(Ve(V)&&!e.context.triggerElements.hasElement(V)){for(let Ce of e.context.triggerElements.elements())if(le(Ce,V)){ee=Ce;break}}if(Ve(G)&&Ve(Z)&&!e.context.triggerElements.hasElement(G)&&le(G,Z))ee=Z;let Pe=ee==null?!1:E(Z,ee,V),te=e.select("open"),ie=R.current?.()??e.select("transitionStatus")==="ending",me=!te&&ie&&b.current,fe=!Pe&&Ve(ee)&&Ve(Z)&&le(Z,ee)&&me,be=A>0&&!ue,ne=Pe&&(te||me)||fe,we=!te||Pe;if(ne){if(U())e.setOpen(!0,Re(Yt,X,ee));return}if(be)return;if(ue)x.openChangeTimeout.start(ue,()=>{if(we&&U())e.setOpen(!0,Re(Yt,X,ee))});else if(we){if(U())e.setOpen(!0,Re(Yt,X,ee))}}function T(X){if(L()){k();return}O();let A=e.select("domReferenceElement"),ue=Ee(A);x.restTimeout.clear(),x.restTimeoutPending=!1;let V=S.current.floatingContext??m?.();if(Jr(X.relatedTarget,e.context.triggerElements))return;if(C.current&&V){if(!e.select("open"))x.openChangeTimeout.clear();let Z=c.current;x.handler=C.current({...V,tree:h,x:X.clientX,y:X.clientY,onClose(){if(k(),O(),w.current&&!L()&&Z===e.select("domReferenceElement"))P(X,!0)}}),ue.addEventListener("mousemove",x.handler),x.handler(X);return}if(x.pointerType==="touch"?!le(e.select("floatingElement"),X.relatedTarget):!0)P(X)}function B(X){if(le(N,X.relatedTarget))return;x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1}let W=f?Ae(N,"mouseout",B):void 0;if(i)return to(Ae(N,"mousemove",j,{once:!0}),Ae(N,"mouseenter",j),Ae(N,"mouseleave",T),W);return to(Ae(N,"mouseenter",j),Ae(N,"mouseleave",T),W)},[O,k,S,I,e,o,C,x,l,E,L,a,i,y,c,h,w,m,R,U,f]),an.useMemo(()=>{if(!o)return;function P(N){x.pointerType=N.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(N){let{nativeEvent:j}=N,T=N.currentTarget,B=e.select("domReferenceElement"),W=e.select("open"),X=E(B,T,N.target);if(a&&!ko(x.pointerType))return;if(W&&X&&x.handleCloseOptions?.blockPointerEvents){let V=e.select("floatingElement");if(V){let G=x.handleCloseOptions?.getScope?.()??T.ownerDocument.body;Fc(x,{scopeElement:G,referenceElement:T,floatingElement:V})}}let A=rm(y.current);if(W&&!X||A===0)return;if(!X&&x.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;x.restTimeout.clear();function ue(){if(x.restTimeoutPending=!1,L())return;let V=e.select("open");if(!x.blockMouseMove&&(!V||X)&&U())e.setOpen(!0,Re(Yt,j,T))}if(x.pointerType==="touch")Z0.flushSync(()=>{ue()});else if(X&&W)ue();else x.restTimeoutPending=!0,x.restTimeout.start(A,ue)}}},[o,x,L,E,a,e,y,U])}import*as io from"react";function $0(e){return Lr.webkit&&e.movementX===0&&e.movementY===0}function Nc(e,t,o){switch(e){case"vertical":return t;case"horizontal":return o;default:return t||o}}function Oc(e,t){return Nc(t,e===tm||e===uc,e===ss||e===is)}function Hm(e,t,o){return Nc(t,e===uc,o?e===ss:e===is)||e==="Enter"||e===" "||e===""}function nS(e,t,o){return Nc(t,o?e===ss:e===is,e===uc)}function aS(e,t,o,r){let n=o?e===is:e===ss,a=e===tm;if(t==="both"||t==="horizontal"&&r)return e==="Escape";return Nc(t,n,a)}function Vm(e,t){let{listRef:o,activeIndex:r,onNavigate:n=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:i=!1,loopFocus:c=!1,nested:u=!1,rtl:l=!1,virtual:m=!1,focusItemOnOpen:p="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:f=!0,disabledIndices:S=void 0,orientation:g="vertical",triggerOrientation:h=g,parentOrientation:x,id:b,resetOnPointerLeave:C=!0,externalTree:I,nestedReturnFocusRef:y,grid:w}=t,v=w!=null,R=e.useState("open"),L=e.useState("floatingElement"),U=e.useState("domReferenceElement"),E=e.context.dataRef,O=us(L),k=ls(U),P=ct(O),N=Do(),j=fo(I),T=io.useRef(p),B=io.useRef(s??-1),W=io.useRef(null),X=io.useRef(!0),A=re((M)=>{n(B.current===-1?null:B.current,M)}),ue=io.useRef(!!L),V=io.useRef(R),G=io.useRef(!1),Z=io.useRef(!1),ee=io.useRef(null),Pe=ct(S),te=ct(R),ie=ct(s),me=ct(C),fe=Dr(),be=Dr(),ne=re(()=>{fe.cancel();function M(se){if(!m)ee.current=ma(se,{sync:G.current,preventScroll:!0})}let _=o.current[B.current],Se=Z.current;if(_)M(_);(G.current?(se)=>se():(se)=>fe.request(se))(()=>{let se=o.current[B.current]||_;if(!se)return;if(!_)M(se);if(Y&&(Se||!X.current))se.scrollIntoView?.({block:"nearest",inline:"nearest"})})});z(()=>{E.current.orientation=g},[E,g]),z(()=>{if(!R)W.current=null;if(!R||p!=="auto")T.current=p},[R,p]),z(()=>{if(!a)return;if(R&&L){if(B.current=s??-1,T.current&&s!=null)Z.current=!0,A()}else if(ue.current)B.current=-1,A()},[a,R,L,s,A]),z(()=>{if(!a)return;if(!R){G.current=!1;return}if(!L)return;if(r==null){if(G.current=!1,ie.current!=null)return;if(ue.current)B.current=-1,ne();if((!V.current||!ue.current)&&T.current&&(W.current!=null||T.current===!0&&W.current==null)){let M=0,_=()=>{if(o.current[0]==null){if(M<2)(M?(J)=>be.request(J):queueMicrotask)(_);M+=1}else B.current=W.current==null||Hm(W.current,h,l)||u?Sc(o):am(o),W.current=null,A()};_()}}else if(!Cc(o.current,r))B.current=r,ne(),Z.current=!1},[a,R,L,r,ie,u,o,h,l,A,ne,be]),z(()=>{if(!a||L||!j||m||!ue.current)return;let M=j.nodesRef.current,_=M.find((se)=>se.id===N)?.context?.elements.floating,Se=st(Ee(U??_??null)),J=M.some((se)=>se.context&&le(se.context.elements.floating,Se));if(_&&!J&&X.current)_.focus({preventScroll:!0})},[a,L,U,j,N,m]),z(()=>{V.current=R,ue.current=!!L});let we=r!=null,Ce=re((M)=>{if(!te.current)return;let _=o.current.indexOf(M.currentTarget);if(_!==-1&&(B.current!==_||r!==_))B.current=_,A(M)}),De=re(()=>x??j?.nodesRef.current.find((M)=>M.id===N)?.context?.dataRef?.current.orientation),Q=re(()=>Sc(o,Pe.current)),H=re((M)=>{if(X.current=!1,G.current=!0,M.which===229)return;if(!te.current&&M.currentTarget===P.current)return;if(u&&aS(M.key,g,l,v)){if(!Oc(M.key,De()))Mo(M);e.setOpen(!1,Re(ec,M.nativeEvent));let se=y?.current??U;if(je(se))se.focus();return}if(r!=null&&r!==B.current&&!Cc(o.current,r))B.current=r;let _=B.current,Se=Sc(o,S),J=am(o,S);if(!k){if(M.key==="Home")Mo(M),B.current=Se,A(M);if(M.key==="End")Mo(M),B.current=J,A(M)}if(w!=null){let se=w(M,B.current,o,g,c,l,S,Se,J);if(se!=null&&se!==B.current)B.current=se,A(M);if(g==="both")return}if(Oc(M.key,g)){Mo(M);let se=st(M.currentTarget.ownerDocument);if(R&&!m&&le(M.currentTarget,se)&&!o.current.some((Ie)=>Ie!=null&&le(Ie,se))){if(B.current=Hm(M.key,g,l)?Se:J,A(M),r===B.current)ne();return}let{index:ge,wrapped:he}=e0(o.current,_,{decrement:!Hm(M.key,g,l),loopFocus:c,allowEscape:i,disabledIndices:S,minIndex:Se,maxIndex:J});if(he)G.current=!1;B.current=ge,A(M)}}),Y=io.useMemo(()=>({onFocus(_){G.current=!0,Ce(_)},onClick({currentTarget:_}){if(!m)_.focus({preventScroll:!0})},onMouseMove(_){if($0(_))return;if(G.current=!0,Z.current=!1,d)Ce(_)},onPointerLeave(_){if(!te.current||!X.current||_.pointerType==="touch")return;G.current=!0;let Se=_.relatedTarget;if(!d||o.current.includes(Se))return;if(!me.current)return;if(ee.current?.(),ee.current=null,B.current=-1,A(_),!m){let J=P.current,se=st(Ee(J));if(J&&le(J,se))J.focus({preventScroll:!0})}}}),[Ce,te,P,d,o,A,me,m]),D=io.useMemo(()=>m&&R&&we&&{"aria-activedescendant":`${b}-${r}`},[m,R,we,b,r]),de=io.useMemo(()=>({...!k?D:{},onKeyDown(M){if(M.key==="Tab"&&M.shiftKey&&R&&!m){let _=Ze(M.nativeEvent);if(_&&!le(P.current,_))return;Mo(M);let Se=Re(ia,M.nativeEvent);e.setOpen(!1,Se);let J=y?.current??U;if(!Se.isCanceled&&je(J))J.focus();return}H(M)},onPointerMove(M){if($0(M))return;X.current=!0}}),[D,H,P,k,e,R,m,U,y]),K=io.useMemo(()=>{function M(J){e.setOpen(!0,Re(ec,J.nativeEvent,J.currentTarget))}function _(J){if(p==="auto"&&Kr(J.nativeEvent))T.current=!m}function Se(J){if(T.current=p,p==="auto"&&ua(J.nativeEvent))T.current=!0}return{onKeyDown(J){let se=e.select("open");X.current=!1;let ge=J.key.startsWith("Arrow"),he=nS(J.key,De(),l),Ie=Oc(J.key,se?g:h),Ne=(u?he:Ie)||J.key==="Enter"||J.key.trim()==="";if(m&&se&&(!u||Fr(J.currentTarget)))return H(J);if(!se&&!f&&ge)return;if(Ne){let Qe=Oc(J.key,De());W.current=u&&Qe?null:J.key}if(u){if(he)if(Mo(J),se){if(B.current=Q(),A(J),m)P.current?.focus()}else M(J);return}if(Ie){if(ie.current!=null)B.current=ie.current;if(Mo(J),!se&&f)M(J);else H(J);if(se)A(J)}return},onFocus(J){if(J.target!==J.currentTarget)return;if(e.select("open")&&!m)B.current=-1,A(J)},onPointerDown:Se,onPointerEnter:Se,onMouseDown:_,onClick:_}},[H,p,Q,u,A,e,f,g,h,De,l,ie,m,P]),pe=io.useMemo(()=>({...D,...K}),[D,K]);return io.useMemo(()=>a?{reference:pe,floating:de,item:Y,trigger:K}:{},[a,pe,de,K,Y])}import*as Nn from"react";function Um(e,t){let{listRef:o,elementsRef:r,activeIndex:n,onMatch:a,disabledIndices:s,onTyping:i,enabled:c=!0,resetMs:u=750,selectedIndex:l=null}=t,m=re(i),p=e.useState("open"),d=Je(),f=Nn.useRef(""),S=Nn.useRef(l??n??-1),g=Nn.useRef(null),h=re((C)=>{function I(k){return r?.current[k]}function y(k){let P=I(k);if(P&&!Mn(P)||P?.matches(":disabled"))return!1;return s==null||!im(Mr,k,s)}function w(k,P,N=0){if(k.length===0)return-1;let j=(N%k.length+k.length)%k.length,T=P.toLowerCase();for(let B=0;B<k.length;B+=1){let W=(j+B)%k.length;if(!k[W]?.toLowerCase().startsWith(T)||!y(W))continue;return W}return-1}let v=o.current;if(f.current.length>0&&C.key===" ")Mo(C),m?.(!0);if(f.current.length>0&&f.current[0]!==" "){if(w(v,f.current)===-1&&C.key!==" ")m?.(!1)}if(v==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;if(p&&C.key!==" ")Mo(C),m?.(!0);let R=f.current==="";if(R)S.current=l??n??-1;if(v.every((k,P)=>k&&y(P)?k[0]?.toLowerCase()!==k[1]?.toLowerCase():!0)&&f.current===C.key)f.current="",S.current=g.current;f.current+=C.key,d.start(u,()=>{f.current="",S.current=g.current,m?.(!1)});let E=((R?l??n??-1:S.current)??0)+1,O=w(v,f.current,E);if(O!==-1)a?.(O,C),g.current=O;else if(C.key!==" ")f.current="",m?.(!1)}),x=re((C)=>{let I=C.relatedTarget,y=e.select("domReferenceElement"),w=e.select("floatingElement");if(le(y,I)||le(w,I))return;d.clear(),f.current="",S.current=g.current,m?.(!1)});z(()=>{if(!p&&l!==null)return;if(d.clear(),g.current=null,f.current!=="")f.current="",m?.(!1)},[p,l,d,m]);let b=Nn.useMemo(()=>({onKeyDown:h,onBlur:x}),[h,x]);return Nn.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var q0=0.1,sS=q0*q0,ot=0.5;function Bc(e,t,o,r,n,a){return r>=t!==a>=t&&e<=(n-o)*(t-r)/(a-r)+o}function Hc(e,t,o,r,n,a,s,i,c,u){let l=!1;if(Bc(e,t,o,r,n,a))l=!l;if(Bc(e,t,n,a,s,i))l=!l;if(Bc(e,t,s,i,c,u))l=!l;if(Bc(e,t,c,u,o,r))l=!l;return l}function iS(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function Vc(e,t,o,r,n,a){let s=Math.min(o,n),i=Math.max(o,n),c=Math.min(r,a),u=Math.max(r,a);return e>=s&&e<=i&&t>=c&&t<=u}function ks(e={}){let{blockPointerEvents:t=!1}=e,o=new eo,r=({x:n,y:a,placement:s,elements:i,onClose:c,nodeId:u,tree:l})=>{let m=s?.split("-")[0],p=!1,d=null,f=null,S=typeof performance<"u"?performance.now():0;function g(x,b){let C=performance.now(),I=C-S;if(d===null||f===null||I===0)return d=x,f=b,S=C,!1;let y=x-d,w=b-f,v=y*y+w*w,R=I*I*sS;return d=x,f=b,S=C,v<R}function h(){o.clear(),c()}return function(b){o.clear();let{domReference:C,floating:I}=i;if(!C||!I||m==null||n==null||a==null)return;let{clientX:y,clientY:w}=b,v=Ze(b),R=b.type==="mouseleave",L=le(I,v),U=le(C,v);if(L){if(p=!0,!R)return}if(U){if(p=!1,!R){p=!0;return}}if(R&&Ve(b.relatedTarget)&&le(I,b.relatedTarget))return;function E(){return Boolean(l&&qo(l.nodesRef.current,u).length>0)}function O(){if(!E())h()}if(E())return;let k=C.getBoundingClientRect(),P=I.getBoundingClientRect(),N=n>P.right-P.width/2,j=a>P.bottom-P.height/2,T=P.width>k.width,B=P.height>k.height,W=(T?k:P).left,X=(T?k:P).right,A=(B?k:P).top,ue=(B?k:P).bottom;if(m==="top"&&a>=k.bottom-1||m==="bottom"&&a<=k.top+1||m==="left"&&n>=k.right-1||m==="right"&&n<=k.left+1){O();return}let V=!1;switch(m){case"top":V=Vc(y,w,W,k.top+1,X,P.bottom-1);break;case"bottom":V=Vc(y,w,W,P.top+1,X,k.bottom-1);break;case"left":V=Vc(y,w,P.right-1,ue,k.left+1,A);break;case"right":V=Vc(y,w,k.right-1,ue,P.left+1,A);break;default:}if(V)return;if(p&&!iS(y,w,k)){O();return}if(!R&&g(y,w)){O();return}let G=!1;switch(m){case"top":{let Z=T?ot/2:ot*4,ee=T?n+Z:N?n+Z:n-Z,Pe=T?n-Z:N?n+Z:n-Z,te=a+ot+1,ie=N?P.bottom-ot:T?P.bottom-ot:P.top,me=N?T?P.bottom-ot:P.top:P.bottom-ot;G=Hc(y,w,ee,te,Pe,te,P.left,ie,P.right,me);break}case"bottom":{let Z=T?ot/2:ot*4,ee=T?n+Z:N?n+Z:n-Z,Pe=T?n-Z:N?n+Z:n-Z,te=a-ot,ie=N?P.top+ot:T?P.top+ot:P.bottom,me=N?T?P.top+ot:P.bottom:P.top+ot;G=Hc(y,w,ee,te,Pe,te,P.left,ie,P.right,me);break}case"left":{let Z=B?ot/2:ot*4,ee=B?a+Z:j?a+Z:a-Z,Pe=B?a-Z:j?a+Z:a-Z,te=n+ot+1,ie=j?P.right-ot:B?P.right-ot:P.left,me=j?B?P.right-ot:P.left:P.right-ot;G=Hc(y,w,ie,P.top,me,P.bottom,te,ee,te,Pe);break}case"right":{let Z=B?ot/2:ot*4,ee=B?a+Z:j?a+Z:a-Z,Pe=B?a-Z:j?a+Z:a-Z,te=n-ot,ie=j?P.left+ot:B?P.left+ot:P.right,me=j?B?P.left+ot:P.right:P.left+ot;G=Hc(y,w,te,ee,te,Pe,ie,P.top,me,P.bottom);break}default:}if(!G)O();else if(!p)o.start(40,O);return}};return r.__options={...e,blockPointerEvents:t},r}function j0(e,t,o){let{reference:r,floating:n}=e,a=Ro(t),s=gs(t),i=ds(s),c=wo(t),u=a==="y",l=r.x+r.width/2-n.width/2,m=r.y+r.height/2-n.height/2,p=r[i]/2-n[i]/2,d;switch(c){case"top":d={x:l,y:r.y-n.height};break;case"bottom":d={x:l,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:m};break;case"left":d={x:r.x-n.width,y:m};break;default:d={x:r.x,y:r.y}}let f=Lo(t);if(f)d[s]+=p*(f==="end"?1:-1)*(o&&u?-1:1);return d}async function X0(e,t){var o;if(t===void 0)t={};let{x:r,y:n,platform:a,rects:s,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:m="floating",altBoundary:p=!1,padding:d=0}=wr(t,e),f=bc(d),g=i[p?m==="floating"?"reference":"floating":m],h=An(await a.getClippingRect({element:((o=await(a.isElement==null?void 0:a.isElement(g)))!=null?o:!0)?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),x=m==="floating"?{x:r,y:n,width:s.floating.width,height:s.floating.height}:s.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),C=await(a.isElement==null?void 0:a.isElement(b))&&await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},I=An(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:b,strategy:c}):x);return{top:(h.top-I.top+f.top)/C.y,bottom:(I.bottom-h.bottom+f.bottom)/C.y,left:(h.left-I.left+f.left)/C.x,right:(I.right-h.right+f.right)/C.x}}var cS=50,Y0=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:s}=o,i=s.detectOverflow?s:{...s,detectOverflow:X0},c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:l,y:m}=j0(u,r,c),p=r,d=0,f={};for(let S=0;S<a.length;S++){let g=a[S];if(!g)continue;let{name:h,fn:x}=g,{x:b,y:C,data:I,reset:y}=await x({x:l,y:m,initialPlacement:r,placement:p,strategy:n,middlewareData:f,rects:u,platform:i,elements:{reference:e,floating:t}});if(l=b!=null?b:l,m=C!=null?C:m,f[h]={...f[h],...I},y&&d<cS){if(d++,typeof y==="object"){if(y.placement)p=y.placement;if(y.rects)u=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):y.rects;({x:l,y:m}=j0(u,p,c))}S=-1}}return{x:l,y:m,placement:p,strategy:n,middlewareData:f}};var K0=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:a,rects:s,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:S=!0,...g}=wr(e,t);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let h=wo(n),x=Ro(i),b=wo(i)===i,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),I=p||(b||!S?[ms(i)]:Jd(i)),y=f!=="none";if(!p&&y)I.push(...Qd(i,S,f,C));let w=[i,...I],v=await c.detectOverflow(t,g),R=[],L=((r=a.flip)==null?void 0:r.overflows)||[];if(l)R.push(v[h]);if(m){let k=Kd(n,s,C);R.push(v[k[0]],v[k[1]])}if(L=[...L,{placement:n,overflows:R}],!R.every((k)=>k<=0)){var U,E;let k=(((U=a.flip)==null?void 0:U.index)||0)+1,P=w[k];if(P){if(!(m==="alignment"?x!==Ro(P):!1)||L.every((T)=>Ro(T.placement)===x?T.overflows[0]>0:!0))return{data:{index:k,overflows:L},reset:{placement:P}}}let N=(E=L.filter((j)=>j.overflows[0]<=0).sort((j,T)=>j.overflows[1]-T.overflows[1])[0])==null?void 0:E.placement;if(!N)switch(d){case"bestFit":{var O;let j=(O=L.filter((T)=>{if(y){let B=Ro(T.placement);return B===x||B==="y"}return!0}).map((T)=>[T.placement,T.overflows.filter((B)=>B>0).reduce((B,W)=>B+W,0)]).sort((T,B)=>T[1]-B[1])[0])==null?void 0:O[0];if(j)N=j;break}case"initialPlacement":N=i;break}if(n!==N)return{reset:{placement:N}}}return{}}}};var J0=new Set(["left","top"]);async function lS(e,t){let{placement:o,platform:r,elements:n}=e,a=await(r.isRTL==null?void 0:r.isRTL(n.floating)),s=wo(o),i=Lo(o),c=Ro(o)==="y",u=J0.has(s)?-1:1,l=a&&c?-1:1,m=wr(t,e),{mainAxis:p,crossAxis:d,alignmentAxis:f}=typeof m==="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};if(i&&typeof f==="number")d=i==="end"?f*-1:f;return c?{x:d*l,y:p*u}:{x:p*u,y:d*l}}var Q0=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:a,placement:s,middlewareData:i}=t,c=await lS(t,e);if(s===((o=i.offset)==null?void 0:o.placement)&&(r=i.arrow)!=null&&r.alignmentOffset)return{};return{x:n+c.x,y:a+c.y,data:{...c,placement:s}}}}},eg=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:(x)=>{let{x:b,y:C}=x;return{x:b,y:C}}},...u}=wr(e,t),l={x:o,y:r},m=await a.detectOverflow(t,u),p=Ro(n),d=Ic(p),f=l[d],S=l[p],g=(x,b)=>hc(b+m[x==="y"?"top":"left"],b,b-m[x==="y"?"bottom":"right"]);if(s)f=g(d,f);if(i)S=g(p,S);let h=c.fn({...t,[d]:f,[p]:S});return{...h,data:{x:h.x-o,y:h.y-r,enabled:{[d]:s,[p]:i}}}}}},tg=function(e){if(e===void 0)e={};return{options:e,fn(t){var o,r;let{x:n,y:a,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:l=!0,crossAxis:m=!0}=wr(e,t),p={x:n,y:a},d=Ro(s),f=Ic(d),S=p[f],g=p[d],h=wr(u,t),x=typeof h==="number"?{mainAxis:h,crossAxis:0}:{mainAxis:(o=h.mainAxis)!=null?o:0,crossAxis:(r=h.crossAxis)!=null?r:0};if(l){let I=f==="y"?"height":"width",y=i.reference[f]-i.floating[I]+x.mainAxis,w=i.reference[f]+i.reference[I]-x.mainAxis;if(S<y)S=y;else if(S>w)S=w}if(m){var b,C;let I=f==="y"?"width":"height",y=J0.has(wo(s)),w=i.reference[d]-i.floating[I]+(y?((b=c.offset)==null?void 0:b[d])||0:0)+(y?0:x.crossAxis),v=i.reference[d]+i.reference[I]+(y?0:((C=c.offset)==null?void 0:C[d])||0)-(y?x.crossAxis:0);if(g<w)g=w;else if(g>v)g=v}return{[f]:S,[d]:g}}}},og=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:o,rects:r,platform:n,elements:a}=t,{apply:s=()=>{},...i}=wr(e,t),c=await n.detectOverflow(t,i),u=wo(o),l=Lo(o),m=Ro(o)==="y",{width:p,height:d}=r.floating,f,S;if(u==="top"||u==="bottom")f=u,S=l===(await(n.isRTL==null?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right";else S=u,f=l==="end"?"top":"bottom";let g=d-c.top-c.bottom,h=p-c.left-c.right,x=en(d-c[f],g),b=en(p-c[S],h),C=t.middlewareData.shift,I=!C,y=x,w=b;if(C!=null&&C.enabled.x)w=h;if(C!=null&&C.enabled.y)y=g;if(I&&!l)if(m)w=p-2*ar(c.left,c.right);else y=d-2*ar(c.top,c.bottom);await s({...t,availableWidth:w,availableHeight:y});let v=await n.getDimensions(a.floating);if(p!==v.width||d!==v.height)return{reset:{rects:!0}};return{}}}};function ag(e){let t=no(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=je(e),a=n?e.offsetWidth:o,s=n?e.offsetHeight:r,i=fs(o)!==a||fs(r)!==s;if(i)o=a,r=s;return{width:o,height:r,$:i}}function Wm(e){return!Ve(e)?e.contextElement:e}function ya(e){let t=Wm(e);if(!je(t))return xr(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:a}=ag(t),s=(a?fs(o.width):o.width)/r,i=(a?fs(o.height):o.height)/n;if(!s||!Number.isFinite(s))s=1;if(!i||!Number.isFinite(i))i=1;return{x:s,y:i}}var uS=xr(0);function sg(e){let t=qe(e);if(!Wi()||!t.visualViewport)return uS;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mS(e,t,o){if(t===void 0)t=!1;return!!o&&t&&o===qe(e)}function Bn(e,t,o,r){if(t===void 0)t=!1;if(o===void 0)o=!1;let n=e.getBoundingClientRect(),a=Wm(e),s=xr(1);if(t)if(r){if(Ve(r))s=ya(r)}else s=ya(e);let i=mS(a,o,r)?sg(a):xr(0),c=(n.left+i.x)/s.x,u=(n.top+i.y)/s.y,l=n.width/s.x,m=n.height/s.y;if(a&&r){let p=qe(a),d=Ve(r)?qe(r):r,f=p,S=zi(f);while(S&&d!==f){let g=ya(S),h=S.getBoundingClientRect(),x=no(S),b=h.left+(S.clientLeft+parseFloat(x.paddingLeft))*g.x,C=h.top+(S.clientTop+parseFloat(x.paddingTop))*g.y;c*=g.x,u*=g.y,l*=g.x,m*=g.y,c+=b,u+=C,f=qe(S),S=zi(f)}}return An({width:l,height:m,x:c,y:u})}function Uc(e,t){let o=qa(e).scrollLeft;if(!t)return Bn(br(e)).left+o;return t.left+o}function ig(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Uc(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function fS(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,a=n==="fixed",s=br(r),i=t?$a(t.floating):!1;if(r===s||i&&a)return o;let c={scrollLeft:0,scrollTop:0},u=xr(1),l=xr(0),m=je(r);if(m||!a){if(Nt(r)!=="body"||wn(s))c=qa(r);if(m){let d=Bn(r);u=ya(r),l.x=d.x+r.clientLeft,l.y=d.y+r.clientTop}}let p=s&&!m&&!a?ig(s,c):xr(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-c.scrollLeft*u.x+l.x+p.x,y:o.y*u.y-c.scrollTop*u.y+l.y+p.y}}function pS(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dS(e){let t=qa(e),o=e.ownerDocument.body,r=ar(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=ar(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-t.scrollLeft+Uc(e),s=-t.scrollTop;if(no(o).direction==="rtl")a+=ar(e.clientWidth,o.clientWidth)-r;return{width:r,height:n,x:a,y:s}}var gS=25;function hS(e,t,o){if(o===void 0)o="viewport";let r=o==="layoutViewport",n=qe(e),a=br(e),s=n.visualViewport,{clientWidth:i,clientHeight:c}=a,u=0,l=0;if(s){let p=!Wi()||t==="fixed";if(r){if(!p)u=-s.offsetLeft,l=-s.offsetTop}else if(i=s.width,c=s.height,p)u=s.offsetLeft,l=s.offsetTop}if(Uc(a)<=0){let p=a.ownerDocument,d=p.body,f=getComputedStyle(d),S=p.compatMode==="CSS1Compat"?parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0:0,g=Math.abs(a.clientWidth-d.clientWidth-S),h=getComputedStyle(a).scrollbarGutter==="stable both-edges"?g/2:g;if(h<=gS)i-=h}return{width:i,height:c,x:u,y:l}}function IS(e,t){let o=Bn(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,a=ya(e),s=e.clientWidth*a.x,i=e.clientHeight*a.y,c=n*a.x,u=r*a.y;return{width:s,height:i,x:c,y:u}}function rg(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=hS(e,o,t);else if(t==="document")r=dS(br(e));else if(Ve(t))r=IS(t,o);else{let n=sg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return An(r)}function bS(e,t){let o=t.get(e);if(o)return o;let r=qr(e,[],!1).filter((i)=>Ve(i)&&Nt(i)!=="body"),n=null,a=no(e).position==="fixed",s=a?zo(e):e;while(Ve(s)&&!Go(s)){let i=no(s),c=_i(s),u=n?n.position:a?"fixed":"";if(!c&&(u==="fixed"||u==="absolute"&&i.position==="static"))r=r.filter((m)=>m!==s);else n=i;s=zo(s)}return t.set(e,r),r}function CS(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,s=[...o==="clippingAncestors"?$a(t)?[]:bS(t,this._c):[].concat(o),r],i=rg(t,s[0],n),{top:c,right:u,bottom:l,left:m}=i;for(let p=1;p<s.length;p++){let d=rg(t,s[p],n);c=ar(d.top,c),u=en(d.right,u),l=en(d.bottom,l),m=ar(d.left,m)}return{width:u-m,height:l-c,x:m,y:c}}function SS(e){let{width:t,height:o}=ag(e);return{width:t,height:o}}function xS(e,t,o){let r=je(t),n=br(t),a=o==="fixed",s=Bn(e,!0,a,t),i={scrollLeft:0,scrollTop:0},c=xr(0);if(r||!a){if(Nt(t)!=="body"||wn(n))i=qa(t);if(r){let p=Bn(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}}if(!r&&n)c.x=Uc(n);let u=n&&!r&&!a?ig(n,i):xr(0),l=s.left+i.scrollLeft-c.x-u.x,m=s.top+i.scrollTop-c.y-u.y;return{x:l,y:m,width:s.width,height:s.height}}function _m(e){return no(e).position==="static"}function ng(e,t){if(!je(e)||no(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;if(br(e)===o)o=o.ownerDocument.body;return o}function cg(e,t){let o=qe(e);if($a(e))return o;if(!je(e)){let n=zo(e);while(n&&!Go(n)){if(Ve(n)&&!_m(n))return n;n=zo(n)}return o}let r=ng(e,t);while(r&&fd(r)&&_m(r))r=ng(r,t);if(r&&Go(r)&&_m(r)&&!_i(r))return o;return r||pd(e)||o}var wS=async function(e){let t=this.getOffsetParent||cg,o=this.getDimensions,r=await o(e.floating);return{reference:xS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yS(e){return no(e).direction==="rtl"}var zm={convertOffsetParentRelativeRectToViewportRelativeRect:fS,getDocumentElement:br,getClippingRect:CS,getOffsetParent:cg,getElementRects:wS,getClientRects:pS,getDimensions:SS,getScale:ya,isElement:Ve,isRTL:yS};function lg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vS(e,t,o){let r=null,n,a=br(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,m){if(l===void 0)l=!1;if(m===void 0)m=1;s();let p=e.getBoundingClientRect(),{left:d,top:f,width:S,height:g}=p;if(!l)t();if(!S||!g)return;let h=ps(f),x=ps(a.clientWidth-(d+S)),b=ps(a.clientHeight-(f+g)),C=ps(d),y={rootMargin:-h+"px "+-x+"px "+-b+"px "+-C+"px",threshold:ar(0,en(1,m))||1},w=!0;function v(R){let L=R[0].intersectionRatio;if(!lg(p,e.getBoundingClientRect()))return i();if(L!==m){if(!w)return i();if(!L)n=setTimeout(()=>{i(!1,0.0000001)},1000);else i(!1,L)}w=!1}try{r=new IntersectionObserver(v,{...y,root:a.ownerDocument})}catch(R){r=new IntersectionObserver(v,y)}r.observe(e)}let c=qe(e),u=()=>i(o);return c.addEventListener("resize",u),i(!0),()=>{c.removeEventListener("resize",u),s()}}function Ls(e,t,o,r){if(r===void 0)r={};let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:i=typeof IntersectionObserver==="function",animationFrame:c=!1}=r,u=Wm(e),l=n||a?[...u?qr(u):[],...t?qr(t):[]]:[];l.forEach((h)=>{n&&h.addEventListener("scroll",o),a&&h.addEventListener("resize",o)});let m=u&&i?vS(u,o,a):null,p=-1,d=null;if(s){if(d=new ResizeObserver((h)=>{let[x]=h;if(x&&x.target===u&&d&&t)d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=d)==null||b.observe(t)});o()}),u&&!c)d.observe(u);if(t)d.observe(t)}let f,S=c?Bn(e):null;if(c)g();function g(){let h=Bn(e);if(S&&!lg(S,h))o();S=h,f=requestAnimationFrame(g)}return o(),()=>{var h;if(l.forEach((x)=>{n&&x.removeEventListener("scroll",o),a&&x.removeEventListener("resize",o)}),m==null||m(),(h=d)==null||h.disconnect(),d=null,c)cancelAnimationFrame(f)}}var ug=Q0;var mg=eg,fg=K0,pg=og;var dg=tg,_c=(e,t,o)=>{let r=new Map,n=o!=null?o:{},a={...zm,...n.platform,_c:r};return Y0(e,t,{...n,platform:a})};import*as qt from"react";import{useLayoutEffect as PS}from"react";import*as hg from"react-dom";var TS=typeof document<"u",ES=function(){},Wc=TS?PS:ES;function zc(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let o,r,n;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!zc(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let a=n[r];if(a==="_owner"&&e.$$typeof)continue;if(!zc(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Ig(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gg(e,t){let o=Ig(e);return Math.round(t*o)/o}function Gm(e){let t=qt.useRef(e);return Wc(()=>{t.current=e}),t}function bg(e){if(e===void 0)e={};let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,m]=qt.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=qt.useState(r);if(!zc(p,r))d(r);let[f,S]=qt.useState(null),[g,h]=qt.useState(null),x=qt.useCallback((T)=>{if(T!==y.current)y.current=T,S(T)},[]),b=qt.useCallback((T)=>{if(T!==w.current)w.current=T,h(T)},[]),C=a||f,I=s||g,y=qt.useRef(null),w=qt.useRef(null),v=qt.useRef(l),R=c!=null,L=Gm(c),U=Gm(n),E=Gm(u),O=qt.useCallback(()=>{if(!y.current||!w.current)return;let T={placement:t,strategy:o,middleware:p};if(U.current)T.platform=U.current;_c(y.current,w.current,T).then((B)=>{let W={...B,isPositioned:E.current!==!1};if(k.current&&!zc(v.current,W))v.current=W,hg.flushSync(()=>{m(W)})})},[p,t,o,U,E]);Wc(()=>{if(u===!1&&v.current.isPositioned)v.current.isPositioned=!1,m((T)=>({...T,isPositioned:!1}))},[u]);let k=qt.useRef(!1);Wc(()=>(k.current=!0,()=>{k.current=!1}),[]),Wc(()=>{if(C)y.current=C;if(I)w.current=I;if(C&&I){if(L.current)return L.current(C,I,O);O()}},[C,I,O,L,R]);let P=qt.useMemo(()=>({reference:y,floating:w,setReference:x,setFloating:b}),[x,b]),N=qt.useMemo(()=>({reference:C,floating:I}),[C,I]),j=qt.useMemo(()=>{let T={position:o,left:0,top:0};if(!N.floating)return T;let B=gg(N.floating,l.x),W=gg(N.floating,l.y);if(i)return{...T,transform:"translate("+B+"px, "+W+"px)",...Ig(N.floating)>=1.5&&{willChange:"transform"}};return{position:o,left:B,top:W}},[o,i,N.floating,l.x,l.y]);return qt.useMemo(()=>({...l,update:O,refs:P,elements:N,floatingStyles:j}),[l,O,P,N,j])}var Zm=(e,t)=>{let o=ug(e);return{name:o.name,fn:o.fn,options:[e,t]}},$m=(e,t)=>{let o=mg(e);return{name:o.name,fn:o.fn,options:[e,t]}},qm=(e,t)=>({fn:dg(e).fn,options:[e,t]}),jm=(e,t)=>{let o=fg(e);return{name:o.name,fn:o.fn,options:[e,t]}},Xm=(e,t)=>{let o=pg(e);return{name:o.name,fn:o.fn,options:[e,t]}};import*as Gc from"react";var AS=Gc.createContext(void 0);function Cg(e){let t=Gc.useContext(AS);if(t===void 0&&!e)throw Error(Ge(69));return t}var MS="ArrowUp",kS="ArrowDown",LS="ArrowLeft",DS="ArrowRight",FS="Home",OS="End";var Zc=new Set([MS,kS,LS,DS,FS,OS]);function va(e){return e==="starting"?h0:Ue}import*as $c from"react";var NS=$c.createContext(void 0);function Sg(){return $c.useContext(NS)}import*as qc from"react";function BS(e,t){let o=Za(e.render);if(qc.isValidElement(o)){let r=o.props;if(Object.hasOwn(r,"id"))return r.id??""}return e.id??t}function xg(e,t,o){let r=BS(e,t),n=r===t?void 0:r,a=qc.useCallback((s)=>o?.(s?n:void 0),[n,o]);return[r,a]}import*as wg from"react";function yg(e,t,o){let r=Za(e.render),n=wg.isValidElement(r)?r.props:void 0,a=e["aria-label"]??n?.["aria-label"],s=e["aria-labelledby"]??n?.["aria-labelledby"];if(s==null&&!a)s=t?t.id||void 0:o||void 0;return s}import{jsx as vg}from"react/jsx-runtime";var HS=Hn.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,id:i,initialFocus:c,...u}=t,{store:l,defaultFloatingId:m,setRenderedFloatingId:p,virtualFocus:d,orientation:f}=vo(),S=Sg(),{side:g,align:h}=Sd(),x=Cg(!0)!=null,b=l.useState("open"),C=l.useState("transitionStatus"),I=l.useState("popupProps"),y=l.useState("mounted"),w=l.useState("instantType"),v=l.useState("activeTriggerElement"),R=l.useState("parent"),L=l.useState("lastOpenChangeReason"),U=l.useState("rootId"),E=l.useState("floatingRootContext"),O=l.useState("floatingTreeRoot"),k=l.useState("closeDelay"),P=l.useState("hoverEnabled"),N=l.useState("disabled"),j=l.useState("openMethod"),T=l.useState("activeTriggerId"),B=l.useState("listElement"),[W,X]=xg(t,m,p),A=yg(t,v,T),ue=R.type==="menu"?S:void 0,V=R.type==="context-menu",G=c??R.type!=="menu";if(c===void 0&&B&&R.type!=="menu")G=()=>{if(l.state.activeIndex!==null)return!1;return B};$o({open:b,ref:l.context.popupRef,onComplete(){if(b)l.context.onOpenChangeComplete?.(!0)}}),Hn.useEffect(()=>{function ne(we){l.setOpen(!1,Re(we.reason,we.domEvent))}return O.events.on("close",ne),()=>{O.events.off("close",ne)}},[O.events,l]),As(E,{enabled:P&&!N&&!V&&R.type!=="menubar",closeDelay:k});let Z=l.useStateSetter("popupElement"),ee=Hn.useContext(zu)?.useParentHandoff??US,{parentVirtualFocusRef:Pe,handleFocus:te}=ee(l,R,b,d),ie={transitionStatus:C,side:g,align:h,open:b,nested:R.type==="menu",instant:w},me=ve("div",t,{state:ie,ref:[o,l.context.popupRef,Z,X],stateAttributesMapping:ra,props:[I,{id:W,...B?{role:"presentation"}:{role:"menu","aria-orientation":f==="horizontal"?"horizontal":void 0,"aria-labelledby":A},onKeyDown(ne){if(ue?.onPopupKeyDown?.(ne),x&&Zc.has(ne.key))ne.stopPropagation()},onFocus:te},va(C),u,{"data-rootownerid":U}]}),fe=R.type===void 0||V;if(v||R.type==="menubar"&&L!==Uu)fe=!0;let be=ue?.getReturnElement??Pe;return vg(ws,{context:E,openInteractionType:j,modal:V,disabled:!y,returnFocus:s??be??fe,explicitReturnFocus:s===void 0&&be?!1:void 0,initialFocus:G,restoreFocus:!0,getInsideElements:R.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:R.type!=="menubar"?O:void 0,previousFocusableElement:v,nextFocusableElement:R.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:me})}),VS={parentVirtualFocusRef:void 0,handleFocus:void 0};function US(){return VS}var Rg=Hn.forwardRef(function(t,o){let r=Gu()?.Popup??HS;return vg(r,{...t,ref:o})});import*as Eg from"react";import*as jc from"react";var Ym=jc.createContext(void 0);function Pg(){let e=jc.useContext(Ym);if(e===void 0)throw Error(Ge(32));return e}import{jsx as Tg}from"react/jsx-runtime";var Ag=Eg.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,{store:a,parent:s}=vo();if(!(a.useState("mounted")||r))return null;let u=s.type==="menu"||s.type==="menubar"?"group":void 0;return Tg(Ym.Provider,{value:r,children:Tg(Ss,{ref:o,...n,portalOwnerRole:u})})});import*as sn from"react";function Ra(e){if(Kn(19))return e;return e?"true":void 0}import*as Fo from"react";import*as jo from"react";function Mg(e){let{nodeId:t,externalTree:o,rootContext:r}=e,n=r.useState("referenceElement"),a=r.useState("floatingElement"),s=r.useState("domReferenceElement"),i=r.useState("open"),c=r.useState("floatingId"),[u,l]=jo.useState(null),m=jo.useRef(null),p=fo(o),d=jo.useMemo(()=>({reference:n,floating:a,domReference:s}),[n,a,s]),f=bg({...e,elements:{...d,...u&&{reference:u}}}),S=jo.useCallback((b)=>{let C=Ve(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;l(C),f.refs.setReference(C)},[f.refs]),g=jo.useMemo(()=>({...f.refs,setPositionReference:S,domReference:m}),[f.refs,S]),h=jo.useMemo(()=>({...f.elements,domReference:s}),[f.elements,s]),x=jo.useMemo(()=>({...f,dataRef:r.context.dataRef,open:i,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:h,nodeId:t,rootStore:r}),[f,g,h,t,r,i,c]);return z(()=>{if(s)m.current=s},[s]),z(()=>{r.context.dataRef.current.floatingContext=x;let b=p?.nodesRef.current.find((C)=>C.id===t);if(b)b.context=x}),jo.useMemo(()=>({...f,context:x,refs:g,elements:h,rootStore:r}),[f,g,h,x,r])}import*as Xc from"react";var _S=Xc.createContext(void 0);function Yc(){return Xc.useContext(_S)?.direction??"ltr"}var WS=(e)=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:a,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=wr(e,t)||{};if(u==null)return{};let m=bc(l),p={x:o,y:r},d=gs(n),f=ds(d),S=await s.getDimensions(u),g=d==="y",h=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",C=a.reference[f]+a.reference[d]-p[d]-a.floating[f],I=p[d]-a.reference[d],y=i.floating[b]||a.floating[f],w=C/2-I/2,v=y/2-S[f]/2-1,R=Math.min(m[h],v),L=Math.min(m[x],v),U=R,E=y-S[f]-L,O=y/2-S[f]/2+w,k=hc(U,O,E),P=!c.arrow&&Lo(n)!=null&&O!==k&&a.reference[f]/2-(O<U?R:L)-S[f]/2<0,N=P?O<U?O-U:O-E:0;return{[d]:p[d]+N,data:{[d]:k,centerOffset:O-k-N,...P&&{alignmentOffset:N}},reset:P}}}),kg=(e,t)=>{let{name:o,fn:r}=WS(e);return{name:o,fn:r,options:[e,t]}};var Lg={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,a=t===0&&o===0&&r===0&&n===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-o>=0||s.right-t>=0||s.bottom-o>=0||s.left-t>=0||a}}}};var Dg={sideX:"left",sideY:"top"};var Fg="--available-width",Og="--available-height",Ng="--anchor-width",Bg="--anchor-height",Hg="--transform-origin";var Vg=Fg,Ug=Og;function zg(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function _g(e,t,o){let{rects:r,placement:n}=e;return{side:zg(t,wo(n),o),align:Lo(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Kc(e){return GS(e,Mg)}function GS(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,inline:d,keepMounted:f=!1,floatingRootContext:S,mounted:g,collisionAvoidance:h,shift:x,nodeId:b,adaptiveOrigin:C,lazyFlip:I=!1,externalTree:y}=e,w=h.side||"flip",v=h.align||"flip",R=h.fallbackAxisSide||"end",L=x?.crossAxis??!1,U=x?.rootBoundary,E=typeof o==="function"?o:void 0,O=re(E),k=E?O:o,P=ct(o),N=ct(g),T=Yc()==="rtl",[B,W]=Fo.useState(null);if(!g&&B!==null)W(null);let X=I==="placement",A=B?wo(B):null,ue=B&&X?Lo(B)||"center":null,V=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":T?"left":"right","inline-start":T?"right":"left"}[n],G=ue||s,Z=G==="center"?V:`${V}-${G}`,ee=u;if(typeof ee==="number")ee={top:ee,right:ee,bottom:ee,left:ee};else if(ee)ee={top:ee.top||0,right:ee.right||0,bottom:ee.bottom||0,left:ee.left||0};let Pe=1,te=n==="bottom"?Pe:0,ie=n==="top"?Pe:0,me=n==="right"?Pe:0,fe=n==="left"?Pe:0,be={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:ee},ne=Fo.useRef(null),we=ct(a),Ce=ct(i),De=typeof a!=="function"?a:0,Q=typeof i!=="function"?i:0,H=[];if(d)H.push(d);H.push(Zm(($e)=>{let Zt=_g($e,n,T),ye=typeof we.current==="function"?we.current(Zt):we.current,Me=typeof Ce.current==="function"?Ce.current(Zt):Ce.current;return{mainAxis:ye,crossAxis:Me,alignmentAxis:Me}},[De,Q,T,n]));let Y=v==="none"&&w!=="shift",D=!Y&&(l||L||w==="shift"),de=w==="none"?null:jm({...be,padding:{top:ee.top+Pe+te,right:ee.right+Pe+fe,bottom:ee.bottom+Pe+ie,left:ee.left+Pe+me},mainAxis:!L&&w==="flip",crossAxis:v==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),K=Y?null:$m({...be,rootBoundary:U,mainAxis:v!=="none",crossAxis:D,limiter:l||L?void 0:qm(($e)=>{if(!ne.current)return{};let{width:Zt,height:ye}=ne.current.getBoundingClientRect(),Me=Ro(wo($e.placement)),We=Me==="y"?Zt:ye,$t=Me==="y"?ee.left+ee.right:ee.top+ee.bottom;return{offset:We/2+$t/2}})},[be,l,L,U,ee,v]);if(w==="shift"||v==="shift"||G==="center")H.push(K,de);else H.push(de,K);H.push(Xm({...be,apply({elements:{floating:$e},availableWidth:Zt,availableHeight:ye,rects:Me}){if(!N.current)return;let We=$e.style;We.setProperty(Vg,`${Zt}px`),We.setProperty(Ug,`${ye}px`);let $t=qe($e).devicePixelRatio||1,{x:Jt,y:So,width:jt,height:Eo}=Me.reference,Ko=(Math.round((Jt+jt)*$t)-Math.round(Jt*$t))/$t,No=(Math.round((So+Eo)*$t)-Math.round(So*$t))/$t;We.setProperty(Ng,`${Ko}px`),We.setProperty(Bg,`${No}px`)}}),kg(($e)=>({element:ne.current||Ee($e.elements.floating).createElement("div"),padding:ne.current?m:0}),[m]),{name:"transformOrigin",fn($e){let{elements:{floating:Zt},middlewareData:ye,placement:Me,platform:We,rects:$t,y:Jt}=$e,So=wo(Me),jt=Lo(Me),Eo=Ro(So)==="y",Ko=ne.current,No=typeof a==="function"?a(_g($e,n,T)):a,$n;if(!Ko&&jt&&Math.abs(Eo?ye.shift?.x||0:ye.shift?.y||0)<=1)$n=jt==="start"===(Eo&&We.isRTL?.(Zt)===!0)?"100%":"0%";else{let dn=Eo?ye.arrow?.x||0:ye.arrow?.y||0,gn=Eo?Ko?.clientWidth||0:Ko?.clientHeight||0;$n=`${dn+gn/2}px`}let pr=So==="top"||So==="left"?`calc(100% + ${No}px)`:`${-No}px`;if(D&&Eo&&Math.abs(ye.shift?.y||0)>No)pr=`${$t.reference.y+$t.reference.height/2-Jt}px`;return Zt.style.setProperty(Hg,Eo?`${$n} ${pr}`:`${pr} ${$n}`),{}}},Lg,C),z(()=>{if(!g&&S)S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,S]);let pe=Fo.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:M,elements:_,x:Se,y:J,middlewareData:se,update:ge,placement:he,context:Ie,isPositioned:Ne,floatingStyles:Qe}=t({rootContext:S,open:f?g:void 0,placement:Z,middleware:H,strategy:r,whileElementsMounted:f?void 0:(...$e)=>Ls(...$e,pe),nodeId:b,externalTree:y}),{sideX:gt,sideY:bo}=se.adaptiveOrigin||Dg,Co=Ne?r:"fixed",Yo=Fo.useMemo(()=>{let $e;if(!Ne)$e={position:Co,top:0,left:0};else if(C)$e={position:Co,[gt]:Se,[bo]:J};else $e={...Qe,position:Co};if($e[Vg]="100vw",$e[Ug]="100vh",!Ne)$e.opacity=0;return $e},[C,Co,gt,Se,bo,J,Qe,Ne]),oo=Fo.useRef(null);z(()=>{if(!g)return;let $e=P.current,Zt=typeof $e==="function"?$e():$e,Me=(Wg(Zt)?Zt.current:Zt)||null||null;if(Me!==oo.current)M.setPositionReference(Me),oo.current=Me},[g,M,k,P]),Fo.useEffect(()=>{if(!g)return;let $e=P.current;if(typeof $e==="function")return;if(Wg($e)&&$e.current!==oo.current)M.setPositionReference($e.current),oo.current=$e.current},[g,M,k,P]),Fo.useEffect(()=>{if(f&&g&&_.reference&&_.floating)return Ls(_.reference,_.floating,ge,pe);return},[f,g,_,ge,pe]);let Kt=wo(he),yo=zg(n,Kt,T),To=Lo(he)||"center",uo=Boolean(se.hide?.referenceHidden);z(()=>{if(I&&g&&Ne&&(Kt!==V||X&&To!==G))W(he)},[I,X,g,Ne,he,Kt,To,V,G]);let fn=Fo.useMemo(()=>({position:"absolute",top:se.arrow?.y,left:se.arrow?.x}),[se.arrow]),pn=se.arrow?.centerOffset!==0;return Fo.useMemo(()=>({positionerStyles:Yo,arrowStyles:fn,arrowRef:ne,arrowUncentered:pn,side:yo,align:To,physicalSide:Kt,anchorHidden:uo,refs:M,context:Ie,isPositioned:Ne,update:ge}),[Yo,fn,ne,pn,yo,To,Kt,uo,M,Ie,Ne,ge])}function Wg(e){return e!=null&&"current"in e}import*as Br from"react";import{jsx as ZS}from"react/jsx-runtime";function Gg(e){let{children:t,elementsRef:o,labelsRef:r,onMapChange:n}=e,a=re(n),[,s]=Br.useState(0),i=Xe(qS).current,c=Xe($S).current,u=Br.useRef(0),l=Br.useRef(!0),m=Br.useRef(null),p=Br.useRef(null),d=re(()=>{if(l.current)return;l.current=!0,s((I)=>I+1)}),f=re((I,y)=>{c.set(I,y),d()}),S=re((I)=>{c.delete(I),d()}),g=re((I)=>{let y=new Map;if(o.current.length=0,r)r.current.length=0;return I.forEach((w)=>{if(y.set(w.element,{...w.registration.metadata??{},index:w.index}),o.current[w.index]=w.element,r)r.current[w.index]=w.registration.label!==void 0?w.registration.label:w.registration.textRef?.current?.textContent??w.element.textContent}),u.current=o.current.length,y});function h(I){if(p.current?.disconnect(),p.current=null,typeof MutationObserver!=="function"||I.length<2)return;let y=new MutationObserver((v)=>{if(!YS(v))return;let R=null;for(let L of I){if(!L.isConnected)continue;if(R&&Zg(R,L)>0){y.disconnect(),d();return}R=L}});p.current=y;let w=new Set;for(let v=1;v<I.length;v+=1){let R=XS(I[v-1],I[v]);if(R)w.add(R)}w.forEach((v)=>y.observe(v,{childList:!0}))}let x=re(()=>{let[I,y]=jS(c),w=g(I),v=m.current,R=!v||v.length!==I.length||I.some((L,U)=>{let E=v[U];return L.index!==E.index||L.element!==E.element||L.registration.index!==E.registration.index||L.registration.metadata!==E.registration.metadata});if(h(y),m.current=I,l.current=!1,!R)return;i.forEach((L)=>L(w)),a(w)});z(()=>{if(!l.current&&m.current)g(m.current);return()=>{if(o.current=[],r)r.current=[]}},[o,r,g]),z(()=>{if(l.current)x()}),z(()=>()=>{p.current?.disconnect(),l.current=!0},[]);let b=re((I)=>(i.add(I),()=>{i.delete(I)})),C=Br.useMemo(()=>({register:f,unregister:S,subscribeMapChange:b,nextIndexRef:u}),[f,S,b,u]);return ZS(Xu.Provider,{value:C,children:t})}function $S(){return new Map}function qS(){return new Set}function jS(e){let t=new Set,o=[],r=[];e.forEach((a,s)=>{if(!s.isConnected)return;let i=a.index,c={index:i??-1,element:s,registration:a};if(i===null)r.push(c);else if(i>=0)t.add(i),o.push(c)});let n=0;if(r.sort((a,s)=>Zg(a.element,s.element)),r.forEach((a)=>{while(t.has(n))n+=1;a.index=n,o.push(a),n+=1}),t.size>0)o.sort((a,s)=>a.index-s.index);return[o,r.map((a)=>a.element)]}function XS(e,t){let o=e.parentElement;while(o&&!o.contains(t))o=o.parentElement;return o}function YS(e){for(let t of e)for(let o=0;o<t.removedNodes.length;o+=1)if(t.removedNodes[o].isConnected)return!0;return!1}function Zg(e,t){if(e.nextElementSibling===t)return-1;if(t.nextElementSibling===e)return 1;return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}import*as $g from"react";import{jsx as KS}from"react/jsx-runtime";var Jc=$g.forwardRef(function(t,o){let{cutout:r,...n}=t,a;if(r){let s=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${s.left}px ${s.top}px,${s.left}px ${s.bottom}px,${s.right}px ${s.bottom}px,${s.right}px ${s.top}px,${s.left}px ${s.top}px)`}return KS("div",{ref:o,role:"presentation","data-base-ui-inert":"",...n,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});import*as Km from"react";function qg(e){let{store:t,domReference:o,positionerElement:r,open:n}=e,a=Km.useRef(null),s=Km.useRef(null),i=la(r);z(()=>{if(n)return;if(s.current?.abort(),s.current=null,t.state.instantType==="trigger-change")t.set("instantType",void 0)},[n,t]),z(()=>{let c=o,u=a.current;if(c)a.current=c;if(!u||!c||c===u)return;if(!t.select("open"))return;t.set("instantType",void 0);let l=new AbortController;return s.current=l,i(()=>{if(t.select("open"))t.set("instantType","trigger-change")},l.signal),()=>{l.abort()}},[o,i,t])}function Qc(e,t,{styles:o,transitionStatus:r,props:n,refs:a,hidden:s,inert:i=!1}){let c={...o};if(i)c.pointerEvents="none";return ve("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:s,style:c},va(r),n],stateAttributesMapping:vn})}import*as Qg from"react";var jg={},Xg={},Yg="";function el(e,t){return wn(e)?e:t}function Kg(e,t,o){return/hidden|clip/.test(e.getComputedStyle(el(t,o)).overflowY)}function JS(e){if(typeof document>"u")return!1;let t=Ee(e);return qe(t).innerWidth-t.documentElement.clientWidth>0}function QS(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let o=Ee(e),{documentElement:r,body:n}=o,a=el(r,n),s=a.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";let c=a.offsetWidth;a.style.overflowY="hidden";let u=a.offsetWidth;return a.style.overflowY=s,r.style.scrollbarGutter=i,c===u}function ex(e){let t=Ee(e),{documentElement:o,body:r}=t,n=el(o,r),a={overflowY:n.style.overflowY,overflowX:n.style.overflowX};return Object.assign(n.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(n.style,a)}}function tx(e){let t=Ee(e),{documentElement:o,body:r}=t,n=qe(o),a=0,s=0,i=!1,c=Zo.create();if(Lr.webkit&&(n.visualViewport?.scale??1)!==1)return()=>{};function u(){let d=n.getComputedStyle(o),f=n.getComputedStyle(r),h=(d.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=o.scrollTop,s=o.scrollLeft,jg={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},Yg=o.style.scrollBehavior,Xg={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let x=o.scrollHeight>o.clientHeight,b=o.scrollWidth>o.clientWidth,C=d.overflowY==="scroll"||f.overflowY==="scroll",I=d.overflowX==="scroll"||f.overflowX==="scroll",y=Math.max(0,n.innerWidth-r.clientWidth),w=Math.max(0,n.innerHeight-r.clientHeight),v=parseFloat(f.marginTop)+parseFloat(f.marginBottom),R=parseFloat(f.marginLeft)+parseFloat(f.marginRight),L=el(o,r);if(i=QS(e),i){o.style.scrollbarGutter=h,L.style.overflowY="hidden",L.style.overflowX="hidden";return}if(Object.assign(o.style,{scrollbarGutter:h,overflowY:"hidden",overflowX:"hidden"}),x||C)o.style.overflowY="scroll";if(b||I)o.style.overflowX="scroll";Object.assign(r.style,{position:"relative",height:v||w?`calc(100dvh - ${v+w}px)`:"100dvh",width:R||y?`calc(100vw - ${R+y}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=s,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function l(){if(Object.assign(o.style,jg),Object.assign(r.style,Xg),!i)o.scrollTop=a,o.scrollLeft=s,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=Yg}function m(){l(),c.request(u)}u();let p=Ae(n,"resize",m);return()=>{if(c.cancel(),l(),typeof n.removeEventListener==="function")p()}}class Jg{lockCount=0;restore=null;timeoutLock=eo.create();timeoutUnlock=eo.create();acquire(e){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(e));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Ee(e),{documentElement:o,body:r}=t,n=qe(o);if(Kg(n,o,r)){let s=new n.MutationObserver(()=>{if(Kg(n,o,r))return;s.disconnect(),this.restore=null,this.lock(e)}),i={attributes:!0};s.observe(o,i),s.observe(r,i),this.restore=()=>s.disconnect();return}let a=kr.ios||!JS(e);this.restore=a?ex(e):tx(e)}}var ox=new Jg;function tl(e=!0,t=null){z(()=>{if(!e)return;return ox.acquire(t)},[e,t])}var rx=20;function e1(e,t,o,r){let[n,a]=Qg.useState(!1);z(()=>{if(!e||!t||o==null){a(!1);return}let s=Ee(o).documentElement.clientWidth,i=o.offsetWidth;a(s>0&&i>0&&i>=s-rx)},[e,t,o]),tl(e&&(!t||n),r)}import{jsx as Jm,jsxs as nx}from"react/jsx-runtime";var t1=sn.forwardRef(function(t,o){let{anchor:r,positionMethod:n="absolute",className:a,render:s,side:i,align:c,sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:p=5,arrowPadding:d=5,sticky:f=!1,disableAnchorTracking:S=!1,collisionAvoidance:g=C0,style:h,...x}=t,{store:b,virtualFocus:C,syncHighlightedItem:I}=vo(),y=Pg(),w=na(!0),v=b.useState("parent"),R=b.useState("floatingRootContext"),L=b.useState("floatingTreeRoot"),U=b.useState("mounted"),E=b.useState("open"),O=b.useState("modal"),k=b.useState("openMethod"),P=b.useState("activeTriggerElement"),N=b.useState("transitionStatus"),j=b.useState("positionerElement"),T=b.useState("instantType"),B=b.useState("adaptiveOrigin"),W=b.useState("lastOpenChangeReason"),X=b.useState("floatingNodeId"),A=b.useState("floatingParentNodeId"),ue=R.useState("domReferenceElement"),V=r,G=u,Z=l,ee=c,Pe=g;if(v.type==="context-menu"){if(V=r??v.context?.anchor,ee=ee??"start",!i&&ee!=="center")Z=t.alignOffset??2,G=t.sideOffset??-5}let te=i,ie=ee;if(v.type==="menu")te=te??"inline-end",ie=ie??"start",Pe=t.collisionAvoidance??Pc;else if(v.type==="menubar")te=te??(v.context.orientation==="vertical"?"inline-end":"bottom"),ie=ie??"start";let me=v.type==="context-menu",fe=Kc({anchor:V,floatingRootContext:R,positionMethod:w?"fixed":n,mounted:U,side:te,sideOffset:G,align:ie,alignOffset:Z,arrowPadding:me?0:d,collisionBoundary:m,collisionPadding:p,sticky:f,nodeId:X,keepMounted:y,disableAnchorTracking:S,collisionAvoidance:Pe,shift:me?{crossAxis:!(("side"in Pe)&&Pe.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:B,lazyFlip:C?"placement":!1});sn.useEffect(()=>{function Y(D){if(D.open){if(D.parentNodeId===X)b.set("hoverEnabled",!1);if(D.nodeId!==X&&D.parentNodeId===b.select("floatingParentNodeId"))b.setOpen(!1,Re(ts))}}return L.events.on("menuopenchange",Y),()=>{L.events.off("menuopenchange",Y)}},[b,L.events,X]),sn.useEffect(()=>{if(b.select("floatingParentNodeId")==null)return;function Y(D){if(D.open||D.nodeId!==b.select("floatingParentNodeId"))return;let de=D.reason??ts;b.setOpen(!1,Re(de))}return L.events.on("menuopenchange",Y),()=>{L.events.off("menuopenchange",Y)}},[L.events,b]);let be=Je();sn.useEffect(()=>{if(!E)be.clear()},[E,be]),sn.useEffect(()=>{function Y(D){if(!E||D.nodeId!==b.select("floatingParentNodeId"))return;if(D.target&&P&&P!==D.target){let de=b.select("closeDelay");if(de>0){if(!be.isStarted())be.start(de,()=>{b.setOpen(!1,Re(ts))})}else b.setOpen(!1,Re(ts))}else be.clear()}return L.events.on("itemhover",Y),()=>{L.events.off("itemhover",Y)}},[L.events,E,P,b,be]),sn.useEffect(()=>{let Y={open:E,nodeId:X,parentNodeId:A,reason:b.select("lastOpenChangeReason")};L.events.emit("menuopenchange",Y)},[L.events,E,b,X,A]),qg({store:b,domReference:ue,positionerElement:j,open:E});let ne={open:E,side:fe.side,align:fe.align,anchorHidden:fe.anchorHidden,nested:v.type==="menu",instant:T},we=v.type==="menubar"&&v.context.modal,Ce=O&&W!==Yt;e1(E&&(we||Ce),k==="touch",j,P);let De=Qc(t,ne,{styles:fe.positionerStyles,transitionStatus:N,props:x,refs:[o,b.useStateSetter("positionerElement")],hidden:!U,inert:!E}),Q=U&&v.type!=="menu"&&(v.type!=="menubar"&&O&&W!==Yt||v.type==="menubar"&&v.context.modal),H=null;if(v.type==="menubar")H=v.context.contentElement;else if(v.type===void 0)H=P;return nx(Nu.Provider,{value:fe,children:[Q&&Jm(Jc,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Ra(!E),cutout:H}),Jm(Sm,{id:X,children:Jm(Gg,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:I,children:De})})]})});import*as lt from"react";import*as ol from"react";var ax=ol.createContext(null);function rl(e){let t=ol.useContext(ax);if(t===null&&!e)throw Error(Ge(5));return t}import*as Fs from"react";import*as Ds from"react";function o1(e){let t=Ds.useRef(""),o=Ds.useCallback((n)=>{if(n.defaultPrevented)return;t.current=n.pointerType,e(n,n.pointerType)},[e]);return{onClick:Ds.useCallback((n)=>{if(n.detail===0){e(n,"keyboard");return}if("pointerType"in n)e(n,n.pointerType);else e(n,t.current);t.current=""},[e]),onPointerDown:o}}import*as r1 from"react";function nl(e,t){let o=r1.useRef(e),r=re(t);z(()=>{if(o.current!==e)r(o.current);o.current=e},[e,r])}function Qm(e,t){let o=re((a,s)=>{if(!(typeof e==="function"?e():e))t(s||(kr.ios?"touch":""))}),{onClick:r,onPointerDown:n}=o1(o);return Fs.useMemo(()=>({onClick:r,onPointerDown:n}),[r,n])}function n1(e){let[t,o]=Fs.useState(null),r=Qm(e,o);return nl(e,(n)=>{if(n&&!e)o(null)}),Fs.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function a1(e){if(e==null)return Rn;if(e.type.startsWith("key"))return Rd;if(e.type.startsWith("mouse")||e.type.startsWith("pointer"))return _b;return Rn}import*as Pa from"react";var sx={...nn,disabled:(e)=>e.parent.type==="menubar"?e.parent.context.disabled||e.disabled:e.disabled,modal:(e)=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:(e)=>e.openMethod,keyboardOpen:(e)=>e.keyboardOpen,allowMouseEnter:(e)=>e.allowMouseEnter,highlightItemOnHover:(e)=>e.highlightItemOnHover,parent:(e)=>e.parent,rootId:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("rootId");return e.parent.type!==void 0?e.parent.context.rootId:e.rootId},activeIndex:(e)=>e.activeIndex,listElement:(e)=>e.listElement,triggerControlsId:(e,t)=>{let o=nn.triggerPopupId(e,t);return o?e.listElement?.id||o:void 0},filterTriggerProps:(e)=>e.filterTriggerProps,inputProps:(e)=>e.inputProps,webkitAriaSelected:(e,t)=>Lr.webkit&&e.inputFocused&&t?!0:void 0,highlightedItemId:(e)=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:(e)=>e.hoverEnabled,instantType:(e)=>e.instantType==="trigger-change"&&!nn.open(e)?void 0:e.instantType,lastOpenChangeReason:(e)=>e.openChangeReason,floatingTreeRoot:(e)=>{if(e.parent.type==="menu")return e.parent.store.select("floatingTreeRoot");return e.floatingTreeRoot},floatingNodeId:(e)=>e.floatingNodeId,floatingParentNodeId:(e)=>e.floatingParentNodeId,itemProps:(e)=>e.itemProps,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin,keyboardEventRelay:(e)=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay");return}};class ef extends ir{constructor(e,t,o=!1){let r=new Dn,n=cx(r,t,o,e);super(n,ix(r),sx);this.observe("parent",(a)=>{if(a.type==="menu")this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;else if(a.type!==void 0)this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!=="menu")return;let t=e.store.select("rootId"),o=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return e.store.subscribe(()=>{let n=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),s=e.store.select("keyboardEventRelay");if(t===n&&o===a&&r===s)return;t=n,o=a,r=s,this.notifyAll()})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}setActiveIndex(e,t,o){if(this.state.activeIndex!==e){let n=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=n?"none":t,this.context.highlightEvent=n?void 0:o}this.set("activeIndex",e)}highlightItem(e,t,o){let r=this.context.itemDomElements.current.indexOf(e);if(r>-1)this.setActiveIndex(r,t,o)}}function ix(e){return{positionerRef:Pa.createRef(),popupRef:Pa.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Pa.createRef(),beforeTriggerFocusGuardRef:Pa.createRef(),beforeContentFocusGuardRef:Pa.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function cx(e,t,o=!1,r){return{...Ca(e,t,o),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Ue,inputProps:Ue,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new kn,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ue,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}import*as s1 from"react";var tf=s1.createContext(null);function of(e,t){return(e===aa||e===_u)&&t?.detail===0}function i1(e,t){return e===ec||of(e,t)}import{jsx as Os,jsxs as lx}from"react/jsx-runtime";var ux=Fn(function(t){let{children:o,open:r,onOpenChange:n,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:i=!1,disabled:c=!1,modal:u,loopFocus:l=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:d=!1,handle:f,triggerId:S,defaultTriggerId:g=null,highlightItemOnHover:h=!0,isSubmenu:x=!1,virtualFocus:b=!1,virtualFocusRef:C,allowEscape:I=!0,resetOnPointerLeave:y=!0}=t,w=na(!0),v=vo(!0),R=rl(!0),L=v?.store,U=v?.virtualFocus??!1,E=lt.useMemo(()=>{if(x&&L)return{type:"menu",store:L};if(R)return{type:"menubar",context:R};if(w&&!L)return{type:"context-menu",context:w};return{type:void 0}},[w,L,R,x]),O=ao(),k=ao(),[P,N]=lt.useState(void 0),j=(P??k)||void 0,T=Do(),B=E.type==="menu"?E.store:void 0,W=(r??i)&&B?.state.transitionStatus==="starting",X=Xe(()=>W?B?.state.instantType:void 0).current,A=Xe(()=>{let ye=new ef({open:i,openProp:r,activeTriggerId:g,triggerIdProp:S,parent:E,disabled:c,highlightItemOnHover:h,modal:E.type===void 0?u:void 0,rootId:O,instantType:X},j,T!=null);return ye.context.virtualFocusRef=C,ye}).current;A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",S),A.useContextCallback("onOpenChangeComplete",a);let ue=A.useState("floatingTreeRoot"),V=xs(ue),G=A.useState("open"),Z=A.useState("activeTriggerElement"),ee=A.useState("positionerElement"),Pe=A.useState("hoverEnabled"),te=A.useState("disabled"),ie=A.useState("lastOpenChangeReason"),me=A.useState("parent"),fe=A.useState("activeIndex"),be=A.useState("keyboardOpen"),ne=A.useState("payload"),we=A.useState("floatingParentNodeId"),Ce=lt.useRef(null),De=lt.useRef(me.type!=="context-menu"),Q=Je(),H=lt.useRef(!0),Y=Je(),D=we!=null,{openMethod:de,triggerProps:K}=n1(G);A.useSyncedValues({disabled:c,highlightItemOnHover:h,modal:me.type===void 0?u:void 0,openMethod:de,rootId:O}),ga(A);let{forceUnmount:pe,transitionStatus:M}=ha(G,A,()=>{A.set("allowMouseEnter",!1)},W),_=la(A.context.popupRef);lt.useEffect(()=>{if(X===void 0)return;let ye=()=>{if(A.state.instantType===X)A.set("instantType",void 0)};if(!G){ye();return}if(M!==void 0)return;if(A.context.popupRef.current==null){ye();return}let Me=new AbortController;return _(ye,Me.signal),()=>{Me.abort()}},[X,G,M,_,A]),z(()=>{if(w&&!v)A.update({parent:{type:"context-menu",context:w},floatingNodeId:V,floatingParentNodeId:T});else if(v||!A.select("activeTriggerElement"))A.update({floatingNodeId:V,floatingParentNodeId:T})},[w,v,V,T,Z,A]),lt.useEffect(()=>{if(!G)Ce.current=null;if(me.type!=="context-menu")return;if(!G){Q.clear(),De.current=!1;return}Q.start(500,()=>{De.current=!0})},[Q,G,me.type]),z(()=>{if(!G&&!Pe)A.set("hoverEnabled",!0)},[G,Pe,A]);let Se=re((ye,Me)=>{let We=Me.reason;if(!ye&&!A.select("open"))return;if(G===ye&&Me.trigger===Z&&ie===We)return;let $t=Pm(Me);if(!ye&&Me.trigger==null)Me.trigger=Z??void 0;if(n?.(ye,Me),Me.isCanceled)return;A.state.floatingRootContext.dispatchOpenChange(ye,Me);let Jt=Me.event;if(ye===!1&&We!==_u&&Jt?.type==="click"&&Jt.pointerType==="touch"&&!H.current)return;if(ye&&We===sa)H.current=!1,Y.start(300,()=>{H.current=!0});else H.current=!0,Y.clear();let So=!ye&&(We===Qi||We==null);Ce.current=Me.event;let jt=Ps(A.state,ye,Me.trigger,$t());if(jt.openChangeReason=We,jt.keyboardOpen=ye&&i1(We,Jt),me.type==="menubar"&&(We===sa||We===ia||We===Yt||We===ec||We===ts))jt.instantType="group";else if(of(We,Jt))jt.instantType="click";else if(So)jt.instantType="dismiss";else jt.instantType=void 0;A.update(jt)}),J=Rs({popupStore:A,floatingRootContext:A.state.floatingRootContext,floatingId:j,nested:T!=null,onOpenChange:Se}),se=J.context.events;z(()=>{let ye=({open:Me,eventDetails:We})=>Se(Me,We);return se.on("setOpen",ye),()=>{se?.off("setOpen",ye)}},[se,Se]),z(()=>A.subscribeToParentMenu(),[A]);let ge=lt.useCallback(()=>{A.setOpen(!1,Re(Wu))},[A]);lt.useImperativeHandle(p,()=>({unmount:pe,close:ge}),[pe,ge]);let he;if(me.type==="context-menu")he=me.context;lt.useImperativeHandle(he?.positionerRef,()=>ee,[ee]),lt.useImperativeHandle(he?.actionsRef,()=>({setOpen:Se}),[Se]);let Ie=Ln(J,{enabled:!te,bubbles:{escapeKey:d&&me.type==="menu"},outsidePress(){if(me.type!=="context-menu"||Ce.current?.type==="contextmenu")return!0;return De.current},externalTree:D?ue:void 0}),Ne=Yc(),Qe=Vm(J,{enabled:!te,listRef:A.context.itemDomElements,activeIndex:fe,virtual:b,nested:me.type==="menubar"||!b&&me.type!==void 0,parentOrientation:me.type==="menubar"?me.context.orientation:void 0,loopFocus:l,focusItemOnOpen:b?be:void 0,allowEscape:b&&l&&I,orientation:m,triggerOrientation:b?"vertical":m,rtl:Ne==="rtl",disabledIndices:Mr,onNavigate(ye,Me){A.setActiveIndex(ye,a1(Me),Me?.nativeEvent)},openOnArrowKeyDown:me.type!=="context-menu"&&!(b&&x),externalTree:!b&&D?ue:void 0,nestedReturnFocusRef:B?.context.virtualFocusRef,focusItemOnHover:h,resetOnPointerLeave:y}),gt=lt.useCallback((ye)=>{A.context.typingRef.current=ye},[A]),bo=Um(J,{enabled:!te&&!b,listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:fe,resetMs:d0,onMatch:(ye,Me)=>{if(G&&ye!==fe)A.setActiveIndex(ye,Rd,Me.nativeEvent)},onTyping:gt}),Co=re(s),Yo=lt.useRef(-1),oo=re(()=>{let ye=A.state.activeIndex,Me=ye===null?void 0:A.context.itemDomElements.current[ye]??void 0;if(Me?.isConnected===!1)return;let We=Me===void 0?-1:ye;if(Yo.current===We&&A.context.reportedItem===Me)return;if(Yo.current=We,A.context.reportedItem=Me,b)A.set("highlightedItem",Me);let{highlightReason:$t,highlightEvent:Jt}=A.context;if(A.context.highlightReason=Rn,A.context.highlightEvent=void 0,!s)return;Co(Me,Hd($t,Jt,{label:Me===void 0?void 0:A.context.itemLabels.current[We]??void 0}))});z(()=>{oo()},[fe,oo]);let Kt=lt.useMemo(()=>{if(!b)return Qe.reference;if(!Qe.trigger)return Ue;let{onFocus:ye,...Me}=Qe.trigger;return Me},[b,Qe.reference,Qe.trigger]);A.useSyncedValue("inputProps",b?Qe.reference??Ue:Ue);let yo=lt.useMemo(()=>{let ye=Ot(bo.reference,Kt,Ie.reference,{onMouseMove(){A.set("allowMouseEnter",!0)}},K);return ye["aria-haspopup"]="menu",ye["aria-expanded"]=G,ye},[A,bo.reference,Kt,Ie.reference,K,G]),To=lt.useMemo(()=>{let ye=Ot(Qe.trigger,Ie.trigger,K);return ye["aria-haspopup"]="menu",ye["aria-expanded"]=!1,ye},[Qe.trigger,Ie.trigger,K]);Xe(()=>(A.update({inactiveTriggerProps:To}),null));let uo=lt.useMemo(()=>Ot(fa,{onMouseMove(){if(A.set("allowMouseEnter",!0),me.type==="menu")A.set("hoverEnabled",!1)},onClick(){if(A.select("hoverEnabled"))A.set("hoverEnabled",!1)},onKeyDown(ye){let Me=A.select("keyboardEventRelay");if(Me&&!ye.isPropagationStopped())Me(ye)}},bo.floating,Qe.floating,Ie.floating),[me.type,A,bo.floating,Qe.floating,Ie.floating]),fn=Qe.item??Ue;Ia(A,{floatingRootContext:J,activeTriggerProps:yo,inactiveTriggerProps:To,popupProps:uo,itemProps:fn});let pn=lt.useMemo(()=>({store:A,parent:E,orientation:m,loopFocus:l,allowEscape:I,defaultFloatingId:k,setRenderedFloatingId:N,virtualFocus:b,parentVirtualFocus:U,syncHighlightedItem:oo}),[A,E,m,l,I,k,b,U,oo]),$e=typeof o==="function"?o({payload:ne}):o,Zt=lx(Qa.Provider,{value:pn,children:[f&&Os(pa,{handle:f,store:A}),$e]});if(me.type===void 0||me.type==="context-menu")Zt=Os(xm,{externalTree:ue,children:Zt});return Zt});function c1(e){let t=lt.useContext(tf);if(t===null)return Os(ux,{...e});let o=t.Root;return Os(tf.Provider,{value:null,children:Os(o,{...t.options,...e})})}import*as go from"react";var al=5;function l1(e,t){let o=mx(t);return e.clientX>=o.left-al&&e.clientX<=o.right+al&&e.clientY>=o.top-al&&e.clientY<=o.bottom+al}function mx(e){let t=e.getBoundingClientRect(),o=qe(e);if(rs.jsdom)return t;let r=o.getComputedStyle(e,"::before"),n=o.getComputedStyle(e,"::after");if(!(r.content!=="none"||n.content!=="none"))return t;let s=parseFloat(r.width)||0,i=parseFloat(r.height)||0,c=parseFloat(n.width)||0,u=parseFloat(n.height)||0,l=Math.max(t.width,s,c),m=Math.max(t.height,i,u),p=l-t.width,d=m-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-d/2,bottom:t.bottom+d/2}}import*as u1 from"react";function m1(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:r}=Qn(),{ref:n,index:a}=oc(e),s=o===a,i=u1.useRef(null),c=Wo(n,i);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let l=i.current;if(!t||!l)return;let m=l.hasAttribute("disabled")||l.ariaDisabled==="true";if(!s&&!m)l.focus()}},compositeRef:c,index:a}}function f1(e){let{render:t,className:o,style:r,state:n=Ue,props:a=Mr,refs:s=Mr,metadata:i,stateAttributesMapping:c,tag:u="div",...l}=e,{compositeProps:m,compositeRef:p}=m1({metadata:i});return ve(u,e,{state:n,ref:[p,...s],props:[m,...a,l],stateAttributesMapping:c})}function rf(e){if(je(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(Go(e))return;return rf(zo(e))}import*as p1 from"react-dom";function d1(e,t){function o(a,s,i){let c=a.currentTarget;p1.flushSync(()=>{e.setOpen(!1,Re(ia,a.nativeEvent,c))}),i0(c.isConnected?c:t.current,s,i)?.focus()}function r(a){o(a,-1,e.select("positionerElement"))}function n(a){let s=e.select("positionerElement");if(s&&Nr(a,s))e.context.beforeContentFocusGuardRef.current?.focus();else o(a,1,s)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:n}}import*as sl from"react";function g1(e){let{enabled:t=!0,mouseDownAction:o,open:r}=e,n=sl.useRef(!1);return sl.useMemo(()=>{if(!t)return Ue;return{onMouseDown:(a)=>{if(o==="open"&&!r||o==="close"&&r)n.current=!0,Ee(a.currentTarget).addEventListener("click",()=>{n.current=!1},{once:!0})},onClick:(a)=>{if(n.current)n.current=!1,a.preventBaseUIHandler()}}},[t,o,r])}import{jsx as Ns,jsxs as fx}from"react/jsx-runtime";var h1=ba(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,openOnHover:u,delay:l=100,closeDelay:m=0,handle:p,payload:d,...f}=t,S=vo(!0),h=Sa(p)??S?.store;if(!h)throw Error(Ge(85));let x=ao(c),b=h.useState("isTriggerActive",x),C=h.useState("floatingRootContext"),I=h.useState("isOpenedByTrigger",x),y=h.useState("triggerControlsId",x),w=go.useRef(null),v=dx(),R=Qn(!0),L=fo(),U=go.useMemo(()=>L??new kn,[L]),E=xs(U),O=Do(),{registerTrigger:k,isMountedByThisTrigger:P}=da(x,w,h,{payload:d,closeDelay:m,parent:v,floatingTreeRoot:U,floatingNodeId:E,floatingParentNodeId:O,keyboardEventRelay:R?.relayKeyboardEvent}),N=v.type==="menubar",j=h.useState("disabled"),T=s||j||N&&v.context.disabled,{getButtonProps:B,buttonRef:W}=xo({disabled:T,native:i});go.useEffect(()=>{if(!I&&v.type===void 0)h.context.allowMouseUpTriggerRef.current=!1},[h,I,v.type]);let X=go.useRef(null),A=Je(),ue=re((Y)=>{if(!X.current)return;A.clear(),h.context.allowMouseUpTriggerRef.current=!1;let D=Y.target;if(le(X.current,D)||le(h.select("positionerElement"),D)||D===X.current)return;if(D!=null&&rf(D)===h.select("rootId"))return;if(l1(Y,X.current))return;U.events.emit("close",{domEvent:Y,reason:Wb})});go.useEffect(()=>{let Y=Ee(X.current);if(I&&h.select("lastOpenChangeReason")===Yt)return Y.addEventListener("mouseup",ue,{once:!0}),()=>{Y.removeEventListener("mouseup",ue)};return},[I,ue,h]);let V=N&&v.context.hasSubmenuOpen,Z=Ms(C,{enabled:(u??V)&&!T&&(!N||V&&!P),handleClose:ks({blockPointerEvents:!N}),mouseOnly:!0,move:!1,restMs:v.type===void 0?l:void 0,delay:{close:m},triggerElementRef:w,externalTree:U,isActiveTrigger:b,isClosing:()=>h.select("transitionStatus")==="ending"}),ee=px(I,h.select("lastOpenChangeReason")),Pe=vs(C,{enabled:!T,event:I&&N?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?ee:!1}),te=Es(C,{enabled:!T&&V}),ie=g1({open:I,enabled:N,mouseDownAction:"open"}),me=go.useMemo(()=>Ot(te.reference,Pe.reference),[te.reference,Pe.reference]),fe=h.useState("triggerProps",P),be=h.useState("filterTriggerProps"),{handlePreFocusGuardFocus:ne,handleFocusTargetFocus:we}=d1(h,w),Ce={disabled:T,open:I},De=[X,o,W,k,w],Q=[me,Z??Ue,fe,{"aria-haspopup":"menu","aria-controls":y,id:x,onMouseDown:(Y)=>{if(h.select("open"))return;A.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Ee(Y.currentTarget).addEventListener("mouseup",ue,{once:!0})}},be,N?{role:"menuitem"}:{},ie,f,B],H=ve("button",t,{enabled:!N,stateAttributesMapping:Vu,state:Ce,ref:De,props:Q});if(N)return Ns(f1,{tag:"button",render:r,className:n,style:a,state:Ce,refs:De,props:Q,stateAttributesMapping:Vu});if(I)return fx(go.Fragment,{children:[Ns(nr,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:ne},`${x}-pre-focus-guard`),Ns(go.Fragment,{children:H},x),Ns(nr,{ref:h.context.triggerFocusTargetRef,onFocus:we},`${x}-post-focus-guard`)]});return Ns(go.Fragment,{children:H},x)});function px(e,t){let o=Je(),[r,n]=go.useState(!1);return z(()=>{if(e&&t===Yt)n(!0),o.start(g0,()=>{n(!1)});else if(!e)o.clear(),n(!1)},[e,t,o]),r}function dx(){let e=rl(!0);return go.useMemo(()=>{if(e)return{type:"menubar",context:e};return{type:void 0}},[e])}import*as I1 from"react";var b1=I1.forwardRef(function(t,o){let{className:r,render:n,orientation:a="horizontal",style:s,...i}=t;return ve("div",t,{state:{orientation:a},ref:o,props:[{role:"separator","aria-orientation":a},i]})});import{jsx as Vn,jsxs as JYe}from"react/jsx-runtime";function S1({...e}){return Vn(c1,{"data-slot":"dropdown-menu",...e})}function x1({...e}){return Vn(h1,{"data-slot":"dropdown-menu-trigger",...e})}function w1({align:e="start",alignOffset:t=0,side:o="bottom",sideOffset:r=4,className:n,portalContainer:a,...s}){return Vn(Ag,{container:a,children:Vn(t1,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:o,sideOffset:r,children:Vn(Rg,{"data-slot":"dropdown-menu-content",className:ce("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 transition-[opacity,scale] duration-[180ms] ease-[var(--ease-out)] outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100",n),...s})})})}function Bs({className:e,inset:t,variant:o="default",...r}){return Vn(Wd,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:ce("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function y1({className:e,...t}){return Vn(b1,{"data-slot":"dropdown-menu-separator",className:ce("-mx-1 my-1 h-px bg-border",e),...t})}import*as O1 from"react";import*as il from"react";var v1="data-valid",R1="data-invalid";var P1={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},hx={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},T1={disabled:!1,...hx},E1={valid(e){if(e===null)return null;if(e)return{[v1]:""};return{[R1]:""}}};var Ix={invalid:void 0,name:void 0,validityData:{state:P1,errors:[],error:"",value:"",initialValue:null},setValidityData:Ye,disabled:void 0,setTouched:Ye,setDirty:Ye,setFilled:Ye,setFocused:Ye,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:T1,registerFieldControl:Ye,validation:{getValidationProps:(e,t=Ue)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ye,getInputControl:()=>null,commit:async()=>{},change:Ye}},bx=il.createContext(Ix);function Ta(e=!0){let t=il.useContext(bx);if(t.setValidityData===Ye&&!e)throw Error(Ge(28));return t}import*as cl from"react";var Cx=cl.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitCountRef:{current:0}});function A1(){return cl.useContext(Cx)}import*as ll from"react";var Sx=ll.createContext({controlId:void 0,registerControlId:Ye,resetControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:(e)=>e});function ul(){return ll.useContext(Sx)}import*as ml from"react";function M1(e,t,o){let{setFocused:r,focusOwnerRef:n}=Ta(),a=re((s)=>{if(s?!e:n.current===a)n.current=s&&a,o?.(s),r(s)});return z(()=>{let s=t.current;if(s?.getRootNode()?.activeElement===s)a(!0);return()=>a(!1)},[e,t,a]),a}function k1(e,t,o,r,n=!0,a){let{registerFieldControl:s}=Ta(),i=Xe(()=>Symbol());z(()=>{let c=i.current;if(!n){s(c,void 0);return}s(c,{controlRef:e,getValue:r,id:t,name:a,value:o})},[e,n,r,t,a,s,i,o]),z(()=>{let c=i.current;return()=>{s(c,void 0)}},[s,i])}import*as nf from"react";function L1(e={}){let{id:t,enabled:o=!0}=e,{controlId:r,registerControlId:n,resetControlId:a}=ul(),s=ao(),i=Xe(()=>Symbol()),c=nf.useRef(!1),u=nf.useRef(!1),l=re(()=>{if(!c.current||n===Ye)return;c.current=!1,n(i.current,void 0)});return z(()=>{if(!o||n===Ye){l();return}let m;if(t!==void 0)u.current=!0,m=t;else if(u.current)m=s;else{a();return}if(m===void 0){l();return}c.current=!0,n(i.current,m);return},[t,o,n,a,s,i,l]),z(()=>l,[l]),(o?r:void 0)??t??s}var D1=ml.forwardRef(function(t,o){let{render:r,className:n,id:a,name:s,value:i,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:m=!1,style:p,...d}=t,{state:f,name:S,disabled:g,setTouched:h,setDirty:x,validityData:b,setFilled:C,validationMode:I,validation:y}=Ta(),{clearErrors:w,elementRef:v,submitCountRef:R}=A1(),L=g||c,U=S??s,E={...f,disabled:L},{labelId:O}=ul(),k=L1({id:a}),P=i!==void 0,N=i==null?void 0:String(i),j=re(()=>y.inputRef.current?.value);k1(y.inputRef,k,N,j,!L,s),z(()=>{let A=N??y.inputRef.current?.value;if(A!==void 0)C(A!=="")},[N,l,y.inputRef,C]),nl(N,()=>{if(N===void 0)return;w(U),x(N!==(b.initialValue??"")),y.change(N)});let T=ml.useRef(null),B=M1(L,T),W=Je();return ve("input",t,{ref:[o,T],state:E,props:[{id:k,disabled:L,name:U,ref:y.inputRef,"aria-labelledby":O,autoFocus:m,...P?{value:i}:{defaultValue:l},onChange(A){let ue=A.currentTarget.value,V=Re(Rn,A.nativeEvent);if(u?.(ue,V),P)return;if(x(ue!==(b.initialValue??"")),C(ue!==""),!A.nativeEvent.defaultPrevented&&!V.isCanceled)w(U),y.change(ue)},onFocus(){B(!0)},onBlur(A){if(h(!0),B(!1),I==="onBlur"){let ue=A.currentTarget.value;if(y.commit(ue),P)queueMicrotask(()=>{let V=y.inputRef.current?.value;if(V!==void 0&&V!==ue&&V!==(b.initialValue??""))y.commit(V)})}},onKeyDown(A){if(A.currentTarget.tagName==="INPUT"&&A.key==="Enter"){h(!0);let ue=A.currentTarget.value,V=A.currentTarget.form;if(V&&V===v.current&&!A.defaultPrevented){let G=A.currentTarget,Z=R.current;W.start(0,()=>{if(R.current===Z)y.commit(G.value)})}else y.commit(ue)}}},d,(A)=>y.getValidationProps(L,A)],stateAttributesMapping:E1})});import{jsx as xx}from"react/jsx-runtime";var af=O1.forwardRef(function(t,o){return xx(D1,{ref:o,...t})});import{jsx as wx}from"react/jsx-runtime";function sf({className:e,type:t,...o}){return wx(af,{type:t,"data-slot":"input",className:ce("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...o})}import{jsx as yx}from"react/jsx-runtime";function N1({className:e,...t}){return yx("textarea",{"data-slot":"textarea",className:ce("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}import{jsx as fl}from"react/jsx-runtime";function B1({className:e,...t}){return fl("div",{"data-slot":"input-group",role:"group",className:ce("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}var vx=ro("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function H1({className:e,align:t="inline-start",...o}){return fl("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:ce(vx({align:t}),e),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...o})}var Rx=ro("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function cf({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return fl(mt,{type:t,"data-size":r,variant:o,className:ce(Rx({size:r}),e),...n})}function V1({className:e,...t}){return fl(N1,{"data-slot":"input-group-control",className:ce("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",e),...t})}import{jsx as rt,jsxs as co}from"react/jsx-runtime";function U1({send:e,upload:t,sendDisabled:o=!1,showPoweredBy:r=!1,assetBaseUrl:n,body:a,onBodyChange:s,inputRef:i}){let[c,u]=Hs(!1),[l,m]=Hs(""),[p,d]=Hs([]),[f,S]=Hs(!1),g=Tx(null),[h,x]=Hs(null);Px(()=>{x(g.current?.closest("[data-coristen-widget]")??null)},[]);async function b(I){let y=Array.from(I.target.files??[]).slice(0,Math.max(0,5-p.length));if(I.target.value="",!y.length)return;S(!0),m("");try{let w=[];for(let v of y)w.push(await t(v));d((v)=>[...v,...w].slice(0,5))}catch(w){m(w instanceof Error?w.message:"File upload failed. Try again.")}finally{S(!1)}}async function C(I){I.preventDefault();let y=a.trim();if(!y&&!p.length||c||f||o)return;u(!0),m("");try{await e(y,p),s(""),d([])}catch{m("Message could not be sent. Try again.")}finally{u(!1)}}return co("form",{onSubmit:(I)=>void C(I),className:"w-full",children:[rt("input",{ref:g,type:"file",multiple:!0,className:"sr-only",onChange:(I)=>void b(I)}),(p.length>0||f)&&co($i,{className:"px-2 pb-2",children:[p.map((I)=>co(oa,{size:"xs",children:[rt(Xa,{children:rt(Cn,{})}),co(Ya,{className:"max-w-32",children:[rt(Ka,{title:I.name,children:I.name}),co(Ja,{children:[(I.size/1024).toFixed(0)," KB"]})]}),rt(Zi,{children:rt(Cd,{type:"button","aria-label":`Remove ${I.name}`,onClick:()=>d((y)=>y.filter((w)=>w.storageId!==I.storageId)),children:rt(Uo,{})})})]},I.storageId)),f&&co(oa,{size:"xs",state:"uploading",children:[rt(Xa,{children:rt(Cn,{})}),co(Ya,{children:[rt(Ka,{children:"Uploading file"}),rt(Ja,{children:"Please wait"})]})]})]}),co(B1,{className:"has-disabled:opacity-100",children:[rt(V1,{ref:i,"aria-label":"Message",placeholder:"Write a message...",value:a,onChange:(I)=>s(I.target.value),maxLength:2000,rows:2,onKeyDown:(I)=>{if(I.key==="Enter"&&!I.shiftKey)I.preventDefault(),I.currentTarget.form?.requestSubmit()}}),co(H1,{align:"block-end",className:"pt-1",children:[co(S1,{children:[rt(x1,{render:rt(cf,{type:"button",variant:"outline",size:"icon-sm","aria-label":"More message options"}),children:rt(Yn,{className:"size-5"})}),co(w1,{portalContainer:h,align:"start",side:"top",className:"w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",children:[co(Bs,{onClick:()=>g.current?.click(),children:[rt(Mi,{}),"Add Photos & Files"]}),rt(y1,{}),co(Bs,{children:[rt(Pi,{}),"Create Image"]}),co(Bs,{children:[rt(mi,{}),"Deep Research"]}),co(Bs,{children:[rt(wi,{}),"Web Search"]})]})]}),r&&rt("div",{className:"mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",children:r&&rt("a",{href:"https://coristen.com",target:"_blank",rel:"noreferrer",className:"transition-colors hover:text-foreground",children:co("span",{className:"inline-flex items-center gap-1",children:["Powered by",co("span",{className:"relative size-4 shrink-0",children:[rt("img",{src:`${n}/brand/coristen-mark-light.png`,alt:"",className:"absolute inset-0 size-full object-contain dark:hidden"}),rt("img",{src:`${n}/brand/coristen-mark-dark.png`,alt:"",className:"absolute inset-0 hidden size-full object-contain dark:block"})]}),rt("span",{className:"font-medium",children:"Coristen"})]})})}),rt(cf,{type:"submit",variant:"default",size:"icon-sm",className:r?void 0:"ml-auto","aria-label":"Send message",disabled:c||f||o||!a.trim()&&!p.length,children:rt(ai,{})})]})]}),l&&rt("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:l})]})}import{jsx as Un}from"react/jsx-runtime";function lf({className:e,size:t="default",...o}){return Un("div",{"data-slot":"card","data-size":t,className:ce("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...o})}function uf({className:e,...t}){return Un("div",{"data-slot":"card-header",className:ce("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function mf({className:e,...t}){return Un("div",{"data-slot":"card-title",className:ce("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function ff({className:e,...t}){return Un("div",{"data-slot":"card-description",className:ce("text-sm text-muted-foreground",e),...t})}function _1({className:e,...t}){return Un("div",{"data-slot":"card-action",className:ce("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function W1({className:e,...t}){return Un("div",{"data-slot":"card-content",className:ce("px-(--card-spacing)",e),...t})}function pl({className:e,...t}){return Un("div",{"data-slot":"card-footer",className:ce("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}import{jsx as Ax}from"react/jsx-runtime";var Ex=ro("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});function pf({variant:e="default",align:t="start",className:o,...r}){return Ax("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:ce(Ex({variant:e}),o),...r})}function df({className:e,render:t,...o}){return Jn({defaultTagName:"div",props:Ot({className:ce("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},o),render:t,state:{slot:"bubble-content"}})}var MJe=ro("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}});import{jsx as dl}from"react/jsx-runtime";function z1({className:e,...t}){return dl("div",{"data-slot":"empty",className:ce("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",e),...t})}function G1({className:e,...t}){return dl("div",{"data-slot":"empty-header",className:ce("flex max-w-sm flex-col items-center gap-2",e),...t})}var OJe=ro("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default"}});function Z1({className:e,...t}){return dl("div",{"data-slot":"empty-title",className:ce("font-heading text-sm font-medium tracking-tight",e),...t})}function $1({className:e,...t}){return dl("div",{"data-slot":"empty-description",className:ce("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}import{jsx as Vs}from"react/jsx-runtime";function q1({className:e,align:t="start",...o}){return Vs("div",{"data-slot":"message","data-align":t,className:ce("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",e),...o})}function j1({className:e,...t}){return Vs("div",{"data-slot":"message-avatar",className:ce("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",e),...t})}function X1({className:e,...t}){return Vs("div",{"data-slot":"message-content",className:ce("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",e),...t})}function Y1({className:e,...t}){return Vs("div",{"data-slot":"message-header",className:ce("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",e),...t})}function K1({className:e,...t}){return Vs("div",{"data-slot":"message-footer",className:ce("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",e),...t})}import*as gl from"react";import*as Bt from"react";var J1=new Map([["bold",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),Bt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",Bt.createElement(Bt.Fragment,null,Bt.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var gf=gl.forwardRef((e,t)=>gl.createElement(Le,{ref:t,...e,weights:J1}));gf.displayName="ArrowCounterClockwiseIcon";import*as hl from"react";import*as Ht from"react";var Q1=new Map([["bold",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),Ht.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",Ht.createElement(Ht.Fragment,null,Ht.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]);var hf=hl.forwardRef((e,t)=>hl.createElement(Le,{ref:t,...e,weights:Q1}));hf.displayName="DownloadSimpleIcon";import{useState as Tl}from"react";import*as eh from"react";import*as Il from"react";var If=Il.createContext(void 0);function ho(e){let t=Il.useContext(If);if(!e&&t===void 0)throw Error(Ge(27));return t}var th=eh.forwardRef(function(t,o){let{render:r,className:n,style:a,forceRender:s=!1,...i}=t,c=ho(),u=c.useState("open"),l=c.useState("nested"),m=c.useState("mounted"),p=c.useState("transitionStatus");return ve("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,o],stateAttributesMapping:ra,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});import*as oh from"react";var bf=oh.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,...c}=t,u=ho(),l=u.useState("open"),{getButtonProps:m,buttonRef:p}=xo({disabled:s,native:i}),d={disabled:s};function f(S){if(l)u.setOpen(!1,Re(Ub,S.nativeEvent))}return ve("button",t,{state:d,ref:[o,p],props:[{onClick:f},c,m]})});import*as rh from"react";var nh=rh.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=ho(),u=ao(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),ve("p",t,{ref:o,props:[{id:u},i]})});import*as lh from"react";import*as bl from"react";var Cf=bl.createContext(void 0);function ah(){let e=bl.useContext(Cf);if(e===void 0)throw Error(Ge(26));return e}var sh="--nested-dialogs";var dQe=Bu,gQe=Hu,hQe=Lb,IQe=Db;var ih="data-nested-dialog-open";var ch={...vn,...Xr,nestedDialogOpen(e){return e?{[ih]:""}:null}};import{jsx as Lx}from"react/jsx-runtime";var uh=lh.forwardRef(function(t,o){let{render:r,className:n,style:a,finalFocus:s,initialFocus:i,...c}=t,u=ho(),l=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),d=u.useState("popupProps"),f=u.useState("modal"),S=u.useState("mounted"),g=u.useState("nested"),h=u.useState("nestedOpenDialogCount"),x=u.useState("open"),b=u.useState("openMethod"),C=u.useState("titleElementId"),I=u.useState("transitionStatus"),y=u.useState("role"),w=p.useState("floatingId");ah(),$o({open:x,ref:u.context.popupRef,onComplete(){if(x)u.context.onOpenChangeComplete?.(!0)}});let v=i===void 0?O0(u.context.popupRef):i,R=h>0,L=u.useStateSetter("popupElement"),E=ve("div",t,{state:{open:x,nested:g,transitionStatus:I,nestedDialogOpen:R},props:[d,{id:w,"aria-labelledby":C,"aria-describedby":l,role:y,...fa,hidden:!S,onKeyDown(O){if(Zc.has(O.key))O.stopPropagation()},style:{[sh]:h}},c],ref:[o,u.context.popupRef,L],stateAttributesMapping:ch});return Lx(ws,{context:p,openInteractionType:b,disabled:!S,closeOnFocusOut:!m,initialFocus:v,returnFocus:s,modal:f!==!1,restoreFocus:"popup",children:E})});import*as fh from"react";import{jsx as mh,jsxs as Dx}from"react/jsx-runtime";var ph=fh.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t,a=ho(),s=a.useState("mounted"),i=a.useState("modal"),c=a.useState("open");if(!(s||r))return null;return mh(Cf.Provider,{value:r,children:Dx(Ss,{ref:o,...n,children:[s&&i===!0&&mh(Jc,{ref:a.context.internalBackdropRef,inert:Ra(!c)}),t.children]})})});import*as hh from"react";import*as Sf from"react";function dh({store:e,parentContext:t,isDrawer:o}){let r=e.useState("open"),n=e.useState("mounted"),a=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,l]=Sf.useState(0),[m,p]=Sf.useState(0),d=u===0,f=Ln(c,{outsidePressEvent(){if(e.context.internalBackdropRef.current||e.context.backdropRef.current)return"intentional";return{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in S&&S.button!==0)return!1;if("touches"in S){if(S.type==="touchend"){if(S.changedTouches.length!==1||S.touches.length!==0)return!1}else if(S.touches.length!==1)return!1}let g=Ze(S);if(d&&!a){if(s){let h=e.context.internalBackdropRef.current,x=e.context.backdropRef.current;return h||x?h===g||x===g||le(g,i)&&!g?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:d});return tl(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(S,g)=>{if(!e.select("open")&&!e.select("mounted"))return;l(S),p(g)}),z(()=>{if(!r&&!n)l(0),p(0)},[r,n]),z(()=>{if(t?.onNestedDialogOpen){if(r)t.onNestedDialogOpen(u+1,m+(o?1:0))}return()=>{if(t?.onNestedDialogOpen&&r)t.onNestedDialogOpen(0,0)}},[o,r,u,m,t]),Ia(e,{activeTriggerProps:f.reference,inactiveTriggerProps:f.trigger,popupProps:f.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:m}),null}import*as Cl from"react";var Fx={...nn,modal:(e)=>e.modal,nested:(e)=>e.nested,nestedOpenDialogCount:(e)=>e.nestedOpenDialogCount,nestedOpenDrawerCount:(e)=>e.nestedOpenDrawerCount,disablePointerDismissal:(e)=>e.disablePointerDismissal,openMethod:(e)=>e.openMethod,descriptionElementId:(e)=>e.descriptionElementId,titleElementId:(e)=>e.titleElementId,viewportElement:(e)=>e.viewportElement,role:(e)=>e.role};class xf extends ir{constructor(e,t,o){let r=new Dn,n=Ox(e,r,t,o);super(n,Nx(r),Fx)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null)t.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Ps(this.state,e,t.trigger))}}function Ox(e,t,o,r=!1){return{...Ca(t,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function Nx(e){return{popupRef:Cl.createRef(),backdropRef:Cl.createRef(),internalBackdropRef:Cl.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}import{jsx as gh,jsxs as Bx}from"react/jsx-runtime";function Ih(e,t){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:m,defaultTriggerId:p=null}=t,d=e==="drawer",f=e==="alert-dialog",S=f?!0:c,g=f||i,h=f?"alertdialog":"dialog",x=ho(!0),b=x!=null,C={modal:S,disablePointerDismissal:g,nested:b,role:h},I=Ac((U,E)=>new xf({open:n,openProp:r,activeTriggerId:p,triggerIdProp:m,...C},U,E),!0);I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",m),I.useSyncedValues(C),I.useContextCallback("onOpenChange",a),I.useContextCallback("onOpenChangeComplete",s);let y=I.useState("open"),w=I.useState("mounted"),v=I.useState("payload");B0(I,y),ga(I);let{forceUnmount:R}=ha(y,I);hh.useImperativeHandle(u,()=>({unmount:R,close:()=>I.setOpen(!1,Re(Wu))}),[R,I]);let L=y||w||l!=null;return Bx(If.Provider,{value:I,children:[l&&gh(pa,{handle:l,store:I}),L&&gh(dh,{store:I,parentContext:x?.context,isDrawer:d}),typeof o==="function"?o({payload:v}):o]})}var bh=Fn(function(t){return Ih("dialog",t)});import*as Ch from"react";var Sh=Ch.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,...i}=t,c=ho(),u=ao(s);return c.useSyncedValueWithCleanup("titleElementId",u),ve("h2",t,{ref:o,props:[{id:u},i]})});import*as xh from"react";var wh=ba(function(t,o){let{render:r,className:n,style:a,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...m}=t,p=ho(!0),f=Sa(l)??p;if(!f)throw Error(Ge(79));let S=ao(c),g=f.useState("floatingRootContext"),h=f.useState("isOpenedByTrigger",S),x=f.useState("triggerPopupId",S),b=xh.useRef(null),{registerTrigger:C,isMountedByThisTrigger:I}=da(S,b,f,{payload:u}),{getButtonProps:y,buttonRef:w}=xo({disabled:s,native:i}),v=vs(g),R=Qm(()=>f.select("open"),(E)=>{f.set("openMethod",E)}),L={disabled:s,open:h},U=f.useState("triggerProps",I);return ve("button",t,{state:L,ref:[w,o,C,b],props:[v.reference,U,R,{[Rc]:"",id:S,"aria-haspopup":"dialog","aria-expanded":h,"aria-controls":x},m,y],stateAttributesMapping:Ki})});import{jsx as cr,jsxs as wf}from"react/jsx-runtime";function yf({...e}){return cr(bh,{"data-slot":"dialog",...e})}function vh({...e}){return cr(wh,{"data-slot":"dialog-trigger",...e})}function Hx({...e}){return cr(ph,{"data-slot":"dialog-portal",...e})}function Rh({...e}){return cr(bf,{"data-slot":"dialog-close",...e})}function Vx({className:e,...t}){return cr(th,{"data-slot":"dialog-overlay",className:ce("fixed inset-0 isolate z-50 bg-black/10 transition-opacity duration-250 ease-[var(--ease-out)] data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:duration-150",e),...t})}function vf({className:e,children:t,showCloseButton:o=!0,...r}){return wf(Hx,{children:[cr(Vx,{}),wf(uh,{"data-slot":"dialog-content",className:ce("squircle fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-hidden rounded-(--radius-dialog) bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 transition-[opacity,scale] duration-250 ease-[var(--ease-out)] outline-none ring-inset data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100 sm:max-w-sm",e),...r,children:[t,o&&wf(bf,{"data-slot":"dialog-close",render:cr(mt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[cr(Uo,{}),cr("span",{className:"sr-only",children:"Close"})]})]})]})}function Rf({className:e,...t}){return cr(Sh,{"data-slot":"dialog-title",className:ce("font-heading text-base leading-none font-medium",e),...t})}function Pf({className:e,...t}){return cr(nh,{"data-slot":"dialog-description",className:ce("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}async function Ph(e,t){let o=await fetch(e);if(!o.ok)throw Error("Download failed");let r=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=r,n.download=t;try{document.body.append(n),n.click()}finally{n.remove(),setTimeout(()=>URL.revokeObjectURL(r),1000)}}var Ux=ro("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Sl({className:e,variant:t="default",render:o,...r}){return Jn({defaultTagName:"span",props:Ot({className:ce(Ux({variant:t}),e)},r),render:o,state:{slot:"badge",variant:t}})}import{jsx as Wx}from"react/jsx-runtime";var _x=ro("group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",{variants:{variant:{default:"",separator:"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",border:"border-b border-border pb-2"}}});function Th({className:e,variant:t="default",render:o,...r}){return Jn({defaultTagName:"div",props:Ot({className:ce(_x({variant:t,className:e}))},r),render:o,state:{slot:"marker",variant:t}})}function Eh({className:e,...t}){return Wx("span",{"data-slot":"marker-content",className:ce("min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function Ah(e,t=new Date){let o=new Date(e);if(o.toDateString()===t.toDateString())return"Today";let r=new Date(t);if(r.setDate(r.getDate()-1),o.toDateString()===r.toDateString())return"Yesterday";return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:o.getFullYear()===t.getFullYear()?void 0:"numeric"}).format(o)}import*as Ea from"react";function Mh({defaultTagName:e,props:t,render:o,state:r={},stateAttributesMapping:n}){let a=xl(zx(r,n),t);if(!o)return Ea.createElement(e,a);if(typeof o=="function")return o(a,r);if(!Ea.isValidElement(o))return null;let s=o.props,i={...xl(a,s),ref:Aa(a.ref,s.ref)};return Ea.cloneElement(o,i)}function xl(...e){let t={};for(let o of e){if(!o)continue;let r=o;for(let n of Object.keys(r)){let a=r[n];if(a===void 0)continue;let s=t[n];n==="className"?t[n]=[s,a].filter(Boolean).join(" "):n==="style"?t[n]={...s,...a}:n==="ref"?t[n]=Aa(s,a):Zx(n)&&typeof s=="function"&&typeof a=="function"?t[n]=Gx(a,s):t[n]=a}}return t}function zx(e,t){let o={};for(let r of Object.keys(e)){let n=e[r],a=t?.[r]?.(n);if(a){Object.assign(o,a);continue}if(r==="slot"){o["data-slot"]=n;continue}let s=`data-${String(r).replace(/[A-Z]/g,(i)=>`-${i.toLowerCase()}`)}`;typeof n=="boolean"?o[s]=n?"":void 0:n!=null&&(o[s]=String(n))}return o}function Gx(e,t){return function(o){e(o),o.defaultPrevented||t(o)}}function Zx(e){return/^on[A-Z]/.test(e)}function Aa(...e){let t=e.filter(Boolean);if(t.length!==0)return(o)=>{for(let r of t)typeof r=="function"?r(o):r&&(r.current=o)}}import*as oe from"react";import{jsx as Ma,jsxs as Dh}from"react/jsx-runtime";var $x=8,qx=64,jx=0,vl=0.5,Xx=180,Yx=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),Fh={start:!1,end:!1},Kx=[],Rl={currentAnchorId:null,visibleMessageIds:Kx};function Jx({content:e,scrollEdgeThreshold:t,spacer:o,viewport:r}){if(!r||!e)return Fh;let n=Ef({content:e,spacer:o,viewport:r});return{start:r.scrollTop>t,end:n-r.scrollTop-r.clientHeight>t}}function Qx({content:e,scrollMargin:t,scrollPreviousItemPeek:o,spacer:r,viewport:n,visibleMessageIds:a}){if(!e||!n)return Rl;let s=n.getBoundingClientRect(),i=s.top+t+o,c=typeof IntersectionObserver>"u",u=[],l=null;for(let m of Us(e,r)){let p=m.dataset.messageId;if(!p)continue;let d=m.dataset.scrollAnchor==="true",f=d||c?m.getBoundingClientRect():null;(c&&f?f.bottom>i&&f.top<s.bottom:a.has(p))&&u.push(p),d&&f&&f.top<=i+vl&&(l=p)}return u.length===0&&l===null?Rl:{currentAnchorId:l,visibleMessageIds:u}}function Us(e,t){return Array.from(e.children).filter((o)=>o instanceof HTMLElement&&o!==t)}function e8(e,t){for(let o=t;o<e.length;o++){let r=e[o];if(r?.dataset.scrollAnchor==="true")return r}return null}function t8(e,t){for(let o of e)if(o.dataset.scrollAnchor==="true"&&!t.has(o))return o;return null}function o8(e,t){let o=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(o+=1,o>1))return!0;return!1}function r8(e){for(let t=e.length-1;t>=0;t--){let o=e[t];if(o?.dataset.scrollAnchor==="true")return o}return null}function n8({content:e,spacer:t,viewport:o}){let r=o.getBoundingClientRect();for(let n of Us(e,t)){if(!n.dataset.messageId)continue;let a=n.getBoundingClientRect();if(a.bottom>r.top&&a.top<r.bottom)return n}return null}function a8({align:e,element:t,scrollMargin:o,spacer:r,viewport:n}){let a=Oh(t,n),s=t.getBoundingClientRect().height,i=c8(r);if(e==="center"){let c=Math.max(0,n.clientHeight-i.start-i.end);return a-i.start-(c-s)/2-o}if(e==="end")return a-n.clientHeight+s+i.end+o;if(e==="nearest"){let c=a+s,u=n.scrollTop+i.start,l=n.scrollTop+n.clientHeight-i.end;return a>=u&&c<=l?n.scrollTop:a<u?a-i.start-o:c-n.clientHeight+i.end+o}return a-i.start-o}function Oh(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();return o.top-r.top+t.scrollTop}function wl(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function s8({content:e,scrollTop:t,spacer:o,viewport:r}){let n=Ef({content:e,spacer:o,viewport:r});return t+r.clientHeight-n}function Ef({content:e,spacer:t,viewport:o}){let r=Us(e,t),n=Nh(e),a=o.getBoundingClientRect(),s=o.scrollTop,i=n.start+n.end;for(let c of r){let u=c.getBoundingClientRect();i=Math.max(i,u.bottom-a.top+s+n.end)}return i}function i8(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Nh(e){let t=window.getComputedStyle(e);return{end:Tf(t.paddingBlockEnd||t.paddingBottom),start:Tf(t.paddingBlockStart||t.paddingTop)}}function c8(e){let t=e?.parentElement;return t?Nh(t):{end:0,start:0}}function l8(e){if(!e)return 0;let t=window.getComputedStyle(e),o=t.rowGap==="normal"?t.gap:t.rowGap;return Tf(o)}function Tf(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Bh(e,t){let o=e,r=new Set;return{getSnapshot:()=>o,hasListeners:()=>r.size>0,setSnapshot:(n)=>{t(o,n)||(o=n,r.forEach((a)=>a()))},subscribe:(n,a,s)=>{let i=r.size===0;return r.add(n),i&&a?.(),()=>{r.delete(n),r.size===0&&s?.()}}}}function kh(e,t){return Bh(e,t)}function u8(){return Bh(Rl,f8)}function m8(e,t){return e.start===t.start&&e.end===t.end}function f8(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((o,r)=>o===t.visibleMessageIds[r])}function p8({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:r,scrollPreviousItemPeek:n}){let a=oe.useRef(e),s=oe.useRef(!1),i=oe.useRef(null),c=oe.useRef(!1),u=oe.useRef(o),l=oe.useRef(0),m=oe.useRef(null),p=oe.useRef(0),d=oe.useRef(e?"following-bottom":"free-scrolling"),f=oe.useRef(new Map),S=oe.useRef(null),g=oe.useRef(null),h=oe.useRef(null),x=oe.useRef(n),b=oe.useRef(!0),C=oe.useRef(null),I=oe.useRef(r),y=oe.useRef(null),w=oe.useRef(0),v=oe.useRef(0),R=oe.useRef(null),L=oe.useRef(null),U=oe.useRef(null),E=oe.useRef(null),O=oe.useRef(null),k=oe.useRef(null),P=oe.useRef(null),N=oe.useRef(null),j=oe.useRef(null),T=oe.useRef(new Set),B=oe.useRef(new WeakSet);return U.current===null&&(U.current=kh(t==="end"||t==="last-anchor",(W,X)=>W===X)),E.current===null&&(E.current=kh(Fh,m8)),j.current===null&&(j.current=u8()),a.current=e,u.current=o,I.current=r,x.current=n,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:O,streamingTurnRef:h,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:m,itemCountRef:l,lastScrollTopRef:p,messageElementsRef:f,modeRef:d,pendingScrollFrameRef:y,pendingScrollToMessageRef:S,prependRestoreRef:g,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:U.current,rootRef:C,scrollEdgeThresholdRef:u,scrollMarginRef:I,scrollPreviousItemPeekRef:x,spacerGapRef:w,spacerHeightRef:v,spacerRef:R,stateFrameRef:L,stateStore:E.current,viewportRef:k,visibilityFrameRef:P,visibilityObserverRef:N,visibilityStore:j.current,visibleMessageIdsRef:T,handledScrollAnchorsRef:B}}function Hh(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function yl(e){e.defaultScrollPositionAppliedRef.current=!0,Hh(e)}function d8({refs:e,commitScrollState:t,scheduleStateCommit:o,scheduleVisibilitySync:r}){let{streamingTurnRef:n,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:u,messageElementsRef:l,modeRef:m,pendingScrollToMessageRef:p,prependRestoreRef:d,scrollMarginRef:f,scrollPreviousItemPeekRef:S,spacerGapRef:g,spacerHeightRef:h,spacerRef:x,viewportRef:b}=e,C=oe.useCallback((E)=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current!==E&&(s.current=E,t()),E&&(i.current=window.setTimeout(()=>{i.current=null,s.current=!1,t()},Xx))},[t]),I=oe.useCallback((E)=>{let O=x.current;if(!O)return;let k=Math.max(0,Math.ceil(E));h.current!==k&&(h.current=k,O.hidden=k===0,O.style.height=`${k}px`,O.style.marginTop=k>0?`${-g.current}px`:"")},[]),y=oe.useCallback((E,{behavior:O="auto",autoscrolling:k=!1}={})=>{let P=b.current;if(!P)return;let N=Math.max(0,E);if(Math.abs(P.scrollTop-N)<=vl){P.scrollTop=N,t();return}k&&C(!0),P.scrollTo({top:N,behavior:O}),o()},[t,o,C]),w=oe.useCallback(({behavior:E="auto"}={})=>b.current?(I(0),n.current=null,m.current="free-scrolling",y(0,{behavior:E}),r(),!0):!1,[r,y,I]),v=oe.useCallback(({behavior:E="auto"}={})=>{let O=b.current;return O?(I(0),n.current=null,m.current=a.current?"following-bottom":"free-scrolling",y(i8(O),{autoscrolling:!0,behavior:E}),r(),!0):!1},[r,y,I]),R=oe.useCallback((E,{align:O="start",behavior:k="auto",scrollMargin:P=f.current}={},{keepPreviousPeek:N=!1}={})=>{let j=c.current,T=b.current;if(!j||!T||!j.contains(E))return!1;let B=a8({align:O,element:E,scrollMargin:N?P+S.current:P,spacer:x.current,viewport:T}),W=s8({content:j,scrollTop:B,spacer:x.current,viewport:T});return I(W),d.current={element:E,viewportTop:wl(E,T)},m.current=N?"anchored-to-message":"settling-jump",n.current=N?E:null,y(B,{behavior:k}),r(),!0},[r,y,I]),L=oe.useCallback(()=>{let E=n.current;return!E||!E.isConnected||m.current!=="anchored-to-message"?!1:R(E,{align:"start"},{keepPreviousPeek:!0})},[R]),U=oe.useCallback((E,O)=>{let k=l.current.get(E);return k?(yl(e),R(k,O)?(p.current=null,!0):(p.current={messageId:E,options:O},!0)):u.current===0?(p.current={messageId:E,options:O},yl(e),!0):!1},[R]);return{flushPendingScrollToMessage:oe.useCallback(()=>{let E=p.current;if(!E)return!1;let O=l.current.get(E.messageId);return!O||!R(O,E.options)?!1:(p.current=null,yl(e),!0)},[R]),reanchorToAnchoredMessage:L,scrollToElement:R,scrollToEnd:v,scrollToMessage:U,scrollToStart:w}}function Lh(e,t){return oe.useCallback((o)=>{e.current=o,o&&t()},[e,t])}function g8({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:o=$x,scrollPreviousItemPeek:r=qx,scrollMargin:n=jx}){let a=p8({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:o,scrollMargin:n,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:i,autoscrollingRef:c,autoscrollingTimeoutRef:u,contentRef:l,defaultScrollPositionAppliedRef:m,firstItemRef:p,itemCountRef:d,lastScrollTopRef:f,messageElementsRef:S,modeRef:g,pendingScrollFrameRef:h,pendingScrollToMessageRef:x,prependRestoreRef:b,preserveScrollOnPrependRef:C,pendingDefaultScrollStore:I,rootRef:y,scrollEdgeThresholdRef:w,scrollMarginRef:v,scrollPreviousItemPeekRef:R,spacerGapRef:L,spacerHeightRef:U,spacerRef:E,stateFrameRef:O,stateStore:k,viewportRef:P,visibilityFrameRef:N,visibilityObserverRef:j,visibilityStore:T,visibleMessageIdsRef:B,handledScrollAnchorsRef:W}=a,X=oe.useRef(t);X.current!==t&&(X.current=t,m.current=!1);let A=oe.useCallback((ge)=>{let he=y.current,Ie=P.current,Ne=[ge.start&&"start",ge.end&&"end"].filter(Boolean).join(" "),Qe=c.current;for(let gt of[he,Ie])gt&&(Ne?gt.setAttribute("data-scrollable",Ne):gt.removeAttribute("data-scrollable"),gt.toggleAttribute("data-autoscrolling",Qe))},[]),ue=oe.useCallback((ge)=>{let he=P.current?.scrollTop??0,Ie=he<f.current-vl;f.current=he,i.current&&!ge.end&&g.current!=="settling-jump"&&g.current!=="anchored-to-message"?g.current="following-bottom":g.current==="following-bottom"&&ge.end&&Ie&&!c.current&&(g.current="free-scrolling")},[]),V=oe.useCallback(()=>{let ge=Jx({content:l.current,scrollEdgeThreshold:w.current,spacer:E.current,viewport:P.current});ue(ge);let he=g.current==="following-bottom"?{...ge,end:!1}:ge;A(he),k.setSnapshot(he)},[ue,k,A]),G=oe.useCallback(()=>{O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,V()}))},[V]),Z=oe.useCallback(()=>{T.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,T.hasListeners()&&T.setSnapshot(Qx({content:l.current,scrollMargin:v.current,scrollPreviousItemPeek:R.current,spacer:E.current,viewport:P.current,visibleMessageIds:B.current}))}))},[T]),{flushPendingScrollToMessage:ee,reanchorToAnchoredMessage:Pe,scrollToElement:te,scrollToEnd:ie,scrollToMessage:me,scrollToStart:fe}=d8({refs:a,commitScrollState:V,scheduleStateCommit:G,scheduleVisibilitySync:Z}),be=oe.useCallback(()=>{let ge=b.current,he=P.current;if(!ge||!he||!ge.element.isConnected)return!1;let Ie=wl(ge.element,he)-ge.viewportTop;return Math.abs(Ie)<=vl?!1:(he.scrollTop+=Ie,ge.viewportTop=wl(ge.element,he),G(),Z(),!0)},[G,Z]),ne=oe.useCallback(()=>{let ge=l.current,he=P.current;if(!ge||!he){b.current=null;return}let Ie=n8({content:ge,spacer:E.current,viewport:he});b.current=Ie?{element:Ie,viewportTop:wl(Ie,he)}:null},[]),we=oe.useCallback(()=>{h.current===null&&(h.current=window.requestAnimationFrame(()=>{h.current=null,ee()&&ne()}))},[ne,ee]),Ce=oe.useCallback(()=>{if(!t||m.current||d.current===0)return!1;let ge=!1;if(t==="last-anchor"){let he=l.current,Ie=P.current,Ne=he&&Ie?r8(Us(he,E.current)):null;if(!he||!Ie||!Ne)ge=ie({behavior:"auto"});else{let Qe=Oh(Ne,Ie);ge=Ef({content:he,spacer:E.current,viewport:Ie})-Qe<=Ie.clientHeight?ie({behavior:"auto"}):te(Ne,{align:"start"},{keepPreviousPeek:!0})}}else ge=t==="end"?ie({behavior:"auto"}):fe({behavior:"auto"});return ge?(yl(a),!0):!1},[t,te,ie,fe]),De=oe.useCallback(()=>{let ge=l.current;if(!ge)return;let he=Us(ge,E.current),Ie=d.current,Ne=p.current;d.current=he.length,p.current=he[0]??null,(()=>{if(ee())return;if(Ie===0){if(Ce()||he.length>0&&i.current&&ie({behavior:"auto"}))return;V(),Z();return}let Qe=Ne?he.indexOf(Ne):-1;if(C.current&&Qe>0){be();return}if(he.length>Ie){let gt=e8(he,Ie);if(gt){if(i.current&&g.current==="following-bottom"&&o8(he,Ie)){ie({behavior:"auto"});return}te(gt,{align:"start"},{keepPreviousPeek:!0}),W.current.add(gt);return}}if(he.length===Ie){let gt=t8(he,W.current);if(gt){te(gt,{align:"start"},{keepPreviousPeek:!0}),W.current.add(gt);return}}g.current==="following-bottom"&&i.current?ie({behavior:"auto"}):(V(),Z())})(),ne()},[Ce,ne,V,ee,be,Z,te,ie]),Q=oe.useCallback(()=>{if(g.current==="following-bottom"&&i.current){ie({behavior:"auto"});return}let ge=U.current;if(Pe()){i.current&&ge>0&&U.current===0&&ie({behavior:"auto"});return}G(),Z()},[Pe,G,Z,ie]),H=oe.useCallback(()=>{let ge=P.current;if(!(!ge||!T.hasListeners())){if(typeof IntersectionObserver>"u"){Z();return}j.current||(j.current=new IntersectionObserver((he)=>{for(let Ie of he){let Ne=Ie.target.dataset.messageId;Ne&&(Ie.isIntersecting?B.current.add(Ne):B.current.delete(Ne))}Z()},{root:ge,rootMargin:`${-(v.current+R.current)}px 0px 0px 0px`,threshold:[0,0.01,0.5,1]})),S.current.forEach((he)=>{j.current?.observe(he)}),Z()}},[Z,T]),Y=oe.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),j.current?.disconnect(),j.current=null,B.current.clear(),T.setSnapshot(Rl)},[T]),D=oe.useCallback((ge,he,Ie)=>{if(he){S.current.set(ge,he),j.current?.observe(he),Z(),x.current?.messageId===ge&&we();return}Ie&&S.current.get(ge)===Ie&&(S.current.delete(ge),B.current.delete(ge),j.current?.unobserve(Ie),Z())},[we,Z]),de=oe.useCallback(()=>{(g.current==="following-bottom"||g.current==="anchored-to-message"||g.current==="settling-jump")&&(s.current=null,g.current="free-scrolling")},[]),K=oe.useCallback(()=>A(k.getSnapshot()),[k,A]),pe=Lh(y,K),M=Lh(P,K),_=oe.useCallback((ge)=>{l.current=ge},[]),Se=oe.useCallback((ge)=>{E.current=ge,L.current=l8(ge?.parentElement??null)},[]),J=oe.useCallback(()=>{V(),Z(),ne()},[ne,V,Z]),se=oe.useMemo(()=>({handleContentChange:De,handleResize:Q,observeVisibility:H,pendingDefaultScrollStore:I,preserveScrollOnPrependRef:C,scrollToEnd:ie,scrollToMessage:me,scrollToStart:fe,setContentElement:_,setRootElement:pe,setSpacerElement:Se,setViewportElement:M,stateStore:k,syncAfterScroll:J,unobserveVisibility:Y,userScrollIntent:de,viewportRef:P,visibilityStore:T}),[De,Q,H,I,ie,me,fe,_,pe,Se,M,k,J,Y,de,T]);return oe.useLayoutEffect(()=>{Ce()||d.current===0&&Hh(a)},[Ce]),oe.useEffect(()=>()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),j.current?.disconnect(),j.current=null},[]),oe.useLayoutEffect(()=>{if(e&&g.current==="following-bottom"&&d.current>0){ie({behavior:"auto"});return}V()},[e,V,ie]),{context:se,registerMessage:D}}function h8(e){let t=oe.useRef(e);return t.current=e,t}var Vh=oe.createContext(null),Uh=oe.createContext(null);function _s(){let e=oe.useContext(Vh);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function I8(){let e=oe.useContext(Uh);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}function b8({autoScroll:e=!1,children:t,defaultScrollPosition:o="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a}){let{context:s,registerMessage:i}=g8({autoScroll:e,defaultScrollPosition:o,scrollEdgeThreshold:r,scrollPreviousItemPeek:n,scrollMargin:a});return Ma(Vh.Provider,{value:s,children:Ma(Uh.Provider,{value:i,children:t})})}function _h(){let{pendingDefaultScrollStore:e}=_s();return oe.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function C8({children:e,...t}){let{setRootElement:o}=_s(),r=_h();return Ma("div",{ref:o,...t,...r?{"data-pending-scroll":""}:null,children:e})}function S8({"aria-label":e,children:t,onKeyDown:o,onScroll:r,onTouchMove:n,onWheel:a,preserveScrollOnPrepend:s=!0,ref:i,role:c,tabIndex:u,...l}){let{handleResize:m,preserveScrollOnPrependRef:p,setViewportElement:d,syncAfterScroll:f,userScrollIntent:S,viewportRef:g}=_s(),h=_h();p.current=s;let x=oe.useCallback((w)=>{d(w),Aa(i)?.(w)},[i,d]);function b(w){f(),r?.(w)}function C(w){S(),a?.(w)}function I(w){S(),n?.(w)}function y(w){Yx.has(w.key)&&S(),o?.(w)}return oe.useEffect(()=>{let w=g.current;if(!w||typeof ResizeObserver>"u")return;let v=0,R=new ResizeObserver(()=>{window.cancelAnimationFrame(v),v=window.requestAnimationFrame(m)});return R.observe(w),()=>{window.cancelAnimationFrame(v),R.disconnect()}},[m,g]),Ma("div",{ref:x,role:c??"region","aria-label":e??"Messages",tabIndex:u??0,onKeyDown:y,onScroll:b,onTouchMove:I,onWheel:C,...l,...h?{"data-pending-scroll":""}:null,children:t})}function x8({"aria-relevant":e,children:t,ref:o,role:r,spacerClassName:n,...a}){let{handleContentChange:s,handleResize:i,setContentElement:c,setSpacerElement:u}=_s(),l=oe.useRef(null),m=oe.useCallback((p)=>{l.current=p,c(p),Aa(o)?.(p)},[o,c]);return oe.useLayoutEffect(()=>{let p=l.current;if(!p||(s(),typeof MutationObserver>"u"))return;let d=new MutationObserver(()=>{s()});return d.observe(p,{childList:!0}),()=>d.disconnect()},[s]),oe.useEffect(()=>{let p=l.current;if(!p||typeof ResizeObserver>"u")return;let d=0,f=new ResizeObserver(()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(i)});return f.observe(p),()=>{window.cancelAnimationFrame(d),f.disconnect()}},[i]),Dh("div",{ref:m,role:r??"log","aria-relevant":e??"additions",...a,children:[t,Ma("div",{ref:u,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:n})]})}function w8({messageId:e,ref:t,scrollAnchor:o=!1,...r}){let n=I8(),a=oe.useRef(null),s=oe.useCallback((i)=>{let c=a.current;a.current=i,e&&n(e,i,c),Aa(t)?.(i)},[e,t,n]);return Ma("div",{ref:s,"data-message-id":e,"data-scroll-anchor":o?"true":"false",...r})}function y8({behavior:e="smooth",children:t,direction:o="end",onClick:r,render:n,tabIndex:a,type:s="button",...i}){let{scrollToEnd:c,scrollToStart:u,stateStore:l}=_s(),m=h8(r),p=oe.useCallback((g)=>l.subscribe(g),[l]),d=oe.useCallback(()=>{let g=l.getSnapshot();return o==="start"?g.start:g.end},[o,l]),f=oe.useSyncExternalStore(p,d,d),S=oe.useCallback((g)=>{f&&(m.current?.(g),g.defaultPrevented||(g.currentTarget.blur(),o==="start"?u({behavior:e}):c({behavior:e})))},[e,o,f,m,c,u]);return Mh({defaultTagName:"button",props:xl({type:s,inert:!f,tabIndex:f?a:-1,children:t??Dh("span",{children:["Scroll to ",o]}),onClick:S},i),render:n,state:{active:f,direction:o},stateAttributesMapping:{active:(g)=>({"data-active":g?"true":"false"})}})}var _n={Provider:b8,Root:C8,Viewport:S8,Content:x8,Item:w8,Button:y8};import*as Pl from"react";import*as Vt from"react";var Wh=new Map([["bold",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"}))],["duotone",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M200,144l-72,72L56,144Z",opacity:"0.2"}),Vt.createElement("path",{d:"M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"}))],["fill",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"}))],["light",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",Vt.createElement(Vt.Fragment,null,Vt.createElement("path",{d:"M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"}))]]);var Af=Pl.forwardRef((e,t)=>Pl.createElement(Le,{ref:t,...e,weights:Wh}));Af.displayName="ArrowDownIcon";import{jsx as Hr,jsxs as R8,Fragment as v8}from"react/jsx-runtime";function zh(e){return Hr(_n.Provider,{...e})}function Gh({className:e,...t}){return Hr(_n.Root,{"data-slot":"message-scroller",className:ce("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function Zh({className:e,...t}){return Hr(_n.Viewport,{"data-slot":"message-scroller-viewport",className:ce("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible",e),...t})}function $h({className:e,...t}){return Hr(_n.Content,{"data-slot":"message-scroller-content",className:ce("flex h-max min-h-full flex-col gap-6",e),...t})}function qh({className:e,scrollAnchor:t=!1,...o}){return Hr(_n.Item,{"data-slot":"message-scroller-item",scrollAnchor:t,className:ce("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...o})}function jh({direction:e="end",className:t,children:o,render:r,variant:n="secondary",size:a="icon-sm",...s}){return Hr(_n.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":n,"data-size":a,direction:e,className:ce("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",t),render:r??Hr(mt,{variant:n,size:a}),...s,children:o??R8(v8,{children:[Hr(Af,{}),Hr("span",{className:"sr-only",children:e==="end"?"Scroll to end":"Scroll to start"})]})})}import{jsx as He,jsxs as Io}from"react/jsx-runtime";function P8(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Xh({attachment:e}){let[t,o]=Tl(!1),[r,n]=Tl(!1);return Io("div",{className:"flex flex-col items-end gap-1",children:[He(mt,{variant:"secondary",size:"icon-sm",disabled:t,"aria-busy":t,"aria-label":`Download ${e.name}`,title:t?"Downloading…":"Download",onClick:async()=>{if(!e.url)return;o(!0),n(!1);try{await Ph(e.url,e.name)}catch{n(!0)}finally{o(!1)}},children:He(hf,{})}),r&&He("span",{role:"alert",className:"text-xs text-destructive",children:"Download failed. Try again."})]})}function T8({attachments:e,allowDownloads:t=!1}){let[o,r]=Tl(null),[n,a]=Tl(!1);if(!e?.length)return null;return Io(yf,{onOpenChange:(s)=>{if(!s)r(null)},children:[He($i,{className:"max-w-full flex-wrap gap-2",children:e.map((s)=>{if(s.type.startsWith("image/")&&s.url)return He(oa,{className:"min-w-0 border-0 bg-transparent p-0 has-[>a,>button]:hover:bg-transparent",children:He(vh,{render:He("button",{type:"button",className:"block max-w-48 overflow-hidden rounded-lg focus-visible:outline-2 focus-visible:outline-ring"}),"aria-label":`Preview ${s.name}`,onClick:()=>{a(!1),r(s)},children:He("img",{src:s.url,alt:s.name,loading:"lazy",className:"max-h-40 max-w-full object-contain"})})},s.storageId);return Io(oa,{className:"min-w-52",children:[He(Xa,{children:He(Cn,{})}),Io(Ya,{className:"max-w-44",children:[He(Ka,{title:s.name,children:s.name}),Io(Ja,{children:[s.type||"File"," ·"," ",P8(s.size)]})]}),t&&s.url&&He(Zi,{children:He(Xh,{attachment:s})})]},s.storageId)})}),Io(vf,{showCloseButton:!1,className:"w-fit max-w-[calc(100%-2rem)] gap-3 rounded-none bg-transparent p-0 shadow-none ring-0 sm:max-w-[calc(100%-4rem)]",children:[He(Rf,{className:"sr-only",children:o?.name??"Image preview"}),He(Pf,{className:"sr-only",children:"Expanded image preview"}),Io("div",{className:"flex items-start justify-end gap-2",children:[t&&o?.url&&He(Xh,{attachment:o},o.storageId),He(Rh,{render:He(mt,{variant:"secondary",size:"icon-sm"}),"aria-label":"Close image preview",children:He(Uo,{})})]}),n?He("p",{role:"alert",className:"text-sm text-foreground",children:"Image preview unavailable."}):o?.url&&He("img",{src:o.url,alt:o.name,className:"max-h-[75dvh] max-w-full object-contain",onError:()=>a(!0)})]})]})}function Mf({messages:e,ownSender:t,ownVariant:o="default",plainOther:r=!1,ownAvatar:n,otherAvatar:a,onRetry:s,showMetadata:i=!1}){return He(zh,{children:Io(Gh,{children:[He(Zh,{children:Io($h,{className:"p-4",children:[e?.length===0&&He(z1,{children:Io(G1,{children:[He(Z1,{children:"No messages yet"}),He($1,{children:"Send a message to get started."})]})}),e?.map((c,u)=>{let l=c.sender===t,m=c._creationTime===void 0?void 0:new Date(c._creationTime),p=e[u-1]?._creationTime,d=i&&m&&(p===void 0||m.toDateString()!==new Date(p).toDateString()),f=c.sender==="merchant"&&!!(c.isAi||c.generationStatus);return Io(qh,{messageId:c._id,scrollAnchor:l,children:[d&&He(Th,{className:"mb-5 justify-center",children:He(Eh,{children:Ah(m.getTime())})}),Io(q1,{align:l?"end":"start",children:[(l?n:a)&&He(j1,{className:"size-7 min-w-7",children:l?n:a}),Io(X1,{children:[i&&Io(Y1,{className:"gap-2",children:[c.sender==="customer"?"You":f?"Ten":"Support",f&&He(Sl,{variant:"secondary",children:"AI"})]}),He(T8,{attachments:c.attachments}),c.generationStatus==="generating"&&!c.body&&He(pf,{variant:"muted",children:He(df,{className:"animate-pulse text-muted-foreground",children:"Thinking…"})}),c.body&&(!l&&r?He("p",{className:"leading-relaxed whitespace-pre-wrap",children:c.body}):He(pf,{variant:l?o:"secondary",children:He(df,{children:c.body})})),c.citations&&c.citations.length>0&&He("div",{className:"flex max-w-sm flex-wrap gap-1",children:c.citations.map((S)=>S.url?He("a",{href:S.url,target:"_blank",rel:"noreferrer",className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:S.title},S.sourceId):He("span",{className:"rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground",children:S.title},S.sourceId))}),c.generationStatus==="failed"&&Io("div",{className:"flex max-w-sm min-w-0 items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[He("span",{className:"min-w-0 flex-1 text-xs leading-relaxed break-words text-destructive",children:c.generationError??"The agent could not respond."}),c.inReplyTo&&s&&Io(mt,{type:"button",size:"xs",variant:"outline",className:"shrink-0",onClick:()=>s(c.inReplyTo),children:[He(gf,{}),"Retry"]})]}),i&&m&&He(K1,{children:He("time",{dateTime:m.toISOString(),title:m.toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(m)})})]})]})]},c._id)})]})}),He(jh,{})]})})}import{jsx as E8}from"react/jsx-runtime";function Yh({className:e,...t}){return E8("label",{"data-slot":"label",className:ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}import{jsx as A8}from"react/jsx-runtime";function lr({className:e,...t}){return A8("div",{"data-slot":"skeleton",className:ce("animate-pulse rounded-md bg-muted",e),...t})}import*as La from"react";import*as El from"react";var kf=El.createContext(void 0);function Al(){let e=El.useContext(kf);if(e===void 0)throw Error(Ge(13));return e}var ka={imageLoadingStatus:()=>null};import{jsx as M8}from"react/jsx-runtime";var Kh=La.forwardRef(function(t,o){let{className:r,render:n,style:a,...s}=t,[i,c]=La.useState("idle"),u={imageLoadingStatus:i},l=La.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:c}),[i,c]),m=ve("span",t,{state:u,ref:o,props:s,stateAttributesMapping:ka});return M8(kf.Provider,{value:l,children:m})});import*as Ws from"react";import*as Jh from"react";function Qh(e,{referrerPolicy:t,crossOrigin:o,sizes:r,srcSet:n},a){let s=Jh.useState("idle"),i=s[1];return z(()=>{if(!a)return Ye;if(!e&&!n)return i("error"),Ye;let c=!0,u=new window.Image,l=(m)=>()=>{if(!c)return;i(m)};if(i("loading"),u.onload=l("loaded"),u.onerror=l("error"),t)u.referrerPolicy=t;if(u.crossOrigin=o??null,r)u.sizes=r;if(n)u.srcset=n;if(e)u.src=e;if(u.complete)i(u.naturalWidth>0?"loaded":"error");return()=>{c=!1}},[a,e,n,r,o,t,i]),s}var k8={...ka,...Xr},e2=Ws.forwardRef(function(t,o){let{className:r,render:n,onLoadingStatusChange:a,keepMounted:s=!1,style:i,sizes:c,srcSet:u,src:l,...m}=t,{setImageLoadingStatus:p}=Al(),[d,f]=Qh(l,t,!s),S=d==="loaded",{mounted:g,transitionStatus:h,setMounted:x}=cc(S),b=Ws.useRef(null),C=Ws.useRef(!0);z(()=>{if(!s)return;let U=C.current;C.current=!1;let E=b.current;if(!E)return;if(!E.complete){f("loading");return}let O=E.naturalWidth>0?"loaded":"error";if(f(O),O==="loaded"&&U)x(!0)},[s,l,u,c,m.crossOrigin,m.referrerPolicy,n,f,x]);let I=s?{"data-loading":d==="loading"?"":void 0,"data-error":d==="error"?"":void 0,"aria-hidden":d!=="loaded"||void 0,onLoad(){f("loaded")},onError(){f("error")}}:void 0,y=re((U)=>{a?.(U),p(U)});z(()=>{if(d!=="idle")y(d)},[d,y]),z(()=>()=>p("idle"),[p]),$o({enabled:!S,open:S,ref:b,onComplete(){if(!S)x(!1)}});let w={imageLoadingStatus:d,transitionStatus:s&&h==="ending"?void 0:h},v=s||g,R={};if(c!==void 0)R.sizes=c;if(u!==void 0)R.srcSet=u;if(l!==void 0)R.src=l;let L=ve("img",t,{state:w,ref:[o,b],props:[I,m,R],stateAttributesMapping:k8,enabled:v});if(!v)return null;return L});import*as Da from"react";var t2=Da.forwardRef(function(t,o){let{className:r,render:n,delay:a=0,style:s,...i}=t,{imageLoadingStatus:c}=Al(),[u,l]=Da.useState(a===0),m=Je();return Da.useEffect(()=>{if(a>0)m.start(a,()=>l(!0));else l(!0);return m.clear},[m,a]),ve("span",t,{state:{imageLoadingStatus:c},ref:o,props:i,stateAttributesMapping:ka,enabled:c!=="loaded"&&(a===0||u)})});import{jsx as Of}from"react/jsx-runtime";function Lf({className:e,size:t="default",...o}){return Of(Kh,{"data-slot":"avatar","data-size":t,className:(r)=>ce("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full bg-muted select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",r.imageLoadingStatus==="loading"&&"animate-pulse",typeof e==="function"?e(r):e),...o})}function Df({className:e,...t}){return Of(e2,{"data-slot":"avatar-image",className:ce("aspect-square size-full rounded-full object-cover",e),...t})}function Ff({className:e,...t}){return Of(t2,{"data-slot":"avatar-fallback",className:(o)=>ce("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",o.imageLoadingStatus==="loading"&&"opacity-0",typeof e==="function"?e(o):e),...t})}var Fa=Math.PI*2,Fe=(e)=>Math.round(e*100)/100,ke=(e,t)=>t[Math.floor(e()*t.length)];function Nf(e){let t=2166136261;for(let o=0;o<e.length;o++)t^=e.charCodeAt(o),t=Math.imul(t,16777619);return t>>>0}function Bf(e){let t=e;return()=>{t=t+1831565813|0;let o=Math.imul(t^t>>>15,1|t);return o=o+Math.imul(o^o>>>7,61|o)^o,((o^o>>>14)>>>0)/4294967296}}var kl=[{name:"rose",bg:"#E8608A",fg:"#FFE3C2"},{name:"marigold",bg:"#F6CD5E",fg:"#D9416F"},{name:"mint",bg:"#8EDBC4",fg:"#1D6448"},{name:"cobalt",bg:"#3D7FE6",fg:"#C7E3FF"},{name:"lilac",bg:"#C9B6F4",fg:"#E0477E"},{name:"meadow",bg:"#2E9D52",fg:"#F9E07A"},{name:"sky",bg:"#9CC9F5",fg:"#24418F"},{name:"butter",bg:"#FBE38E",fg:"#3A62D6"},{name:"forest",bg:"#1F6B4A",fg:"#9BE3C9"},{name:"plum",bg:"#6E3A8E",fg:"#F0D9FF"},{name:"peach",bg:"#FFC4A3",fg:"#C23B5B"},{name:"tangerine",bg:"#F28A4B",fg:"#FFF0D6"},{name:"teal",bg:"#2BA3A0",fg:"#FFF3C4"},{name:"slate",bg:"#56637F",fg:"#FFD3B0"}],r2=36,L8=["bright","soft","deep"],D8=["tonal","complement","triad"],F8={tonal:0,complement:180,triad:120},O8={bright:0.7,soft:0.87,deep:0.48},N8={bright:0.16,soft:0.085,deep:0.12};function Ml(e,t,o){let r=(s)=>{let i=s*Math.cos(o*Math.PI/180),c=s*Math.sin(o*Math.PI/180),u=(e+0.3963377774*i+0.2158037573*c)**3,l=(e-0.1055613458*i-0.0638541728*c)**3,m=(e-0.0894841775*i-1.291485548*c)**3;return[4.0767416621*u-3.3077115913*l+0.2309699292*m,-1.2684380046*u+2.6097574011*l-0.3413193965*m,-0.0041960863*u-0.7034186147*l+1.707614701*m]},n=t,a=r(n);while(n>0&&a.some((s)=>s<-0.0001||s>1.0001))n-=0.004,a=r(Math.max(n,0));return`#${a.map((s)=>{let i=Math.min(1,Math.max(0,s)),c=i<=0.0031308?12.92*i:1.055*i**0.4166666666666667-0.055;return Math.round(c*255).toString(16).padStart(2,"0")}).join("")}`}function B8(e,t,o){let r=(e.match(/\w\w/g)??[]).map((a)=>parseInt(a,16)),n=(t.match(/\w\w/g)??[]).map((a)=>parseInt(a,16));return`#${r.map((a,s)=>Math.round(a+(n[s]-a)*o).toString(16).padStart(2,"0")).join("")}`}function H8(e){let t=Math.floor(e()*r2)*(360/r2),o=t>=50&&t<=130,r=ke(e,L8),n=o&&r==="deep"?"bright":r,a=ke(e,D8),s=(t+F8[a])%360,i=n==="bright"&&o?0.86:O8[n],c=N8[n],u=i<0.8,l=u?Ml(0.96,0.05,s):Ml(0.4,0.15,s),m=Ml(i,c,t),p=Ml(i+(u?-0.06:0.045),c,t);return{name:`${Math.round(t)}° ${n} ${a}`,bg:m,fg:l,bg2:p}}function Hf(e,t,o){let r=H8(o),n=ke(o,kl),a=t==="curated"?n:r;if(typeof e==="number"){let s=kl.length;a=kl[(e%s+s)%s]}if(e&&typeof e==="object"&&e.bg&&e.fg)a=e;return{...a,bg2:a.bg2??B8(a.bg,a.fg,0.14)}}var n2=Math.PI*2,Wn=0.000000001,Oo=50,Dl=(e,t,o)=>({x:e.x+t*Math.cos(o),y:e.y+t*Math.sin(o)}),Vf=(e)=>e.kind==="line"?e.from:Dl(e.c,e.r,e.from),Uf=(e)=>e.kind==="line"?e.to:Dl(e.c,e.r,e.to),a2=(e,t)=>Math.abs(e.x-t.x)<0.000001&&Math.abs(e.y-t.y)<0.000001;function V8(e){if(!e.square)return[{kind:"arc",c:{x:Oo,y:Oo},r:Oo,from:-Math.PI,to:Math.PI}];let t=Math.min(Math.max(e.radius,0),Oo),o=100-t;return[{kind:"line",from:{x:t,y:0},to:{x:o,y:0}},{kind:"arc",c:{x:o,y:t},r:t,from:-Math.PI/2,to:0},{kind:"line",from:{x:100,y:t},to:{x:100,y:o}},{kind:"arc",c:{x:o,y:o},r:t,from:0,to:Math.PI/2},{kind:"line",from:{x:o,y:100},to:{x:t,y:100}},{kind:"arc",c:{x:t,y:o},r:t,from:Math.PI/2,to:Math.PI},{kind:"line",from:{x:0,y:o},to:{x:0,y:t}},{kind:"arc",c:{x:t,y:t},r:t,from:Math.PI,to:3*Math.PI/2}].filter((n)=>n.kind==="arc"?n.r>Wn:!a2(n.from,n.to))}function U8(e,t){let o=(m)=>t.nx*m.x+t.ny*m.y-t.d;if(e.kind==="line"){let m=o(e.from),p=o(e.to);if(m<=Wn&&p<=Wn)return[e];if(m>-Wn&&p>-Wn)return[];let d=m/(m-p),f={x:e.from.x+d*(e.to.x-e.from.x),y:e.from.y+d*(e.to.y-e.from.y)};return[m<0?{kind:"line",from:e.from,to:f}:{kind:"line",from:f,to:e.to}]}let{c:r,r:n,from:a,to:s}=e,i=(t.d-t.nx*r.x-t.ny*r.y)/n,c=[];if(Math.abs(i)<1){let m=Math.atan2(t.ny,t.nx),p=Math.acos(i);for(let d of[m-p,m+p]){let f=d;while(f<a)f+=n2;while(f>s)f-=n2;if(f>a+Wn&&f<s-Wn)c.push(f)}}let u=[a,...c.sort((m,p)=>m-p),s],l=[];for(let m=0;m<u.length-1;m++){let p=u[m],d=u[m+1];if(o(Dl(r,n,(p+d)/2))<=0)l.push({kind:"arc",c:r,r:n,from:p,to:d})}return l}function _8(e,t){let o=e.flatMap((n)=>U8(n,t));if(o.length===0)return[];let r=[];for(let n=0;n<o.length;n++){let a=o[n];r.push(a);let s=o[(n+1)%o.length];if(!a2(Uf(a),Vf(s)))r.push({kind:"line",from:Uf(a),to:Vf(s)})}return r}var Ll=(e)=>`${Fe(e.x)} ${Fe(e.y)}`;function W8(e){if(e.length===0)return"";let t=`M${Ll(Vf(e[0]))}`;for(let o of e){if(o.kind==="line"){t+=`L${Ll(o.to)}`;continue}let r=o.to-o.from;if(r>Math.PI*1.999){let n=(o.from+o.to)/2;t+=`A${Fe(o.r)} ${Fe(o.r)} 0 0 1 ${Ll(Dl(o.c,o.r,n))}`}t+=`A${Fe(o.r)} ${Fe(o.r)} 0 ${r>Math.PI&&r<=Math.PI*1.999?1:0} 1 ${Ll(Uf(o))}`}return`${t}Z`}function zn(e,t,o,r){let n=r*Math.PI/180,a=e*Math.cos(n)-t*Math.sin(n),s=e*Math.sin(n)+t*Math.cos(n);return{nx:a,ny:s,d:o+a*Oo+s*Oo}}function zs(e,t){let o=V8(e);for(let r of t)o=_8(o,r);return W8(o)}function s2(e,t,o,r){if(!e.square)return Math.hypot(t-Oo,o-Oo)+r<=Oo;let n=Oo-r,a=Math.max(Math.min(Math.max(e.radius,0),Oo)-r,0),s=Math.max(Math.abs(t-Oo)-(n-a),0),i=Math.max(Math.abs(o-Oo)-(n-a),0);return Math.hypot(s,i)<=a}var Gn=["solid","split","quarter","ring","halo","stripes","horizon","polka"],z8=(e,t,o,r)=>`<circle cx="${Fe(e)}" cy="${Fe(t)}" r="${Fe(o)}" fill="${r}"/>`,Fl=(e,t)=>e?`<path d="${e}" fill="${t}"/>`:"";function i2(e,t,o,r,n){let{bg:a,bg2:s}=o,i=Math.floor(e()*8)*45,c=Math.floor(e()*4)*90,u=r(a);if(t==="split")return u+Fl(zs(n,[zn(-1,0,0,i)]),s);if(t==="quarter")return u+Fl(zs(n,[zn(-1,0,0,c),zn(0,-1,0,c)]),s);if(t==="ring")return r(s)+`<g transform="translate(50 50) scale(0.84) translate(-50 -50)">${u}</g>`;if(t==="halo")return u+`<circle cx="50" cy="50" r="34" fill="${s}"/>`;if(t==="stripes"){let l=i%180===0?45:135,m=[];for(let p=-4;p<=4;p++){let d=p*16;m.push(zs(n,[zn(-1,0,-(d-4),l),zn(1,0,d+4,l)]))}return u+Fl(m.join(""),s)}if(t==="horizon")return u+Fl(zs(n,[zn(0,-1,-16,c)]),s);if(t==="polka"){let l="";for(let m=0;m<6;m++)for(let p=0;p<6;p++){let d=8+p*17+m%2*8.5,f=8+m*17;if(s2(n,d,f,2.6))l+=z8(d,f,2.6,s)}return u+l}return u}var Zn=(e,t)=>e[t],dt=(e,t,o,r)=>`<circle cx="${Fe(e)}" cy="${Fe(t)}" r="${Fe(o)}" fill="${r}"/>`,ur=(e,t)=>`<polygon points="${e.map((o)=>o.map(Fe).join(",")).join(" ")}" fill="${t}"/>`,ut=(e,t)=>{if(!e)return t;return`<g transform="rotate(${e} 50 50)">${t}</g>`},Ol={dots(e,{fg:t}){let o=ke(e,[2,3,3,4,4]),r=Zn({2:20,3:28,4:30},o),n=Zn({2:7.5,3:5,4:3.6},o),a=Zn({2:["full","diag"],3:["full","plus","x","ring","linked"],4:["full","ring","x","diag","center"]},o),s=ke(e,a),i=e()<0.3?45:0,c=r/(o-1),u=50-r/2,l="";if(s==="linked"){let p="";for(let d=0;d<o;d++){let f=u+d*c;p+=`M${u} ${f}H${u+r}M${f} ${u}V${u+r}`}l+=`<path d="${p}" stroke="${t}" stroke-width="1.6" fill="none"/>`}let m=(p,d)=>{let f=p===0||d===0||p===o-1||d===o-1,S=(p===0||p===o-1)&&(d===0||d===o-1);if(s==="plus")return p!==1&&d!==1;if(s==="x")return(p+d)%2===1;if(s==="ring")return o===3?p===1&&d===1:!f;if(s==="diag")return o===2?p!==d:p!==d&&p+d!==o-1;if(s==="center")return f&&!S;return!1};for(let p=0;p<o;p++)for(let d=0;d<o;d++){if(m(p,d))continue;l+=dt(u+p*c,u+d*c,s==="linked"?3.6:n,t)}return ut(i,l)},flower(e,{fg:t,bg:o}){let r=ke(e,[4,4,5,6,8]),[n,a]=Zn({4:[11,12],5:[12,10],6:[13,9],8:[15,7]},r),s=e()<0.5?0:Math.PI/r,i=ke(e,["fill","hole","none"]),c="";for(let u=0;u<r;u++){let l=u/r*Fa+s-Math.PI/2;c+=dt(50+Math.cos(l)*n,50+Math.sin(l)*n,a,t)}if(i==="fill")c+=dt(50,50,n,t);if(i==="hole")c+=dt(50,50,a*0.5,o);return c},burst(e,{fg:t}){let o=ke(e,[5,6,8,10,12]),r=e()<0.6,n=ke(e,["dot","ring","none"]),a=r?17:22,s="",i="";for(let c=0;c<o;c++){let u=c/o*Fa-Math.PI/2,l=Math.cos(u),m=Math.sin(u);if(s+=`M${Fe(50+l*8)} ${Fe(50+m*8)}L${Fe(50+l*a)} ${Fe(50+m*a)}`,r)i+=dt(50+l*22,50+m*22,3.4,t)}if(n==="dot")i+=dt(50,50,4.5,t);if(n==="ring")i+=`<circle cx="50" cy="50" r="4.5" fill="none" stroke="${t}" stroke-width="2.5"/>`;return`<path d="${s}" stroke="${t}" stroke-width="3" stroke-linecap="round"/>${i}`},stairs(e,{fg:t}){let o=ke(e,[2,3,4]),r=Math.floor(e()*4)*90,[n,a,s,i]=[29,29,71,71],c=(s-n)/o,u=(i-a)/o,l=[[n,i],[s,i],[s,a]];for(let p=1;p<o;p++)l.push([s-p*c,a+(p-1)*u],[s-p*c,a+p*u]);l.push([n,a+(o-1)*u]);let m=e()<0.5?`<rect x="29" y="29" width="42" height="42" fill="${t}" opacity="0.35"/>`:"";return ut(r,m+ur(l,t))},hourglass(e,{fg:t}){let o=ke(e,[3,6]),n=e()<0.6?[[30,28],[70,28],[70,34],[50+o,50],[70,66],[70,72],[30,72],[30,66],[50-o,50],[30,34]]:[[30,28],[70,28],[50+o,50],[70,72],[30,72],[50-o,50]];return ut(ke(e,[0,45,90,135]),ur(n,t))},plus(e,{fg:t,bg:o}){let r=ke(e,[14,18,22]),n=ke(e,[0,3]),a=50-r/2,s=`<rect x="${a}" y="28" width="${r}" height="44" rx="${n}" fill="${t}"/><rect x="28" y="${a}" width="44" height="${r}" rx="${n}" fill="${t}"/>`,i=e()<0.25?45:0;if(r===22&&e()<0.6)for(let c of[-5.5,5.5])for(let u of[-5.5,5.5])s+=dt(50+c,50+u,2.2,o);return ut(i,s)},leaves(e,{fg:t,bg:o}){let r=ke(e,[2,3,4,4,6]),n=`<path d="M50 50C40 42 40 28 50 22C60 28 60 42 50 50Z" fill="${t}"/>`,a=e()<0.5?0:180/r,s="";for(let i=0;i<r;i++)s+=ut(360/r*i+a,n);if(e()<0.4)s+=dt(50,50,3.5,o);return s},rings(e,{fg:t}){let o=ke(e,[2,3,4]),r=o===4?5.5:7,n=o===4?2.8:3.5,a=e()<0.35,s="";for(let i=0;i<o;i++){let c=22-i*r,u=a?50+(22-c):50;s+=`<circle cx="50" cy="${u}" r="${c}" fill="none" stroke="${t}" stroke-width="${n}"/>`}if(e()<0.5){let i=22-o*r;s+=dt(50,a?50+(22-i):50,Math.max(2.5,Math.min(6,i-2)),t)}return s},checker(e,{fg:t}){let o=ke(e,[2,3,4,5]),r=e()<0.5?0:1,n=40/o,a="";for(let s=0;s<o;s++)for(let i=0;i<o;i++){if((s+i)%2!==r)continue;a+=`<rect x="${Fe(30+s*n)}" y="${Fe(30+i*n)}" width="${Fe(n)}" height="${Fe(n)}" fill="${t}"/>`}return ut(e()<0.4?45:0,a)},sparkle(e,{fg:t}){let o=(s,i,c)=>{let u=c*0.14,l=(m,p)=>`${Fe(m)} ${Fe(p)}`;return`<path d="M${l(s,i-c)}Q${l(s+u,i-u)} ${l(s+c,i)}Q${l(s+u,i+u)} ${l(s,i+c)}Q${l(s-u,i+u)} ${l(s-c,i)}Q${l(s-u,i-u)} ${l(s,i-c)}Z" fill="${t}"/>`},r=e()<0.4,a=ke(e,[[[50,50,24]],[[46,54,18],[65,34,8]],[[44,56,15],[64,42,9],[42,31,6]]]).map(([s,i,c],u)=>{if(r&&u===0)return`<g transform="rotate(45 ${s} ${i})">${o(s,i,c*0.55)}</g>${o(s,i,c)}`;return o(s,i,c)}).join("");return ut(ke(e,[0,90]),a)},arch(e,{fg:t,bg:o}){let r=ke(e,[[26,13],[26,18,10]]),n="";return r.forEach((a,s)=>{n+=`<path d="M${50-a} 63A${a} ${a} 0 0 1 ${50+a} 63Z" fill="${s%2?o:t}"/>`}),ut(Math.floor(e()*4)*90,n)},pinwheel(e,{fg:t}){let o=ke(e,[[[28,28],[50,28],[50,50]],[[28,28],[50,28],[28,50]],[[50,50],[50,26],[33.7,33.7]]]),r="";for(let n=0;n<4;n++)r+=ut(n*90,ur(o,t));if(e()<0.4)r+=dt(50,50,4,t);return ut(e()<0.5?0:45,r)},waves(e,{fg:t}){let o=ke(e,[[43,57],[38,50,62],[33.5,44.5,55.5,66.5]]),r=o.length===4?3.5:4,n=e()<0.5,a=7.333333333333333,s="";for(let i of o){if(n){s+=`M28 ${i}Q${Fe(31.666666666666668)} ${i-r*1.6} ${Fe(35.333333333333336)} ${i}`;for(let c=2;c<=6;c++)s+=`T${Fe(28+c*7.333333333333333)} ${i}`;continue}s+=`M28 ${i+r}`;for(let c=1;c<=6;c++)s+=`L${Fe(28+c*7.333333333333333)} ${i+(c%2?-r:r)}`}return ut(ke(e,[0,45,90,135]),`<path d="${s}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>`)},halves(e,{fg:t}){let o=ke(e,[3,5]),r=`<path d="M${50-o} 28A22 22 0 0 0 ${50-o} 72Z" fill="${t}"/><path d="M${50+o} 28A22 22 0 0 1 ${50+o} 72Z" fill="${t}"/>`;return ut(ke(e,[0,45,90,135]),r)},diamond(e,{fg:t,bg:o}){let r=ke(e,[2,8]),n=`<rect x="34" y="34" width="32" height="32" rx="${r}" fill="${t}"/>`,a=ke(e,["none","hole","dot","nest"]);if(a==="hole")n+=`<rect x="43" y="43" width="14" height="14" rx="${r/2}" fill="${o}"/>`;if(a==="dot")n+=dt(50,50,5,o);if(a==="nest")n+=`<rect x="40" y="40" width="20" height="20" rx="${r/2}" fill="${o}"/><rect x="45" y="45" width="10" height="10" rx="${r/4}" fill="${t}"/>`;return ut(e()<0.7?45:0,n)},moon(e,{fg:t}){let o=Math.floor(e()*8)*45-22,r=ke(e,[10,14]),n=21,a=18,s=(117+r*r)/(2*r),i=Math.sqrt(441-s*s),c=`${Fe(50+s)} ${Fe(50-i)}`,u=`${Fe(50+s)} ${Fe(50+i)}`,l=`<path d="M${c}A21 21 0 1 0 ${u}A18 18 0 ${s-r>0?1:0} 1 ${c}Z" fill="${t}"/>`;if(e()<0.4)l+=dt(50+r+3,43,3,t);return ut(o,l)},eye(e,{fg:t,bg:o}){let r=ke(e,[10,14]),n=`<path d="M26 50Q50 ${50-r*2} 74 50Q50 ${50+r*2} 26 50Z" fill="${t}"/>`;if(n+=dt(50,50,r*0.75,o),e()<0.5)n+=dt(50,50,r*0.35,t);return ut(e()<0.5?0:90,n)},triangle(e,{fg:t,bg:o}){let r=ke(e,["solid","hole","split"]),n=(s,i,c,u=1)=>{let l=c*0.866;return[[s,i-u*2*l/3],[s+c/2,i+u*l/3],[s-c/2,i+u*l/3]]},a=ur(n(50,53,46),t);if(r==="hole")a+=ur(n(50,53,18),o);if(r==="split")a+=ur(n(50,53,23,-1),o);return ut(Math.floor(e()*4)*90,a)},bars(e,{fg:t}){let o=ke(e,[3,4,5]),r=Zn({3:9,4:7,5:5.6},o),n=(44-o*r)/(o-1),a=ke(e,["center","bottom"]),s="";for(let i=0;i<o;i++){let c=ke(e,[14,20,26,32,38,44]),u=a==="center"?50-c/2:72-c;s+=`<rect x="${Fe(28+i*(r+n))}" y="${u}" width="${r}" height="${c}" rx="${r/2}" fill="${t}"/>`}return ut(e()<0.5?0:90,s)},pixels(e,{fg:t}){let o=ke(e,[3,4,5]),r=e()<0.35,n=44/o,a=Math.ceil(o/2),s=[];for(let i=0;i<o;i++)for(let c=0;c<a;c++)if(e()<0.6)s.push([c,i],[o-1-c,i]);if(s.length<o*o*0.45){let i=Math.floor(o/2);for(let c=0;c<o;c++)s.push([i,c],[c,i])}return s.map(([i,c])=>{if(r)return dt(28+i*n+n/2,28+c*n+n/2,n*0.4,t);return`<rect x="${Fe(28+i*n)}" y="${Fe(28+c*n)}" width="${Fe(n+0.4)}" height="${Fe(n+0.4)}" fill="${t}"/>`}).join("")},chain(e,{fg:t}){let o=ke(e,[2,3,4]),r=ke(e,[0,45,90,135]),n=Zn({2:7,3:7.5,4:9},o),a=Zn({2:13,3:12,4:11},o),s="";for(let i=0;i<o;i++){let c=i/o*Fa;s+=`<circle cx="${Fe(50+Math.cos(c)*n)}" cy="${Fe(50+Math.sin(c)*n)}" r="${a}" fill="none" stroke="${t}" stroke-width="${o===4?3.5:4}"/>`}return ut(r,s)},gear(e,{fg:t,bg:o}){let r=ke(e,[6,8,10,12]),n=dt(50,50,16,t);for(let s=0;s<r;s++)n+=`<rect x="46.5" y="27" width="7" height="10" rx="1.5" fill="${t}" transform="rotate(${Fe(360/r*s)} 50 50)"/>`;let a=ke(e,[0,5,8]);if(a)n+=dt(50,50,a,o);return n},orbit(e,{fg:t}){let o=Math.floor(e()*8)*45,r=ke(e,[7,9]),n=e()<0.4,a=`<circle cx="50" cy="50" r="19" fill="none" stroke="${t}" stroke-width="3"/>`+dt(50,50,r,t),s=(i)=>{let c=i*Math.PI/180;return dt(50+Math.cos(c)*19,50+Math.sin(c)*19,4.5,t)};if(a+=s(o),n)a+=s(o+180);return a},truchet(e,{fg:t}){let r="";for(let n=0;n<2;n++)for(let a=0;a<2;a++){let s=e()<0.5?0:1,i=e()<0.5?0:1,c=28+a*22+s*22,u=28+n*22+i*22,l=s?-1:1,m=i?-1:1;r+=`<path d="M${c} ${u}L${c+l*22} ${u}A22 22 0 0 ${l*m>0?1:0} ${c} ${u+m*22}Z" fill="${t}"/>`}return r},chevrons(e,{fg:t}){let r=ke(e,[[43,57],[38,50,62]]).map((n)=>`M30 ${n+6}L50 ${n-6}L70 ${n+6}`).join("");return ut(Math.floor(e()*4)*90,`<path d="${r}" fill="none" stroke="${t}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>`)},drop(e,{fg:t,bg:o}){let r=`<path d="M50 24C56 32 69 43 69 54A19 19 0 0 1 31 54C31 43 44 32 50 24Z" fill="${t}"/>`,n=ke(e,["none","dot","ring"]);if(n==="dot")r+=dt(50,55,6,o);if(n==="ring")r+=dt(50,55,9,o)+dt(50,55,4,t);return ut(Math.floor(e()*8)*45,r)},spiral(e,{fg:t}){let o=ke(e,[2,2.75]),r=e()<0.5?1:-1,n=o*Fa,a="";for(let s=0;s<=n;s+=0.2){let i=1+21*s/n;a+=`${a?"L":"M"}${Fe(50+Math.cos(s*r)*i)} ${Fe(50+Math.sin(s*r)*i)}`}return ut(Math.floor(e()*4)*90,`<path d="${a}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>`)},stripes(e,{fg:t}){let o=ke(e,[3,4,5]),r=23,n=46/(o+1),a="";for(let s=0;s<o;s++){let i=-23+n*(s+1),c=Math.sqrt(529-i*i);a+=`M${Fe(50-c)} ${Fe(50+i)}H${Fe(50+c)}`}return ut(ke(e,[0,45,90,135]),`<path d="${a}" stroke="${t}" stroke-width="4.5" stroke-linecap="round"/>`)},cube(e,{fg:t}){let o=[50,28],r=[69.05,39],n=[69.05,61],a=[50,72],s=[30.95,61],i=[30.95,39],c=[50,50],u=e()<0.2,l=ke(e,[[1,0.5,0.75],[1,0.75,0.5],[0.5,1,0.75],[0.75,0.5,1],[1,0.45,0],[1,0,0.45],[0,1,0.5]]),m="";if(u){let p=(d)=>d.map(Fe).join(" ");m=`<path d="M${p(o)}L${p(r)}L${p(n)}L${p(a)}L${p(s)}L${p(i)}ZM${p(i)}L${p(c)}L${p(r)}M${p(c)}L${p(a)}" fill="none" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/>`}if(!u)[[o,r,c,i],[c,r,n,a],[i,c,a,s]].forEach((p,d)=>{if(!l[d])return;m+=ur(p,t).replace("/>",l[d]<1?` opacity="${l[d]}"/>`:"/>")});return ut(e()<0.5?0:180,m)},peaks(e,{fg:t}){let o=e()<0.6,r=e()<0.5,n=o?ur([[50,66],[61,46],[72,66]],t).replace("/>",' opacity="0.6"/>')+ur([[28,66],[46,34],[64,66]],t):ur([[28,66],[50,32],[72,66]],t);if(r)n+=dt(o?64:66,34,5,t);if(e()<0.5)return`<g transform="matrix(-1 0 0 1 100 0)">${n}</g>`;return n},hex(e,{fg:t,bg:o}){let r=e()<0.5?0:30,n=(c)=>Array.from({length:6},(u,l)=>{let m=l/6*Fa-Math.PI/2;return[50+Math.cos(m)*c,50+Math.sin(m)*c]}),a=(c,u)=>ur(n(c),u),s=ke(e,["none","hole","dot","nested","outline"]);if(s==="outline")return ut(r,`<polygon points="${n(21).map((c)=>c.map(Fe).join(",")).join(" ")}" fill="none" stroke="${t}" stroke-width="4" stroke-linejoin="round"/>${a(8,t)}`);let i=a(23,t);if(s==="hole")i+=a(11,o);if(s==="dot")i+=dt(50,50,7,o);if(s==="nested")i+=a(15,o)+a(8,t);return ut(r,i)},bubbles(e,{fg:t}){let o=ke(e,[[[44,46,15],[63,60,8],[61,37,5]],[[50,42,13],[37,63,7],[63,63,7]],[[40,58,12],[60,44,9],[52,30,4]]]);return ut(Math.floor(e()*4)*90,o.map(([r,n,a])=>dt(r,n,a,t)).join(""))}},_f=Object.keys(Ol);var l2=1,c2=`v${l2}:`;function Nl(e){if(!e.startsWith(c2))return null;let[t,o,r,n]=e.slice(c2.length).split(":");if(!t)return null;let a={seed:decodeURIComponent(t)};if(o)a.colorSeed=decodeURIComponent(o);if(r&&Gn.includes(r))a.background=r;if(n==="c")a.colors="curated";return a}var G8=(e)=>e.replace(/[&<>"]/g,(t)=>({"&":"&","<":"<",">":">",'"':"""})[t]),u2=(e)=>Gn.includes(e),m2=(e)=>typeof e==="string"&&(e in Ol);function f2(e,t,o){let r=e?.filter(t)??[];return r.length>0?r:o}function Z8(e,t){let o=Bf(Nf(e)),r=Hf(t.palette,t.colors,o);if(t.colorSeed&&t.palette===void 0)r=Hf(void 0,t.colors,Bf(Nf(t.colorSeed)));let n=ke(o,f2(t.backgrounds,u2,Gn)),a=u2(t.background)?t.background:n,s=m2(t.glyph)?t.glyph:ke(o,f2(t.glyphs,m2,_f)),i=Ol[s](o,r),c=t.size??64,u=t.shape==="square",l=t.radius??24,p=i2(o,a,r,(S)=>u?`<rect width="100" height="100" rx="${l}" fill="${S}"/>`:`<circle cx="50" cy="50" r="50" fill="${S}"/>`,{square:u,radius:l}),d=t.title?` role="img"><title>${G8(t.title)}</title>`:' aria-hidden="true">';return{svg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="${c}" height="${c}" style="display:block;width:100%;height:100%"${d}${p}${i}</svg>`,glyph:s,palette:r,background:a}}function Wf(e,t={}){let o=typeof e==="string"?Nl(e):null,r=o??(typeof e==="string"?{seed:e}:e),n={...t};if(o)n.colors="generated";if(r.colorSeed!==void 0)n.colorSeed=r.colorSeed;if(r.background!==void 0)n.background=r.background;if(r.colors!==void 0)n.colors=r.colors;return Z8(r.seed,n)}function zf(e,t){return Wf(e,t).svg}import{jsx as j8}from"react/jsx-runtime";function Rr(e){let{value:t,size:o=40,alt:r,glyph:n,glyphs:a,colors:s,colorSeed:i,palette:c,background:u,backgrounds:l,shape:m,radius:p,className:d,style:f,...S}=e,g=zf(t,{glyph:n,glyphs:a,colors:s,colorSeed:i,palette:c,background:u,backgrounds:l,shape:m,radius:p,size:o,title:r});return j8("span",{...S,className:["overflow-hidden [&>svg]:block [&>svg]:size-full",d].filter(Boolean).join(" "),style:{display:"inline-block",width:o,height:o,minWidth:o,lineHeight:0,flexShrink:0,...f},dangerouslySetInnerHTML:{__html:g}})}import{createContext as nw,useCallback as qnt,useContext as aw,useEffect as jnt,useRef as Xnt,useState as Ynt}from"react";import*as Oa from"react";import*as Bl from"react";var Gf=Bl.createContext(void 0);function Pr(e){let t=Bl.useContext(Gf);if(t===void 0&&!e)throw Error(Ge(72));return t}import*as p2 from"react";var X8={...nn,disabled:(e)=>e.disabled,instantType:(e)=>e.instantType,isInstantPhase:(e)=>e.isInstantPhase,trackCursorAxis:(e)=>e.trackCursorAxis,disableHoverablePopup:(e)=>e.disableHoverablePopup,lastOpenChangeReason:(e)=>e.openChangeReason,closeOnClick:(e)=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:(e)=>e.closeDelay,adaptiveOrigin:(e)=>e.adaptiveOrigin};class Zf extends ir{constructor(e,t,o){let r=new Dn;super(Y8(e,r,t,o),K8(r),X8)}setOpen=(e,t)=>{N0(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Re(aa,e))}}function Y8(e,t,o,r=!1){return{...Ca(t,o,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function K8(e){return{popupRef:p2.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}import{jsx as d2,jsxs as J8}from"react/jsx-runtime";var g2=Fn(function(t){let{disabled:o=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:a=!1,trackCursorAxis:s="none",actionsRef:i,onOpenChange:c,onOpenChangeComplete:u,handle:l,triggerId:m,defaultTriggerId:p=null,children:d}=t,f=Ac((U,E)=>new Zf({open:r,openProp:n,activeTriggerId:p,triggerIdProp:m},U,E));f.useControlledProp("openProp",n),f.useControlledProp("triggerIdProp",m),f.useContextCallback("onOpenChange",c),f.useContextCallback("onOpenChangeComplete",u);let S=f.useState("open"),g=!o&&S,h=f.useState("activeTriggerId"),x=f.useState("mounted"),b=f.useState("payload");f.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:a,disabled:o}),ga(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:C,transitionStatus:I}=ha(g,f),y=f.useState("isInstantPhase"),w=f.useState("instantType"),v=f.useState("lastOpenChangeReason"),R=Oa.useRef(null);z(()=>{if(S&&o)f.setOpen(!1,Re(zb))},[S,o,f]),z(()=>{if(I==="ending"&&v===Rn||I!=="ending"&&y){if(w!=="delay")R.current=w;f.set("instantType","delay")}else if(R.current!==null)f.set("instantType",R.current),R.current=null},[I,y,v,w,f]),z(()=>{if(g){if(h==null)f.set("payload",void 0)}},[f,h,g]),Oa.useImperativeHandle(i,()=>({unmount:C,close:()=>f.setOpen(!1,Re(Wu))}),[C,f]);let L=g||x||!o&&s!=="none";return J8(Gf.Provider,{value:f,children:[l&&d2(pa,{handle:l,store:f}),L&&d2(Q8,{store:f,disabled:o,trackCursorAxis:s}),typeof d==="function"?d({payload:b}):d]})});function Q8({store:e,disabled:t,trackCursorAxis:o}){let r=e.useState("floatingRootContext"),n=Ln(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=ym(r,{enabled:!t&&o!=="none",axis:o==="none"?void 0:o}),s=Oa.useMemo(()=>Ot(a.reference,n.reference),[a.reference,n.reference]);return Ia(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:n.floating??Ue}),null}import*as Vl from"react";import*as Hl from"react";var ew=Hl.createContext(void 0);function h2(){return Hl.useContext(ew)}var I2=600;var b2="data-base-ui-tooltip-trigger";function C2(e){let t=Ze(e);return Ve(t)?t:null}var S2=ba(function(t,o){let{render:r,className:n,style:a,handle:s,payload:i,disabled:c,delay:u,closeOnClick:l=!0,closeDelay:m,id:p,...d}=t,f=Pr(!0),g=Sa(s)??f;if(!g)throw Error(Ge(82));let h=ao(p),x=g.useState("isTriggerActive",h),b=g.useState("isOpenedByTrigger",h),C=g.useState("floatingRootContext"),I=Vl.useRef(null),y=m??0,{registerTrigger:w,isMountedByThisTrigger:v}=da(h,I,g,{payload:i,closeOnClick:l,closeDelay:y}),R=h2(),{activeIdRef:L,delayRef:U,isInstantPhase:E,hasProvider:O}=nm(C,{open:b}),k=wa(C);g.useSyncedValue("isInstantPhase",E);let P=g.useState("disabled"),N=c??P,j=ct(N),T=g.useState("trackCursorAxis"),B=g.useState("disableHoverablePopup"),W=Vl.useRef(!1),X=Je(),A=Vl.useRef(void 0);function ue(){if(O&&L.current!=null)return 0;return u??R??I2}function V(fe){let be=I.current;if(!be||!fe)return!1;let ne=rr(fe,`[${b2}]`);return ne!==null&&ne!==be&&le(be,ne)}function G(fe){let be=V(fe);if(W.current=be,be)k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,X.clear();return be}let Z=Ms(C,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!B&&T!=="both"?ks():null,restMs:ue,delay(){if(m==null&&O)return{close:Or(U.current,"close")};return{close:y}},triggerElementRef:I,isActiveTrigger:x,isClosing:()=>g.select("transitionStatus")==="ending",shouldOpen(){return!W.current}}),ee=Es(C,{enabled:!N}).reference,Pe=(fe)=>{let be=W.current,ne=C2(fe),we=G(ne),Ce=I.current,De=Ce&&ne&&le(Ce,ne);if(we&&g.select("open")&&g.select("lastOpenChangeReason")===Yt){g.setOpen(!1,Re(Yt,fe));return}if(be&&!we&&De&&!j.current&&!g.select("open")&&Ce&&ko(A.current)){let Q=()=>{if(!W.current&&!j.current&&!g.select("open"))g.setOpen(!0,Re(Yt,fe,Ce))},H=ue();if(H===0)X.clear(),Q();else X.start(H,Q)}},te=g.useState("appliedTriggerProps",v||T!=="none");return ve("button",t,{state:{open:b},ref:[o,w,I],props:[Z,ee,te,{onMouseOver(fe){Pe(fe.nativeEvent)},onFocus(fe){if(V(C2(fe.nativeEvent)))fe.preventBaseUIHandler()},onMouseLeave(){W.current=!1,X.clear(),A.current=void 0},onPointerEnter(fe){A.current=fe.pointerType},onPointerDown(fe){if(A.current=fe.pointerType,g.set("closeOnClick",l),l&&!g.select("open"))g.cancelPendingOpen(fe.nativeEvent)},onClick(fe){if(l&&!g.select("open"))g.cancelPendingOpen(fe.nativeEvent)},id:h,[cs]:N?"":void 0,[b2]:N?void 0:""},d],stateAttributesMapping:Ki})});import*as v2 from"react";import*as Ul from"react";var $f=Ul.createContext(void 0);function x2(){let e=Ul.useContext($f);if(e===void 0)throw Error(Ge(70));return e}import*as _l from"react";import*as w2 from"react-dom";import{jsxs as tw}from"react/jsx-runtime";var Wl=_l.forwardRef(function(t,o){let{children:r,container:n,className:a,render:s,style:i,...c}=t,{node:u,subtree:l}=Tc({container:n,ref:o,componentProps:t,elementProps:c});if(!l&&!u)return null;return tw(_l.Fragment,{children:[l,u&&w2.createPortal(r,u)]})});import{jsx as y2}from"react/jsx-runtime";var R2=v2.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t;if(!(Pr().useState("mounted")||r))return null;return y2($f.Provider,{value:r,children:y2(Wl,{ref:o,...n})})});import*as Zl from"react";import*as zl from"react";var qf=zl.createContext(void 0);function Gl(){let e=zl.useContext(qf);if(e===void 0)throw Error(Ge(71));return e}import{jsx as ow}from"react/jsx-runtime";var P2=Zl.forwardRef(function(t,o){let{render:r,className:n,anchor:a,positionMethod:s="absolute",side:i="top",align:c="center",sideOffset:u=0,alignOffset:l=0,collisionBoundary:m="clipping-ancestors",collisionPadding:p=5,arrowPadding:d=5,sticky:f=!1,disableAnchorTracking:S=!1,collisionAvoidance:g=Pc,style:h,...x}=t,b=Pr(),C=x2(),I=b.useState("open"),y=b.useState("mounted"),w=b.useState("trackCursorAxis"),v=b.useState("disableHoverablePopup"),R=b.useState("floatingRootContext"),L=b.useState("instantType"),U=b.useState("transitionStatus"),E=b.useState("adaptiveOrigin"),O=Kc({anchor:a,positionMethod:s,floatingRootContext:R,mounted:y,side:i,sideOffset:u,align:c,alignOffset:l,collisionBoundary:m,collisionPadding:p,sticky:f,arrowPadding:d,disableAnchorTracking:S,keepMounted:C,collisionAvoidance:g,adaptiveOrigin:E}),k=Zl.useMemo(()=>({open:I,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:w!=="none"?"tracking-cursor":L}),[I,O.side,O.align,O.anchorHidden,w,L]),P=Qc(t,k,{styles:O.positionerStyles,transitionStatus:U,props:x,refs:[o,b.useStateSetter("positionerElement")],hidden:!y,inert:!I||w==="both"||v});return ow(qf.Provider,{value:O,children:P})});import*as T2 from"react";var E2=T2.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,i=Pr(),{side:c,align:u}=Gl(),l=i.useState("open"),m=i.useState("instantType"),p=i.useState("transitionStatus"),d=i.useState("popupProps"),f=i.useState("floatingRootContext"),S=i.useState("disabled"),g=i.useState("closeDelay");$o({open:l,ref:i.context.popupRef,onComplete(){if(l)i.context.onOpenChangeComplete?.(!0)}}),As(f,{enabled:!S,closeDelay:g});let h=i.useStateSetter("popupElement");return ve("div",t,{state:{open:l,side:c,align:u,instant:m,transitionStatus:p},ref:[o,i.context.popupRef,h],props:[fa,d,va(p),s],stateAttributesMapping:ra})});import*as A2 from"react";var M2=A2.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,i=Pr(),{arrowRef:c,side:u,align:l,arrowUncentered:m,arrowStyles:p}=Gl(),d=i.useState("open"),f=i.useState("instantType");return ve("div",t,{state:{open:d,side:u,align:l,uncentered:m,instant:f},ref:[o,c],props:[{style:p,"aria-hidden":!0},s],stateAttributesMapping:vn})});import{jsx as Gs,jsxs as rw}from"react/jsx-runtime";function L2({...e}){return Gs(g2,{"data-slot":"tooltip",...e})}function D2({...e}){return Gs(S2,{"data-slot":"tooltip-trigger",...e})}function F2({className:e,side:t="top",sideOffset:o=4,align:r="center",alignOffset:n=0,children:a,...s}){return Gs(R2,{children:Gs(P2,{align:r,alignOffset:n,side:t,sideOffset:o,className:"isolate z-50",children:rw(E2,{"data-slot":"tooltip-content",className:ce("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s,children:[a,Gs(M2,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}import{useInsertionEffect as Vnt}from"react";import{jsx as cn,jsxs as N2,Fragment as fw}from"react/jsx-runtime";var sw=nw(null);function iw(){let e=aw(sw);if(!e)throw Error("useAvatarPicker and the AvatarPicker parts must be used inside <AvatarPickerRoot>.");return e}function O2(){return iw()}function $l(e,t,o,r,n,a=!1){function s(i){let{className:c,children:u,onClick:l,...m}=i,p=O2(),d=n(p),f=(h)=>{if(l?.(h),h.defaultPrevented)return;d()},S=a?"ga-ghost":"ga-icon",g=cn(mt,{type:"button",variant:"ghost",size:a?"default":"icon","aria-label":u?void 0:o,...m,className:c?`${S} ${c}`:S,"data-part":t,onClick:f,children:u??r});if(a)return g;return N2(L2,{children:[cn(D2,{render:g}),cn(F2,{children:o})]})}return s.displayName=e,s}var cw=$l("AvatarPickerShuffle","shuffle","Shuffle",N2(fw,{children:[cn(Di,{}),cn("span",{className:"ga-label",children:"Shuffle"})]}),(e)=>e.shuffle,!0),lw=$l("AvatarPickerNewShape","new-shape","New shape",cn(vi,{}),(e)=>e.newShape),uw=$l("AvatarPickerNewColors","new-colors","New colors",cn(Ei,{}),(e)=>e.newColors),mw=$l("AvatarPickerNewBackground","new-background","New background",cn(Ii,{}),(e)=>e.newBackground);import{jsx as xe,jsxs as ht}from"react/jsx-runtime";function dw(e){if(/Edg\//.test(e))return"Microsoft Edge";if(/Chrome\//.test(e))return"Google Chrome";if(/Safari\//.test(e)&&!/Chrome\//.test(e))return"Safari";if(/Firefox\//.test(e))return"Firefox";return"Unknown browser"}function H2({workspaceId:e,initialSettings:t,sessionToken:o,expanded:r,onExpandedChange:n,canExpand:a,onClose:s,onSettingsChange:i,theme:c,assetBaseUrl:u,welcome:l}){let m=$s(_o.workspace,{workspaceId:e,sessionToken:o}),p=m===void 0?t:m,d=B2("");Zs(()=>{if(!m)return;let D=JSON.stringify(m);if(d.current===D)return;d.current=D,i(m)},[i,m]);let f=p?{...p,theme:c}:p,S=Na(_o.openWebsite),g=Na(_o.startCustomer),h=Na(_o.sendCustomer),x=Na(_o.retryAgentResponse),b=Na(_o.generateAttachmentUploadUrl),C=Na(_o.markCustomerRead),[I,y]=Vr(""),[w,v]=Vr(),[R,L]=Vr(""),[U,E]=Vr(""),O=B2(null),[k,P]=Vr(!1),[N,j]=Vr(""),[T,B]=Vr(),[W,X]=Vr("chat"),[A,ue]=Vr(),V=!!o,G=$s(_o.visitorProfile,I&&V?{workspaceId:e,visitorId:I,sessionToken:o}:"skip"),Z=$s(_o.welcomeSuggestions,(G||f?.collectEmail===!1)&&l?.suggestions===void 0?{workspaceId:e,sessionToken:o}:"skip");Zs(()=>{let D=`coristen:${e}`,de=localStorage.getItem(D)??crypto.randomUUID();localStorage.setItem(D,de),y(de);let K=navigator.userAgent;ue({currentPage:window.location.href,referrer:document.referrer,browser:dw(K),device:/Mobi|Android|iPhone|iPad/i.test(K)?"Mobile":navigator.platform||"Desktop"})},[e]);async function ee(D){if(D.preventDefault(),!A||!o||k)return;P(!0),j("");try{let de=R.split("@")[0]?.replace(/[._-]+/g," ").trim()||"Visitor",K=await S({workspaceId:e,visitorId:I,sessionToken:o,name:de,email:R,...A,newConversation:!0});v(K??void 0),X("chat")}catch{j("We couldn't save your email. Please try again.")}finally{P(!1)}}async function Pe(){if(!G){X("chat");return}if(!A||k)return;P(!0),j("");try{let D=await S({workspaceId:e,visitorId:I,sessionToken:o,...G,...A,newConversation:!0});v(D??void 0),X("chat")}catch{j("We couldn't start a new conversation. Please try again.")}finally{P(!1)}}async function te(D,de){if(G===void 0)throw Error("Customer details are still loading");if(f?.collectEmail!==!1&&!G)throw Error("Enter your email before sending a message");if(w)return await h({conversationId:w,visitorId:I,sessionToken:o,body:D,attachments:de});if(!A)throw Error("Chat is still loading");await S({workspaceId:e,visitorId:I,sessionToken:o,...G??{},...A,newConversation:!0});let K=await g({workspaceId:e,visitorId:I,sessionToken:o,body:D,attachments:de});return B({body:D,attachments:de.map((pe)=>({...pe,url:null})),createdAt:Date.now()}),v(K),K}let ie=$s(_o.customerMessages,w&&I&&V?{conversationId:w,visitorId:I,sessionToken:o}:"skip"),me=$s(_o.visitorConversations,I&&V?{workspaceId:e,visitorId:I,sessionToken:o}:"skip"),fe=ie?.at(-1);if(Zs(()=>{if(ie!==void 0)B(void 0)},[ie]),Zs(()=>{if(W==="chat"&&V&&w&&I&&fe?.sender==="merchant")C({conversationId:w,visitorId:I,sessionToken:o}).catch(()=>{})},[w,W,fe?._id,fe?.sender,C,o,V,I]),Zs(()=>{let D=(de)=>{if(de.key==="Escape"&&!de.defaultPrevented)s()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[s]),f===void 0||!o)return null;if(f===null||f.enabled===!1)return xe(lf,{className:"w-full max-w-md",children:ht(uf,{children:[xe(mf,{children:"Chat unavailable"}),xe(ff,{children:f?"This chat is currently offline.":"This chat is no longer available."})]})});let be=f.collectEmail!==!1&&G===null,we=`${{none:0,sm:6,md:10,lg:16}[f?.radius??"lg"]}px`,Ce=f?.accentEnabled?f.brandColor:"var(--foreground)",De=f.theme==="dark"?`color-mix(in oklch, ${Ce} 20%, white)`:Ce,Q=ht(Lf,{children:[xe(Df,{src:f.agentImageUrl||void 0,alt:f.agentName}),xe(Ff,{children:xe(Rr,{value:f.agentName,size:32,className:"size-8"})})]}),H=ht("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3 overflow-y-auto px-8 py-10 text-center",children:[ht(Lf,{className:"size-12",children:[xe(Df,{src:f.agentImageUrl||void 0,alt:f.agentName}),xe(Ff,{children:xe(Rr,{value:f.agentName,size:48,className:"size-12"})})]}),ht("div",{className:"flex flex-col gap-1.5",children:[xe("p",{className:"text-base font-semibold",children:`Hi, I’m ${f.agentName}`}),xe("p",{className:"max-w-72 text-sm text-muted-foreground",children:!be?l?.message??f.welcomeMessage:"Enter your email below so we can keep your conversation and share replies with you."})]}),!be&&xe("div",{className:"flex w-full max-w-72 flex-col gap-1 pt-3",children:l?.suggestions===void 0&&Z===void 0?xe("div",{className:"flex flex-col items-center gap-3","aria-label":"Loading suggestions","aria-busy":"true",children:["w-4/5","w-3/5","w-2/3"].map((D)=>xe(lr,{className:`h-10 rounded-lg ${D}`},D))}):(l?.suggestions??(Z?.length?Z:[{title:"Tell me what you can help with",message:"What can you help me with, and where should I start?"},{title:"Help me understand my options",message:"Can you explain the options available and help me decide what to do next?"},{title:"I need help with something",message:"I need help with something and would like guidance on the next step."}])).map((D,de)=>xe(mt,{type:"button",variant:"ghost",className:"h-auto min-h-10 w-full justify-center px-2.5 py-2 text-center text-sm font-medium whitespace-normal",disabled:k,onClick:()=>{P(!0),j(""),te(D.message.slice(0,2000),[]).catch(()=>j("Your message couldn't be sent. Please try again.")).finally(()=>P(!1))},children:xe("span",{className:"min-w-0 break-words",children:D.title})},`${de}:${D.title}`))})]}),Y=W==="history"?"history":w?`conversation:${w}`:be?"contact":"new";return xe("div",{className:f.theme==="dark"?"dark flex h-full w-full flex-col text-foreground":"flex h-full w-full flex-col text-foreground",children:ht(lf,{className:"squircle relative h-full w-full gap-0 rounded-(--configured-radius) bg-background text-foreground shadow-none",style:{"--primary":f.accentSendIcon?f.theme==="dark"?De:Ce:void 0,"--primary-foreground":f.accentSendIcon&&f.theme==="dark"?"var(--background)":void 0,"--configured-radius":we,backgroundColor:f?.tintedGrayscale?`color-mix(in oklch, ${Ce} 4%, var(--background))`:void 0},children:[ht(uf,{className:"shrink-0 gap-1 pb-5 select-none",style:f?.accentEnabled&&f.accentHeader?{color:De}:void 0,children:[ht(mf,{className:"flex min-w-0 items-center gap-2",children:[f.logoUrl?xe("img",{src:f.logoUrl,alt:"",className:"size-6 shrink-0 object-contain"}):xe(Rr,{value:f.name,size:24,className:"size-6"}),xe("span",{className:"truncate",children:f.name})]}),W==="history"&&xe(ff,{className:"text-current opacity-85",children:"Continue a previous conversation"}),ht(_1,{className:"flex gap-1",children:[ht(mt,{variant:"ghost",size:"sm",onClick:()=>X(W==="chat"?"history":"chat"),children:[W==="chat"?xe(Ci,{weight:"duotone","data-icon":"inline-start"}):xe(pi,{weight:"duotone","data-icon":"inline-start"}),W==="chat"?"Messages":"Chat"]}),a&&xe(mt,{variant:"ghost",size:"icon-sm",className:"hidden sm:inline-flex","aria-label":r?"Restore chat size":"Expand chat","aria-pressed":r,onClick:()=>n(!r),children:r?xe(ii,{}):xe(li,{})}),xe(mt,{variant:"ghost",size:"icon-sm",className:"text-foreground","aria-label":"Close chat",title:"Close chat",onClick:s,children:xe(Uo,{weight:"duotone"})})]})]}),N&&G!==null&&xe("p",{role:"alert",className:"mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",children:N}),xe(W1,{className:"coristen-view flex min-h-0 flex-1 overflow-hidden p-0",children:W==="history"?xe("div",{className:"flex min-h-0 w-full flex-col",children:ht("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto p-4",children:[me===void 0&&Array.from({length:3}).map((D,de)=>ht("div",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2",children:[xe(lr,{className:"h-4 w-4/5"}),xe(lr,{className:"h-3 w-2/5"})]},de)),me?.map((D)=>ht(mt,{type:"button",variant:"ghost",className:"h-auto w-full justify-start gap-3 border border-transparent p-3 text-left whitespace-normal hover:border-border",onClick:()=>{v(D._id),X("chat")},children:[f.agentImageUrl?xe("img",{src:f.agentImageUrl,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):xe(Rr,{value:f.agentName,size:32,className:"size-8"}),ht("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[ht("span",{className:"flex items-center justify-between gap-2",children:[xe("span",{className:"text-sm font-medium",children:"Conversation"}),xe("time",{className:"shrink-0 text-xs text-muted-foreground",dateTime:new Date(D.lastMessageAt).toISOString(),children:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(D.lastMessageAt)})]}),xe("span",{className:"line-clamp-2 text-sm text-muted-foreground",children:D.lastMessagePreview||"Attachment"}),!!D.customerUnreadCount&&ht(Sl,{variant:"secondary",children:[D.customerUnreadCount," unread"]})]}),xe(gi,{className:"size-4 shrink-0 text-muted-foreground"})]},D._id)),me?.length===0&&xe("p",{className:"flex flex-1 items-center justify-center py-8 text-center text-sm text-muted-foreground",children:"No conversations yet"})]})}):G===void 0&&!w?ht("div",{className:"flex min-h-0 w-full flex-col p-(--surface-inset-md)",children:[ht("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-center",children:[xe(lr,{className:"size-12 rounded-full"}),xe(lr,{className:"h-5 w-28"}),ht("div",{className:"flex w-full max-w-72 flex-col items-center gap-2",children:[xe(lr,{className:"h-4 w-full"}),xe(lr,{className:"h-4 w-4/5"})]})]}),ht("div",{className:"flex flex-col gap-3",children:[ht("div",{className:"flex flex-col gap-2",children:[xe(lr,{className:"h-4 w-24"}),xe(lr,{className:"h-8 w-full rounded-lg"})]}),xe(lr,{className:"h-9 w-full rounded-lg"})]})]}):be&&!w?xe("div",{className:"flex min-h-0 w-full flex-col",children:H}):w&&ie===void 0&&T?xe(Mf,{messages:[{_id:"pending-first-message",_creationTime:T.createdAt,sender:"customer",body:T.body,attachments:T.attachments}],ownSender:"customer",showMetadata:!0,ownVariant:"secondary",ownAvatar:xe(Rr,{value:I,size:32,className:"size-8"}),otherAvatar:Q}):!w||ie===void 0||ie.length===0?H:xe(Mf,{messages:ie,showMetadata:!0,ownSender:"customer",ownVariant:"secondary",ownAvatar:xe(Rr,{value:I,size:32,className:"size-8"}),otherAvatar:Q,onRetry:(D)=>{j(""),x({conversationId:w,visitorId:I,customerMessageId:D,sessionToken:o}).catch(()=>j("The reply couldn't be retried. Please try again."))}},w)},Y),W==="history"&&xe(pl,{className:"shrink-0 flex-col gap-2 border-0 bg-transparent p-(--surface-inset-md)",children:ht(mt,{variant:"secondary",size:"lg",className:"w-full",disabled:k||G===void 0,onClick:()=>void Pe(),children:[xe(Yn,{"data-icon":"inline-start"}),"Start a conversation"]})}),be&&!w&&W==="chat"&&xe(pl,{className:"shrink-0 border-0 bg-transparent p-(--surface-inset-md)",children:ht("form",{className:"flex w-full flex-col gap-3",onSubmit:(D)=>void ee(D),children:[ht("div",{className:"flex flex-col gap-2",children:[xe(Yh,{htmlFor:"customer-email",children:"Email address"}),xe(sf,{id:"customer-email",type:"email",value:R,onChange:(D)=>L(D.target.value),autoComplete:"email",placeholder:"you@example.com",maxLength:254,required:!0})]}),N&&xe("p",{role:"alert",className:"text-xs text-destructive",children:N}),xe(mt,{type:"submit",size:"lg",className:"w-full",disabled:k||!A,children:k?"Continuing...":"Continue"})]})}),!be&&G!==void 0&&W==="chat"&&V&&xe(pl,{className:"flex-col gap-1 border-0 bg-transparent px-2 pt-0 pb-2",children:xe(U1,{body:U,onBodyChange:E,inputRef:O,sendDisabled:!A,showPoweredBy:f.showPoweredBy,assetBaseUrl:u,upload:async(D)=>{if(D.size>f.maxAttachmentSizeMb*1024*1024)throw Error(`Files must be ${f.maxAttachmentSizeMb} MB or smaller`);if(!f.allowedAttachmentTypes.some((M)=>D.type===M||D.type.startsWith(M)))throw Error("This file type is not allowed");let de=await b({workspaceId:e,visitorId:I,sessionToken:o}),K=await fetch(de,{method:"POST",headers:{"Content-Type":D.type||"application/octet-stream"},body:D});if(!K.ok)throw Error("Upload failed");let{storageId:pe}=await K.json();return{storageId:pe,name:D.name,type:D.type||"application/octet-stream",size:D.size}},send:te})})]})})}function V2(e){let t=e.message.toLowerCase();if(t.includes("valid coristen api key"))return"A Coristen public key is required. Pass an apiKey that starts with coristen_pk_.";if(t.includes("domain")||t.includes("origin"))return"This website is not allowed to use this support widget.";if(t.includes("key")||t.includes("not found"))return"This Coristen public key is invalid or no longer active.";if(t.includes("security is not configured"))return"Support chat is not configured yet.";return"Support chat is temporarily unavailable. Please try again."}import*as _2 from"react";import*as ql from"react";var jf=ql.createContext(void 0);function ln(){let e=ql.useContext(jf);if(!e)throw Error(Ge(73));return e}var U2=0;function jl(e){return U2+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${U2}`}function Xl(e,t){if(typeof e==="string")return{description:e};if(typeof e==="function"){let o=e(t);return typeof o==="string"?{description:o}:o}return e}function Xf(e){let t=new Map,o=0,r=0;return e.forEach((n,a)=>{let s=n.transitionStatus==="ending";if(t.set(n.id,{value:n,domIndex:a,visibleIndex:s?-1:o,offsetY:r}),r+=n.height||0,!s)o+=1}),t}function Yf(e,t){let o=0;return e.map((r)=>{if(r.transitionStatus==="ending")return r;let n=o>=t;return o+=1,r.limited===n?r:{...r,limited:n}})}var mr={toasts:(e)=>e.toasts,isEmpty:(e)=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:(e)=>e.focused,expanded:(e)=>e.hovering||e.focused,expandedOrOutOfFocus:(e)=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:(e)=>e.prevFocusElement};class Kf extends ir{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Xf(e.toasts)},{},mr)}setViewport=(e)=>{this.set("viewport",e)};syncProviderProps(e,t){let o=this.state.limit!==t;if(this.state.timeout===e&&!o)return;let r={timeout:e,limit:t};if(o){let n=Yf(this.state.toasts,t);r.toasts=n,r.toastMetadata=Xf(n)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let o=mr.toastIndex(this.state,e);if(o===-1)return;let r=this.state.toasts[o];if(!t)r?.onRemove?.();let n=[...this.state.toasts];n.splice(o,1),this.setToasts(n)}addToast=(e)=>{let{timeout:t,limit:o}=this.state,r=e.id||jl("toast");if(e.id){let i=mr.toast(this.state,e.id);if(i)if(i.transitionStatus==="ending")this.removeToast(e.id,!0);else{let{id:c,transitionStatus:u,...l}=e;return this.updateToastInternal(e.id,l,!0,!0),e.id}}let n={...e,id:r,updateKey:0,transitionStatus:"starting"},a=[n,...this.state.toasts];this.setToasts(Yf(a,o));let s=n.timeout??t;if(n.type!=="loading"&&s>0)this.scheduleTimer(r,s,()=>this.closeToast(r));if(mr.expandedOrOutOfFocus(this.state))this.pauseTimers();return r};updateToast=(e,t)=>{let o=mr.toast(this.state,e);if(!o||o.transitionStatus==="ending")return;this.updateToastInternal(e,typeof t==="function"?t(o):t,!1,!0)};updateToastInternal=(e,t,o=!1,r=!1)=>{let{timeout:n,toasts:a}=this.state,s=mr.toast(this.state,e);if(!s)return;if(s.transitionStatus==="ending")return;let i={...s,...t,...r&&{updateKey:s.updateKey+1}};this.setToasts(a.map((S)=>S.id===e?i:S));let c=i.timeout??n,u=s.timeout??n,l=Object.hasOwn(t,"timeout"),m=i.transitionStatus!=="ending"&&i.type!=="loading"&&c>0,p=this.timers.has(e),d=u!==c,f=s.type==="loading";if(!m&&p){this.clearTimer(e);return}if(m&&(!p||d||l||f||o)){if(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),mr.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=(e)=>{let t=e===void 0,{limit:o,toasts:r}=this.state,n;if(t)n=r,this.clearTimers();else{let i=mr.toast(this.state,e);if(!i)return;n=[i],this.clearTimer(e)}let a=r.map((i)=>t||i.id===e?{...i,transitionStatus:"ending",height:0}:i),s=Yf(a,o);this.setToasts(s,!s.some((i)=>i.transitionStatus!=="ending")),n.forEach((i)=>{if(i.transitionStatus!=="ending")i.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let o=Xl(t.loading),r=this.addToast({...o,type:"loading"}),n=e.then((a)=>{let s=Xl(t.success,a);return this.updateToast(r,{...s,type:"success",timeout:s.timeout}),a}).catch((a)=>{let s=Xl(t.error,a);return this.updateToast(r,{...s,type:"error",timeout:s.timeout}),Promise.reject(a)});if({}.hasOwnProperty.call(t,"setPromise"))t.setPromise(n);return n};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach((e)=>{if(e.timeout)e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=eo.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=(e)=>{if(e.pointerType!=="touch")return;let t=Ze(e);if(le(this.state.viewport,t))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer(e,t,o){let r=Date.now(),a=!mr.expandedOrOutOfFocus(this.state)?eo.create():void 0;a?.start(t,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:a,start:r,delay:t,remaining:t,callback:o})}clearTimers(){this.timers.forEach((e)=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts(e,t=e.length===0){let o={toasts:e,toastMetadata:Xf(e)};if(t)o.hovering=!1,o.focused=!1;this.update(o)}handleFocusManagement(e){let t=st(Ee(this.state.viewport));if(!this.state.viewport||!le(this.state.viewport,t)||!Qr(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let o=mr.toasts(this.state),r=mr.toastIndex(this.state,e),n=(s,i)=>{for(let c=s;c>=0&&c<o.length;c+=i)if(o[c].transitionStatus!=="ending")return o[c];return null},a=n(r+1,1)??n(r-1,-1);if(a)a.ref?.current?.focus();else this.restoreFocusToPrevElement()}}import{jsx as gw,jsxs as hw}from"react/jsx-runtime";var W2=function(t){let{children:o,timeout:r=5000,limit:n=3,toastManager:a}=t,s=Xe(()=>new Kf({timeout:r,limit:n,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Yr(s.disposeEffect),_2.useEffect(function(){if(!a)return;return a[" subscribe"](({action:u,options:l})=>{let m=l.id;if(u==="promise"&&l.promise)s.promiseToast(l.promise,l);else if(u==="update"&&m)s.updateToast(m,l.updates);else if(u==="close")s.closeToast(m);else s.addToast(l)})},[s,a]),hw(jf.Provider,{value:s,children:[gw(Iw,{store:s,timeout:r,limit:n}),o]})};function Iw(e){let{store:t,timeout:o,limit:r}=e;return z(()=>{t.syncProviderProps(o,r)},[t,o,r]),null}import*as Xo from"react";var z2="--toast-frontmost-height";import{jsx as Yl,jsxs as Jf}from"react/jsx-runtime";var G2=Xo.forwardRef(function(t,o){let{render:r,className:n,style:a,children:s,...i}=t,c=ln(),u=Je(),l=Xo.useRef(!1),m=Xo.useRef(!1),p=Xo.useRef(!1),d=c.useState("isEmpty"),f=c.useState("toasts"),S=c.useState("focused"),g=c.useState("expanded"),h=c.useState("prevFocusElement"),x=f[0]?.height,b=f.some((T)=>T.transitionStatus==="ending"),C=f.filter((T)=>T.priority==="high");Xo.useEffect(()=>{let T=c.state.viewport;if(!T||d)return;let B=qe(T),W=Ee(T);function X(V){if(V.key==="F6"&&Ze(V)!==T)V.preventDefault(),c.set("prevFocusElement",st(W)),T?.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0)}function A(V){if(Ze(V)!==B)return;c.set("isWindowFocused",!1),c.pauseTimers()}function ue(V){if(V.relatedTarget)return;let G=Ze(V),Z=st(Ee(T));if(G===B||!le(T,G)||!Qr(Z))c.resumeTimers();u.start(0,()=>c.set("isWindowFocused",!0))}return to(Ae(B,"keydown",X),Ae(B,"blur",A,!0),Ae(B,"focus",ue,!0),Ae(W,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,d]);function I(T){l.current=!0;let B=T.relatedTarget===c.state.viewport?f.find((W)=>W.transitionStatus!=="ending"&&!W.limited):void 0;if(B)B.ref?.current?.focus();else c.restoreFocusToPrevElement()}function y(T){if(T.key==="Tab"&&T.shiftKey&&Ze(T.nativeEvent)===c.state.viewport)T.preventDefault(),c.restoreFocusToPrevElement()}function w(){if(c.state.toasts.some((B)=>B.transitionStatus==="ending")||p.current||!m.current)return;if(c.set("hovering",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers();m.current=!1}Xo.useEffect(w,[b,c]);function v(){c.pauseTimers(),c.set("hovering",!0),m.current=!1}function R(){m.current=!0,w()}function L(T){if(T.pointerType==="touch")p.current=!0}function U(T){if(T.pointerType!=="touch")return;p.current=!1,w()}function E(){if(l.current){l.current=!1;return}if(S)return;if(Qr(st(Ee(c.state.viewport))))c.set("focused",!0),c.pauseTimers()}function O(T){if(!S||le(c.state.viewport,T.relatedTarget))return;if(c.set("focused",!1),!c.select("expandedOrOutOfFocus"))c.resumeTimers()}let k={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:v,onMouseMove:v,onMouseLeave:R,onFocus:E,onBlur:O,onKeyDown:y,onClick:E,onPointerDown:L,onPointerUp:U,onPointerCancel:U,style:{[z2]:x?`${x}px`:void 0}},P={expanded:g},N=!d&&h&&Yl(nr,{onFocus:I}),j=ve("div",t,{ref:[o,c.setViewport],state:P,props:[k,i,{children:Jf(Xo.Fragment,{children:[N,s,N]})}]});return Jf(Xo.Fragment,{children:[N,j,!S&&C.length>0&&Yl("div",{style:pc,children:C.map((T)=>Jf("div",{role:"alert","aria-atomic":!0,children:[Yl("div",{children:T.title}),Yl("div",{children:T.description})]},T.id))})]})});import*as nt from"react";import*as eI from"react-dom";import*as Kl from"react";var Qf=Kl.createContext(void 0);function un(){let e=Kl.useContext(Qf);if(!e)throw Error(Ge(66));return e}import*as ep from"react";function Z2(e,t){let o=(t??qe(e).getComputedStyle(e)).transform,r=0,n=0,a=1;if(o&&o!=="none"){let s=o.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){let i=s[1].split(", ").map(parseFloat);if(i.length===6)r=i[4],n=i[5],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]);else if(i.length===16)r=i[12],n=i[13],a=i[0]}}return{x:r,y:n,scale:a}}function Jl(e,t,o){switch(e){case"up":return-o;case"down":return o;case"left":return-t;case"right":return t;default:return 0}}var $2="--toast-index",q2="--toast-offset-y",j2="--toast-height",X2="--toast-swipe-movement-x",Y2="--toast-swipe-movement-y";var K2="data-swipe-direction",Sst=yn,xst=es;import{jsx as xw}from"react/jsx-runtime";var ww={...Xr,swipeDirection(e){return e?{[K2]:e}:null}},J2=40,yw=10,Q2=0.5,vw=1,Rw=`${I0},${b0}`,tI=nt.forwardRef(function(t,o){let{toast:r,render:n,className:a,swipeDirection:s=["down","right"],style:i,...c}=t,u=r.positionerProps?.anchor!==void 0,l=[];if(!u)l=Array.isArray(s)?s:[s];let m=l.length>0,p=ln(),[d,f]=nt.useState(void 0),[S,g]=nt.useState(!1),[h,x]=nt.useState(!1),[b,C]=nt.useState({x:0,y:0}),[I,y]=nt.useState({x:0,y:0,scale:1}),[w,v]=nt.useState(),[R,L]=nt.useState(),[U,E]=nt.useState(null),O=nt.useRef(null),k=nt.useRef(void 0),P=nt.useRef({x:0,y:0}),N=nt.useRef({x:0,y:0,scale:1}),j=nt.useRef(void 0),T=nt.useRef(0),B=nt.useRef(!1),W=nt.useRef({x:0,y:0}),X=nt.useRef(!1),A=nt.useRef({x:0,y:0}),ue=nt.useRef(null),V=nt.useRef(null),G=p.useState("toastIndex",r.id),Z=p.useState("toastVisibleIndex",r.id),ee=p.useState("toastOffsetY",r.id),Pe=p.useState("focused"),te=p.useState("expanded");$o({open:r.transitionStatus!=="ending",ref:O,onComplete(){if(r.transitionStatus==="ending")p.removeToast(r.id)}});let ie=re((K=!1)=>{let pe=O.current;if(!pe)return;let M=pe.style.height;pe.style.height="auto";let _=pe.offsetHeight;pe.style.height=M;function Se(){p.updateToastInternal(r.id,{ref:O,height:_,transitionStatus:void 0})}if(K)eI.flushSync(Se);else Se()});z(()=>{let K=k.current;if(r.transitionStatus!=="starting"&&K===r.id)return;if(K!==void 0)f(void 0),y({x:0,y:0,scale:1}),me({x:0,y:0});k.current=r.id,ie()},[ie,r.id,r.transitionStatus]);function me(K){A.current=K,C(K)}z(()=>()=>{V.current?.abort()},[]);function fe(K,pe){let M=(J)=>J>0?J**Q2:-(Math.abs(J)**Q2),_=K>0&&!l.includes("right")||K<0&&!l.includes("left"),Se=pe>0&&!l.includes("down")||pe<0&&!l.includes("up");return{x:_?M(K):K,y:Se?M(pe):pe}}let be=re((K)=>{if(K.pointerId!==ue.current)return;ue.current=null,V.current?.abort(),V.current=null,g(!1),x(!1),E(null);let pe=N.current;if(K.type==="pointercancel"||B.current){me({x:pe.x,y:pe.y}),f(void 0);return}let M=A.current,_=M.x-pe.x,Se=M.y-pe.y,J;for(let se of l)if(Jl(se,_,Se)>J2){J=se;break}if(J)f(J),p.closeToast(r.id);else me({x:pe.x,y:pe.y}),f(void 0)});function ne(K){if(K.button!==0)return;if(K.pointerType==="touch")p.pauseTimers();let pe=Ze(K.nativeEvent);if(rr(pe,`button,a,input,textarea,[role="button"],${Rw}`))return;B.current=!1,j.current=void 0,T.current=0,ue.current=K.pointerId,P.current={x:K.clientX,y:K.clientY},W.current=P.current;let _=K.currentTarget,Se=Z2(_);N.current=Se,y(Se),me({x:Se.x,y:Se.y}),p.set("hovering",!0),g(!0),x(!1),E(null),X.current=!0,V.current?.abort();let J=new AbortController;V.current=J;let se=Ee(_);se.addEventListener("pointerup",be,{signal:J.signal}),se.addEventListener("pointercancel",be,{signal:J.signal}),_.setPointerCapture?.(K.pointerId)}function we(K){if(K.pointerId!==ue.current)return;if(K.preventDefault(),X.current)P.current={x:K.clientX,y:K.clientY},X.current=!1;let{clientY:pe,clientX:M,movementX:_,movementY:Se}=K;if(Se<0&&pe>W.current.y||Se>0&&pe<W.current.y)W.current={x:W.current.x,y:pe};if(_<0&&M>W.current.x||_>0&&M<W.current.x)W.current={x:M,y:W.current.y};let J=M-P.current.x,se=pe-P.current.y,ge=pe-W.current.y,he=M-W.current.x,Ie=U;if(!h){if(Math.sqrt(J*J+se*se)>=vw){x(!0);let Kt=l.includes("left")||l.includes("right"),yo=l.includes("up")||l.includes("down");if(Kt&&yo){let To=Math.abs(J),uo=Math.abs(se);Ie=To>uo?"horizontal":"vertical",E(Ie)}}}let Ne;if(!j.current){if(Ie==="vertical"){if(se>0)Ne="down";else if(se<0)Ne="up"}else if(Ie==="horizontal"){if(J>0)Ne="right";else if(J<0)Ne="left"}else if(Math.abs(J)>=Math.abs(se))Ne=J>0?"right":"left";else Ne=se>0?"down":"up";if(Ne&&l.includes(Ne))j.current=Ne,T.current=Jl(Ne,J,se),f(Ne)}else{let oo=j.current,Kt=Jl(oo,he,ge);if(Kt>J2)B.current=!1,f(oo);else if(!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&T.current-Kt>=yw)B.current=!0}let Qe=fe(J,se),gt=N.current.x,bo=N.current.y,Co=l.includes("left")||l.includes("right"),Yo=l.includes("up")||l.includes("down");if(Ie!=="vertical"&&Co)gt+=Qe.x;if(Ie!=="horizontal"&&Yo)bo+=Qe.y;me({x:gt,y:bo})}function Ce(K){if(K.key==="Escape"){if(!O.current||!le(O.current,st(Ee(O.current))))return;p.closeToast(r.id)}}nt.useEffect(()=>{let K=O.current;if(!m||!K)return;function pe(M){if(ue.current===null||!le(K,Ze(M)))return;M.preventDefault()}return Ae(K,"touchmove",pe,{passive:!1})},[m]);function De(){let K=b.x-I.x,pe=b.y-I.y;return{transition:S?"none":void 0,transform:S?`translateX(${b.x}px) translateY(${b.y}px) scale(${I.scale})`:void 0,[X2]:`${K}px`,[Y2]:`${pe}px`}}let Q=r.priority==="high",H={role:Q?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":R,"aria-hidden":Q&&!Pe?!0:void 0,onPointerDown:m?ne:void 0,onPointerMove:m?we:void 0,onPointerUp:m?be:void 0,onPointerCancel:m?be:void 0,onKeyDown:Ce,inert:Ra(r.limited),style:{...De(),[$2]:r.transitionStatus==="ending"?G:Z,[q2]:`${ee}px`,[j2]:r.height?`${r.height}px`:void 0}},Y=nt.useMemo(()=>({toast:r,setTitleId:v,setDescriptionId:L,recalculateHeight:ie,visibleIndex:Z,expanded:te}),[r,v,L,ie,Z,te]),D={transitionStatus:r.transitionStatus,expanded:te,limited:r.limited||!1,type:r.type,swiping:S,swipeDirection:d},de=ve("div",t,{ref:[o,O],state:D,stateAttributesMapping:ww,props:[H,c]});return xw(Qf.Provider,{value:Y,children:de})});import*as Ql from"react";var oI=Ql.forwardRef(function(t,o){let{render:r,className:n,style:a,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=un(),l=Ql.useRef(null);z(()=>{u();let d=l.current;if(!d||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let f=new ResizeObserver(()=>u(!0)),S=new MutationObserver(()=>u(!0));return f.observe(d),S.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>{f.disconnect(),S.disconnect()}},[u]);let m=i>0;return ve("div",t,{ref:[o,l],state:{expanded:c,behind:m},props:s})});import*as aI from"react";import*as rI from"react";function nI(e){if(e==null||typeof e==="boolean"||e==="")return!1;if(Array.isArray(e))return e.some(nI);return!0}function eu(e){return rI.isValidElement(e)&&nI(e.props.children)}function tu(e,t,o){let{toast:r,setTitleId:n,setDescriptionId:a}=un(),s=o==="title"?n:a,i=t??(o==="title"?r.title:r.description);return{id:Cr(e),children:i,type:r.type,setId:s}}function ou(e,t,o){let r=eu(e);return z(()=>{if(!r)return;return o(t),()=>{o((n)=>n===t?void 0:n)}},[r,t,o]),r?e:null}var sI=aI.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=tu(s,i,"description"),f=ve("p",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return ou(f,u,p)});import*as iI from"react";var cI=iI.forwardRef(function(t,o){let{render:r,className:n,style:a,id:s,children:i,...c}=t,{id:u,children:l,type:m,setId:p}=tu(s,i,"title"),f=ve("h2",t,{ref:o,state:{type:m},props:{...c,id:u,children:l}});return ou(f,u,p)});import*as ru from"react";var lI=ru.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,u=ln(),{toast:l,expanded:m}=un(),[p,d]=ru.useState(!1),{getButtonProps:f,buttonRef:S}=xo({disabled:s,native:i}),g={type:l.type};return ve("button",t,{ref:[o,S],state:g,props:[{"aria-hidden":!m&&!p,onClick(){u.closeToast(l.id)},onFocus(){d(!0)},onBlur(){d(!1)}},c,f]})});import*as uI from"react";var mI=uI.forwardRef(function(t,o){let{render:r,className:n,style:a,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=un(),l=u.actionProps?.children??c.children,{getButtonProps:m,buttonRef:p}=xo({disabled:s,native:i}),d={type:u.type},f=ve("button",t,{ref:[o,p],state:d,props:[c,u.actionProps,m,{children:l}]});return eu(f)?f:null});import*as fI from"react";import{jsx as Pw}from"react/jsx-runtime";var pI=fI.forwardRef(function(t,o){return Pw(Wl,{ref:o,...t})});import*as dI from"react";function tp(){let e=ln(),t=e.useState("toasts");return dI.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function op(){let e=new Set;function t(o){e.forEach((r)=>r(o))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(o){let r=o.id||jl("toast"),n={...o,id:r,transitionStatus:"starting"};return t({action:"add",options:n}),r},close(o){t({action:"close",options:{id:o}})},update(o,r){t({action:"update",options:{id:o,updates:r}})},promise(o,r){let n=o;return t({action:"promise",options:{...r,promise:o,setPromise(a){n=a}}}),n}}}import*as nu from"react";import*as Ut from"react";var hI=new Map([["bold",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Ut.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Ut.createElement(Ut.Fragment,null,Ut.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var rp=nu.forwardRef((e,t)=>nu.createElement(Le,{ref:t,...e,weights:hI}));rp.displayName="CheckCircleIcon";import*as au from"react";import*as _t from"react";var II=new Map([["bold",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),_t.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",_t.createElement(_t.Fragment,null,_t.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]);var np=au.forwardRef((e,t)=>au.createElement(Le,{ref:t,...e,weights:II}));np.displayName="CircleNotchIcon";import*as su from"react";import*as Wt from"react";var bI=new Map([["bold",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Wt.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",Wt.createElement(Wt.Fragment,null,Wt.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var ap=su.forwardRef((e,t)=>su.createElement(Le,{ref:t,...e,weights:bI}));ap.displayName="InfoIcon";import*as iu from"react";import*as zt from"react";var CI=new Map([["bold",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),zt.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",zt.createElement(zt.Fragment,null,zt.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]);var sp=iu.forwardRef((e,t)=>iu.createElement(Le,{ref:t,...e,weights:CI}));sp.displayName="WarningIcon";import*as cu from"react";import*as Gt from"react";var SI=new Map([["bold",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),Gt.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",Gt.createElement(Gt.Fragment,null,Gt.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]);var ip=cu.forwardRef((e,t)=>cu.createElement(Le,{ref:t,...e,weights:SI}));ip.displayName="XCircleIcon";import{jsx as it,jsxs as cp}from"react/jsx-runtime";var Tw=op();function Ew({...e}){return it(W2,{...e})}function Aw({...e}){return it(pI,{"data-slot":"toast-portal",...e})}function Mw({className:e,...t}){return it(G2,{"data-slot":"toast-viewport",className:ce("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",e),...t})}function kw({className:e,...t}){return it(tI,{"data-slot":"toast",className:ce("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border border-border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-border focus-visible:ring-1 focus-visible:ring-border","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",e),...t})}function Lw({className:e,...t}){return it(oI,{"data-slot":"toast-content",className:ce("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",e),...t})}function Dw({className:e,...t}){return it(cI,{"data-slot":"toast-title",className:ce("text-sm font-medium",e),...t})}function Fw({className:e,...t}){return it(sI,{"data-slot":"toast-description",className:ce("text-sm text-muted-foreground",e),...t})}function Ow({className:e,render:t=it(mt,{variant:"outline",size:"sm"}),...o}){return it(mI,{"data-slot":"toast-action",render:t,className:ce("shrink-0",e),...o})}function Nw({className:e,children:t,render:o=it(mt,{variant:"ghost",size:"icon-sm"}),...r}){return it(lI,{"data-slot":"toast-close","aria-label":"Close toast",render:o,className:ce("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",e),...r,children:t??it(Uo,{"aria-hidden":"true"})})}function Bw({type:e}){let t=null;if(e==="success")t=it(rp,{"aria-hidden":"true"});if(e==="info")t=it(ap,{"aria-hidden":"true"});if(e==="warning")t=it(sp,{"aria-hidden":"true"});if(e==="error")t=it(ip,{className:"text-destructive","aria-hidden":"true"});if(e==="loading")t=it(np,{className:"animate-spin","aria-hidden":"true"});if(!t)return null;return it("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:t})}function Hw(){let{toasts:e}=tp();return e.map((t)=>it(kw,{toast:t,children:cp(Lw,{children:[it(Bw,{type:t.type}),cp("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[it(Dw,{}),it(Fw,{})]}),it(Ow,{}),it(Nw,{})]})},t.id))}function lu({children:e,toastManager:t=Tw,container:o,...r}){return cp(Ew,{toastManager:t,...r,children:[e,it(Aw,{container:o,children:it(Mw,{children:it(Hw,{})})})]})}var xI=op,hct=tp;import{jsx as lo,jsxs as js}from"react/jsx-runtime";var Gw="https://coristen-three.vercel.app",Ba=xI(),Zw=["--background","--foreground","--card","--card-foreground","--popover","--popover-foreground","--primary","--primary-foreground","--secondary","--secondary-foreground","--muted","--muted-foreground","--accent","--accent-foreground","--destructive","--border","--input","--ring","--radius-small","--radius-medium","--radius-control","--radius-card","--radius-panel","--radius-dialog","--radius-display","--surface-inset-sm","--surface-inset-md","--surface-inset-lg"],$w={name:"Coristen",logoUrl:null,agentName:"Ten",agentImageUrl:null,brandColor:"#171717",welcomeMessage:"",privacyPolicyUrl:"",position:"right",enabled:!0,theme:"light",tintedGrayscale:!1,accentEnabled:!1,accentHeader:!1,accentSendIcon:!1,radius:"lg",bubbleIcon:"chat-text",bubbleImageUrl:null,bubbleColor:"#171717",showPoweredBy:!0,collectEmail:!0,maxAttachmentSizeMb:10,allowedAttachmentTypes:[]};class wI extends Vw{state={error:!1};static getDerivedStateFromError(){return{error:!0}}componentDidCatch(e,t){this.props.onError(e),console.error("[Coristen widget] Runtime error",e,t)}render(){if(!this.state.error)return this.props.children;return null}}function up({identity:e,apiKey:t,apiUrl:o=Gw,mode:r="floating",renderTrigger:n,open:a,onOpenChange:s,defaultOpen:i=!1,welcome:c,fontSize:u,appearance:l,onReady:m,onError:p}){let d=o.replace(/\/$/,""),[f,S]=fr(),[g,h]=fr(""),[x,b]=fr(""),[C,I]=fr(),[y,w]=fr(i),v=a??y,R=lp((Q)=>{if(a===void 0)w(Q);s?.(Q)},[a,s]),[L,U]=fr(0),[E,O]=fr(!1),[k,P]=fr({}),[N,j]=fr(!1),[T,B]=fr(),W=qs(null),X=qs(void 0),A=qs(!1),ue=qs(m),V=qs(p);ue.current=m,V.current=p,mn(()=>{let Q=document.querySelector('meta[name="viewport"]'),H=!Q;if(!Q)Q=document.createElement("meta"),Q.name="viewport",document.head.append(Q);let Y=Q.content;return Q.content=(Y?Y.split(","):["width=device-width","initial-scale=1"]).map((D)=>D.trim()).filter((D)=>!/^maximum-scale\s*=/i.test(D)).concat("maximum-scale=1").filter(Boolean).join(", "),()=>{if(H)Q.remove();else Q.content=Y}},[]),mn(()=>{let Q=window.visualViewport,H=()=>{W.current?.style.setProperty("--coristen-viewport-height",`${Q?.height??window.innerHeight}px`),W.current?.style.setProperty("--coristen-viewport-top",`${Q?.offsetTop??0}px`)};return H(),Q?.addEventListener("resize",H),Q?.addEventListener("scroll",H),window.addEventListener("resize",H),()=>{Q?.removeEventListener("resize",H),Q?.removeEventListener("scroll",H),window.removeEventListener("resize",H)}},[]);let G=lp(async(Q)=>{let H=t,Y;if(e){if(!e.startsWith("/")||e.startsWith("//"))throw Error("Coristen identity must be a same-origin path");let K=await fetch(e,{credentials:"include",headers:{accept:"application/json"}});if(!K.ok){let M=Error("Authentication required");throw M.status=K.status,M}let pe=await K.json();if(H=pe.publishableKey,Y=pe.identityToken,!Y)throw Error("Invalid Coristen identity response")}if(!H?.startsWith("coristen_pk_"))throw Error("A valid Coristen API key is required");let D=await fetch(`${d}/api/widget-session`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({publishableKey:H,identityToken:Y,previousToken:Q})});if(!D.ok){let K=Error(await D.text());throw K.status=D.status,K}let de=await D.json();if(e&&!de.identity)throw Error("Verified identity required");return de},[t,d,e]);mn(()=>{let Q=!0,H,Y="",D=async()=>{try{let de=await G(Y||void 0);if(!Q)return;Y=de.token,S(de),h(""),ue.current?.(),H=window.setTimeout(D,Math.max(5000,de.expiresAt-Date.now()-30000))}catch(de){if(!Q)return;let K=de instanceof Error?de:Error("Widget failed to load");h(V2(K)),S((M)=>M&&M.expiresAt>Date.now()?M:void 0),V.current?.(K),console.error("[Coristen widget] Failed to initialize",K);let pe=K.status;if(!pe||pe===429||pe>=500)H=window.setTimeout(D,5000)}};return D(),()=>{if(Q=!1,H)window.clearTimeout(H);if(Y)fetch(`${d}/api/widget-session`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({sessionToken:Y}),keepalive:!0})}},[d,G,L]),mn(()=>{let Q=g||x;if(!Q)return;let H=Ba.add({title:"Support chat couldn't load",description:Q,type:"error",timeout:6000,priority:"high",actionProps:{children:"Try again",onClick:()=>{Ba.close(H),h(""),b(""),U((Y)=>Y+1)}}});return()=>Ba.close(H)},[g,x]),mn(()=>{let Q=()=>U((D)=>D+1),H=()=>R(!0),Y=()=>R(!1);return window.addEventListener("coristen:reset",Q),window.addEventListener("coristen:open",H),window.addEventListener("coristen:close",Y),()=>{window.removeEventListener("coristen:reset",Q),window.removeEventListener("coristen:open",H),window.removeEventListener("coristen:close",Y)}},[r,R]),mn(()=>{if(f)I(f.settings)},[f]),mn(()=>{if(!T)return;let Q=()=>B((H)=>{if(!H)return H;let Y=window.innerWidth<640?12:20;return{left:Math.min(Math.max(H.left,Y),window.innerWidth-56-Y),top:Math.min(Math.max(H.top,Y),window.innerHeight-56-Y)}});return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[T]),mn(()=>{let Q=()=>{let D=getComputedStyle(document.documentElement),de=W.current?.parentElement??document.body,K=getComputedStyle(de);j(document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||D.colorScheme==="dark"),P({...Object.fromEntries(Zw.flatMap((pe)=>{let M=D.getPropertyValue(pe).trim();return M?[[pe,M]]:[]})),"--coristen-host-font-family":K.fontFamily,"--coristen-host-font-size":K.fontSize})};Q();let H=new MutationObserver(Q);H.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]});let Y=W.current?.parentElement??document.body;if(Y!==document.documentElement)H.observe(Y,{attributes:!0,attributeFilter:["class","style"]});return()=>H.disconnect()},[]);let Z=_w(()=>f?new zw(f.convexUrl):void 0,[f?.convexUrl]),ee={...C??f?.settings??$w,...l,theme:l?.theme??(N?"dark":"light")};if(ee.enabled===!1)return null;let Pe=ee.position==="left"?"left":"right",te=T&&typeof window<"u"?T.left+28<window.innerWidth/2?"left":"right":Pe,ie=T&&typeof window<"u"?T.top+28<window.innerHeight/2?"top":"bottom":"bottom",me={none:0,sm:6,md:10,lg:16}[ee.radius],be={...r!=="floating"?{}:T?{left:`${T.left}px`,top:`${T.top}px`,right:"auto",bottom:"auto"}:Pe==="left"?{left:"20px"}:{right:"20px"},...k,"--coristen-radius":`${me}px`,"--coristen-bubble-color":ee.bubbleColor,"--radius-small":`${Math.max(0,me-10)}px`,"--radius-medium":`${Math.max(0,me-8)}px`,"--radius-control":`${Math.max(0,me-8)}px`,"--radius-card":`${Math.max(0,me-4)}px`,"--radius-panel":`${me}px`,"--radius-dialog":`${me}px`,"--radius-display":`${me}px`,...u?{"--coristen-font-size":u}:{}},ne=(Q)=>{if(r!=="floating"||v||Q.button!==0)return;let H=Q.currentTarget.getBoundingClientRect();X.current={pointerId:Q.pointerId,startX:Q.clientX,startY:Q.clientY,left:H.left,top:H.top,moved:!1},Q.currentTarget.setPointerCapture(Q.pointerId)},we=(Q)=>{let H=X.current;if(!H||H.pointerId!==Q.pointerId)return;if(!H.moved&&Math.hypot(Q.clientX-H.startX,Q.clientY-H.startY)<=4)return;H.moved=!0;let Y=window.innerWidth<640?12:20;B({left:Math.min(Math.max(H.left+Q.clientX-H.startX,Y),window.innerWidth-56-Y),top:Math.min(Math.max(H.top+Q.clientY-H.startY,Y),window.innerHeight-56-Y)})},Ce=(Q)=>{let H=X.current;if(!H||H.pointerId!==Q.pointerId)return;if(H.moved){A.current=!0;let Y=window.innerWidth<640?12:20;B((D)=>D?{left:D.left+28<window.innerWidth/2?Y:window.innerWidth-56-Y,top:D.top}:D)}X.current=void 0},De=()=>{R(!v)};if(g&&(!f||!Z))return js("div",{ref:W,"data-coristen-widget":"","data-mode":r,className:ee.theme==="dark"?"dark":void 0,style:be,children:[lo(lu,{toastManager:Ba,container:W}),n&&lo("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:De})})]});if(!f||!Z)return js("div",{ref:W,"data-coristen-widget":"","data-mode":r,className:ee.theme==="dark"?"dark":void 0,style:be,children:[lo(lu,{toastManager:Ba,container:W}),n&&lo("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:De})})]});return js("div",{ref:W,"data-coristen-widget":"","data-open":v||void 0,"data-expanded":E||void 0,"data-mode":r,"data-position":te,"data-vertical":ie,className:ee.theme==="dark"?"dark":void 0,style:be,children:[lo(lu,{toastManager:Ba,container:W}),r==="modal"&&v&&lo("button",{type:"button",className:"coristen-backdrop","aria-label":"Close chat",onClick:()=>R(!1)}),f&&Z&&lo("div",{className:"coristen-panel",role:"dialog","aria-modal":r==="modal"?!0:void 0,"aria-label":`${ee.name} chat`,"aria-hidden":!v,inert:!v,children:lo(wI,{onError:(Q)=>{b("Chat ran into a problem. Please try again."),V.current?.(Q)},children:lo(Ww,{client:Z,children:lo(H2,{workspaceId:f.workspaceId,initialSettings:ee,sessionToken:f.token,expanded:E,onExpandedChange:O,canExpand:r==="floating",onClose:()=>R(!1),onSettingsChange:I,theme:ee.theme,assetBaseUrl:d,welcome:c})})},L)}),n?lo("div",{className:"coristen-custom-trigger",children:n({open:v,toggle:De})}):r==="floating"?lo("button",{type:"button",className:"coristen-launcher","aria-label":v?"Close chat":"Open chat","aria-expanded":v,"aria-busy":!f,onPointerDown:ne,onPointerMove:we,onPointerUp:Ce,onPointerCancel:Ce,onClick:()=>{if(A.current){A.current=!1;return}De()},children:lo("img",{src:ee.bubbleImageUrl||`${d}/widget-icons/${ee.bubbleIcon||"chat-text"}.svg`,alt:"",draggable:!1,"data-custom-image":ee.bubbleImageUrl?"":void 0})}):null]})}function yI(e,t,o){return Uw(e,{"aria-expanded":t,onClick:(r)=>{if(e.props.onClick?.(r),!r.defaultPrevented)o()}})}function vct(e){return lo(up,{...e,mode:"floating"})}function Rct({trigger:e,...t}){return lo(up,{...t,mode:"modal",renderTrigger:({open:o,toggle:r})=>yI(e,o,r)})}function Pct({children:e,side:t="right",trigger:o,open:r,onOpenChange:n,defaultOpen:a=!1,appearance:s,...i}){let[c,u]=fr(a),l=r??c,m=lp((p)=>{if(r===void 0)u(p);n?.(p)},[r,n]);return js("div",{className:"coristen-dock","data-side":t,"data-open":l||void 0,children:[js("div",{className:"coristen-dock-content",children:[e,!l&&lo("div",{className:"coristen-dock-trigger",children:yI(o,l,()=>m(!0))})]}),lo(up,{...i,mode:"embedded",open:l,onOpenChange:m,appearance:{...s,position:t}})]})}var Tct={open(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:open"))},close(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:close"))},reset(){if(typeof window<"u")window.dispatchEvent(new Event("coristen:reset"))}};export{Pct as CoristenDock,Rct as CoristenModal,vct as CoristenWidget,Tct as coristenWidget};
|