@accounter/client
Version:
Accounter client application
45 lines • 88 kB
JavaScript
import{s as e}from"./dist-BBBZL-zT.js";import{i as t,o as n,t as r}from"./utils-C9b7NsUD.js";import{jo as i}from"./error-handling-DBz7h-2r.js";import{i as a,s as o}from"./button-DATCl8sW.js";var s=e(n(),1),c=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),l=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),u=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),d=e=>{let t=u(e);return t.charAt(0).toUpperCase()+t.slice(1)},f={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},p=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},m=(0,s.createContext)({}),h=()=>(0,s.useContext)(m),g=(0,s.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...l},u)=>{let{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=h()??{},y=r??g?Number(n??m)*24/Number(t??d):n??m;return(0,s.createElement)(`svg`,{ref:u,...f,width:t??d??f.width,height:t??d??f.height,stroke:e??_,strokeWidth:y,className:c(`lucide`,v,i),...!a&&!p(l)&&{"aria-hidden":`true`},...l},[...o.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),_=(e,t)=>{let n=(0,s.forwardRef)(({className:n,...r},i)=>(0,s.createElement)(g,{ref:i,iconNode:t,className:c(`lucide-${l(d(e))}`,`lucide-${e}`,n),...r}));return n.displayName=d(e),n},v=_(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),y=_(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),b=_(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),x=_(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),S=_(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),C=_(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),w=e(i(),1),T=t(),E=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=a(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,T.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function D(e,t){e&&w.flushSync(()=>e.dispatchEvent(t))}var O=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),k=`VisuallyHidden`,A=s.forwardRef((e,t)=>(0,T.jsx)(E.span,{...e,ref:t,style:{...O,...e.style}}));A.displayName=k;var j=A;function M(e,t){let n=s.createContext(t),r=e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,T.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=s.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function N(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,T.jsx)(c.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function c(n,o){let c=o?.[e]?.[a]||i,l=s.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,c]}let i=()=>{let t=n.map(e=>s.createContext(e));return function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,P(i,...t)]}function P(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function F(e){let t=e+`CollectionProvider`,[n,r]=N(t),[i,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,T.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};l.displayName=t;let u=e+`CollectionSlot`,d=a(u),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,T.jsx)(d,{ref:o(t,c(u,n).collectionRef),children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=a(p),g=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=s.useRef(null),l=o(t,a),u=c(p,n);return s.useEffect(()=>(u.itemMap.set(a,{ref:a,...i}),()=>void u.itemMap.delete(a))),(0,T.jsx)(h,{[m]:``,ref:l,children:r})});g.displayName=p;function _(t){let n=c(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:l,Slot:f,ItemSlot:g},_,r]}typeof window<`u`&&window.document&&window.document.createElement;function I(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var L=globalThis?.document?s.useLayoutEffect:()=>{},R=s.useInsertionEffect||L;function z({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ee({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=s.useRef(e!==void 0);s.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,s.useCallback(t=>{if(c){let n=te(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function ee({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return R(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function te(e){return typeof e==`function`}function ne(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}var re=e=>{let{present:t,children:n}=e,r=ie(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=o(r.ref,oe(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null};re.displayName=`Presence`;function ie(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),[o,c]=ne(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{let e=ae(r.current);a.current=o===`mounted`?e:`none`},[o]),L(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=ae(t);e?c(`MOUNT`):o===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),L(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=ae(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=ae(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:s.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function ae(e){return e?.animationName||`none`}function oe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var se=s.useId||(()=>void 0),ce=0;function le(e){let[t,n]=s.useState(se());return L(()=>{e||n(e=>e??String(ce++))},[e]),e||(t?`radix-${t}`:``)}var ue=s.createContext(void 0);function de(e){let t=s.useContext(ue);return e||t||`ltr`}function fe(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>t.current?.(...e),[])}function pe(e,t=globalThis?.document){let n=fe(e);s.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var me=`DismissableLayer`,he=`dismissableLayer.update`,ge=`dismissableLayer.pointerDownOutside`,_e=`dismissableLayer.focusOutside`,ve,ye=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),be=s.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...u}=e,d=s.useContext(ye),[f,p]=s.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=s.useState({}),g=o(t,e=>p(e)),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=_.indexOf(v),b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=Ce(e=>{let t=e.target,n=[...d.branches].some(e=>e.contains(t));!S||n||(i?.(e),c?.(e),e.defaultPrevented||l?.())},m),w=we(e=>{let t=e.target;[...d.branches].some(e=>e.contains(t))||(a?.(e),c?.(e),e.defaultPrevented||l?.())},m);return pe(e=>{b===d.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},m),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ve=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Te(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ve)}},[f,m,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Te())},[f,d]),s.useEffect(()=>{let e=()=>h({});return document.addEventListener(he,e),()=>document.removeEventListener(he,e)},[]),(0,T.jsx)(E.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:I(e.onFocusCapture,w.onFocusCapture),onBlurCapture:I(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,C.onPointerDownCapture)})});be.displayName=me;var xe=`DismissableLayerBranch`,Se=s.forwardRef((e,t)=>{let n=s.useContext(ye),r=s.useRef(null),i=o(t,r);return s.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,T.jsx)(E.div,{...e,ref:i})});Se.displayName=xe;function Ce(e,t=globalThis?.document){let n=fe(e),r=s.useRef(!1),i=s.useRef(()=>{});return s.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Ee(ge,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function we(e,t=globalThis?.document){let n=fe(e),r=s.useRef(!1);return s.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ee(_e,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Te(){let e=new CustomEvent(he);document.dispatchEvent(e)}function Ee(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?D(i,a):i.dispatchEvent(a)}var De=`focusScope.autoFocusOnMount`,Oe=`focusScope.autoFocusOnUnmount`,ke={bubbles:!1,cancelable:!0},Ae=`FocusScope`,je=s.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=e,[l,u]=s.useState(null),d=fe(i),f=fe(a),p=s.useRef(null),m=o(t,e=>u(e)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(h.paused||!l)return;let t=e.target;l.contains(t)?p.current=t:Re(p.current,{select:!0})},t=function(e){if(h.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||Re(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Re(l)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,h.paused]),s.useEffect(()=>{if(l){ze.add(h);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(De,ke);l.addEventListener(De,d),l.dispatchEvent(t),t.defaultPrevented||(Me(He(Pe(l)),{select:!0}),document.activeElement===e&&Re(l))}return()=>{l.removeEventListener(De,d),setTimeout(()=>{let t=new CustomEvent(Oe,ke);l.addEventListener(Oe,f),l.dispatchEvent(t),t.defaultPrevented||Re(e??document.body,{select:!0}),l.removeEventListener(Oe,f),ze.remove(h)},0)}}},[l,d,f,h]);let g=s.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ne(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Re(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Re(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,T.jsx)(E.div,{tabIndex:-1,...c,ref:m,onKeyDown:g})});je.displayName=Ae;function Me(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Re(r,{select:t}),document.activeElement!==n)return}function Ne(e){let t=Pe(e);return[Fe(t,e),Fe(t.reverse(),e)]}function Pe(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fe(e,t){for(let n of e)if(!Ie(n,{upTo:t}))return n}function Ie(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Le(e){return e instanceof HTMLInputElement&&`select`in e}function Re(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Le(e)&&t&&e.select()}}var ze=Be();function Be(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ve(e,t),e.unshift(t)},remove(t){e=Ve(e,t),e[0]?.resume()}}}function Ve(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function He(e){return e.filter(e=>e.tagName!==`A`)}var Ue=`Portal`,We=s.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=s.useState(!1);L(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?w.createPortal((0,T.jsx)(E.div,{...r,ref:t}),o):null});We.displayName=Ue;var Ge=0;function Ke(){s.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??qe()),document.body.insertAdjacentElement(`beforeend`,e[1]??qe()),Ge++,()=>{Ge===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Ge--}},[])}function qe(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},B.apply(this,arguments)};function Je(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ye(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Xe(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Ze(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Qe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var $e=`right-scroll-bar-position`,et=`width-before-scroll-bar`,tt=`with-scroll-bars-hidden`,nt=`--removed-body-scroll-bar-size`;function rt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function it(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var at=typeof window<`u`?s.useLayoutEffect:s.useEffect,ot=new WeakMap;function st(e,t){var n=it(t||null,function(t){return e.forEach(function(e){return rt(e,t)})});return at(function(){var t=ot.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||rt(e,null)}),i.forEach(function(e){r.has(e)||rt(e,a)})}ot.set(n,e)},[e]),n}function ct(e){return e}function lt(e,t){t===void 0&&(t=ct);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ut(e){e===void 0&&(e={});var t=lt(null);return t.options=B({async:!0,ssr:!1},e),t}var dt=function(e){var t=e.sideCar,n=Je(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,B({},n))};dt.isSideCarExport=!0;function ft(e,t){return e.useMedium(t),dt}var pt=ut(),mt=function(){},ht=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:mt,onWheelCapture:mt,onTouchMoveCapture:mt}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Je(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=st([n,t]),w=B(B({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:pt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),B(B({},w),{ref:C})):s.createElement(y,B({},w,{className:l,ref:C}),c))});ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ht.classNames={fullWidth:et,zeroRight:$e};var gt,_t=function(){if(gt)return gt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function vt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=_t();return t&&e.setAttribute(`nonce`,t),e}function yt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vt())&&(yt(t,n),bt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},St=function(){var e=xt();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ct=function(){var e=St();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},wt={left:0,top:0,right:0,gap:0},Tt=function(e){return parseInt(e||``,10)||0},Et=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Tt(n),Tt(r),Tt(i)]},Dt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return wt;var t=Et(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ot=Ct(),kt=`data-scroll-locked`,At=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
.${tt} {
overflow: hidden ${r};
padding-right: ${s}px ${r};
}
body[${kt}] {
overflow: hidden ${r};
overscroll-behavior: contain;
${[t&&`position: relative ${r};`,n===`margin`&&`
padding-left: ${i}px;
padding-top: ${a}px;
padding-right: ${o}px;
margin-left:0;
margin-top:0;
margin-right: ${s}px ${r};
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
}
.${$e} {
right: ${s}px ${r};
}
.${et} {
margin-right: ${s}px ${r};
}
.${$e} .${$e} {
right: 0 ${r};
}
.${et} .${et} {
margin-right: 0 ${r};
}
body[${kt}] {
${nt}: ${s}px;
}
`},jt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Mt=function(){s.useEffect(function(){return document.body.setAttribute(kt,(jt()+1).toString()),function(){var e=jt()-1;e<=0?document.body.removeAttribute(kt):document.body.setAttribute(kt,e.toString())}},[])},Nt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Mt();var a=s.useMemo(function(){return Dt(i)},[i]);return s.createElement(Ot,{styles:At(a,!t,i,n?``:`!important`)})},Pt=!1;if(typeof window<`u`)try{var Ft=Object.defineProperty({},`passive`,{get:function(){return Pt=!0,!0}});window.addEventListener(`test`,Ft,Ft),window.removeEventListener(`test`,Ft,Ft)}catch{Pt=!1}var It=Pt?{passive:!1}:!1,Lt=function(e){return e.tagName===`TEXTAREA`},Rt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Lt(e)&&n[t]===`visible`)},zt=function(e){return Rt(e,`overflowY`)},Bt=function(e){return Rt(e,`overflowX`)},Vt=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Wt(e,r)){var i=Gt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ht=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ut=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Wt=function(e,t){return e===`v`?zt(t):Bt(t)},Gt=function(e,t){return e===`v`?Ht(t):Ut(t)},Kt=function(e,t){return e===`h`&&t===`rtl`?-1:1},qt=function(e,t,n,r,i){var a=Kt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Gt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Wt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Jt=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yt=function(e){return[e.deltaX,e.deltaY]},Xt=function(e){return e&&`current`in e?e.current:e},Zt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Qt=function(e){return`
.block-interactivity-${e} {pointer-events: none;}
.allow-interactivity-${e} {pointer-events: all;}
`},$t=0,en=[];function tn(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState($t++)[0],a=s.useState(Ct)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Qe([e.lockRef.current],(e.shards||[]).map(Xt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Jt(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Vt(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Vt(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return qt(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(!(!en.length||en[en.length-1]!==a)){var r=`deltaY`in n?Yt(n):Jt(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Zt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(Xt).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:nn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=Jt(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,Yt(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,Jt(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return en.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,It),document.addEventListener(`touchmove`,l,It),document.addEventListener(`touchstart`,d,It),function(){en=en.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,It),document.removeEventListener(`touchmove`,l,It),document.removeEventListener(`touchstart`,d,It)}},[]);var m=e.removeScrollBar,h=e.inert;return s.createElement(s.Fragment,null,h?s.createElement(a,{styles:Qt(i)}):null,m?s.createElement(Nt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var rn=ft(pt,tn),an=s.forwardRef(function(e,t){return s.createElement(ht,B({},e,{ref:t,sideCar:rn}))});an.classNames=ht.classNames;var on=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},sn=new WeakMap,cn=new WeakMap,ln={},un=0,dn=function(e){return e&&(e.host||dn(e.parentNode))},fn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=dn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},pn=function(e,t,n,r){var i=fn(t,Array.isArray(e)?e:[e]);ln[n]||(ln[n]=new WeakMap);var a=ln[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(sn.get(e)||0)+1,l=(a.get(e)||0)+1;sn.set(e,c),a.set(e,l),o.push(e),c===1&&i&&cn.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),un++,function(){o.forEach(function(e){var t=sn.get(e)-1,i=a.get(e)-1;sn.set(e,t),a.set(e,i),t||(cn.has(e)||e.removeAttribute(r),cn.delete(e)),i||e.removeAttribute(n)}),un--,un||(sn=new WeakMap,sn=new WeakMap,cn=new WeakMap,ln={})}},mn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||on(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),pn(r,i,n,`aria-hidden`)):function(){return null}},hn=`Dialog`,[gn,_n]=N(hn),[vn,V]=gn(hn),yn=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=s.useRef(null),l=s.useRef(null),[u,d]=z({prop:r,defaultProp:i??!1,onChange:a,caller:hn});return(0,T.jsx)(vn,{scope:t,triggerRef:c,contentRef:l,contentId:le(),titleId:le(),descriptionId:le(),open:u,onOpenChange:d,onOpenToggle:s.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};yn.displayName=hn;var bn=`DialogTrigger`,xn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=V(bn,n),a=o(t,i.triggerRef);return(0,T.jsx)(E.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Vn(i.open),...r,ref:a,onClick:I(e.onClick,i.onOpenToggle)})});xn.displayName=bn;var Sn=`DialogPortal`,[Cn,wn]=gn(Sn,{forceMount:void 0}),Tn=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=V(Sn,t);return(0,T.jsx)(Cn,{scope:t,forceMount:n,children:s.Children.map(r,e=>(0,T.jsx)(re,{present:n||a.open,children:(0,T.jsx)(We,{asChild:!0,container:i,children:e})}))})};Tn.displayName=Sn;var En=`DialogOverlay`,Dn=s.forwardRef((e,t)=>{let n=wn(En,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=V(En,e.__scopeDialog);return a.modal?(0,T.jsx)(re,{present:r||a.open,children:(0,T.jsx)(kn,{...i,ref:t})}):null});Dn.displayName=En;var On=a(`DialogOverlay.RemoveScroll`),kn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=V(En,n);return(0,T.jsx)(an,{as:On,allowPinchZoom:!0,shards:[i.contentRef],children:(0,T.jsx)(E.div,{"data-state":Vn(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),An=`DialogContent`,jn=s.forwardRef((e,t)=>{let n=wn(An,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=V(An,e.__scopeDialog);return(0,T.jsx)(re,{present:r||a.open,children:a.modal?(0,T.jsx)(Mn,{...i,ref:t}):(0,T.jsx)(Nn,{...i,ref:t})})});jn.displayName=An;var Mn=s.forwardRef((e,t)=>{let n=V(An,e.__scopeDialog),r=s.useRef(null),i=o(t,n.contentRef,r);return s.useEffect(()=>{let e=r.current;if(e)return mn(e)},[]),(0,T.jsx)(Pn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:I(e.onFocusOutside,e=>e.preventDefault())})}),Nn=s.forwardRef((e,t)=>{let n=V(An,e.__scopeDialog),r=s.useRef(!1),i=s.useRef(!1);return(0,T.jsx)(Pn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Pn=s.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...c}=e,l=V(An,n),u=s.useRef(null),d=o(t,u);return Ke(),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(je,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,T.jsx)(be,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Vn(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Gn,{titleId:l.titleId}),(0,T.jsx)(qn,{contentRef:u,descriptionId:l.descriptionId})]})]})}),Fn=`DialogTitle`,In=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=V(Fn,n);return(0,T.jsx)(E.h2,{id:i.titleId,...r,ref:t})});In.displayName=Fn;var Ln=`DialogDescription`,Rn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=V(Ln,n);return(0,T.jsx)(E.p,{id:i.descriptionId,...r,ref:t})});Rn.displayName=Ln;var zn=`DialogClose`,Bn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=V(zn,n);return(0,T.jsx)(E.button,{type:`button`,...r,ref:t,onClick:I(e.onClick,()=>i.onOpenChange(!1))})});Bn.displayName=zn;function Vn(e){return e?`open`:`closed`}var Hn=`DialogTitleWarning`,[Un,Wn]=M(Hn,{contentName:An,titleName:Fn,docsSlug:`dialog`}),Gn=({titleId:e})=>{let t=Wn(Hn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Kn=`DialogDescriptionWarning`,qn=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wn(Kn).contentName}}.`;return s.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Jn=yn,Yn=xn,Xn=Tn,Zn=Dn,Qn=jn,$n=In,er=Rn,tr=Bn;function nr(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function rr(e){let[t,n]=s.useState(void 0);return L(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var ir=[`top`,`right`,`bottom`,`left`],H=Math.min,U=Math.max,ar=Math.round,or=Math.floor,W=e=>({x:e,y:e}),sr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function cr(e,t,n){return U(e,H(t,n))}function G(e,t){return typeof e==`function`?e(t):e}function K(e){return e.split(`-`)[0]}function lr(e){return e.split(`-`)[1]}function ur(e){return e===`x`?`y`:`x`}function dr(e){return e===`y`?`height`:`width`}function q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function fr(e){return ur(q(e))}function pr(e,t,n){n===void 0&&(n=!1);let r=lr(e),i=fr(e),a=dr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Sr(o)),[o,Sr(o)]}function mr(e){let t=Sr(e);return[hr(e),t,hr(t)]}function hr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var gr=[`left`,`right`],_r=[`right`,`left`],vr=[`top`,`bottom`],yr=[`bottom`,`top`];function br(e,t,n){switch(e){case`top`:case`bottom`:return n?t?_r:gr:t?gr:_r;case`left`:case`right`:return t?vr:yr;default:return[]}}function xr(e,t,n,r){let i=lr(e),a=br(K(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(hr)))),a}function Sr(e){let t=K(e);return sr[t]+e.slice(t.length)}function Cr(e){return{top:0,right:0,bottom:0,left:0,...e}}function wr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Cr(e)}function Tr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Er(e,t,n){let{reference:r,floating:i}=e,a=q(t),o=fr(t),s=dr(o),c=K(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(lr(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Dr(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=G(t,e),p=wr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Tr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Tr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Or=50,kr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Dr},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Er(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Or&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Er(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ar=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=G(e,t)||{};if(l==null)return{};let d=wr(u),f={x:n,y:r},p=fr(i),m=dr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=H(d[_],T),D=H(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=cr(O,A,k),M=!c.arrow&&lr(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),jr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=G(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=K(r),_=q(o),v=K(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Sr(o)]:mr(o)),x=p!==`none`;!d&&x&&b.push(...xr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=pr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==q(t))||T.every(e=>q(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Mr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Nr(e){return ir.some(t=>e[t]>=0)}var Pr=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G(e,t);switch(i){case`referenceHidden`:{let e=Mr(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Nr(e)}}}case`escaped`:{let e=Mr(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Nr(e)}}}default:return{}}}}};function Fr(e){let t=H(...e.map(e=>e.left)),n=H(...e.map(e=>e.top)),r=U(...e.map(e=>e.right)),i=U(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Ir(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>Tr(Fr(e)))}var Lr=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=G(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=Ir(u),f=Tr(Fr(u)),p=wr(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(q(n)===`y`){let e=d[0],t=d[d.length-1],r=K(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=K(n)===`left`,t=U(...d.map(e=>e.right)),r=H(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Rr=new Set([`left`,`top`]);async function zr(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=K(n),s=lr(n),c=q(n)===`y`,l=Rr.has(o)?-1:1,u=a&&c?-1:1,d=G(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Br=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await zr(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Vr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=G(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=q(K(i)),p=ur(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=cr(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=cr(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Hr=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=G(e,t),u={x:n,y:r},d=q(i),f=ur(d),p=u[f],m=u[d],h=G(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Rr.has(K(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ur=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=G(e,t),u=await o.detectOverflow(t,l),d=K(i),f=lr(i),p=q(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=H(h-u[g],v),x=H(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=U(u.left,0),t=U(u.right,0),n=U(u.top,0),r=U(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:U(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:U(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Wr(){return typeof window<`u`}function Gr(e){return Kr(e)?(e.nodeName||``).toLowerCase():`#document`}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Y(e){return((Kr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Kr(e){return Wr()?e instanceof Node||e instanceof J(e).Node:!1}function X(e){return Wr()?e instanceof Element||e instanceof J(e).Element:!1}function Z(e){return Wr()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function qr(e){return!Wr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function Jr(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Yr(e){return/^(table|td|th)$/.test(Gr(e))}function Xr(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Zr=/transform|translate|scale|rotate|perspective|filter/,Qr=/paint|layout|strict|content/,$r=e=>!!e&&e!==`none`,ei;function ti(e){let t=X(e)?Q(e):e;return $r(t.transform)||$r(t.translate)||$r(t.scale)||$r(t.rotate)||$r(t.perspective)||!ri()&&($r(t.backdropFilter)||$r(t.filter))||Zr.test(t.willChange||``)||Qr.test(t.contain||``)}function ni(e){let t=oi(e);for(;Z(t)&&!ii(t);){if(ti(t))return t;if(Xr(t))return null;t=oi(t)}return null}function ri(){return ei??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ei}function ii(e){return/^(html|body|#document)$/.test(Gr(e))}function Q(e){return J(e).getComputedStyle(e)}function ai(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oi(e){if(Gr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||qr(e)&&e.host||Y(e);return qr(t)?t.host:t}function si(e){let t=oi(e);return ii(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&Jr(t)?t:si(t)}function ci(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=si(e),i=r===e.ownerDocument?.body,a=J(r);if(i){let e=li(a);return t.concat(a,a.visualViewport||[],Jr(r)?r:[],e&&n?ci(e):[])}else return t.concat(r,ci(r,[],n))}function li(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ui(e){let t=Q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Z(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ar(n)!==a||ar(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function di(e){return X(e)?e:e.contextElement}function fi(e){let t=di(e);if(!Z(t))return W(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ui(t),o=(a?ar(n.width):n.width)/r,s=(a?ar(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var pi=W(0);function mi(e){let t=J(e);return!ri()||!t.visualViewport?pi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==J(e)?!1:t}function gi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=di(e),o=W(1);t&&(r?X(r)&&(o=fi(r)):o=fi(e));let s=hi(a,n,r)?mi(a):W(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=J(a),t=r&&X(r)?J(r):r,n=e,i=li(n);for(;i&&r&&t!==n;){let e=fi(i),t=i.getBoundingClientRect(),r=Q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=J(i),i=li(n)}}return Tr({width:u,height:d,x:c,y:l})}function _i(e,t){let n=ai(e).scrollLeft;return t?t.left+n:gi(Y(e)).left+n}function vi(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_i(e,n),y:n.top+t.scrollTop}}function yi(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Y(r),s=t?Xr(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=W(1),u=W(0),d=Z(r);if((d||!d&&!a)&&((Gr(r)!==`body`||Jr(o))&&(c=ai(r)),d)){let e=gi(r);l=fi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?vi(o,c):W(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function bi(e){return Array.from(e.getClientRects())}function xi(e){let t=Y(e),n=ai(e),r=e.ownerDocument.body,i=U(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=U(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+_i(e),s=-n.scrollTop;return Q(r).direction===`rtl`&&(o+=U(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Si=25;function Ci(e,t){let n=J(e),r=Y(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ri();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=_i(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Si&&(a-=o)}else l<=Si&&(a+=l);return{width:a,height:o,x:s,y:c}}function wi(e,t){let n=gi(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Z(e)?fi(e):W(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ti(e,t,n){let r;if(t===`viewport`)r=Ci(e,n);else if(t===`document`)r=xi(Y(e));else if(X(t))r=wi(t,n);else{let n=mi(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Tr(r)}function Ei(e,t){let n=oi(e);return n===t||!X(n)||ii(n)?!1:Q(n).position===`fixed`||Ei(n,t)}function Di(e,t){let n=t.get(e);if(n)return n;let r=ci(e,[],!1).filter(e=>X(e)&&Gr(e)!==`body`),i=null,a=Q(e).position===`fixed`,o=a?oi(e):e;for(;X(o)&&!ii(o);){let t=Q(o),n=ti(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Jr(o)&&!n&&Ei(e,o))?r=r.filter(e=>e!==o):i=t,o=oi(o)}return t.set(e,r),r}function Oi(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Xr(t)?[]:Di(t,this._c):[].concat(n),r],o=Ti(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ti(t,a[e],i);s=U(n.top,s),c=H(n.right,c),l=H(n.bottom,l),u=U(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ki(e){let{width:t,height:n}=ui(e);return{width:t,height:n}}function Ai(e,t,n){let r=Z(t),i=Y(t),a=n===`fixed`,o=gi(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=W(0);function l(){c.x=_i(i)}if(r||!r&&!a)if((Gr(t)!==`body`||Jr(i))&&(s=ai(t)),r){let e=gi(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?vi(i,s):W(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ji(e){return Q(e).position===`static`}function Mi(e,t){if(!Z(e)||Q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Y(e)===n&&(n=n.ownerDocument.body),n}function Ni(e,t){let n=J(e);if(Xr(e))return n;if(!Z(e)){let t=oi(e);for(;t&&!ii(t);){if(X(t)&&!ji(t))return t;t=oi(t)}return n}let r=Mi(e,t);for(;r&&Yr(r)&&ji(r);)r=Mi(r,t);return r&&ii(r)&&ji(r)&&!ti(r)?n:r||ni(e)||n}var Pi=async function(e){let t=this.getOffsetParent||Ni,n=this.getDimensions,r=await n(e.floating);return{reference:Ai(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fi(e){return Q(e).direction===`rtl`}var Ii={convertOffsetParentRelativeRectToViewportRelativeRect:yi,getDocumentElement:Y,getClippingRect:Oi,getOffsetParent:Ni,getElementRects:Pi,getClientRects:bi,getDimensions:ki,getScale:fi,isElement:X,isRTL:Fi};function Li(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ri(e,t){let n=null,r,i=Y(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=or(d),h=or(i.clientWidth-(u+f)),g=or(i.clientHeight-(d+p)),_=or(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:U(0,H(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Li(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function zi(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=di(e),u=i||a?[...l?ci(l):[],...t?ci(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ri(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?gi(e):null;c&&g();function g(){let t=gi(e);h&&!Li(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Bi=Br,Vi=Vr,Hi=jr,Ui=Ur,Wi=Pr,Gi=Ar,Ki=Lr,qi=Hr,Ji=(e,t,n)=>{let r=new Map,i={platform:Ii,...n},a={...i.platform,_c:r};return kr(e,t,{...i,platform:a})},Yi=typeof document<`u`?s.useLayoutEffect:function(){};function Xi(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 n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xi(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Xi(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Zi(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qi(e,t){let n=Zi(e);return Math.round(t*n)/n}function $i(e){let t=s.useRef(e);return Yi(()=>{t.current=e}),t}function ea(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=s.useState(r);Xi(p,r)||m(r);let[h,g]=s.useState(null),[_,v]=s.useState(null),y=s.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=s.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),x=a||h,S=o||_,C=s.useRef(null),T=s.useRef(null),E=s.useRef(d),D=l!=null,O=$i(l),k=$i(i),A=$i(u),j=s.useCallback(()=>{if(!C.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),Ji(C.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Xi(E.current,t)&&(E.current=t,w.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Yi(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=s.useRef(!1);Yi(()=>(M.current=!0,()=>{M.current=!1}),[]),Yi(()=>{if(x&&(C.current=x),S&&(T.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=s.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:b}),[y,b]),P=s.useMemo(()=>({reference:x,floating:S}),[x,S]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Qi(P.floating,d.x),r=Qi(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Zi(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var ta=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Gi({element:r.current,padding:i}).fn(n):r?Gi({element:r,padding:i}).fn(n):{}}}},na=(e,t)=>{let n=Bi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ra=(e,t)=>{let n=Vi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ia=(e,t)=>({fn:qi(e).fn,options:[e,t]}),aa=(e,t)=>{let n=Hi(e);return{name:n.name,fn:n.fn,options:[e,t]}},oa=(e,t)=>{let n=Ui(e);return{name:n.name,fn:n.fn,options:[e,t]}},sa=(e,t)=>{let n=Wi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ca=(e,t)=>{let n=ta(e);return{name:n.name,fn:n.fn,options:[e,t]}},la=`Arrow`,ua=s.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,T.jsx)(E.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,T.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ua.displayName=la;var da=ua,fa=`Popper`,[pa,ma]=N(fa),[ha,ga]=pa(fa),_a=e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null);return(0,T.jsx)(ha,{scope:t,anchor:r,onAnchorChange:i,children:n})};_a.displayName=fa;var va=`PopperAnchor`,ya=s.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=ga(va,n),c=s.useRef(null),l=o(t,c),u=s.useRef(null);return s.useEffect(()=>{let e=u.current;u.current=r?.current||c.current,e!==u.current&&a.onAnchorChange(u.current)}),r?null:(0,T.jsx)(E.div,{...i,ref:l})});ya.displayName=va;var ba=`PopperContent`,[xa,Sa]=pa(ba),Ca=s.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=ga(ba,n),[y,b]=s.useState(null),x=o(t,e=>b(e)),[S,C]=s.useState(null),w=rr(S),D=w?.width??0,O=w?.height??0,k=r+(a===`center`?``:`-`+a),A=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:A,boundary:j.filter(Da),altBoundary:M},{refs:P,floatingStyles:F,placement:I,isPositioned:R,middlewareData:z}=ea({strategy:`fixed`,placement:k,whileElementsMounted:(...e)=>zi(...e,{animationFrame:h===`always`}),elements:{reference:v.anchor},middleware:[na({mainAxis:i+O,alignmentAxis:c}),u&&ra({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?ia():void 0,...N}),u&&aa({...N}),oa({...N,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),S&&ca({element:S,padding:l}),Oa({arrowWidth:D,arrowHeight:O}),m&&sa({strategy:`referenceHidden`,...N})]}),[ee,te]=ka(I),ne=fe(g);L(()=>{R&&ne?.()},[R,ne]);let re=z.arrow?.x,ie=z.arrow?.y,ae=z.arrow?.centerOffset!==0,[oe,se]=s.useState();return L(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),(0,T.jsx)(`div`,{ref:P.setFloating,"data-radix-popper-content-wrapper":``,style:{...F,transform:R?F.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,T.jsx)(xa,{scope:n,placedSide:ee,onArrowChange:C,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,T.jsx)(E.div,{"data-side":ee,"data-align":te,..._,ref:x,style:{..._.style,animation:R?void 0:`none`}})})})});Ca.displayName=ba;var wa=`PopperArrow`,Ta={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ea=s.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Sa(wa,n),a=Ta[i.placedSide];return(0,T.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,T.jsx)(da,{...r,ref:t,style:{...r.style,display:`block`}})})});Ea.displayName=wa;function Da(e){return e!==null}var Oa=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ka(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function ka(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Aa=_a,ja=ya,Ma=Ca,Na=Ea,Pa=`Label`,Fa=s.forwardRef((e,t)=>(0,T.jsx)(E.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Fa.displayName=Pa;var Ia=Fa;function La(e,[t,n]){return Math.min(n,Math.max(t,e))}var Ra=[` `,`Enter`,`ArrowUp`,`ArrowDown`],za=[` `,`Enter`],Ba=`Select`,[Va,Ha,Ua]=F(Ba),[Wa,Ga]=N(Ba,[Ua,ma]),Ka=ma(),[qa,Ja]=Wa(Ba),[Ya,Xa]=Wa(Ba),Za=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:h}=e,g=Ka(t),[_,v]=s.useState(null),[y,b]=s.useState(null),[x,S]=s.useState(!1),C=de(u),[w,E]=z({prop:r,defaultProp:i??!1,onChange:a,caller:Ba}),[D,O]=z({prop:o,defaultProp:c,onChange:l,caller:Ba}),k=s.useRef(null),A=_?h||!!_.closest(`form`):!0,[j,M]=s.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,T.jsx)(Aa,{...g,children:(0,T.jsxs)(qa,{required:m,scope:t,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:le(),value:D,onValueChange:O,open:w,onOpenChange:E,dir:C,triggerPointerDownPosRef:k,disabled:p,children:[(0,T.jsx)(Va.Provider,{scope:t,children:(0,T.jsx)(Ya,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:s.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,T.jsxs)(Ko,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:e=>O(e.target.value),disabled:p,form:h,children:[D===void 0?(0,T.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Za.displayName=Ba;var Qa=`SelectTrigger`,$a=s.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Ka(n),c=Ja(Qa,n),l=c.disabled||r,u=o(t,c.onTriggerChange),d=Ha(n),f=s.useRef(`touch`),[p,m,h]=Jo(e=>{let t=d().filter(e=>!e.disabled),n=Yo(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,T.jsx)(ja,{asChild:!0,...a,children:(0,T.jsx)(E.button,{type:`button`,role:`combobox`,"aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":`none`,dir:c.dir,"data-state":c.open?`open`:`closed`,disabled:l,"data-disabled":l?``:void 0,"data-placeholder":qo(c.value)?``:void 0,...i,ref:u,onClick:I(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:I(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:I(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&Ra.includes(e.key)&&(g(),e.preventDefault())})})})});$a.displayName=Qa;var eo=`SelectValue`,to=s.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:s=``,...c}=e,l=Ja(eo,n),{onValueNodeHasChildrenChange:u}=l,d=a!==void 0,f=o(t,l.onValueNodeChange);return L(()=>{u(d)},[u,d]),(0,T.jsx)(E.span,{...c,ref:f,style:{pointerEvents:`none`},children:qo(l.value)?(0,T.jsx)(T.Fragment,{children:s}):a})});to.displayName=eo;var no=`SelectIcon`,ro=s.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,T.jsx)(E.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ro.displayName=no;var io=`SelectPortal`,ao=e=>(0,T.jsx)(We,{asChild:!0,...e});ao.displayName=io;var oo=`SelectContent`,so=s.forwardRef((e,t)=>{let n=Ja(oo,e.__scopeSelect),[r,i]=s.useState();if(L(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?w.createPortal((0,T.jsx)(co,{scope:e.__scopeSelect,children:(0,T.jsx)(Va.Slot,{scope:e.__scopeSelect,children:(0,T.jsx)(`div`,{children:e.children})})}),t):null}return(0,T.jsx)(po,{...e,ref:t})});so.displayName=oo;var $=10,[co,lo]=Wa(oo),uo=`SelectContentImpl`,fo=a(`SelectContent.RemoveScroll`),po=s.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=Ja(oo,n),[x,S]=s.useState(null),[C,w]=s.useState(null),E=o(t,e=>S(e)),[D,O]=s.useState(null),[k,A]=s.useState(null),j=Ha(n),[M,N]=s.useState(!1),P=s.useRef(!1);s.useEffect(()=>{if(x)return mn(x)},[x]),Ke();let F=s.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,C]),L=s.useCallback(()=>F([D,x]),[F,D,x]);s.useEffect(()=>{M&&L()},[M,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=b;s.useEffect(()=>{if(x){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null};return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,R,z]),s.useEffect(()=>{let e=()=>R(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[ee,te]=Jo(e=>{let t=j().filter(e=>!e.disabled),n=Yo(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=s.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&(O(e),r&&(P.current=!0))},[b.value]),re=s.useCallback(()=>x?.focus(),[x]),ie=s.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&A(e)},[b.value]),ae=r===`popper`?_o:ho,oe=ae===_o?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,T.jsx)(co,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:ne,selectedItem:D,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:L,selectedItemText:k,position:r,isPositioned:M,searchRef:ee,children:(0,T.jsx)(an,{as:fo,allowPinchZoom:!0,children:(0,T.jsx)(je,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:I(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,T.jsx)(be,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,T.jsx)(ae,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...oe,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:I(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});po.displayName=uo;var mo=`SelectItemAlignedPosition`,ho=s.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Ja(oo,n),c=lo(oo,n),[l,u]=s.useState(null),[d,f]=s.useState(null),p=o(t,e=>f(e)),m=Ha(n),h=s.useRef(!1),g=s.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=c,x=s.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-$,d=La(a,[$,Math.max($,u-c)]);l.style.minWidth=s+`px`,l.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-$,d=La(a,[$,Math.max($,u-c)]);l.style.minWidth=s+`px`,l.style.right=d+`px`}let o=m(),s=window.innerHeight-$*2,c=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),b=parseInt(u.paddingBottom,10),x=f+p+c+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-$,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;l.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);l.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;l.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;l.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}l.style.margin=`${$}px 0`,l.style.minHeight=S+`px`,l.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,l,d,_,v,y,a.dir,r]);L(()=>x(),[x]);let[S,C]=s.useState();return L(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]),(0,T.jsx)(vo,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:s.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]),children:(0,T.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,T.jsx)(E.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});ho.displayName=mo;var go=`SelectPopperPosition`,_o=s.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=Ka(n);return(0,T.jsx)(Ma,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});_o.displayName=go;var[vo,yo]=Wa(oo,{}),bo=`SelectViewport`,xo=s.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=lo(bo,n),c=yo(bo,n),l=o(t,a.onViewportChange),u=s.useRef(0);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,T.jsx)(Va.Slot,{scope:n,children:(0,T.jsx)(E.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:I(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});xo.displayName=bo;var So=`SelectGroup`,[Co,wo]=Wa(So),To=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=le();return(0,T.jsx)(Co,{scope:n,id:i,children:(0,T.jsx)(E.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});To.displayName=So;var Eo=`SelectLabel`,Do=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=wo(Eo,n);return(0,T.jsx)(E.div,{id:i.id,...r,ref:t})});Do.displayName=Eo;var Oo=`SelectItem`,[ko,Ao]=Wa(Oo),jo=s.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...c}=e,l=Ja(Oo,n),u=lo(Oo,n),d=l.value===r,[f,p]=s.useState(a??``),[m,h]=s.useState(!1),g=o(t,e=>u.itemRefCallback?.(e,r,i)),_=le(),v=s.useRef(`touch`),y=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,T.jsx)(ko,{scope:n,value:r,disabled:i,textId:_,isSelected:d,onItemTextChange:s.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,T.jsx)(Va.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,T.jsx)(E.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:I(c.onFocus,()=>h(!0)),onBlur:I(c.onBlur,()=>h(!1)),onClick:I(c.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:I(c.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:I(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:I(c.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:I(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:I(c.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(za.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})});jo.displayName=Oo;var Mo=`SelectItemText`,No=s.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,c=Ja(Mo,n),l=lo(Mo,n),u=Ao(Mo,n),d=Xa(Mo,n),[f,p]=s.useState(null),m=o(t,e=>p(e),u.onItemTextChange,e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),h=f?.textContent,g=s.useMemo(()=>(0,T.jsx)(`option`,{value:u.value,disabled:u.disabled,children:h},u.value),[u.disabled,u.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=d;return L(()=>(_(g),()=>v(g)),[_,v,g]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(E.span,{id:u.textId,...a,ref:m}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?w.createPortal(a.children,c.valueNode):null]})});No.displayName=Mo;var Po=`SelectItemIndicator`,Fo=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ao(Po,n).isSelected?(0,T.jsx)(E.span,{"aria-hidden":!0,...r,ref:t}):null});Fo.displayName=Po;var Io=`SelectScrollUpButton`,Lo=s.forwardRef((e,t)=>{let n=lo(Io,e.__scopeSelect),r=yo(Io,e.__scopeSelect),[i,a]=s.useState(!1),c=o(t,r.onScrollButtonChange);return L(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,T.jsx)(Bo,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Lo.displayName=Io;var Ro=`SelectScrollDownButton`,zo=s.forwardRef((e,t)=>{let n=lo(Ro,e.__scopeSelect),r=yo(Ro,e.__scopeSelect),[i,a]=s.useState(!1),c=o(t,r.onScrollButtonChange);return L(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,T.jsx)(Bo,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});zo.displayName=Ro;var Bo=s.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=lo(`SelectScrollButton`,n),o=s.useRef(null),c=Ha(n),l=s.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return s.useEffect(()=>()=>l(),[l]),L(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,T.jsx)(E.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:I(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:I(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:I(i.onPointerLeave,()=>{l()})})}),Vo=`SelectSeparator`,Ho=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,T.jsx)(E.div,{"aria-hidden":!0,...r,ref:t})});Ho.displayName=Vo;var Uo=`SelectArrow`,Wo=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ka(n),a=Ja(Uo,n),o=lo(Uo,n);return a.open&&o.position===`popper`?(0,T.jsx)(Na,{...i,...r,ref:t}):null});Wo.displayName=Uo;var Go=`SelectBubbleInput`,Ko=s.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=s.useRef(null),a=o(r,i),c=nr(t);return s.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(c!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[c,t]),(0,T.jsx)(E.select,{...n,style:{...O,...n.style},ref:a,defaultValue:t})});Ko.displayName=Go;function qo(e){return e===``||e===void 0}function Jo(e){let t=fe(e),n=s.useRef(``),r=s.useRef(0),i=s.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=s.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Yo(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Xo(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Xo(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Zo=Za,Qo=$a,$o=to,es=ro,ts=ao,ns=so,rs=xo,is=jo,as=No,os=Fo,ss=Lo,cs=zo;function ls({...e}){return(0,T.jsx)(Jn,{"data-slot":`dialog`,...e})}function us({...e}){return(0,T.jsx)(Yn,{"data-slot":`dialog-trigger`,...e})}function ds({...e}){return(0,T.jsx)(Xn,{"data-slot":`dialog-portal`,...e})}function fs({className:e,...t}){return(0,T.jsx)(Zn,{"data-slot":`dialog-overlay`,className:r(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-1001 bg-black/50`,e),...t})}function ps({className:e,children:t,showCloseButton:n=!0,...i}){return(0,T.jsxs)(ds,{"data-slot":`dialog-portal`,children:[(0,T.jsx)(fs,{}),(0,T.jsxs)(Qn,{"data-slot":`dialog-content`,className:r(`bg-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-1001 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-gray-200 p-6 shadow-lg duration-200 sm:max-w-lg dark:bg-gray-950 dark:border-gray-800`,e),...i,children:[t,n&&(0,T.jsxs)(tr,{"data-slot":`dialog-close`,className:`ring-offset-white focus:ring-gray-950 data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500 absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:ring-offset-gray-950 dark:focus:ring-gray-300 dark:data-[state=open]:bg-gray-800 dark:data-[state=open]:text-gray-400`,children:[(0,T.jsx)(C,{}),(0,T.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function ms({className:e,...t}){return(0,T.jsx)(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function hs({className:e,...t}){return(0,T.jsx)(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function gs({className:e,...t}){return(0,T.jsx)($n,{"data-slot":`dialog-title`,className:r(`text-lg leading-none font-semibold`,e),...t})}function _s({className:e,...t}){return(0,T.jsx)(er,{"data-slot":`dialog-description`,className:r(`text-gray-500 text-sm dark:text-gray-400`,e),...t})}function vs({className:e,...t}){return(0,T.jsx)(Ia,{"data-slot":`label`,className:r(`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})}function ys({...e}){return(0,T.jsx)(Zo,{"data-slot":`select`,...e})}function bs({...e}){return(0,T.jsx)($o,{"data-slot":`select-value`,...e})}function xs({className:e,size:t=`default`,children:n,...i}){return(0,T.jsxs)(Qo,{"data-slot":`select-trigger`,"data-size":t,className:r(`border-gray-200 data-[placeholder]:text-gray-500 [&_svg:not([class*='text-'])]:text-gray-500 focus-visible:border-gray-950 focus-visible:ring-gray-950/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:bg-gray-200/30 dark:hover:bg-gray-200/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:border-gray-800 dark:data-[placeholder]:text-gray-400 dark:[&_svg:not([class*='text-'])]:text-gray-400 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900 dark:dark:bg-gray-800/30 dark:dark:hover:bg-gray-800/50`,e),...i,children:[n,(0,T.jsx)(es,{asChild:!0,children:(0,T.jsx)(y,{className:`size-4 opacity-50`})})]})}function Ss({className:e,children:t,position:n=`popper`,...i}){return(0,T.jsx)(ts,{children:(0,T.jsxs)(ns,{"data-slot":`select-content`,className:r(`bg-white text-gray-950 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-1001 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-gray-200 shadow-md dark:bg-gray-950 dark:text-gray-50 dark:border-gray-800`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...i,children:[(0,T.jsx)(ws,{}),(0,T.jsx)(rs,{className:r(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,T.jsx)(Ts,{})]})})}function Cs({className:e,children:t,...n}){return(0,T.jsxs)(is,{"data-slot":`select-item`,className:r(`focus:bg-gray-100 focus:text-gray-900 [&_svg:not([class*='text-'])]:text-gray-500 relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 dark:focus:bg-gray-800 dark:focus:text-gray-50 dark:[&_svg:not([class*='text-'])]:text-gray-400`,e),...n,children:[(0,T.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(os,{children:(0,T.jsx)(v,{className:`size-4`})})}),(0,T.jsx)(as,{children:t})]})}function ws({className:e,...t}){return(0,T.jsx)(ss,{"data-slot":`select-scroll-up-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,T.jsx)(x,{className:`size-4`})})}function Ts({className:e,...t}){return(0,T.jsx)(cs,{"data-slot":`select-scroll-down-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,T.jsx)(y,{className:`size-4`})})}export{de as $,rr as A,Un as B,Hi as C,Vi as D,Bi as E,Zn as F,Xe as G,mn as H,Xn as I,Ke as J,Ze as K,Jn as L,tr as M,Qn as N,Ui as O,er as P,fe as Q,$n as R,Ji as S,qi as T,an as U,_n as V,Ye as W,je as X,We as Y,be as Z,Ma as _,bs as a,F as at,Gi as b,ps as c,E as ct,ms as d,S as dt,le as et,gs as f,x as ft,Na as g,_ as gt,ja as h,v as ht,xs as i,I as it,nr as j,ci as k,_s as l,D as lt,La as m,y as mt,Ss as n,z as nt,vs as o,N as ot,us as p,b as pt,Qe as q,Cs as r,L as rt,ls as s,j as st,ys as t,re as tt,hs as u,C as ut,Aa as v,Ki as w,zi as x,ma as y,Yn as z};