@buildbase/sdk 0.0.24 โ 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +0 -1
- package/dist/index.js +0 -1
- package/package.json +3 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/api/currency-utils.d.ts +0 -44
- package/dist/types/api/index.d.ts +0 -12
- package/dist/types/api/pricing-variant-utils.d.ts +0 -66
- package/dist/types/api/quota-utils.d.ts +0 -24
- package/dist/types/api/types.d.ts +0 -495
- package/dist/types/components/ErrorBoundary.d.ts +0 -81
- package/dist/types/components/beta/BetaForm.d.ts +0 -24
- package/dist/types/components/beta/api.d.ts +0 -48
- package/dist/types/components/beta/hooks.d.ts +0 -11
- package/dist/types/components/beta/schema.d.ts +0 -6
- package/dist/types/components/beta/types.d.ts +0 -8
- package/dist/types/components/dropdowns/country/countries.d.ts +0 -7
- package/dist/types/components/dropdowns/country/selectCountry.d.ts +0 -6
- package/dist/types/components/dropdowns/currency/currencies.d.ts +0 -6
- package/dist/types/components/dropdowns/currency/selectCurrency.d.ts +0 -6
- package/dist/types/components/dropdowns/language/languages.d.ts +0 -6
- package/dist/types/components/dropdowns/language/selectLanguage.d.ts +0 -6
- package/dist/types/components/dropdowns/timezone/selectTimeZone.d.ts +0 -6
- package/dist/types/components/dropdowns/timezone/timezones.d.ts +0 -8
- package/dist/types/components/features/index.d.ts +0 -130
- package/dist/types/components/pricing/PricingPage.d.ts +0 -49
- package/dist/types/components/pricing/index.d.ts +0 -2
- package/dist/types/components/quota/index.d.ts +0 -121
- package/dist/types/components/subscription/index.d.ts +0 -182
- package/dist/types/components/ui/alert-dialog.d.ts +0 -20
- package/dist/types/components/ui/avatar.d.ts +0 -6
- package/dist/types/components/ui/button.d.ts +0 -18
- package/dist/types/components/ui/command-select.d.ts +0 -13
- package/dist/types/components/ui/command.d.ts +0 -82
- package/dist/types/components/ui/dialog.d.ts +0 -19
- package/dist/types/components/ui/form.d.ts +0 -23
- package/dist/types/components/ui/input.d.ts +0 -5
- package/dist/types/components/ui/label.d.ts +0 -5
- package/dist/types/components/ui/popover.d.ts +0 -6
- package/dist/types/components/ui/radio-group.d.ts +0 -5
- package/dist/types/components/ui/scroll-area.d.ts +0 -5
- package/dist/types/components/ui/select.d.ts +0 -11
- package/dist/types/components/ui/separator.d.ts +0 -4
- package/dist/types/components/ui/skeleton.d.ts +0 -3
- package/dist/types/components/ui/switch.d.ts +0 -4
- package/dist/types/components/user/auth.d.ts +0 -76
- package/dist/types/components/user/role.d.ts +0 -84
- package/dist/types/contexts/AuthContext/AuthContext.d.ts +0 -9
- package/dist/types/contexts/AuthContext/actions.d.ts +0 -12
- package/dist/types/contexts/AuthContext/index.d.ts +0 -4
- package/dist/types/contexts/AuthContext/reducer.d.ts +0 -19
- package/dist/types/contexts/AuthContext/types.d.ts +0 -18
- package/dist/types/contexts/OSContext/OSContext.d.ts +0 -9
- package/dist/types/contexts/OSContext/actions.d.ts +0 -11
- package/dist/types/contexts/OSContext/index.d.ts +0 -4
- package/dist/types/contexts/OSContext/reducer.d.ts +0 -11
- package/dist/types/contexts/OSContext/types.d.ts +0 -16
- package/dist/types/contexts/QuotaUsageContext/QuotaUsageContext.d.ts +0 -22
- package/dist/types/contexts/QuotaUsageContext/index.d.ts +0 -2
- package/dist/types/contexts/QuotaUsageContext/quotaUsageInvalidation.d.ts +0 -21
- package/dist/types/contexts/QuotaUsageContext/types.d.ts +0 -14
- package/dist/types/contexts/SDKContext/SDKContextProvider.d.ts +0 -18
- package/dist/types/contexts/SDKContext/index.d.ts +0 -2
- package/dist/types/contexts/SDKContext/types.d.ts +0 -12
- package/dist/types/contexts/SubscriptionContext/SubscriptionContext.d.ts +0 -22
- package/dist/types/contexts/SubscriptionContext/index.d.ts +0 -2
- package/dist/types/contexts/SubscriptionContext/subscriptionInvalidation.d.ts +0 -21
- package/dist/types/contexts/SubscriptionContext/types.d.ts +0 -14
- package/dist/types/contexts/WorkspaceContext/WorkspaceContext.d.ts +0 -8
- package/dist/types/contexts/WorkspaceContext/actions.d.ts +0 -19
- package/dist/types/contexts/WorkspaceContext/index.d.ts +0 -4
- package/dist/types/contexts/WorkspaceContext/reducer.d.ts +0 -10
- package/dist/types/contexts/WorkspaceContext/types.d.ts +0 -52
- package/dist/types/contexts/index.d.ts +0 -14
- package/dist/types/contexts/shared/createContext.d.ts +0 -27
- package/dist/types/contexts/shared/types.d.ts +0 -21
- package/dist/types/contexts/shared/useAppDispatch.d.ts +0 -20
- package/dist/types/contexts/shared/useAppSelector.d.ts +0 -26
- package/dist/types/contexts/shared/useSelectWithEquality.d.ts +0 -10
- package/dist/types/contexts/shared/utils/reducerHelpers.d.ts +0 -11
- package/dist/types/contexts/shared/utils/storage.d.ts +0 -25
- package/dist/types/hooks/use-seat-status.d.ts +0 -42
- package/dist/types/hooks/use-trial-status.d.ts +0 -28
- package/dist/types/index.d.ts +0 -39
- package/dist/types/lib/api-base.d.ts +0 -49
- package/dist/types/lib/api-client.d.ts +0 -25
- package/dist/types/lib/api-utils.d.ts +0 -182
- package/dist/types/lib/error-handler.d.ts +0 -118
- package/dist/types/lib/logger.d.ts +0 -27
- package/dist/types/lib/useAsyncEffect.d.ts +0 -29
- package/dist/types/lib/utils.d.ts +0 -7
- package/dist/types/providers/ContextConfigProvider.d.ts +0 -15
- package/dist/types/providers/PortalContainer.d.ts +0 -9
- package/dist/types/providers/SaaSOSProvider.d.ts +0 -7
- package/dist/types/providers/auth/api.d.ts +0 -12
- package/dist/types/providers/auth/hooks.d.ts +0 -75
- package/dist/types/providers/auth/provider.d.ts +0 -13
- package/dist/types/providers/auth/types.d.ts +0 -62
- package/dist/types/providers/auth/utils.d.ts +0 -40
- package/dist/types/providers/constants.d.ts +0 -3
- package/dist/types/providers/events/EventEmitter.d.ts +0 -81
- package/dist/types/providers/events/index.d.ts +0 -2
- package/dist/types/providers/events/types.d.ts +0 -61
- package/dist/types/providers/os/api.d.ts +0 -11
- package/dist/types/providers/os/hooks.d.ts +0 -50
- package/dist/types/providers/os/types.d.ts +0 -19
- package/dist/types/providers/types.d.ts +0 -9
- package/dist/types/providers/user/api.d.ts +0 -16
- package/dist/types/providers/user/hooks.d.ts +0 -80
- package/dist/types/providers/user/provider.d.ts +0 -17
- package/dist/types/providers/workspace/WorkspaceSettingsProvider.d.ts +0 -9
- package/dist/types/providers/workspace/api.d.ts +0 -155
- package/dist/types/providers/workspace/hooks.d.ts +0 -161
- package/dist/types/providers/workspace/provider.d.ts +0 -8
- package/dist/types/providers/workspace/settings-manager.d.ts +0 -36
- package/dist/types/providers/workspace/subscription-hooks.d.ts +0 -741
- package/dist/types/providers/workspace/types.d.ts +0 -61
- package/dist/types/providers/workspace/ui/SettingsDanger.d.ts +0 -6
- package/dist/types/providers/workspace/ui/SettingsDialog.d.ts +0 -17
- package/dist/types/providers/workspace/ui/SettingsFeatures.d.ts +0 -5
- package/dist/types/providers/workspace/ui/SettingsGeneral.d.ts +0 -6
- package/dist/types/providers/workspace/ui/SettingsInvoices.d.ts +0 -12
- package/dist/types/providers/workspace/ui/SettingsProfile.d.ts +0 -6
- package/dist/types/providers/workspace/ui/SettingsSubscription.d.ts +0 -6
- package/dist/types/providers/workspace/ui/SettingsUsage.d.ts +0 -3
- package/dist/types/providers/workspace/ui/SettingsUsers.d.ts +0 -6
- package/dist/types/providers/workspace/ui/Sidebar.d.ts +0 -10
- package/dist/types/providers/workspace/ui/Skeleton.d.ts +0 -1
- package/dist/types/providers/workspace/ui/SubscriptionDialog.d.ts +0 -21
- package/dist/types/providers/workspace/ui/utils.d.ts +0 -2
- package/dist/types/providers/workspace/utils.d.ts +0 -28
package/dist/index.esm.js
CHANGED
|
@@ -27,4 +27,3 @@ var Id={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
27
27
|
* This source code is licensed under the MIT license found in the
|
|
28
28
|
* LICENSE file in the root directory of this source tree.
|
|
29
29
|
*/function Em(){return Sm||(Sm=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=a,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useState,o=t.useEffect,s=t.useLayoutEffect,i=t.useDebugValue,l=!1,c=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(a,d){l||void 0===t.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var u=d();if(!c){var f=d();r(u,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=(f=n({inst:{value:u,getSnapshot:d}}))[0].inst,p=f[1];return s(function(){m.value=u,m.getSnapshot=d,e(m)&&p({inst:m})},[a,u,d]),o(function(){return e(m)&&p({inst:m}),a(function(){e(m)&&p({inst:m})})},[a]),i(u),u};Nm.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Nm}function Cm(){return km||(km=1,"production"===process.env.NODE_ENV?vm.exports=xm():vm.exports=Em()),vm.exports}var Am=Cm();function _m(){return()=>{}}var Tm="Avatar",[Rm]=function(e,r=[]){let a=[];const o=()=>{const t=a.map(e=>n.createContext(e));return function(r){const a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return o.scopeName=e,[function(r,o){const s=n.createContext(o);s.displayName=r+"Context";const i=a.length;a=[...a,o];const l=r=>{const{scope:a,children:o,...l}=r,c=a?.[e]?.[i]||s,d=n.useMemo(()=>l,Object.values(l));return t(c.Provider,{value:d,children:o})};return l.displayName=r+"Provider",[l,function(t,a){const l=a?.[e]?.[i]||s,c=n.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},pm(o,...r)]}(Tm),[Pm,Om]=Rm(Tm),Im=n.forwardRef((e,r)=>{const{__scopeAvatar:a,...o}=e,[s,i]=n.useState("idle");return t(Pm,{scope:a,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:t(ym.span,{...o,ref:r})})});Im.displayName=Tm;var Dm="AvatarImage",Um=n.forwardRef((e,r)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:s=()=>{},...i}=e,l=Om(Dm,a),c=function(e,{referrerPolicy:t,crossOrigin:r}){const a=Am.useSyncExternalStore(_m,()=>!0,()=>!1),o=n.useRef(null),s=a?(o.current||(o.current=new window.Image),o.current):null,[i,l]=n.useState(()=>Fm(s,e));return bm(()=>{l(Fm(s,e))},[s,e]),bm(()=>{const e=e=>()=>{l(e)};if(!s)return;const n=e("loaded"),a=e("error");return s.addEventListener("load",n),s.addEventListener("error",a),t&&(s.referrerPolicy=t),"string"==typeof r&&(s.crossOrigin=r),()=>{s.removeEventListener("load",n),s.removeEventListener("error",a)}},[s,r,t]),i}(o,i),d=hm(e=>{s(e),l.onImageLoadingStatusChange(e)});return bm(()=>{"idle"!==c&&d(c)},[c,d]),"loaded"===c?t(ym.img,{...i,ref:r,src:o}):null});Um.displayName=Dm;var Mm="AvatarFallback",zm=n.forwardRef((e,r)=>{const{__scopeAvatar:a,delayMs:o,...s}=e,i=Om(Mm,a),[l,c]=n.useState(void 0===o);return n.useEffect(()=>{if(void 0!==o){const e=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(e)}},[o]),l&&"loaded"!==i.imageLoadingStatus?t(ym.span,{...s,ref:r}):null});function Fm(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}zm.displayName=Mm;var Lm=Im,jm=Um,$m=zm;const Vm=n.forwardRef(({className:e,...r},n)=>t(Lm,{ref:n,className:je("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...r}));Vm.displayName=Lm.displayName;const Wm=n.forwardRef(({className:e,...r},n)=>t(jm,{ref:n,className:je("aspect-square h-full w-full",e),...r}));Wm.displayName=jm.displayName;const Bm=n.forwardRef(({className:e,...r},n)=>t($m,{ref:n,className:je("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...r}));function Gm(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Km(e,r=[]){let a=[];const o=()=>{const t=a.map(e=>n.createContext(e));return function(r){const a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return o.scopeName=e,[function(r,o){const s=n.createContext(o),i=a.length;a=[...a,o];const l=r=>{const{scope:a,children:o,...l}=r,c=a?.[e]?.[i]||s,d=n.useMemo(()=>l,Object.values(l));return t(c.Provider,{value:d,children:o})};return l.displayName=r+"Provider",[l,function(t,a){const l=a?.[e]?.[i]||s,c=n.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},Hm(o,...r)]}function Hm(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const a=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}Bm.displayName=$m.displayName;var Zm=n[" useId ".trim().toString()]||(()=>{}),qm=0;function Jm(e){const[t,r]=n.useState(Zm());return bm(()=>{r(e=>e??String(qm++))},[e]),e||(t?`radix-${t}`:"")}var Ym=n[" useInsertionEffect ".trim().toString()]||bm;function Xm({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){const[o,s,i]=function({defaultProp:e,onChange:t}){const[r,a]=n.useState(e),o=n.useRef(r),s=n.useRef(t);return Ym(()=>{s.current=t},[t]),n.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,a,s]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",r=l?"controlled":"uncontrolled";console.warn(`${a} is changing from ${t} to ${r}. 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=l},[l,a])}const d=n.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&i.current?.(r)}else s(t)},[l,e,s,i]);return[c,d]}function Qm(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(o.ref=t?gd(t,e):e),n.cloneElement(r,o)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ep=Symbol("radix.slottable");function tp(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ep}var rp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=function(e){const r=Qm(e),a=n.forwardRef((e,a)=>{const{children:o,...s}=e,i=n.Children.toArray(o),l=i.find(tp);if(l){const e=l.props.children,o=i.map(t=>t===l?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,o):null})}return t(r,{...s,ref:a,children:o})});return a.displayName=`${e}.Slot`,a}(`Primitive.${r}`),o=n.forwardRef((e,n)=>{const{asChild:o,...s}=e,i=o?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(i,{...s,ref:n})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});var np,ap="dismissableLayer.update",op="dismissableLayer.pointerDownOutside",sp="dismissableLayer.focusOutside",ip=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lp=n.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...d}=e,u=n.useContext(ip),[f,m]=n.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=n.useState({}),g=bd(r,e=>m(e)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=b.indexOf(y),w=f?b.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=v,k=function(e,t=globalThis?.document){const r=hm(e),a=n.useRef(!1),o=n.useRef(()=>{});return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){let n=function(){dp(op,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);a.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));S&&!r&&(s?.(e),l?.(e),e.defaultPrevented||c?.())},p),N=function(e,t=globalThis?.document){const r=hm(e),a=n.useRef(!1);return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){dp(sp,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(i?.(e),l?.(e),e.defaultPrevented||c?.())},p);return function(e,t=globalThis?.document){const r=hm(e);n.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===u.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),n.useEffect(()=>{if(f)return a&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(np=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),cp(),()=>{a&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=np)}},[f,p,a,u]),n.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),cp())},[f,u]),n.useEffect(()=>{const e=()=>h({});return document.addEventListener(ap,e),()=>document.removeEventListener(ap,e)},[]),t(rp.div,{...d,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:Gm(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Gm(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Gm(e.onPointerDownCapture,k.onPointerDownCapture)})});lp.displayName="DismissableLayer";function cp(){const e=new CustomEvent(ap);document.dispatchEvent(e)}function dp(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&v.flushSync(()=>e.dispatchEvent(t))}(a,o):a.dispatchEvent(o)}n.forwardRef((e,r)=>{const a=n.useContext(ip),o=n.useRef(null),s=bd(r,o);return n.useEffect(()=>{const e=o.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),t(rp.div,{...e,ref:s})}).displayName="DismissableLayerBranch";var up="focusScope.autoFocusOnMount",fp="focusScope.autoFocusOnUnmount",mp={bubbles:!1,cancelable:!0},pp=n.forwardRef((e,r)=>{const{loop:a=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[c,d]=n.useState(null),u=hm(s),f=hm(i),m=n.useRef(null),p=bd(r,e=>d(e)),h=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(o){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:yp(m.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||yp(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&yp(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,h.paused]),n.useEffect(()=>{if(c){vp.add(h);const t=document.activeElement;if(!c.contains(t)){const r=new CustomEvent(up,mp);c.addEventListener(up,u),c.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(yp(n,{select:t}),document.activeElement!==r)return}((e=hp(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&yp(c))}return()=>{c.removeEventListener(up,u),setTimeout(()=>{const e=new CustomEvent(fp,mp);c.addEventListener(fp,f),c.dispatchEvent(e),e.defaultPrevented||yp(t??document.body,{select:!0}),c.removeEventListener(fp,f),vp.remove(h)},0)}}var e},[c,u,f,h]);const g=n.useCallback(e=>{if(!a&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[n,o]=function(e){const t=hp(e),r=gp(t,e),n=gp(t.reverse(),e);return[r,n]}(t);n&&o?e.shiftKey||r!==o?e.shiftKey&&r===n&&(e.preventDefault(),a&&yp(o,{select:!0})):(e.preventDefault(),a&&yp(n,{select:!0})):r===t&&e.preventDefault()}},[a,o,h.paused]);return t(rp.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})});function hp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function gp(e,t){for(const r of e)if(!bp(r,{upTo:t}))return r}function bp(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function yp(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}pp.displayName="FocusScope";var vp=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=wp(e,t),e.unshift(t)},remove(t){e=wp(e,t),e[0]?.resume()}}}();function wp(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var xp=n.forwardRef((e,r)=>{const{container:a,...o}=e,[s,i]=n.useState(!1);bm(()=>i(!0),[]);const l=a||s&&globalThis?.document?.body;return l?w.createPortal(t(rp.div,{...o,ref:r}),l):null});xp.displayName="Portal";var Sp=e=>{const{present:t,children:r}=e,a=function(e){const[t,r]=n.useState(),a=n.useRef(null),o=n.useRef(e),s=n.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return n.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const e=kp(a.current);s.current="mounted"===l?e:"none"},[l]),bm(()=>{const t=a.current,r=o.current;if(r!==e){const n=s.current,a=kp(t);if(e)c("MOUNT");else if("none"===a||"none"===t?.display)c("UNMOUNT");else{c(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,c]),bm(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,n=n=>{const s=kp(a.current).includes(CSS.escape(n.animationName));if(n.target===t&&s&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},i=e=>{e.target===t&&(s.current=kp(a.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",n),t.addEventListener("animationend",n),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",n),t.removeEventListener("animationend",n)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:n.useCallback(e=>{a.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:a.isPresent}):n.Children.only(r),s=bd(a.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof r||a.isPresent?n.cloneElement(o,{ref:s}):null};function kp(e){return e?.animationName||"none"}Sp.displayName="Presence";var Np=0;function Ep(){n.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cp()),document.body.insertAdjacentElement("beforeend",e[1]??Cp()),Np++,()=>{1===Np&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Np--}},[])}function Cp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ap=function(){return Ap=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ap.apply(this,arguments)};function _p(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}"function"==typeof SuppressedError&&SuppressedError;var Tp="right-scroll-bar-position",Rp="width-before-scroll-bar";function Pp(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Op="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,Ip=new WeakMap;function Dp(e,t){var r,n,a,o=(r=null,n=function(t){return e.forEach(function(e){return Pp(e,t)})},(a=f(function(){return{value:r,callback:n,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=n,a.facade);return Op(function(){var t=Ip.get(o);if(t){var r=new Set(t),n=new Set(e),a=o.current;r.forEach(function(e){n.has(e)||Pp(e,null)}),n.forEach(function(e){r.has(e)||Pp(e,a)})}Ip.set(o,e)},[e]),o}function Up(e){return e}var Mp=function(e){var t=e.sideCar,r=_p(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return n.createElement(a,Ap({},r))};Mp.isSideCarExport=!0;var zp=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Up);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var o=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(o)};s(),r={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Ap({async:!0,ssr:!1},e),t}(),Fp=function(){},Lp=n.forwardRef(function(e,t){var r=n.useRef(null),a=n.useState({onScrollCapture:Fp,onWheelCapture:Fp,onTouchMoveCapture:Fp}),o=a[0],s=a[1],i=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,b=e.allowPinchZoom,y=e.as,v=void 0===y?"div":y,w=e.gapMode,x=_p(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Dp([r,t]),N=Ap(Ap({},x),o);return n.createElement(n.Fragment,null,u&&n.createElement(S,{sideCar:zp,removeScrollBar:d,shards:f,noRelative:p,noIsolation:h,inert:g,setCallbacks:s,allowPinchZoom:!!b,lockRef:r,gapMode:w}),i?n.cloneElement(n.Children.only(l),Ap(Ap({},N),{ref:k})):n.createElement(v,Ap({},N,{className:c,ref:k}),l))});Lp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Lp.classNames={fullWidth:Rp,zeroRight:Tp};function jp(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var $p=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=jp())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Vp=function(){var e,t=(e=$p(),function(t,r){n.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Wp={left:0,top:0,right:0,gap:0},Bp=function(e){return parseInt(e||"",10)||0},Gp=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Wp;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[Bp(r),Bp(n),Bp(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Kp=Vp(),Hp="data-scroll-locked",Zp=function(e,t,r,n){var a=e.left,o=e.top,s=e.right,i=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(i,"px ").concat(n,";\n }\n body[").concat(Hp,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Tp," {\n right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(Rp," {\n margin-right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(Tp," .").concat(Tp," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Rp," .").concat(Rp," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Hp,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},qp=function(){var e=parseInt(document.body.getAttribute(Hp)||"0",10);return isFinite(e)?e:0},Jp=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,o=void 0===a?"margin":a;n.useEffect(function(){return document.body.setAttribute(Hp,(qp()+1).toString()),function(){var e=qp()-1;e<=0?document.body.removeAttribute(Hp):document.body.setAttribute(Hp,e.toString())}},[]);var s=n.useMemo(function(){return Gp(o)},[o]);return n.createElement(Kp,{styles:Zp(s,!t,o,r?"":"!important")})},Yp=!1;if("undefined"!=typeof window)try{var Xp=Object.defineProperty({},"passive",{get:function(){return Yp=!0,!0}});window.addEventListener("test",Xp,Xp),window.removeEventListener("test",Xp,Xp)}catch(e){Yp=!1}var Qp=!!Yp&&{passive:!1},eh=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},th=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),rh(e,n)){var a=nh(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},rh=function(e,t){return"v"===e?function(e){return eh(e,"overflowY")}(t):function(e){return eh(e,"overflowX")}(t)},nh=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},ah=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oh=function(e){return[e.deltaX,e.deltaY]},sh=function(e){return e&&"current"in e?e.current:e},ih=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},lh=0,ch=[];function dh(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var uh,fh=(uh=function(e){var t=n.useRef([]),r=n.useRef([0,0]),a=n.useRef(),o=n.useState(lh++)[0],s=n.useState(Vp)[0],i=n.useRef(e);n.useEffect(function(){i.current=e},[e]),n.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(sh),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=n.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var n,o=ah(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var f=window.getSelection(),m=f&&f.anchorNode;if(m&&(m===d||m.contains(d)))return!1;var p=th(u,d);if(!p)return!0;if(p?n=u:(n="v"===u?"h":"v",p=th(u,d)),!p)return!1;if(!a.current&&"changedTouches"in e&&(l||c)&&(a.current=n),!n)return!0;var h=a.current||n;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=a*n,s=r.target,i=t.contains(s),l=!1,c=o>0,d=0,u=0;do{if(!s)break;var f=nh(e,s),m=f[0],p=f[1]-f[2]-a*m;(m||p)&&rh(e,s)&&(d+=p,u+=m);var h=s.parentNode;s=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!i&&s!==document.body||i&&(t.contains(s)||t===s));return(c&&Math.abs(d)<1||!c&&Math.abs(u)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=n.useCallback(function(e){var r=e;if(ch.length&&ch[ch.length-1]===s){var n="deltaY"in r?oh(r):ah(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var o=(i.current.shards||[]).map(sh).filter(Boolean).filter(function(e){return e.contains(r.target)});(o.length>0?l(r,o[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=n.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:dh(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),u=n.useCallback(function(e){r.current=ah(e),a.current=void 0},[]),f=n.useCallback(function(t){d(t.type,oh(t),t.target,l(t,e.lockRef.current))},[]),m=n.useCallback(function(t){d(t.type,ah(t),t.target,l(t,e.lockRef.current))},[]);n.useEffect(function(){return ch.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Qp),document.addEventListener("touchmove",c,Qp),document.addEventListener("touchstart",u,Qp),function(){ch=ch.filter(function(e){return e!==s}),document.removeEventListener("wheel",c,Qp),document.removeEventListener("touchmove",c,Qp),document.removeEventListener("touchstart",u,Qp)}},[]);var p=e.removeScrollBar,h=e.inert;return n.createElement(n.Fragment,null,h?n.createElement(s,{styles:ih(o)}):null,p?n.createElement(Jp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},zp.useMedium(uh),Mp),mh=n.forwardRef(function(e,t){return n.createElement(Lp,Ap({},e,{ref:t,sideCar:fh}))});mh.classNames=Lp.classNames;var ph=new WeakMap,hh=new WeakMap,gh={},bh=0,yh=function(e){return e&&(e.host||yh(e.parentNode))},vh=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=yh(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);gh[r]||(gh[r]=new WeakMap);var o=gh[r],s=[],i=new Set,l=new Set(a),c=function(e){e&&!i.has(e)&&(i.add(e),c(e.parentNode))};a.forEach(c);var d=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(i.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(ph.get(e)||0)+1,c=(o.get(e)||0)+1;ph.set(e,l),o.set(e,c),s.push(e),1===l&&a&&hh.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),i.clear(),bh++,function(){s.forEach(function(e){var t=ph.get(e)-1,a=o.get(e)-1;ph.set(e,t),o.set(e,a),t||(hh.has(e)||e.removeAttribute(n),hh.delete(e)),a||e.removeAttribute(r)}),--bh||(ph=new WeakMap,ph=new WeakMap,hh=new WeakMap,gh={})}},wh=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),vh(n,a,r,"aria-hidden")):function(){return null}};function xh(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(o.ref=t?gd(t,e):e),n.cloneElement(r,o)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Sh=Symbol("radix.slottable");function kh(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Sh}var Nh="Dialog",[Eh,Ch]=Km(Nh),[Ah,_h]=Eh(Nh),Th=e=>{const{__scopeDialog:r,children:a,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,c=n.useRef(null),d=n.useRef(null),[u,f]=Xm({prop:o,defaultProp:s??!1,onChange:i,caller:Nh});return t(Ah,{scope:r,triggerRef:c,contentRef:d,contentId:Jm(),titleId:Jm(),descriptionId:Jm(),open:u,onOpenChange:f,onOpenToggle:n.useCallback(()=>f(e=>!e),[f]),modal:l,children:a})};Th.displayName=Nh;var Rh="DialogTrigger",Ph=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,o=_h(Rh,n),s=bd(r,o.triggerRef);return t(rp.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yh(o.open),...a,ref:s,onClick:Gm(e.onClick,o.onOpenToggle)})});Ph.displayName=Rh;var Oh="DialogPortal",[Ih,Dh]=Eh(Oh,{forceMount:void 0}),Uh=e=>{const{__scopeDialog:r,forceMount:a,children:o,container:s}=e,i=_h(Oh,r);return t(Ih,{scope:r,forceMount:a,children:n.Children.map(o,e=>t(Sp,{present:a||i.open,children:t(xp,{asChild:!0,container:s,children:e})}))})};Uh.displayName=Oh;var Mh="DialogOverlay",zh=n.forwardRef((e,r)=>{const n=Dh(Mh,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=_h(Mh,e.__scopeDialog);return s.modal?t(Sp,{present:a||s.open,children:t(Lh,{...o,ref:r})}):null});zh.displayName=Mh;var Fh=function(e){const r=xh(e),a=n.forwardRef((e,a)=>{const{children:o,...s}=e,i=n.Children.toArray(o),l=i.find(kh);if(l){const e=l.props.children,o=i.map(t=>t===l?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,o):null})}return t(r,{...s,ref:a,children:o})});return a.displayName=`${e}.Slot`,a}("DialogOverlay.RemoveScroll"),Lh=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,o=_h(Mh,n);return t(mh,{as:Fh,allowPinchZoom:!0,shards:[o.contentRef],children:t(rp.div,{"data-state":Yh(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),jh="DialogContent",$h=n.forwardRef((e,r)=>{const n=Dh(jh,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=_h(jh,e.__scopeDialog);return t(Sp,{present:a||s.open,children:s.modal?t(Vh,{...o,ref:r}):t(Wh,{...o,ref:r})})});$h.displayName=jh;var Vh=n.forwardRef((e,r)=>{const a=_h(jh,e.__scopeDialog),o=n.useRef(null),s=bd(r,a.contentRef,o);return n.useEffect(()=>{const e=o.current;if(e)return wh(e)},[]),t(Bh,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gm(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Gm(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Gm(e.onFocusOutside,e=>e.preventDefault())})}),Wh=n.forwardRef((e,r)=>{const a=_h(jh,e.__scopeDialog),o=n.useRef(!1),s=n.useRef(!1);return t(Bh,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||a.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const r=t.target,n=a.triggerRef.current?.contains(r);n&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),Bh=n.forwardRef((a,o)=>{const{__scopeDialog:s,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:c,...d}=a,u=_h(jh,s),f=n.useRef(null),m=bd(o,f);return Ep(),e(r,{children:[t(pp,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:c,children:t(lp,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Yh(u.open),...d,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),e(r,{children:[t(tg,{titleId:u.titleId}),t(rg,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Gh="DialogTitle",Kh=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,o=_h(Gh,n);return t(rp.h2,{id:o.titleId,...a,ref:r})});Kh.displayName=Gh;var Hh="DialogDescription",Zh=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,o=_h(Hh,n);return t(rp.p,{id:o.descriptionId,...a,ref:r})});Zh.displayName=Hh;var qh="DialogClose",Jh=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,o=_h(qh,n);return t(rp.button,{type:"button",...a,ref:r,onClick:Gm(e.onClick,()=>o.onOpenChange(!1))})});function Yh(e){return e?"open":"closed"}Jh.displayName=qh;var Xh="DialogTitleWarning",[Qh,eg]=function(e,r){const a=n.createContext(r),o=e=>{const{children:r,...o}=e,s=n.useMemo(()=>o,Object.values(o));return t(a.Provider,{value:s,children:r})};return o.displayName=e+"Provider",[o,function(t){const o=n.useContext(a);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(Xh,{contentName:jh,titleName:Gh,docsSlug:"dialog"}),tg=({titleId:e})=>{const t=eg(Xh),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return n.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},rg=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eg("DialogDescriptionWarning").contentName}}.`;return n.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},ng=Th,ag=Ph,og=Uh,sg=zh,ig=$h,lg=Kh,cg=Zh,dg=Jh;function ug(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var fg=["color"],mg=g(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=ug(e,fg);return b("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),b("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),pg=["color"],hg=g(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=ug(e,pg);return b("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),b("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),gg=["color"],bg=g(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=ug(e,gg);return b("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),b("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),yg=["color"],vg=g(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=ug(e,yg);return b("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),b("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const wg=ng,xg=ag,Sg=og,kg=n.forwardRef(({className:e,...r},n)=>t(sg,{ref:n,className:je("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));kg.displayName=sg.displayName;const Ng=n.forwardRef(({className:r,children:a,...o},s)=>{const{container:i}=n.useContext(Eo);return e(Sg,{container:i,children:[t(kg,{}),e(ig,{ref:s,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",r),...o,children:[a,e(dg,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t(bg,{className:"h-4 w-4"}),t("span",{className:"sr-only",children:"Close"})]})]})]})});Ng.displayName=ig.displayName;const Eg=({className:e,...r})=>t("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});Eg.displayName="DialogHeader";const Cg=n.forwardRef(({className:e,...r},n)=>t(lg,{ref:n,className:je("text-lg font-semibold leading-none tracking-tight",e),...r}));Cg.displayName=lg.displayName;const Ag=n.forwardRef(({className:e,...r},n)=>t(cg,{ref:n,className:je("text-sm text-muted-foreground",e),...r}));function _g(e){const r=Tg(e),a=n.forwardRef((e,a)=>{const{children:o,...s}=e,i=n.Children.toArray(o),l=i.find(Pg);if(l){const e=l.props.children,o=i.map(t=>t===l?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,o):null})}return t(r,{...s,ref:a,children:o})});return a.displayName=`${e}.Slot`,a}function Tg(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(o.ref=t?gd(t,e):e),n.cloneElement(r,o)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Ag.displayName=cg.displayName;var Rg=Symbol("radix.slottable");function Pg(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Rg}function Og(e){const r=e+"CollectionProvider",[n,o]=Km(r),[s,i]=n(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:n}=e,o=a.useRef(null),i=a.useRef(new Map).current;return t(s,{scope:r,itemMap:i,collectionRef:o,children:n})};l.displayName=r;const c=e+"CollectionSlot",d=_g(c),u=a.forwardRef((e,r)=>{const{scope:n,children:a}=e,o=bd(r,i(c,n).collectionRef);return t(d,{ref:o,children:a})});u.displayName=c;const f=e+"CollectionItemSlot",m="data-radix-collection-item",p=_g(f),h=a.forwardRef((e,r)=>{const{scope:n,children:o,...s}=e,l=a.useRef(null),c=bd(r,l),d=i(f,n);return a.useEffect(()=>(d.itemMap.set(l,{ref:l,...s}),()=>{d.itemMap.delete(l)})),t(p,{[m]:"",ref:c,children:o})});return h.displayName=f,[{Provider:l,Slot:u,ItemSlot:h},function(t){const r=i(e+"CollectionConsumer",t),n=a.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),n=Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return n},[r.collectionRef,r.itemMap]);return n},o]}var Ig=n.createContext(void 0);function Dg(e){const t=n.useContext(Ig);return e||t||"ltr"}var Ug="rovingFocusGroup.onEntryFocus",Mg={bubbles:!1,cancelable:!0},zg="RovingFocusGroup",[Fg,Lg,jg]=Og(zg),[$g,Vg]=Km(zg,[jg]),[Wg,Bg]=$g(zg),Gg=n.forwardRef((e,r)=>t(Fg.Provider,{scope:e.__scopeRovingFocusGroup,children:t(Fg.Slot,{scope:e.__scopeRovingFocusGroup,children:t(Kg,{...e,ref:r})})}));Gg.displayName=zg;var Kg=n.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,orientation:o,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=e,p=n.useRef(null),h=bd(r,p),g=Dg(i),[b,y]=Xm({prop:l,defaultProp:c??null,onChange:d,caller:zg}),[v,w]=n.useState(!1),x=hm(u),S=Lg(a),k=n.useRef(!1),[N,E]=n.useState(0);return n.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(Ug,x),()=>e.removeEventListener(Ug,x)},[x]),t(Wg,{scope:a,orientation:o,dir:g,loop:s,currentTabStopId:b,onItemFocus:n.useCallback(e=>y(e),[y]),onItemShiftTab:n.useCallback(()=>w(!0),[]),onFocusableItemAdd:n.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>E(e=>e-1),[]),children:t(rp.div,{tabIndex:v||0===N?-1:0,"data-orientation":o,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:Gm(e.onMouseDown,()=>{k.current=!0}),onFocus:Gm(e.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!v){const t=new CustomEvent(Ug,Mg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);Jg([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:Gm(e.onBlur,()=>w(!1))})})}),Hg="RovingFocusGroupItem",Zg=n.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,focusable:o=!0,active:s=!1,tabStopId:i,children:l,...c}=e,d=Jm(),u=i||d,f=Bg(Hg,a),m=f.currentTabStopId===u,p=Lg(a),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:b}=f;return n.useEffect(()=>{if(o)return h(),()=>g()},[o,h,g]),t(Fg.ItemSlot,{scope:a,id:u,focusable:o,active:s,children:t(rp.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:r,onMouseDown:Gm(e.onMouseDown,e=>{o?f.onItemFocus(u):e.preventDefault()}),onFocus:Gm(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Gm(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:qg[n]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=f.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>Jg(r))}}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=b}):l})})});Zg.displayName=Hg;var qg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jg(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Yg=Gg,Xg=Zg;function Qg(e){const[t,r]=n.useState(void 0);return bm(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}function eb(e){const t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var tb="Radio",[rb,nb]=Km(tb),[ab,ob]=rb(tb),sb=n.forwardRef((r,a)=>{const{__scopeRadio:o,name:s,checked:i=!1,required:l,disabled:c,value:d="on",onCheck:u,form:f,...m}=r,[p,h]=n.useState(null),g=bd(a,e=>h(e)),b=n.useRef(!1),y=!p||(f||!!p.closest("form"));return e(ab,{scope:o,checked:i,disabled:c,children:[t(rp.button,{type:"button",role:"radio","aria-checked":i,"data-state":db(i),"data-disabled":c?"":void 0,disabled:c,value:d,...m,ref:g,onClick:Gm(r.onClick,e=>{i||u?.(),y&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),y&&t(cb,{control:p,bubbles:!b.current,name:s,value:d,checked:i,required:l,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});sb.displayName=tb;var ib="RadioIndicator",lb=n.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:a,...o}=e,s=ob(ib,n);return t(Sp,{present:a||s.checked,children:t(rp.span,{"data-state":db(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})})});lb.displayName=ib;var cb=n.forwardRef(({__scopeRadio:e,control:r,checked:a,bubbles:o=!0,...s},i)=>{const l=n.useRef(null),c=bd(l,i),d=eb(a),u=Qg(r);return n.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==a&&r){const t=new Event("click",{bubbles:o});r.call(e,a),e.dispatchEvent(t)}},[d,a,o]),t(rp.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...s,tabIndex:-1,ref:c,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function db(e){return e?"checked":"unchecked"}cb.displayName="RadioBubbleInput";var ub=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],fb="RadioGroup",[mb]=Km(fb,[Vg,nb]),pb=Vg(),hb=nb(),[gb,bb]=mb(fb),yb=n.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:o,value:s,required:i=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:f,...m}=e,p=pb(n),h=Dg(d),[g,b]=Xm({prop:s,defaultProp:o??null,onChange:f,caller:fb});return t(gb,{scope:n,name:a,required:i,disabled:l,value:g,onValueChange:b,children:t(Yg,{asChild:!0,...p,orientation:c,dir:h,loop:u,children:t(rp.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:h,...m,ref:r})})})});yb.displayName=fb;var vb="RadioGroupItem",wb=n.forwardRef((e,r)=>{const{__scopeRadioGroup:a,disabled:o,...s}=e,i=bb(vb,a),l=i.disabled||o,c=pb(a),d=hb(a),u=n.useRef(null),f=bd(r,u),m=i.value===s.value,p=n.useRef(!1);return n.useEffect(()=>{const e=e=>{ub.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t(Xg,{asChild:!0,...c,focusable:!l,active:m,children:t(sb,{disabled:l,required:i.required,checked:m,...d,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:Gm(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Gm(s.onFocus,()=>{p.current&&u.current?.click()})})})});wb.displayName=vb;var xb=n.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...a}=e,o=hb(n);return t(lb,{...o,...a,ref:r})});xb.displayName="RadioGroupIndicator";var Sb=yb,kb=wb,Nb=xb;const Eb=n.forwardRef(({className:e,...r},n)=>t(Sb,{className:je("grid gap-2",e),...r,ref:n}));Eb.displayName=Sb.displayName;const Cb=n.forwardRef(({className:e,...r},n)=>t(kb,{ref:n,className:je("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t(Nb,{className:"flex items-center justify-center",children:t(hg,{className:"h-3.5 w-3.5 fill-primary"})})}));function Ab(e,[t,r]){return Math.min(r,Math.max(t,e))}Cb.displayName=kb.displayName;var _b="ScrollArea",[Tb]=Km(_b),[Rb,Pb]=Tb(_b),Ob=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,type:o="hover",dir:s,scrollHideDelay:i=600,...l}=e,[c,d]=n.useState(null),[u,f]=n.useState(null),[m,p]=n.useState(null),[h,g]=n.useState(null),[b,y]=n.useState(null),[v,w]=n.useState(0),[x,S]=n.useState(0),[k,N]=n.useState(!1),[E,C]=n.useState(!1),A=bd(r,e=>d(e)),_=Dg(s);return t(Rb,{scope:a,type:o,dir:_,scrollHideDelay:i,scrollArea:c,viewport:u,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:N,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:C,onCornerWidthChange:w,onCornerHeightChange:S,children:t(rp.div,{dir:_,...l,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});Ob.displayName=_b;var Ib="ScrollAreaViewport",Db=n.forwardRef((a,o)=>{const{__scopeScrollArea:s,children:i,nonce:l,...c}=a,d=Pb(Ib,s),u=bd(o,n.useRef(null),d.onViewportChange);return e(r,{children:[t("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),t(rp.div,{"data-radix-scroll-area-viewport":"",...c,ref:u,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...a.style},children:t("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});Db.displayName=Ib;var Ub="ScrollAreaScrollbar",Mb=n.forwardRef((e,r)=>{const{forceMount:a,...o}=e,s=Pb(Ub,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,c="horizontal"===e.orientation;return n.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===s.type?t(zb,{...o,ref:r,forceMount:a}):"scroll"===s.type?t(Fb,{...o,ref:r,forceMount:a}):"auto"===s.type?t(Lb,{...o,ref:r,forceMount:a}):"always"===s.type?t(jb,{...o,ref:r}):null});Mb.displayName=Ub;var zb=n.forwardRef((e,r)=>{const{forceMount:a,...o}=e,s=Pb(Ub,e.__scopeScrollArea),[i,l]=n.useState(!1);return n.useEffect(()=>{const e=s.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[s.scrollArea,s.scrollHideDelay]),t(Sp,{present:a||i,children:t(Lb,{"data-state":i?"visible":"hidden",...o,ref:r})})}),Fb=n.forwardRef((e,r)=>{const{forceMount:a,...o}=e,s=Pb(Ub,e.__scopeScrollArea),i="horizontal"===e.orientation,l=oy(()=>d("SCROLL_END"),100),[c,d]=(u="hidden",f={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},n.useReducer((e,t)=>f[e][t]??e,u));var u,f;return n.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,s.scrollHideDelay,d]),n.useEffect(()=>{const e=s.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(d("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[s.viewport,i,d,l]),t(Sp,{present:a||"hidden"!==c,children:t(jb,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:Gm(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Gm(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Lb=n.forwardRef((e,r)=>{const a=Pb(Ub,e.__scopeScrollArea),{forceMount:o,...s}=e,[i,l]=n.useState(!1),c="horizontal"===e.orientation,d=oy(()=>{if(a.viewport){const e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;l(c?e:t)}},10);return sy(a.viewport,d),sy(a.content,d),t(Sp,{present:o||i,children:t(jb,{"data-state":i?"visible":"hidden",...s,ref:r})})}),jb=n.forwardRef((e,r)=>{const{orientation:a="vertical",...o}=e,s=Pb(Ub,e.__scopeScrollArea),i=n.useRef(null),l=n.useRef(0),[c,d]=n.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Qb(c.viewport,c.content),f={...o,sizes:c,onSizesChange:d,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=ey(r),o=a/2,s=t||o,i=a-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-i,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return ry([l,c],u)(e)}(e,l.current,c,t)}return"horizontal"===a?t($b,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=ty(s.viewport.scrollLeft,c,s.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=m(e,s.dir))}}):"vertical"===a?t(Vb,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=ty(s.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=m(e))}}):null}),$b=n.forwardRef((e,r)=>{const{sizes:a,onSizesChange:o,...s}=e,i=Pb(Ub,e.__scopeScrollArea),[l,c]=n.useState(),d=n.useRef(null),u=bd(r,d,i.onScrollbarXChange);return n.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),t(Gb,{"data-orientation":"horizontal",...s,ref:u,sizes:a,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ey(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),ny(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Xb(l.paddingLeft),paddingEnd:Xb(l.paddingRight)}})}})}),Vb=n.forwardRef((e,r)=>{const{sizes:a,onSizesChange:o,...s}=e,i=Pb(Ub,e.__scopeScrollArea),[l,c]=n.useState(),d=n.useRef(null),u=bd(r,d,i.onScrollbarYChange);return n.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),t(Gb,{"data-orientation":"vertical",...s,ref:u,sizes:a,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ey(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),ny(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Xb(l.paddingTop),paddingEnd:Xb(l.paddingBottom)}})}})}),[Wb,Bb]=Tb(Ub),Gb=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,sizes:o,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=e,h=Pb(Ub,a),[g,b]=n.useState(null),y=bd(r,e=>b(e)),v=n.useRef(null),w=n.useRef(""),x=h.viewport,S=o.content-o.viewport,k=hm(f),N=hm(d),E=oy(m,10);function C(e){if(v.current){const t=e.clientX-v.current.left,r=e.clientY-v.current.top;u({x:t,y:r})}}return n.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,g,S,k]),n.useEffect(N,[o,N]),sy(g,E),sy(h.content,E),t(Wb,{scope:a,scrollbar:g,hasThumb:s,onThumbChange:hm(i),onThumbPointerUp:hm(l),onThumbPositionChange:N,onThumbPointerDown:hm(c),children:t(rp.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:Gm(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),v.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),C(e)}}),onPointerMove:Gm(e.onPointerMove,C),onPointerUp:Gm(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),Kb="ScrollAreaThumb",Hb=n.forwardRef((e,r)=>{const{forceMount:n,...a}=e,o=Bb(Kb,e.__scopeScrollArea);return t(Sp,{present:n||o.hasThumb,children:t(Zb,{ref:r,...a})})}),Zb=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,style:o,...s}=e,i=Pb(Kb,a),l=Bb(Kb,a),{onThumbPositionChange:c}=l,d=bd(r,e=>l.onThumbChange(e)),u=n.useRef(void 0),f=oy(()=>{u.current&&(u.current(),u.current=void 0)},100);return n.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(f(),!u.current){const t=ay(e,c);u.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,f,c]),t(rp.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Gm(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:Gm(e.onPointerUp,l.onThumbPointerUp)})});Hb.displayName=Kb;var qb="ScrollAreaCorner",Jb=n.forwardRef((e,r)=>{const n=Pb(qb,e.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?t(Yb,{...e,ref:r}):null});Jb.displayName=qb;var Yb=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,...o}=e,s=Pb(qb,a),[i,l]=n.useState(0),[c,d]=n.useState(0),u=Boolean(i&&c);return sy(s.scrollbarX,()=>{const e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),d(e)}),sy(s.scrollbarY,()=>{const e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),l(e)}),u?t(rp.div,{...o,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...e.style}}):null});function Xb(e){return e?parseInt(e,10):0}function Qb(e,t){const r=e/t;return isNaN(r)?0:r}function ey(e){const t=Qb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function ty(e,t,r="ltr"){const n=ey(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,i=o-n,l=Ab(e,"ltr"===r?[0,s]:[-1*s,0]);return ry([0,s],[0,i])(l)}function ry(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function ny(e,t){return e>0&&e<t}var ay=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,i=r.top!==o.top;(s||i)&&t(),r=o,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function oy(e,t){const r=hm(e),a=n.useRef(0);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),n.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function sy(e,t){const r=hm(t);bm(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var iy=Ob,ly=Db,cy=Jb;const dy=n.forwardRef(({className:r,children:n,...a},o)=>e(iy,{ref:o,className:je("relative overflow-hidden",r),...a,children:[t(ly,{className:"h-full w-full rounded-[inherit]",children:n}),t(uy,{}),t(cy,{})]}));dy.displayName=iy.displayName;const uy=n.forwardRef(({className:e,orientation:r="vertical",...n},a)=>t(Mb,{ref:a,orientation:r,className:je("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",e),...n,children:t(Hb,{className:je("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));uy.displayName=Mb.displayName;var fy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=xd(`Primitive.${r}`),o=n.forwardRef((e,n)=>{const{asChild:o,...s}=e,i=o?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(i,{...s,ref:n})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),my="horizontal",py=["horizontal","vertical"],hy=n.forwardRef((e,r)=>{const{decorative:n,orientation:a=my,...o}=e,s=function(e){return py.includes(e)}(a)?a:my,i=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return t(fy.div,{"data-orientation":s,...i,...o,ref:r})});hy.displayName="Separator";var gy=hy;const by=n.forwardRef(({className:e,orientation:r="horizontal",decorative:n=!0,...a},o)=>t(gy,{ref:o,decorative:n,orientation:r,className:je("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",e),...a}));by.displayName=gy.displayName;var yy=Symbol("radix.slottable");var vy="AlertDialog",[wy]=Km(vy,[Ch]),xy=Ch(),Sy=e=>{const{__scopeAlertDialog:r,...n}=e,a=xy(r);return t(ng,{...a,...n,modal:!0})};Sy.displayName=vy;var ky=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,o=xy(n);return t(ag,{...o,...a,ref:r})});ky.displayName="AlertDialogTrigger";var Ny=e=>{const{__scopeAlertDialog:r,...n}=e,a=xy(r);return t(og,{...a,...n})};Ny.displayName="AlertDialogPortal";var Ey=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,o=xy(n);return t(sg,{...o,...a,ref:r})});Ey.displayName="AlertDialogOverlay";var Cy="AlertDialogContent",[Ay,_y]=wy(Cy),Ty=function(e){const n=({children:e})=>t(r,{children:e});return n.displayName=`${e}.Slottable`,n.__radixId=yy,n}("AlertDialogContent"),Ry=n.forwardRef((r,a)=>{const{__scopeAlertDialog:o,children:s,...i}=r,l=xy(o),c=n.useRef(null),d=bd(a,c),u=n.useRef(null);return t(Qh,{contentName:Cy,titleName:Py,docsSlug:"alert-dialog",children:t(Ay,{scope:o,cancelRef:u,children:e(ig,{role:"alertdialog",...l,...i,ref:d,onOpenAutoFocus:Gm(i.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t(Ty,{children:s}),t(Fy,{contentRef:c})]})})})});Ry.displayName=Cy;var Py="AlertDialogTitle",Oy=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,o=xy(n);return t(lg,{...o,...a,ref:r})});Oy.displayName=Py;var Iy="AlertDialogDescription",Dy=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,o=xy(n);return t(cg,{...o,...a,ref:r})});Dy.displayName=Iy;var Uy=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,o=xy(n);return t(dg,{...o,...a,ref:r})});Uy.displayName="AlertDialogAction";var My="AlertDialogCancel",zy=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:o}=_y(My,n),s=xy(n),i=bd(r,o);return t(dg,{...s,...a,ref:i})});zy.displayName=My;var Fy=({contentRef:e})=>{const t=`\`${Cy}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Cy}\` by passing a \`${Iy}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Cy}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return n.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Ly=Ey,jy=Ry,$y=Uy,Vy=zy,Wy=Oy,By=Dy;const Gy=Sy,Ky=ky,Hy=Ny,Zy=n.forwardRef(({className:e,...r},n)=>t(Ly,{className:je("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));Zy.displayName=Ly.displayName;const qy=n.forwardRef(({className:r,...a},o)=>{const{container:s}=n.useContext(Eo);return e(Hy,{container:s,children:[t(Zy,{}),t(jy,{ref:o,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",r),...a})]})});qy.displayName=jy.displayName;const Jy=({className:e,...r})=>t("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...r});Jy.displayName="AlertDialogHeader";const Yy=({className:e,...r})=>t("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Yy.displayName="AlertDialogFooter";const Xy=n.forwardRef(({className:e,...r},n)=>t(Wy,{ref:n,className:je("text-lg font-semibold",e),...r}));Xy.displayName=Wy.displayName;const Qy=n.forwardRef(({className:e,...r},n)=>t(By,{ref:n,className:je("text-sm text-muted-foreground",e),...r}));Qy.displayName=By.displayName;const ev=n.forwardRef(({className:e,...r},n)=>t($y,{ref:n,className:je(ou(),e),...r}));ev.displayName=$y.displayName;const tv=n.forwardRef(({className:e,...r},n)=>t(Vy,{ref:n,className:je(ou({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));function rv(){return e("div",{className:"space-y-3.5",children:[t(ku,{className:"h-10 w-full"}),t(ku,{className:"h-10 w-full"}),t(ku,{className:"h-10 w-full"})]})}tv.displayName=Vy.displayName;const nv=({workspace:n})=>{const[a,o]=f(!1),{deleteWorkspace:s}=Sr(),{user:i}=So();if(!n)return t(rv,{});const l=wr(n,i?.id??null);return"admin"===l?.toLowerCase()?e("div",{className:"space-y-4",children:[e("div",{children:[t("h3",{className:"text-lg font-semibold text-destructive",children:"Delete Workspace"}),e("p",{className:"text-sm text-muted-foreground mt-2",children:["Once you delete a workspace, there is no going back. This will permanently delete the workspace ",t("strong",{children:n.name})," and all of its data, including members, settings, and features."]})]}),e(Gy,{children:[t(Ky,{asChild:!0,children:e(su,{variant:"destructive",disabled:a,progress:a,children:[t(eu,{className:"h-4 w-4 mr-2"}),"Delete Workspace"]})}),e(qy,{children:[e(Jy,{children:[t(Xy,{children:"Are you absolutely sure?"}),e(Qy,{children:["This action cannot be undone. This will permanently delete the workspace"," ",t("strong",{children:n.name})," and all of its data."]})]}),e(Yy,{children:[t(tv,{disabled:a,children:"Cancel"}),t(ev,{onClick:async()=>{o(!0);try{await s(n._id)}catch(e){Ye(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:n._id}}),alert(e instanceof Error?e.message:"Failed to delete workspace")}finally{o(!1)}},disabled:a,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:a?e(r,{children:[t(Kd,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):"Delete Workspace"})]})]})]})]}):t("div",{className:"space-y-4",children:t("div",{className:"text-red-500",children:"Only workspace admins can delete workspaces."})})};var av="Switch",[ov]=Km(av),[sv,iv]=ov(av),lv=n.forwardRef((r,a)=>{const{__scopeSwitch:o,name:s,checked:i,defaultChecked:l,required:c,disabled:d,value:u="on",onCheckedChange:f,form:m,...p}=r,[h,g]=n.useState(null),b=bd(a,e=>g(e)),y=n.useRef(!1),v=!h||(m||!!h.closest("form")),[w,x]=Xm({prop:i,defaultProp:l??!1,onChange:f,caller:av});return e(sv,{scope:o,checked:w,disabled:d,children:[t(rp.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":fv(w),"data-disabled":d?"":void 0,disabled:d,value:u,...p,ref:b,onClick:Gm(r.onClick,e=>{x(e=>!e),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),v&&t(uv,{control:h,bubbles:!y.current,name:s,value:u,checked:w,required:c,disabled:d,form:m,style:{transform:"translateX(-100%)"}})]})});lv.displayName=av;var cv="SwitchThumb",dv=n.forwardRef((e,r)=>{const{__scopeSwitch:n,...a}=e,o=iv(cv,n);return t(rp.span,{"data-state":fv(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:r})});dv.displayName=cv;var uv=n.forwardRef(({__scopeSwitch:e,control:r,checked:a,bubbles:o=!0,...s},i)=>{const l=n.useRef(null),c=bd(l,i),d=eb(a),u=Qg(r);return n.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==a&&r){const t=new Event("click",{bubbles:o});r.call(e,a),e.dispatchEvent(t)}},[d,a,o]),t("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...s,tabIndex:-1,ref:c,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function fv(e){return e?"checked":"unchecked"}uv.displayName="SwitchBubbleInput";var mv=lv,pv=dv;const hv=n.forwardRef(({className:e,...r},n)=>t(mv,{className:je("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:t(pv,{className:je("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));hv.displayName=mv.displayName;const gv=({workspaceId:r})=>{const[n,a]=f({}),[o,i]=f(null),l=s(null),{allFeatures:c,updateFeature:u,getWorkspace:m}=Sr();d(()=>()=>{l.current&&clearTimeout(l.current)},[]);const[p,h]=f(null),{user:g}=So();if(d(()=>{m(r).then(h)},[r]),!p)return t(rv,{});const b=vr(p,g?.id??null);return e("div",{children:[o&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:"Success!"}),t("p",{className:"text-sm",children:o})]}),e("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!b&&t("div",{className:"text-red-500",children:"Only the workspace owner can change the features."}),!c.length&&t("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),c.length>0&&t("div",{className:"flex flex-col gap-y-3.5",children:c.map(r=>{const o=p?.features?.[r.slug],s=null!==n[r.slug]&&void 0!==n[r.slug],d=n[r.slug],f=!0===d?"Enabling":!1===d?"Disabling":"";return e("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e("div",{className:"flex gap-x-2 flex-col",children:[t("h3",{className:"font-medium text-ellipsis",children:r.name}),t("p",{className:"text-muted-foreground",children:r.description})]}),s?e("div",{className:"flex items-center gap-x-1",children:[t(Kd,{className:"h-4 w-4 animate-spin text-gray-500"}),e("span",{className:"text-sm text-gray-600",children:[f,"..."]})]}):t(hv,{disabled:!b,checked:o??r.defaultValue,onCheckedChange:e=>async function(e,t){if(p){a(r=>({...r,[e]:t})),i(null);try{const r=await u(p._id,e,t);h(r);const n=c.find(t=>t.slug===e);i(`${n?.name||"Feature"} ${t?"enabled":"disabled"} successfully`),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{i(null)},5e3)}catch(t){Ye(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{a(t=>({...t,[e]:null}))}}}(r.slug,e)})]},r._id)})})]})]})},bv={usd:"$",eur:"โฌ",gbp:"ยฃ",jpy:"ยฅ",cad:"CA$",aud:"A$",chf:"CHF",cny:"ยฅ",hkd:"HK$",sgd:"S$",inr:"โน",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zล",thb:"เธฟ"},yv={usd:"๐บ๐ธ",eur:"๐ช๐บ",gbp:"๐ฌ๐ง",jpy:"๐ฏ๐ต",cad:"๐จ๐ฆ",aud:"๐ฆ๐บ",chf:"๐จ๐ญ",cny:"๐จ๐ณ",hkd:"๐ญ๐ฐ",sgd:"๐ธ๐ฌ",inr:"๐ฎ๐ณ",mxn:"๐ฒ๐ฝ",brl:"๐ง๐ท",nzd:"๐ณ๐ฟ",sek:"๐ธ๐ช",nok:"๐ณ๐ด",dkk:"๐ฉ๐ฐ",pln:"๐ต๐ฑ",thb:"๐น๐ญ"};function vv(e){return e&&e.trim()?yv[e.trim().toLowerCase()]??"":""}function wv(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return bv[t]??t.toUpperCase()}const xv=["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"],Sv=xv.map(e=>({value:e,label:`${e.toUpperCase()} (${wv(e)})`}));function kv(e,t){return wv(t)+(e/100).toFixed(2)}function Nv(e,t,r){if(null==e||e<0)return null;const n=null!=t&&t>=1?t:1,a=wv(r),o=(e/100).toFixed(2);return 1===n?`${a}${o}/unit`:`${a}${o}/${n.toLocaleString()} units`}function Ev(e,t,r,n){if(null==e||e<0)return null;const a=null!=t&&t>=1?t:1,o=wv(n),s=(e/100).toFixed(2);if(r){const e=r.endsWith("s")?r:`${r}s`;return a>=2?`${o}${s}/${a.toLocaleString()} ${e}`:`${o}${s}/${r}`}return 1===a?`${o}${s}/unit`:`${o}${s}/${a.toLocaleString()} units`}function Cv(e){const t=(e||"").trim().toLowerCase();if(!t)return"unit";const r=t.split(/\s+/)[0]??t;return new Set(["series","species","status","analysis","basis","bus","campus","corpus","axis"]).has(r)?r:r.endsWith("ies")&&r.length>3?r.slice(0,-3)+"y":r.endsWith("ses")||r.endsWith("xes")||r.endsWith("zes")||r.endsWith("ches")||r.endsWith("shes")?r.slice(0,-2):r.endsWith("s")&&!r.endsWith("ss")&&r.length>1?r.slice(0,-1):r||"unit"}function Av(e,t,r,n,a){const o=r.endsWith("s")?r:`${r}s`,s=null!=a&&a>=2?`${a.toLocaleString()} ${o}`:r;return null!=e&&null!=t?`Included: ${e.toLocaleString()}, after that ${kv(t,n)}/${s}`:null!=e?`Included: ${e.toLocaleString()}`:null!=t?`After included: ${kv(t,n)}/${s}`:"โ"}function _v(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</text></svg>`}const Tv=["๐ข","๐ฌ","๐ฃ","๐ค","๐ฆ","๐๏ธ","๐ ","๐ก","๐ญ","๐๏ธ","๐ช","๐จ","๐ซ","๐ฅ","๐ผ","๐","๐","๐","๐","๐","๐","๐๏ธ","๐๏ธ","๐๏ธ","๐
","๐๏ธ","๐","๐๏ธ","โ๏ธ","๐๏ธ","๐๏ธ","๐๏ธ","๐","๐","๐","๐","๐๏ธ","๐ป","๐ฅ๏ธ","๐จ๏ธ","๐ฑ๏ธ","โจ๏ธ","๐ฑ","๐ฒ","๐ก","๐","๐","๐","๐","โ๏ธ","๐ง","๐ ๏ธ","๐งโ๐ป","๐จโ๐ป","๐ฉโ๐ป","๐น๏ธ","๐พ","๐","๐ฅ๏ธ","๐ฒ๏ธ","๐","๐ก","๐จ","๐ผ๏ธ","๐งช","๐ฌ","๐งฌ","๐ฏ","โก","๐ฒ","๐ฎ","๐งฉ","๐ท","๐ฅ","โ๏ธ","๐จ","๐ฉ","๐ง","๐","โ๏ธ","๐ ","๐ฃ๏ธ","๐ฌ","๐จ๏ธ","๐ข","๐ฃ","๐","๐๏ธ","๐ฐ","๐ธ","๐ณ","๐ฆ","๐","๐","โ๏ธ","๐งพ","๐ช","๐๏ธ","โ๏ธ","๐งช","๐ญ","๐ฌ","๐ฉบ","๐งฌ","๐ฉป","๐ฅ","๐ฑ","๐","๐","๐","๐ก๏ธ","๐จโ๐ผ","๐ฉโ๐ผ","๐จโ๐ซ","๐ฉโ๐ซ","๐จโ๐ฌ","๐ฉโ๐ฌ","๐จโ๐จ","๐ฉโ๐จ","๐จโ๐ง","๐ฉโ๐ง","๐จโ๐","๐ฉโ๐","๐จโโ๏ธ","๐ฉโโ๏ธ","๐
","๐๏ธ","๐ฅ","๐ฅ","๐ฅ","๐","๐๏ธ","๐","๐๏ธ","๐งญ","๐ก๏ธ","๐ฉ","๐ณ๏ธโ๐","๐๏ธ","๐ซ"],Rv=({workspace:r})=>{const[n,a]=f(!1),[o,i]=f("emoji"),[l,c]=f(),[u,m]=f(null),p=s(null),{updateWorkspace:h}=Sr();d(()=>()=>{p.current&&clearTimeout(p.current)},[]);const{user:g}=So(),b=si({resolver:pd(Nf({name:Ju().min(2,{message:"Workspace name must be at least 2 characters."}),image:Ju().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return t(rv,{});const y=vr(r,g?.id??null);return e("div",{children:[u&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:"Success!"}),t("p",{className:"text-sm",children:u})]}),!y&&t("div",{className:"text-red-500",children:"Only the workspace owner can change the workspace settings."}),t(fu,{...b,children:e("form",{onSubmit:b.handleSubmit(async function(e){a(!0),m(null);try{await h(r,e),m("Workspace settings saved successfully"),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(null)},5e3)}catch(e){Ye(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{a(!1)}}),className:"space-y-6",children:[t(pu,{control:b.control,name:"name",render:({field:r})=>e(bu,{children:[t(yu,{children:"Name"}),t(vu,{children:t(Su,{placeholder:"My Awesome Workspace",...r,disabled:!y})}),t(xu,{})]})}),r.billingCurrency?.trim()&&e("div",{className:"space-y-1.5",children:[t(uu,{className:"text-sm font-medium text-muted-foreground",children:"Billing currency"}),e("div",{className:"flex items-center gap-2 text-sm",children:[vv(r.billingCurrency)&&t("span",{className:"text-base",children:vv(r.billingCurrency)}),t("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e("div",{className:"space-y-4",children:[e("div",{children:[t(uu,{className:"text-sm font-medium",children:"Icon"}),t(wu,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e(Eb,{value:o,disabled:!y,onValueChange:e=>i(e),className:"flex flex-col space-y-3",children:[e("div",{className:"flex items-center space-x-2",children:[t(Cb,{value:"emoji",id:"emoji"}),e(uu,{htmlFor:"emoji",className:"flex items-center gap-2",children:[t(Xd,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e("div",{className:"flex items-center space-x-2",children:[t(Cb,{value:"url",id:"url"}),e(uu,{htmlFor:"url",className:"flex items-center gap-2",children:[t(Gd,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&e("div",{className:"space-y-3",children:[e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[l&&t("span",{className:"text-2xl",children:l}),!l&&b.watch("image")?.trim()&&t("img",{src:b.watch("image")||void 0,alt:"Workspace preview"})]})]}),y&&t(dy,{className:"h-32 w-full rounded-md border",children:t("div",{className:"p-4 grid grid-cols-8 gap-2",children:Tv.map((e,r)=>t("button",{type:"button",onClick:()=>(e=>{c(e),b.setValue("image",_v(e))})(e),disabled:!y,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(l===e?"bg-primary text-primary-foreground":""),children:e},r))})})]}),"url"===o&&e("div",{className:"space-y-3",children:[t(pu,{control:b.control,name:"image",render:({field:r})=>e(bu,{children:[t(yu,{children:"Image URL"}),t(vu,{children:t(Su,{placeholder:"https://example.com/image.png",...r,disabled:!y})}),t(wu,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),t(xu,{})]})}),b.watch("image")&&b.watch("image")?.trim()&&e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:"Preview:"}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:t("img",{src:b.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),t("div",{className:"flex justify-end gap-3 pt-4",children:y&&t(su,{type:"submit",disabled:n,progress:n,children:"Update Workspace"})})]})})]})};var Pv=.999,Ov=/[\\\/_+.#"@\[\(\{&]/,Iv=/[\\\/_+.#"@\[\(\{&]/g,Dv=/[\s-]/,Uv=/[\s-]/g;function Mv(e,t,r,n,a,o,s){if(o===t.length)return a===e.length?1:.99;var i=`${a},${o}`;if(void 0!==s[i])return s[i];for(var l,c,d,u,f=n.charAt(o),m=r.indexOf(f,a),p=0;m>=0;)(l=Mv(e,t,r,n,m+1,o+1,s))>p&&(m===a?l*=1:Ov.test(e.charAt(m-1))?(l*=.8,(d=e.slice(a,m-1).match(Iv))&&a>0&&(l*=Math.pow(Pv,d.length))):Dv.test(e.charAt(m-1))?(l*=.9,(u=e.slice(a,m-1).match(Uv))&&a>0&&(l*=Math.pow(Pv,u.length))):(l*=.17,a>0&&(l*=Math.pow(Pv,m-a))),e.charAt(m)!==t.charAt(o)&&(l*=.9999)),(l<.1&&r.charAt(m-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(m-1)!==n.charAt(o))&&(.1*(c=Mv(e,t,r,n,m+1,o+2,s))>l&&(l=.1*c)),l>p&&(p=l),m=r.indexOf(f,m+1);return s[i]=p,p}function zv(e){return e.toLowerCase().replace(Uv," ")}function Fv(e,t,r){return Mv(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,zv(e),zv(t),0,0,{})}var Lv='[cmdk-group=""]',jv='[cmdk-group-items=""]',$v='[cmdk-item=""]',Vv=`${$v}:not([aria-disabled="true"])`,Wv="cmdk-item-select",Bv="data-value",Gv=(e,t,r)=>Fv(e,t,r),Kv=n.createContext(void 0),Hv=()=>n.useContext(Kv),Zv=n.createContext(void 0),qv=()=>n.useContext(Zv),Jv=n.createContext(void 0),Yv=n.forwardRef((e,t)=>{let r=uw(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=uw(()=>new Set),o=uw(()=>new Map),s=uw(()=>new Map),i=uw(()=>new Set),l=cw(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:b=!0,...y}=e,v=Jm(),w=Jm(),x=Jm(),S=n.useRef(null),k=pw();dw(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,N.emit()}},[u]),dw(()=>{k(6,R)},[]);let N=n.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,s,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)T(),A(),k(1,_);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(a=document.getElementById(v))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=P())?void 0:e.id,N.emit()}),n||k(5,R),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(i=(s=l.current).onValueChange)||i.call(s,e))}}N.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),E=n.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,C(t,n)),k(2,()=>{A(),N.emit()}))},item:(e,t)=>(a.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),k(3,()=>{T(),A(),r.current.value||_(),N.emit()}),()=>{s.current.delete(e),a.current.delete(e),r.current.filtered.items.delete(e);let t=P();k(4,()=>{T(),(null==t?void 0:t.getAttribute("id"))===e&&_(),N.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:v,inputId:x,labelId:w,listInnerRef:S}),[]);function C(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:Gv;return e?o(e,r.current.search,t):0}function A(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=S.current;O().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(jv);t?t.appendChild(e.parentElement===t?e:e.closest(`${jv} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${jv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Lv}[${Bv}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function _(){let e=O().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Bv);N.setState("value",t||void 0)}function T(){var e,t,n,i;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=a.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of a.current){let a=C(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(i=null==(n=s.current.get(o))?void 0:n.keywords)?i:[]);r.current.filtered.items.set(o,a),a>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function R(){var e,t,r;let n=P();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Lv))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function P(){var e;return null==(e=S.current)?void 0:e.querySelector(`${$v}[aria-selected="true"]`)}function O(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Vv))||[])}function I(e){let t=O()[e];t&&N.setState("value",t.getAttribute(Bv))}function D(e){var t;let r=P(),n=O(),a=n.findIndex(e=>e===r),o=n[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&N.setState("value",o.getAttribute(Bv))}function U(e){let t,r=P(),n=null==r?void 0:r.closest(Lv);for(;n&&!t;)n=e>0?iw(n,Lv):lw(n,Lv),t=null==n?void 0:n.querySelector(Vv);t?N.setState("value",t.getAttribute(Bv)):D(e)}let M=()=>I(O().length-1),z=e=>{e.preventDefault(),e.metaKey?M():e.altKey?U(1):D(1)},F=e=>{e.preventDefault(),e.metaKey?I(0):e.altKey?U(-1):D(-1)};return n.createElement(rp.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=y.onKeyDown)||t.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":b&&e.ctrlKey&&z(e);break;case"ArrowDown":z(e);break;case"p":case"k":b&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),I(0);break;case"End":e.preventDefault(),M();break;case"Enter":{e.preventDefault();let t=P();if(t){let e=new Event(Wv);t.dispatchEvent(e)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:gw},c),hw(e,e=>n.createElement(Zv.Provider,{value:N},n.createElement(Kv.Provider,{value:E},e))))}),Xv=n.forwardRef((e,t)=>{var r,a;let o=Jm(),s=n.useRef(null),i=n.useContext(Jv),l=Hv(),c=cw(e),d=null!=(a=null==(r=c.current)?void 0:r.forceMount)?a:null==i?void 0:i.forceMount;dw(()=>{if(!d)return l.item(o,null==i?void 0:i.id)},[d]);let u=mw(o,s,[e.value,e.children,s],e.keywords),f=qv(),m=fw(e=>e.value&&e.value===u.current),p=fw(e=>!(!d&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function h(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,u.current)}function g(){f.setState("value",u.current,!0)}if(n.useEffect(()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(Wv,h),()=>t.removeEventListener(Wv,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:b,value:y,onSelect:v,forceMount:w,keywords:x,...S}=e;return n.createElement(rp.div,{ref:gd(s,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!m,"data-disabled":!!b,"data-selected":!!m,onPointerMove:b||l.getDisablePointerSelection()?void 0:g,onClick:b?void 0:h},e.children)}),Qv=n.forwardRef((e,t)=>{let{heading:r,children:a,forceMount:o,...s}=e,i=Jm(),l=n.useRef(null),c=n.useRef(null),d=Jm(),u=Hv(),f=fw(e=>!(!o&&!1!==u.filter())||(!e.search||e.filtered.groups.has(i)));dw(()=>u.group(i),[]),mw(i,l,[e.value,e.heading,c]);let m=n.useMemo(()=>({id:i,forceMount:o}),[o]);return n.createElement(rp.div,{ref:gd(l,t),...s,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&n.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),hw(e,e=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},n.createElement(Jv.Provider,{value:m},e))))}),ew=n.forwardRef((e,t)=>{let{alwaysRender:r,...a}=e,o=n.useRef(null),s=fw(e=>!e.search);return r||s?n.createElement(rp.div,{ref:gd(o,t),...a,"cmdk-separator":"",role:"separator"}):null}),tw=n.forwardRef((e,t)=>{let{onValueChange:r,...a}=e,o=null!=e.value,s=qv(),i=fw(e=>e.search),l=fw(e=>e.selectedItemId),c=Hv();return n.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),n.createElement(rp.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),rw=n.forwardRef((e,t)=>{let{children:r,label:a="Suggestions",...o}=e,s=n.useRef(null),i=n.useRef(null),l=fw(e=>e.selectedItemId),c=Hv();return n.useEffect(()=>{if(i.current&&s.current){let e,t=i.current,r=s.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),n.createElement(rp.div,{ref:gd(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":a,id:c.listId},hw(e,e=>n.createElement("div",{ref:gd(i,c.listInnerRef),"cmdk-list-sizer":""},e)))}),nw=n.forwardRef((e,t)=>{let{open:r,onOpenChange:a,overlayClassName:o,contentClassName:s,container:i,...l}=e;return n.createElement(ng,{open:r,onOpenChange:a},n.createElement(og,{container:i},n.createElement(sg,{"cmdk-overlay":"",className:o}),n.createElement(ig,{"aria-label":e.label,"cmdk-dialog":"",className:s},n.createElement(Yv,{ref:t,...l}))))}),aw=n.forwardRef((e,t)=>fw(e=>0===e.filtered.count)?n.createElement(rp.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ow=n.forwardRef((e,t)=>{let{progress:r,children:a,label:o="Loading...",...s}=e;return n.createElement(rp.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},hw(e,e=>n.createElement("div",{"aria-hidden":!0},e)))}),sw=Object.assign(Yv,{List:rw,Item:Xv,Input:tw,Group:Qv,Separator:ew,Dialog:nw,Empty:aw,Loading:ow});function iw(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function lw(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function cw(e){let t=n.useRef(e);return dw(()=>{t.current=e}),t}var dw="undefined"==typeof window?n.useEffect:n.useLayoutEffect;function uw(e){let t=n.useRef();return void 0===t.current&&(t.current=e()),t}function fw(e){let t=qv(),r=()=>e(t.snapshot());return n.useSyncExternalStore(t.subscribe,r,r)}function mw(e,t,r,a=[]){let o=n.useRef(),s=Hv();return dw(()=>{var n;let i=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=a.map(e=>e.trim());s.value(e,i,l),null==(n=t.current)||n.setAttribute(Bv,i),o.current=i}),o}var pw=()=>{let[e,t]=n.useState(),r=uw(()=>new Map);return dw(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function hw({asChild:e,children:t},r){return e&&n.isValidElement(t)?n.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var gw={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const bw=n.forwardRef(({className:e,...r},n)=>t(sw,{ref:n,className:je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));bw.displayName=sw.displayName;const yw=n.forwardRef(({className:r,...n},a)=>e("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[t(vg,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t(sw.Input,{ref:a,className:je("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r),...n})]}));yw.displayName=sw.Input.displayName;const vw=n.forwardRef(({className:e,...r},n)=>t(sw.List,{ref:n,className:je("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));vw.displayName=sw.List.displayName;n.forwardRef((e,r)=>t(sw.Empty,{ref:r,className:"py-6 text-center text-sm",...e})).displayName=sw.Empty.displayName;const ww=n.forwardRef(({className:e,...r},n)=>t(sw.Group,{ref:n,className:je("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));ww.displayName=sw.Group.displayName;n.forwardRef(({className:e,...r},n)=>t(sw.Separator,{ref:n,className:je("-mx-1 h-px bg-border",e),...r})).displayName=sw.Separator.displayName;const xw=n.forwardRef(({className:e,...r},n)=>t(sw.Item,{ref:n,className:je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r}));xw.displayName=sw.Item.displayName;const Sw=["top","right","bottom","left"],kw=Math.min,Nw=Math.max,Ew=Math.round,Cw=Math.floor,Aw=e=>({x:e,y:e}),_w={left:"right",right:"left",bottom:"top",top:"bottom"},Tw={start:"end",end:"start"};function Rw(e,t,r){return Nw(e,kw(t,r))}function Pw(e,t){return"function"==typeof e?e(t):e}function Ow(e){return e.split("-")[0]}function Iw(e){return e.split("-")[1]}function Dw(e){return"x"===e?"y":"x"}function Uw(e){return"y"===e?"height":"width"}const Mw=new Set(["top","bottom"]);function zw(e){return Mw.has(Ow(e))?"y":"x"}function Fw(e){return Dw(zw(e))}function Lw(e){return e.replace(/start|end/g,e=>Tw[e])}const jw=["left","right"],$w=["right","left"],Vw=["top","bottom"],Ww=["bottom","top"];function Bw(e,t,r,n){const a=Iw(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?$w:jw:t?jw:$w;case"left":case"right":return t?Vw:Ww;default:return[]}}(Ow(e),"start"===r,n);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Lw)))),o}function Gw(e){return e.replace(/left|right|bottom|top/g,e=>_w[e])}function Kw(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Hw(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Zw(e,t,r){let{reference:n,floating:a}=e;const o=zw(t),s=Fw(t),i=Uw(s),l=Ow(t),c="y"===o,d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,f=n[i]/2-a[i]/2;let m;switch(l){case"top":m={x:d,y:n.y-a.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-a.width,y:u};break;default:m={x:n.x,y:n.y}}switch(Iw(t)){case"start":m[s]-=f*(r&&c?-1:1);break;case"end":m[s]+=f*(r&&c?-1:1)}return m}async function qw(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:s,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=Pw(t,e),p=Kw(m),h=i[f?"floating"===u?"reference":"floating":u],g=Hw(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===u?{x:n,y:a,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(i.floating)),v=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},w=Hw(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:b,offsetParent:y,strategy:l}):b);return{top:(g.top-w.top+p.top)/v.y,bottom:(w.bottom-g.bottom+p.bottom)/v.y,left:(g.left-w.left+p.left)/v.x,right:(w.right-g.right+p.right)/v.x}}function Jw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yw(e){return Sw.some(t=>e[t]>=0)}const Xw=new Set(["left","top"]);function Qw(){return"undefined"!=typeof window}function ex(e){return nx(e)?(e.nodeName||"").toLowerCase():"#document"}function tx(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rx(e){var t;return null==(t=(nx(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function nx(e){return!!Qw()&&(e instanceof Node||e instanceof tx(e).Node)}function ax(e){return!!Qw()&&(e instanceof Element||e instanceof tx(e).Element)}function ox(e){return!!Qw()&&(e instanceof HTMLElement||e instanceof tx(e).HTMLElement)}function sx(e){return!(!Qw()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tx(e).ShadowRoot)}const ix=new Set(["inline","contents"]);function lx(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=wx(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!ix.has(a)}const cx=new Set(["table","td","th"]);function dx(e){return cx.has(ex(e))}const ux=[":popover-open",":modal"];function fx(e){return ux.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const mx=["transform","translate","scale","rotate","perspective"],px=["transform","translate","scale","rotate","perspective","filter"],hx=["paint","layout","strict","content"];function gx(e){const t=bx(),r=ax(e)?wx(e):e;return mx.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||px.some(e=>(r.willChange||"").includes(e))||hx.some(e=>(r.contain||"").includes(e))}function bx(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const yx=new Set(["html","body","#document"]);function vx(e){return yx.has(ex(e))}function wx(e){return tx(e).getComputedStyle(e)}function xx(e){return ax(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sx(e){if("html"===ex(e))return e;const t=e.assignedSlot||e.parentNode||sx(e)&&e.host||rx(e);return sx(t)?t.host:t}function kx(e){const t=Sx(e);return vx(t)?e.ownerDocument?e.ownerDocument.body:e.body:ox(t)&&lx(t)?t:kx(t)}function Nx(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=kx(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),s=tx(a);if(o){const e=Ex(s);return t.concat(s,s.visualViewport||[],lx(a)?a:[],e&&r?Nx(e):[])}return t.concat(a,Nx(a,[],r))}function Ex(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cx(e){const t=wx(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ox(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:n,i=Ew(r)!==o||Ew(n)!==s;return i&&(r=o,n=s),{width:r,height:n,$:i}}function Ax(e){return ax(e)?e:e.contextElement}function _x(e){const t=Ax(e);if(!ox(t))return Aw(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=Cx(t);let s=(o?Ew(r.width):r.width)/n,i=(o?Ew(r.height):r.height)/a;return s&&Number.isFinite(s)||(s=1),i&&Number.isFinite(i)||(i=1),{x:s,y:i}}const Tx=Aw(0);function Rx(e){const t=tx(e);return bx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Tx}function Px(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=Ax(e);let s=Aw(1);t&&(n?ax(n)&&(s=_x(n)):s=_x(e));const i=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==tx(e))&&t}(o,r,n)?Rx(o):Aw(0);let l=(a.left+i.x)/s.x,c=(a.top+i.y)/s.y,d=a.width/s.x,u=a.height/s.y;if(o){const e=tx(o),t=n&&ax(n)?tx(n):n;let r=e,a=Ex(r);for(;a&&n&&t!==r;){const e=_x(a),t=a.getBoundingClientRect(),n=wx(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=o,c+=s,r=tx(a),a=Ex(r)}}return Hw({width:d,height:u,x:l,y:c})}function Ox(e,t){const r=xx(e).scrollLeft;return t?t.left+r:Px(rx(e)).left+r}function Ix(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Ox(e,r),y:r.top+t.scrollTop}}const Dx=new Set(["absolute","fixed"]);function Ux(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=tx(e),n=rx(e),a=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,i=0,l=0;if(a){o=a.width,s=a.height;const e=bx();(!e||e&&"fixed"===t)&&(i=a.offsetLeft,l=a.offsetTop)}const c=Ox(n);if(c<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:i,y:l}}(e,r);else if("document"===t)n=function(e){const t=rx(e),r=xx(e),n=e.ownerDocument.body,a=Nw(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Nw(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Ox(e);const i=-r.scrollTop;return"rtl"===wx(n).direction&&(s+=Nw(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:s,y:i}}(rx(e));else if(ax(t))n=function(e,t){const r=Px(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=ox(e)?_x(e):Aw(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:n*o.y}}(t,r);else{const r=Rx(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Hw(n)}function Mx(e,t){const r=Sx(e);return!(r===t||!ax(r)||vx(r))&&("fixed"===wx(r).position||Mx(r,t))}function zx(e,t,r){const n=ox(t),a=rx(t),o="fixed"===r,s=Px(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const l=Aw(0);function c(){l.x=Ox(a)}if(n||!n&&!o)if(("body"!==ex(t)||lx(a))&&(i=xx(t)),n){const e=Px(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!n&&a&&c();const d=!a||n||o?Aw(0):Ix(a,i);return{x:s.left+i.scrollLeft-l.x-d.x,y:s.top+i.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Fx(e){return"static"===wx(e).position}function Lx(e,t){if(!ox(e)||"fixed"===wx(e).position)return null;if(t)return t(e);let r=e.offsetParent;return rx(e)===r&&(r=r.ownerDocument.body),r}function jx(e,t){const r=tx(e);if(fx(e))return r;if(!ox(e)){let t=Sx(e);for(;t&&!vx(t);){if(ax(t)&&!Fx(t))return t;t=Sx(t)}return r}let n=Lx(e,t);for(;n&&dx(n)&&Fx(n);)n=Lx(n,t);return n&&vx(n)&&Fx(n)&&!gx(n)?r:n||function(e){let t=Sx(e);for(;ox(t)&&!vx(t);){if(gx(t))return t;if(fx(t))return null;t=Sx(t)}return null}(e)||r}const $x={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o="fixed"===a,s=rx(n),i=!!t&&fx(t.floating);if(n===s||i&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Aw(1);const d=Aw(0),u=ox(n);if((u||!u&&!o)&&(("body"!==ex(n)||lx(s))&&(l=xx(n)),ox(n))){const e=Px(n);c=_x(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const f=!s||u||o?Aw(0):Ix(s,l);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:r.y*c.y-l.scrollTop*c.y+d.y+f.y}},getDocumentElement:rx,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o="clippingAncestors"===r?fx(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Nx(e,[],!1).filter(e=>ax(e)&&"body"!==ex(e)),a=null;const o="fixed"===wx(e).position;let s=o?Sx(e):e;for(;ax(s)&&!vx(s);){const t=wx(s),r=gx(s);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&Dx.has(a.position)||lx(s)&&!r&&Mx(e,s))?n=n.filter(e=>e!==s):a=t,s=Sx(s)}return t.set(e,n),n}(t,this._c):[].concat(r),s=[...o,n],i=s[0],l=s.reduce((e,r)=>{const n=Ux(t,r,a);return e.top=Nw(n.top,e.top),e.right=kw(n.right,e.right),e.bottom=kw(n.bottom,e.bottom),e.left=Nw(n.left,e.left),e},Ux(t,i,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:jx,getElementRects:async function(e){const t=this.getOffsetParent||jx,r=this.getDimensions,n=await r(e.floating);return{reference:zx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Cx(e);return{width:t,height:r}},getScale:_x,isElement:ax,isRTL:function(e){return"rtl"===wx(e).direction}};function Vx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wx(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Ax(e),d=a||o?[...c?Nx(c):[],...Nx(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const u=c&&i?function(e,t){let r,n=null;const a=rx(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(i,l){void 0===i&&(i=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:m}=c;if(i||t(),!f||!m)return;const p={rootMargin:-Cw(u)+"px "+-Cw(a.clientWidth-(d+f))+"px "+-Cw(a.clientHeight-(u+m))+"px "+-Cw(d)+"px",threshold:Nw(0,kw(1,l))||1};let h=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!h)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||Vx(c,e.getBoundingClientRect())||s(),h=!1}try{n=new IntersectionObserver(g,{...p,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,p)}n.observe(e)}(!0),o}(c,r):null;let f,m=-1,p=null;s&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let h=l?Px(e):null;return l&&function t(){const n=Px(e);h&&!Vx(h,n)&&r();h=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Bx=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:s,middlewareData:i}=t,l=await async function(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),s=Ow(r),i=Iw(r),l="y"===zw(r),c=Xw.has(s)?-1:1,d=o&&l?-1:1,u=Pw(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return i&&"number"==typeof p&&(m="end"===i?-1*p:p),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}(t,e);return s===(null==(r=i.offset)?void 0:r.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:s}}}}},Gx=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...c}=Pw(e,t),d={x:r,y:n},u=await o.detectOverflow(t,c),f=zw(Ow(a)),m=Dw(f);let p=d[m],h=d[f];if(s){const e="y"===m?"bottom":"right";p=Rw(p+u["y"===m?"top":"left"],p,p-u[e])}if(i){const e="y"===f?"bottom":"right";h=Rw(h+u["y"===f?"top":"left"],h,h-u[e])}const g=l.fn({...t,[m]:p,[f]:h});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:s,[f]:i}}}}}},Kx=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=Pw(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const b=Ow(a),y=zw(i),v=Ow(i)===i,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(v||!h?[Gw(i)]:function(e){const t=Gw(e);return[Lw(e),t,Lw(t)]}(i)),S="none"!==p;!f&&S&&x.push(...Bw(i,h,p,w));const k=[i,...x],N=await l.detectOverflow(t,g),E=[];let C=(null==(n=o.flip)?void 0:n.overflows)||[];if(d&&E.push(N[b]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=Iw(e),a=Fw(e),o=Uw(a);let s="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Gw(s)),[s,Gw(s)]}(a,s,w);E.push(N[e[0]],N[e[1]])}if(C=[...C,{placement:a,overflows:E}],!E.every(e=>e<=0)){var A,_;const e=((null==(A=o.flip)?void 0:A.index)||0)+1,t=k[e];if(t){if(!("alignment"===u&&y!==zw(t))||C.every(e=>zw(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let r=null==(_=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:_.placement;if(!r)switch(m){case"bestFit":{var T;const e=null==(T=C.filter(e=>{if(S){const t=zw(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:T[0];e&&(r=e);break}case"initialPlacement":r=i}if(a!==r)return{reset:{placement:r}}}return{}}}},Hx=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:s,elements:i}=t,{apply:l=()=>{},...c}=Pw(e,t),d=await s.detectOverflow(t,c),u=Ow(a),f=Iw(a),m="y"===zw(a),{width:p,height:h}=o.floating;let g,b;"top"===u||"bottom"===u?(g=u,b=f===(await(null==s.isRTL?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(b=u,g="end"===f?"top":"bottom");const y=h-d.top-d.bottom,v=p-d.left-d.right,w=kw(h-d[g],y),x=kw(p-d[b],v),S=!t.middlewareData.shift;let k=w,N=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(N=v),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=y),S&&!f){const e=Nw(d.left,0),t=Nw(d.right,0),r=Nw(d.top,0),n=Nw(d.bottom,0);m?N=p-2*(0!==e||0!==t?e+t:Nw(d.left,d.right)):k=h-2*(0!==r||0!==n?r+n:Nw(d.top,d.bottom))}await l({...t,availableWidth:N,availableHeight:k});const E=await s.getDimensions(i.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}},Zx=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...o}=Pw(e,t);switch(a){case"referenceHidden":{const e=Jw(await n.detectOverflow(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Yw(e)}}}case"escaped":{const e=Jw(await n.detectOverflow(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Yw(e)}}}default:return{}}}}},qx=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:s,elements:i,middlewareData:l}=t,{element:c,padding:d=0}=Pw(e,t)||{};if(null==c)return{};const u=Kw(d),f={x:r,y:n},m=Fw(a),p=Uw(m),h=await s.getDimensions(c),g="y"===m,b=g?"top":"left",y=g?"bottom":"right",v=g?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[m]-f[m]-o.floating[p],x=f[m]-o.reference[m],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let k=S?S[v]:0;k&&await(null==s.isElement?void 0:s.isElement(S))||(k=i.floating[v]||o.floating[p]);const N=w/2-x/2,E=k/2-h[p]/2-1,C=kw(u[b],E),A=kw(u[y],E),_=C,T=k-h[p]-A,R=k/2-h[p]/2+N,P=Rw(_,R,T),O=!l.arrow&&null!=Iw(a)&&R!==P&&o.reference[p]/2-(R<_?C:A)-h[p]/2<0,I=O?R<_?R-_:R-T:0;return{[m]:f[m]+I,data:{[m]:P,centerOffset:R-P-I,...O&&{alignmentOffset:I}},reset:O}}}),Jx=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=Pw(e,t),d={x:r,y:n},u=zw(a),f=Dw(u);let m=d[f],p=d[u];const h=Pw(i,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+g.mainAxis,r=o.reference[f]+o.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(c){var b,y;const e="y"===f?"width":"height",t=Xw.has(Ow(a)),r=o.reference[u]-o.floating[e]+(t&&(null==(b=s.offset)?void 0:b[u])||0)+(t?0:g.crossAxis),n=o.reference[u]+o.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[u])||0)-(t?g.crossAxis:0);p<r?p=r:p>n&&(p=n)}return{[f]:m,[u]:p}}}},Yx=(e,t,r)=>{const n=new Map,a={platform:$x,...r},o={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:s}=r,i=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:u}=Zw(c,n,l),f=n,m={},p=0;for(let r=0;r<i.length;r++){var h;const{name:o,fn:g}=i[r],{x:b,y:y,data:v,reset:w}=await g({x:d,y:u,initialPlacement:n,placement:f,strategy:a,middlewareData:m,rects:c,platform:{...s,detectOverflow:null!=(h=s.detectOverflow)?h:qw},elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=y?y:u,m={...m,[o]:{...m[o],...v}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):w.rects),({x:d,y:u}=Zw(c,f,l))),r=-1)}return{x:d,y:u,placement:f,strategy:a,middlewareData:m}})(e,t,{...a,platform:o})};var Xx="undefined"!=typeof document?y:function(){};function Qx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Qx(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Qx(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eS(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tS(e,t){const r=eS(e);return Math.round(t*r)/r}function rS(e){const t=n.useRef(e);return Xx(()=>{t.current=e}),t}const nS=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?qx({element:r.current,padding:n}).fn(t):{}:r?qx({element:r,padding:n}).fn(t):{};var a}}),aS=(e,t)=>({...Bx(e),options:[e,t]}),oS=(e,t)=>({...Gx(e),options:[e,t]}),sS=(e,t)=>({...Jx(e),options:[e,t]}),iS=(e,t)=>({...Kx(e),options:[e,t]}),lS=(e,t)=>({...Hx(e),options:[e,t]}),cS=(e,t)=>({...Zx(e),options:[e,t]}),dS=(e,t)=>({...nS(e),options:[e,t]});var uS=n.forwardRef((e,r)=>{const{children:n,width:a=10,height:o=5,...s}=e;return t(rp.svg,{...s,ref:r,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t("polygon",{points:"0,0 30,0 15,10"})})});uS.displayName="Arrow";var fS=uS,mS="Popper",[pS,hS]=Km(mS),[gS,bS]=pS(mS),yS=e=>{const{__scopePopper:r,children:a}=e,[o,s]=n.useState(null);return t(gS,{scope:r,anchor:o,onAnchorChange:s,children:a})};yS.displayName=mS;var vS="PopperAnchor",wS=n.forwardRef((e,r)=>{const{__scopePopper:a,virtualRef:o,...s}=e,i=bS(vS,a),l=n.useRef(null),c=bd(r,l),d=n.useRef(null);return n.useEffect(()=>{const e=d.current;d.current=o?.current||l.current,e!==d.current&&i.onAnchorChange(d.current)}),o?null:t(rp.div,{...s,ref:c})});wS.displayName=vS;var xS="PopperContent",[SS,kS]=pS(xS),NS=n.forwardRef((e,r)=>{const{__scopePopper:a,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...b}=e,y=bS(xS,a),[w,x]=n.useState(null),S=bd(r,e=>x(e)),[k,N]=n.useState(null),E=Qg(k),C=E?.width??0,A=E?.height??0,_=o+("center"!==i?"-"+i:""),T="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(u)?u:[u],P=R.length>0,O={padding:T,boundary:R.filter(_S),altBoundary:P},{refs:I,floatingStyles:D,placement:U,isPositioned:M,middlewareData:z}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,f]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=n.useState(a);Qx(m,a)||p(a);const[h,g]=n.useState(null),[b,y]=n.useState(null),w=n.useCallback(e=>{e!==N.current&&(N.current=e,g(e))},[]),x=n.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),S=s||h,k=i||b,N=n.useRef(null),E=n.useRef(null),C=n.useRef(u),A=null!=c,_=rS(c),T=rS(o),R=rS(d),P=n.useCallback(()=>{if(!N.current||!E.current)return;const e={placement:t,strategy:r,middleware:m};T.current&&(e.platform=T.current),Yx(N.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==R.current};O.current&&!Qx(C.current,t)&&(C.current=t,v.flushSync(()=>{f(t)}))})},[m,t,r,T,R]);Xx(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[d]);const O=n.useRef(!1);Xx(()=>(O.current=!0,()=>{O.current=!1}),[]),Xx(()=>{if(S&&(N.current=S),k&&(E.current=k),S&&k){if(_.current)return _.current(S,k,P);P()}},[S,k,P,_,A]);const I=n.useMemo(()=>({reference:N,floating:E,setReference:w,setFloating:x}),[w,x]),D=n.useMemo(()=>({reference:S,floating:k}),[S,k]),U=n.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=tS(D.floating,u.x),n=tS(D.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...eS(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,D.floating,u.x,u.y]);return n.useMemo(()=>({...u,update:P,refs:I,elements:D,floatingStyles:U}),[u,P,I,D,U])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>Wx(...e,{animationFrame:"always"===h}),elements:{reference:y.anchor},middleware:[aS({mainAxis:s+A,alignmentAxis:l}),d&&oS({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?sS():void 0,...O}),d&&iS({...O}),lS({...O,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),k&&dS({element:k,padding:c}),TS({arrowWidth:C,arrowHeight:A}),p&&cS({strategy:"referenceHidden",...O})]}),[F,L]=RS(U),j=hm(g);bm(()=>{M&&j?.()},[M,j]);const $=z.arrow?.x,V=z.arrow?.y,W=0!==z.arrow?.centerOffset,[B,G]=n.useState();return bm(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),t("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:M?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t(SS,{scope:a,placedSide:F,onArrowChange:N,arrowX:$,arrowY:V,shouldHideArrow:W,children:t(rp.div,{"data-side":F,"data-align":L,...b,ref:S,style:{...b.style,animation:M?void 0:"none"}})})})});NS.displayName=xS;var ES="PopperArrow",CS={top:"bottom",right:"left",bottom:"top",left:"right"},AS=n.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,o=kS(ES,n),s=CS[o.placedSide];return t("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:t(fS,{...a,ref:r,style:{...a.style,display:"block"}})})});function _S(e){return null!==e}AS.displayName=ES;var TS=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,s=o?0:e.arrowWidth,i=o?0:e.arrowHeight,[l,c]=RS(r),d={start:"0%",center:"50%",end:"100%"}[c],u=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+i/2;let m="",p="";return"bottom"===l?(m=o?d:`${u}px`,p=-i+"px"):"top"===l?(m=o?d:`${u}px`,p=`${n.floating.height+i}px`):"right"===l?(m=-i+"px",p=o?d:`${f}px`):"left"===l&&(m=`${n.floating.width+i}px`,p=o?d:`${f}px`),{data:{x:m,y:p}}}});function RS(e){const[t,r="center"]=e.split("-");return[t,r]}var PS=yS,OS=wS,IS=NS,DS=AS;function US(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(o.ref=t?gd(t,e):e),n.cloneElement(r,o)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MS=Symbol("radix.slottable");function zS(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===MS}var FS="Popover",[LS]=Km(FS,[hS]),jS=hS(),[$S,VS]=LS(FS),WS=e=>{const{__scopePopover:r,children:a,open:o,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,c=jS(r),d=n.useRef(null),[u,f]=n.useState(!1),[m,p]=Xm({prop:o,defaultProp:s??!1,onChange:i,caller:FS});return t(PS,{...c,children:t($S,{scope:r,contentId:Jm(),triggerRef:d,open:m,onOpenChange:p,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>f(!0),[]),onCustomAnchorRemove:n.useCallback(()=>f(!1),[]),modal:l,children:a})})};WS.displayName=FS;var BS="PopoverAnchor";n.forwardRef((e,r)=>{const{__scopePopover:a,...o}=e,s=VS(BS,a),i=jS(a),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return n.useEffect(()=>(l(),()=>c()),[l,c]),t(OS,{...i,...o,ref:r})}).displayName=BS;var GS="PopoverTrigger",KS=n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,o=VS(GS,n),s=jS(n),i=bd(r,o.triggerRef),l=t(rp.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ak(o.open),...a,ref:i,onClick:Gm(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:t(OS,{asChild:!0,...s,children:l})});KS.displayName=GS;var HS="PopoverPortal",[ZS,qS]=LS(HS,{forceMount:void 0}),JS=e=>{const{__scopePopover:r,forceMount:n,children:a,container:o}=e,s=VS(HS,r);return t(ZS,{scope:r,forceMount:n,children:t(Sp,{present:n||s.open,children:t(xp,{asChild:!0,container:o,children:a})})})};JS.displayName=HS;var YS="PopoverContent",XS=n.forwardRef((e,r)=>{const n=qS(YS,e.__scopePopover),{forceMount:a=n.forceMount,...o}=e,s=VS(YS,e.__scopePopover);return t(Sp,{present:a||s.open,children:s.modal?t(ek,{...o,ref:r}):t(tk,{...o,ref:r})})});XS.displayName=YS;var QS=function(e){const r=US(e),a=n.forwardRef((e,a)=>{const{children:o,...s}=e,i=n.Children.toArray(o),l=i.find(zS);if(l){const e=l.props.children,o=i.map(t=>t===l?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,o):null})}return t(r,{...s,ref:a,children:o})});return a.displayName=`${e}.Slot`,a}("PopoverContent.RemoveScroll"),ek=n.forwardRef((e,r)=>{const a=VS(YS,e.__scopePopover),o=n.useRef(null),s=bd(r,o),i=n.useRef(!1);return n.useEffect(()=>{const e=o.current;if(e)return wh(e)},[]),t(mh,{as:QS,allowPinchZoom:!0,children:t(rk,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gm(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||a.triggerRef.current?.focus()}),onPointerDownOutside:Gm(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Gm(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),tk=n.forwardRef((e,r)=>{const a=VS(YS,e.__scopePopover),o=n.useRef(!1),s=n.useRef(!1);return t(rk,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||a.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const r=t.target,n=a.triggerRef.current?.contains(r);n&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),rk=n.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...f}=e,m=VS(YS,n),p=jS(n);return Ep(),t(pp,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(lp,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:t(IS,{"data-state":ak(m.open),role:"dialog",id:m.contentId,...p,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),nk="PopoverClose";n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,o=VS(nk,n);return t(rp.button,{type:"button",...a,ref:r,onClick:Gm(e.onClick,()=>o.onOpenChange(!1))})}).displayName=nk;function ak(e){return e?"open":"closed"}n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,o=jS(n);return t(DS,{...o,...a,ref:r})}).displayName="PopoverArrow";var ok=JS,sk=XS;const ik=WS,lk=KS,ck=n.forwardRef(({className:e,align:r="center",sideOffset:a=4,...o},s)=>{const{container:i}=n.useContext(Eo);return t(ok,{container:i,children:t(sk,{ref:s,align:r,sideOffset:a,className:je("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})})});function dk({options:r,value:n,onChange:a,placeholder:o="Search...",emptyLabel:s="Choose option"}){const[i,l]=f(n??""),[c,u]=f(!1);d(()=>{void 0!==n&&l(n)},[n]);const m=r.find(e=>e.value===i);return e(ik,{open:c,onOpenChange:u,children:[t(lk,{asChild:!0,children:e(su,{variant:"outline",role:"combobox","aria-expanded":c,className:"justify-between overflow-hidden text-ellipsis",children:[m?e("div",{children:[String(m.label).trim(),m.icon&&t("span",{className:"ml-2 text-xs text-muted-foreground",children:m.icon})]}):t("span",{className:"text-muted-foreground",children:s}),t(jd,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t(ck,{className:"p-0 overflow-hidden text-ellipsis",children:e(bw,{children:[t(yw,{placeholder:o}),t(vw,{children:t(ww,{children:r.map(r=>e(xw,{className:je("whitespace-nowrap text-left",{"text-green-500":i===r.value}),value:r.value,defaultValue:r.value,onSelect:()=>{return e=r.value,l(e),a?.(e),void u(!1);var e},children:[i===r.value&&t(Ld,{className:je("mr-2 h-4 w-4 text-green-400",i===r.value?"opacity-100":"opacity-0")}),String(r.label).trim(),r.icon&&t("span",{className:"ml-2 text-xs text-muted-foreground",children:r.icon})]},r.value))})})]})})]})}ck.displayName=sk.displayName;const uk={USD:"$",EUR:"โฌ",JPY:"ยฅ",GBP:"ยฃ",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"ยฅ",SEK:"kr",NZD:"NZ$",INR:"โน",RUB:"โฝ",KRW:"โฉ",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"โบ",IDR:"Rp",PLN:"zล",THB:"เธฟ",ILS:"โช",PHP:"โฑ",MYR:"RM",CZK:"Kฤ",HUF:"Ft",DKK:"kr",PKR:"โจ",EGP:"ยฃ",NGN:"โฆ",BDT:"เงณ",UAH:"โด",KZT:"โธ",VND:"โซ",ARS:"$",BGN:"ะปะฒ",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"ุฏ.ู
.",MNT:"โฎ",NPR:"เคฐเฅ",RSD:"ะดะธะฝ.",SAR:"ุฑ.ุณ",TWD:"NT$",UYU:"$U",YER:"๏ทผ",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ุจ.ุฏ",KWD:"ุฏ.ู",OMR:"ุฑ.ุน.",BND:"B$",KPW:"โฉ",GHS:"โต",SYP:"ู.ุณ",SLL:"Le",SSP:"ยฃ",AFN:"ุ",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"โพ",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"ยฃ",WST:"T",PGK:"K",KGS:"ะปะฒ",AZN:"โผ",QAR:"ุฑ.ู",XOF:"CFA",XPF:"CFP"},fk={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},mk=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=fk[e.code]||"USD",r=uk[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function pk({value:e,onChange:r}){const n=mk.map(e=>({value:e.value,label:e.text,icon:e.flag}));return t(dk,{options:n,value:e,onChange:r,placeholder:"Choose country...",emptyLabel:"Choose country"})}const hk=mk.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),gk=Array.from(new Set(hk.map(e=>e.value))).map(e=>hk.find(t=>t.value===e)).filter(e=>void 0!==e);function bk({value:e,onChange:r}){const n=gk.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return t(dk,{options:n,value:e,onChange:r,placeholder:"Choose currency...",emptyLabel:"Choose Currency"})}let yk=[{code:"en",label:"English",flag:"๐ฌ๐ง"},{code:"en-GB",label:"English (United Kingdom)",flag:"๐ฌ๐ง"},{code:"en-US",label:"English (United States)",flag:"๐บ๐ธ"},{code:"en-AU",label:"English (Australia)",flag:"๐ฆ๐บ"},{code:"en-CA",label:"English (Canada)",flag:"๐จ๐ฆ"},{code:"en-NZ",label:"English (New Zealand)",flag:"๐ณ๐ฟ"},{code:"es",label:"Spanish",flag:"๐ช๐ธ"},{code:"es-ES",label:"Spanish (Spain)",flag:"๐ช๐ธ"},{code:"es-MX",label:"Spanish (Mexico)",flag:"๐ฒ๐ฝ"},{code:"fr",label:"French",flag:"๐ซ๐ท"},{code:"fr-FR",label:"French (France)",flag:"๐ซ๐ท"},{code:"de",label:"German",flag:"๐ฉ๐ช"},{code:"de-DE",label:"German (Germany)",flag:"๐ฉ๐ช"},{code:"it",label:"Italian",flag:"๐ฎ๐น"},{code:"it-IT",label:"Italian (Italy)",flag:"๐ฎ๐น"},{code:"pt",label:"Portuguese",flag:"๐ต๐น"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"๐ต๐น"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"๐ง๐ท"},{code:"ru",label:"Russian",flag:"๐ท๐บ"},{code:"ru-RU",label:"Russian (Russia)",flag:"๐ท๐บ"},{code:"zh",label:"Chinese",flag:"๐จ๐ณ"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"๐จ๐ณ"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"๐น๐ผ"},{code:"ja",label:"Japanese",flag:"๐ฏ๐ต"},{code:"ja-JP",label:"Japanese (Japan)",flag:"๐ฏ๐ต"},{code:"ko",label:"Korean",flag:"๐ฐ๐ท"},{code:"ko-KR",label:"Korean (South Korea)",flag:"๐ฐ๐ท"},{code:"ar",label:"Arabic",flag:"๐ธ๐ฆ"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"๐ธ๐ฆ"},{code:"hi",label:"Hindi",flag:"๐ฎ๐ณ"},{code:"hi-IN",label:"Hindi (India)",flag:"๐ฎ๐ณ"},{code:"bn",label:"Bengali",flag:"๐ฎ๐ณ"},{code:"bn-IN",label:"Bengali (India)",flag:"๐ฎ๐ณ"},{code:"gu",label:"Gujarati",flag:"๐ฎ๐ณ"},{code:"gu-IN",label:"Gujarati (India)",flag:"๐ฎ๐ณ"},{code:"ta",label:"Tamil",flag:"๐ฎ๐ณ"},{code:"ta-IN",label:"Tamil (India)",flag:"๐ฎ๐ณ"},{code:"te",label:"Telugu",flag:"๐ฎ๐ณ"},{code:"te-IN",label:"Telugu (India)",flag:"๐ฎ๐ณ"},{code:"ml",label:"Malayalam",flag:"๐ฎ๐ณ"},{code:"ml-IN",label:"Malayalam (India)",flag:"๐ฎ๐ณ"},{code:"kn",label:"Kannada",flag:"๐ฎ๐ณ"},{code:"kn-IN",label:"Kannada (India)",flag:"๐ฎ๐ณ"},{code:"mr",label:"Marathi",flag:"๐ฎ๐ณ"},{code:"mr-IN",label:"Marathi (India)",flag:"๐ฎ๐ณ"},{code:"pa",label:"Punjabi",flag:"๐ฎ๐ณ"},{code:"pa-IN",label:"Punjabi (India)",flag:"๐ฎ๐ณ"},{code:"ur",label:"Urdu",flag:"๐ฎ๐ณ"},{code:"ur-IN",label:"Urdu (India)",flag:"๐ฎ๐ณ"},{code:"or",label:"Odia",flag:"๐ฎ๐ณ"},{code:"or-IN",label:"Odia (India)",flag:"๐ฎ๐ณ"},{code:"as",label:"Assamese",flag:"๐ฎ๐ณ"},{code:"as-IN",label:"Assamese (India)",flag:"๐ฎ๐ณ"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"๐ญ๐ฐ"},{code:"nl",label:"Dutch",flag:"๐ณ๐ฑ"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"๐ณ๐ฑ"},{code:"pl",label:"Polish",flag:"๐ต๐ฑ"},{code:"pl-PL",label:"Polish (Poland)",flag:"๐ต๐ฑ"},{code:"sv",label:"Swedish",flag:"๐ธ๐ช"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"๐ธ๐ช"},{code:"da",label:"Danish",flag:"๐ฉ๐ฐ"},{code:"da-DK",label:"Danish (Denmark)",flag:"๐ฉ๐ฐ"},{code:"no",label:"Norwegian",flag:"๐ณ๐ด"},{code:"no-NO",label:"Norwegian (Norway)",flag:"๐ณ๐ด"},{code:"fi",label:"Finnish",flag:"๐ซ๐ฎ"},{code:"fi-FI",label:"Finnish (Finland)",flag:"๐ซ๐ฎ"},{code:"tr",label:"Turkish",flag:"๐น๐ท"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"๐น๐ท"},{code:"cs",label:"Czech",flag:"๐จ๐ฟ"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"๐จ๐ฟ"},{code:"sk",label:"Slovak",flag:"๐ธ๐ฐ"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"๐ธ๐ฐ"},{code:"hu",label:"Hungarian",flag:"๐ญ๐บ"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"๐ญ๐บ"},{code:"ro",label:"Romanian",flag:"๐ท๐ด"},{code:"ro-RO",label:"Romanian (Romania)",flag:"๐ท๐ด"},{code:"el",label:"Greek",flag:"๐ฌ๐ท"},{code:"el-GR",label:"Greek (Greece)",flag:"๐ฌ๐ท"},{code:"th",label:"Thai",flag:"๐น๐ญ"},{code:"th-TH",label:"Thai (Thailand)",flag:"๐น๐ญ"},{code:"id",label:"Indonesian",flag:"๐ฎ๐ฉ"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"๐ฎ๐ฉ"},{code:"ms",label:"Malay",flag:"๐ฒ๐พ"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"๐ฒ๐พ"},{code:"vi",label:"Vietnamese",flag:"๐ป๐ณ"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"๐ป๐ณ"},{code:"he",label:"Hebrew",flag:"๐ฎ๐ฑ"},{code:"he-IL",label:"Hebrew (Israel)",flag:"๐ฎ๐ฑ"}];yk=yk.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),yk.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const vk=yk.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function wk({value:e,onChange:r}){const n=vk.map(e=>({value:e.value,label:e.label,icon:e.flag}));return t(dk,{options:n,value:e,onChange:r,placeholder:"Choose language...",emptyLabel:"Choose language"})}const xk=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],o=t.text;let s=o.substring(o.indexOf("(")+1,o.indexOf(")"));-1!==s.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${s}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function Sk({value:e,onChange:r}){const n=xk.map(e=>({value:e.value,label:e.text}));return t(dk,{options:n,value:e,onChange:r,placeholder:"Choose timezone...",emptyLabel:"Choose timezone"})}const kk=({workspace:r})=>{const{updateUserProfile:n,getProfile:a}=Sr(),[o,i]=f(!1),[l,c]=f(),[u,m]=f(0),[p,h]=f(null),g=s(null);d(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=si({resolver:pd(Nf({name:Ju().min(2,{message:"Name must be at least 2 characters."}),country:Ju().optional(),timezone:Ju().optional(),language:Ju().optional(),currency:Ju().optional()})),defaultValues:{name:l?.name||"",country:l?.country||"",timezone:l?.timezone||"",language:l?.language||"",currency:l?.currency||""}});return d(()=>{a().then(e=>{c(e),b.setValue("name",e.name),b.setValue("country",e.country),b.setValue("timezone",e.timezone),b.setValue("language",e.language),b.setValue("currency",e.currency)})},[u]),l?e("div",{children:[p&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:"Success!"}),t("p",{className:"text-sm",children:p})]}),t("div",{className:"space-y-4",children:t(fu,{...b,children:e("form",{onSubmit:b.handleSubmit(async function(e){i(!0),h(null);try{await n({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),h("Profile saved successfully"),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{h(null)},5e3)}catch(e){Ye(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{i(!1)}}),className:"space-y-4",children:[e("div",{children:[t("label",{className:"block text-sm font-medium mb-1",children:"Email"}),t(Su,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:l?.email})]}),t(pu,{disabled:o,control:b.control,name:"name",render:({field:r})=>e(bu,{children:[t(yu,{children:"Name"}),t(vu,{children:t(Su,{...r})}),t(xu,{})]})}),e("div",{className:"flex gap-y-2 my-4 flex-col",children:[e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:"Language"}),t(wk,{value:b.watch("language"),onChange:e=>{b.setValue("language",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:"Country"}),t(pk,{value:b.watch("country"),onChange:e=>{b.setValue("country",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:"Currency"}),t(bk,{value:b.watch("currency"),onChange:e=>{b.setValue("currency",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:"Timezone"}),t(Sk,{value:b.watch("timezone"),onChange:e=>{b.setValue("timezone",e)}})]})]}),e("div",{className:"flex justify-end gap-x-2",children:[t(su,{type:"submit",progress:o,disabled:o,children:"Save"}),t(su,{type:"button",variant:"outline",onClick:()=>{m(e=>e+1)},disabled:o,children:"Reset"})]})]})})}),l?.image&&e("div",{children:[t("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),t("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:t("img",{src:l.image,alt:l.name,className:"w-full h-full object-cover"})})]})]}):t(rv,{})};function Nk(e,t){const r=e.pricingVariants;if(!r?.length)return null;const n=t.toLowerCase();return r.find(e=>e.currency?.toLowerCase()===n)??null}function Ek(e,t,r){const n=Nk(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function Ck(e,t,r){const n=Nk(e,t);if(!n?.stripePrices)return null;const a="monthly"===r?"monthlyPriceId":"yearly"===r?"yearlyPriceId":"quarterlyPriceId",o="monthly"===r?"monthly":"yearly"===r?"yearly":void 0;return n.stripePrices[a]??(o?n.stripePrices[o]:void 0)??null}function Ak(e,t,r,n){const a=Nk(e,t),o=a?.quotaOverages?.[r];if(o)return o[n]}function _k(e,t){const r=Nk(e,t);return r?r.currency:e.plan?.currency??""}function Tk(e){const t=new Set;for(const r of e)r.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}function Rk(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const o=a[n];if(!o)return null;const s=Ak(e,t,r,n);return{included:o.included,...void 0!==o.unitSize&&{unitSize:o.unitSize},...void 0!==s&&{overage:s}}}function Pk(e,t){if(!e)return null;for(const r of t){const t=r.pricingVariants;if(t?.length)for(const r of t){const t=r.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:r.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:r.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:r.currency}}}}return null}function Ok(e,t){const r=Nk(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function Ik(e,t,r){const n=Ok(e,t);return n?.perSeat?n.perSeat[r]??null:null}function Dk(e,t){return Math.max(0,e-(t||0))}function Uk(e,t,r,n){const a=Ok(e,t);if(!a)return null;return Dk(n,a.includedSeats)*(Ik(e,t,r)??0)}function Mk(e,t,r,n){const a=Ek(e,t,r);if(null===a)return null;if(void 0===n)return a;return a+(Uk(e,t,r,n)??0)}function zk(e,t){if(null==e)return null;const r=e[t??"monthly"];return r?{included:r.included,...void 0!==r.overage&&{overage:r.overage},...void 0!==r.unitSize&&{unitSize:r.unitSize}}:null}function Fk(e,t,r={}){const{overageInCents:n=!0,currency:a}=r,o=r.currencySymbol??wv(a??"");if(null==e)return"โ";const{included:s,overage:i}=e,l=`${s} included`;if(null==i)return l;const c=n?i/100:i;return`${l}, then ${o}${"number"==typeof c&&Number.isFinite(c)?c.toFixed(2):String(i)}${t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?` / ${e.unitSize.toLocaleString()} ${t}`:t?` / ${t}`:""}`}const Lk=(e,t)=>{const r=(t??"").trim();return r?new Intl.NumberFormat("en-US",{style:"currency",currency:r.toUpperCase(),minimumFractionDigits:2}).format(e/100):(e/100).toFixed(2)},jk=e=>{switch(e){case"paid":return"bg-green-100 text-green-800";case"open":return"bg-yellow-100 text-yellow-800";case"draft":case"void":default:return"bg-gray-100 text-gray-800";case"uncollectible":return"bg-red-100 text-red-800"}},$k=({workspaceId:n,hasActiveSubscription:a=!1,onViewPricingPlans:o,limit:s=20})=>{const{invoices:i,loading:l,error:c,refetch:d}=Ir(n,s),u=i.length>0;return e("div",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:[e("div",{children:[t("h3",{className:"text-lg font-semibold",children:"Billing History"}),t("p",{className:"text-sm text-gray-600",children:"View and download your invoices"})]}),t(su,{variant:"ghost",size:"sm",progress:l,onClick:d,disabled:l,children:l?"Refreshing...":"Refresh"})]}),c&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:"Error loading invoices"}),t("p",{className:"text-sm mt-1",children:c})]}),t(su,{variant:"outline",size:"sm",onClick:d,disabled:l,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:l?"Retrying...":"Retry"})]}),l&&!u?t("div",{className:"border rounded-lg p-6",children:t(rv,{})}):u?t("div",{className:"space-y-2",children:i.map(n=>{const a=(e=>{switch(e.status){case"draft":case"open":return{text:"Pay",color:"bg-blue-600 hover:bg-blue-700"};case"paid":return{text:"View",color:"bg-green-600 hover:bg-green-700"};case"uncollectible":case"void":return{text:"View Details",color:"bg-gray-600 hover:bg-gray-700"};default:return{text:"View",color:"bg-gray-600 hover:bg-gray-700"}}})(n);return e("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[t("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:n.description||n.number||`Invoice ${n.id.slice(-8)}`}),t("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${jk(n.status)}`,children:n.status.charAt(0).toUpperCase()+n.status.slice(1)})]}),e("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[t("span",{className:"font-medium text-gray-900",children:Lk(n.amount_due,n.currency)}),n.created&&e(r,{children:[t("span",{className:"text-gray-300 hidden sm:inline",children:"ยท"}),t("span",{children:(o=n.created,o?new Date(1e3*o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"N/A")})]}),n.amount_paid>0&&n.amount_due>0&&e("span",{className:"text-xs text-gray-500",children:["Paid: ",Lk(n.amount_paid,n.currency)]})]}),e("div",{className:"flex items-center gap-2",children:[e(su,{size:"sm",disabled:!n.hosted_invoice_url,onClick:()=>n.hosted_invoice_url&&window.open(n.hosted_invoice_url,"_blank","noopener,noreferrer"),className:a.color,children:[a.text,t(Wd,{className:"h-3 w-3 ml-1.5"})]}),n.invoice_pdf&&e(su,{size:"sm",variant:"outline",onClick:()=>window.open(n.invoice_pdf,"_blank","noopener,noreferrer"),children:[t(Vd,{className:"h-3 w-3 mr-1.5"}),"PDF"]})]})]},n.id);var o})}):e("div",{className:"border rounded-lg p-6 text-center",children:[t(Bd,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),t("p",{className:"text-sm text-gray-500",children:a?"No invoices with download option found":"No invoices yet. Subscribe to a plan to receive invoices."}),!a&&o&&t(su,{size:"sm",className:"mt-4",onClick:o,children:"View Pricing Plans"})]})]})},Vk=h(()=>Promise.resolve().then(function(){return PE}).then(e=>({default:e.default}))),Wk=e=>{if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?"":new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(t)}catch{return""}},Bk=({workspace:n})=>{const a=n._id?.toString(),{subscription:o,loading:l,error:c,updateSubscription:u,refetch:m}=Or(a),{createCheckoutSession:h}=Rr(a),{cancelSubscription:g,loading:b}=Ur(a),{resumeSubscription:y,loading:v}=Mr(a),{versions:w,loading:x,error:S,refetch:k}=Tr(a),N=l||x,E=c||S,{currentVersion:C,latestVersion:A,isDeprecated:_,whatsNew:T,plansToShow:R}=i(()=>{const e=w?.currentVersion,t=w?.availableVersions||[],r=null!=o?.subscription;let n=null;t.length>0?n=t.reduce((e,t)=>t.version>e.version?t:e):e&&(n=e);const a=!!(r&&n&&e)&&n.version>e.version,s=n?.plans&&n.plans.length>0?n.plans:[];return{currentVersion:e,latestVersion:n,hasNewerVersion:a,isDeprecated:a&&r,whatsNew:n?.whatsNew,plansToShow:s}},[w,o?.subscription]),[P,O]=f(!1),[I,D]=f(null),[U,M]=f(null),z=s(null),[F,L]=f(!1),[j,$]=f(!1);d(()=>()=>{z.current&&clearTimeout(z.current)},[]);const[V,W]=f(!1),[B,G]=f("subscription"),K=async()=>{await Promise.all([m(),k()])},H=i(()=>Pk(o?.subscription?.stripePriceId,R??[]),[o?.subscription?.stripePriceId,R]);if(N&&!o&&!w)return t(rv,{});const Z=o?.planVersion?._id||null;return a?e("div",{className:"space-y-6",children:[E&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:"Error loading subscription data"}),t("p",{className:"text-sm mt-1",children:E}),t("p",{className:"text-xs mt-2 text-red-600",children:"Please check your connection and try again."})]}),t(su,{variant:"outline",size:"sm",onClick:K,disabled:N,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:N?"Retrying...":"Retry"})]}),I&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:"Update failed"}),t("p",{className:"text-sm mt-1",children:I})]}),t(su,{variant:"outline",size:"sm",onClick:()=>D(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:"Dismiss"})]}),U&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:"Success!"}),t("p",{className:"text-sm mt-1",children:U})]}),t(su,{variant:"outline",size:"sm",onClick:()=>M(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:"Dismiss"})]}),t("div",{className:"border-b border-gray-200",children:e("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[t("button",{type:"button",onClick:()=>G("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===B?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:"Plan"}),t("button",{type:"button",onClick:()=>G("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===B?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:"Invoices"})]})}),"subscription"===B&&e(r,{children:[N&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[t(Kd,{className:"h-4 w-4 animate-spin flex-shrink-0"}),t("span",{children:"Loading subscription and pricing plans..."})]}),_&&o?.subscription&&e("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t(ru,{className:"h-4 w-4 text-amber-600 shrink-0"}),e("span",{className:"text-sm text-amber-800",children:[t("span",{className:"font-medium",children:"Plan update available"}),e("span",{className:"text-amber-600",children:[" โ v",C?.version||"?"," โ v",A?.version||"?"]})]})]}),t(su,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>L(!0),children:"View Plans"})]}),e("div",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:[t("div",{children:t("p",{className:"text-sm text-gray-600",children:"Manage your plan and billing"})}),e("div",{className:"flex items-center gap-2",children:[o?.subscription?.cancelAtPeriodEnd||b?null:o?.subscription?t(su,{variant:"outline",size:"sm",onClick:()=>L(!0),children:"Change Plan"}):!o?.subscription&&R&&R.length>0?t(su,{size:"sm",onClick:()=>L(!0),children:"View Pricing Plans"}):null,t(su,{variant:"ghost",size:"sm",progress:N,onClick:K,disabled:N||P,children:N?"Refreshing...":"Refresh"})]})]}),o?.subscription?(()=>{const a=Pk(o.subscription.stripePriceId,R??[]),s=a?.interval??null,i=a?.currency??o.plan?.currency??n?.billingCurrency??"",l=s&&o.planVersion?Ek(o.planVersion,i,s):null,c=i,d=o.planVersion?Ok(o.planVersion,i):null,u=d&&s?Ik(o.planVersion,i,s):null,f=Array.isArray(n?.users)?n.users.length:1,m=d?.includedSeats??0,p=Math.max(0,f-m),h=null!=l?0===l?"Free":kv(l,c):null,g="monthly"===s?"/month":"quarterly"===s?"/quarter":"yearly"===s?"/year":"";return e("div",{className:"border rounded-lg overflow-hidden "+(_?"border-amber-300":"border-gray-200"),children:["trialing"===o.subscription.subscriptionStatus&&(()=>{const r=o.subscription.trialEnd||o.subscription.stripeCurrentPeriodEnd,n=r?new Date(r):null,a=n&&!isNaN(n.getTime())?n:null,s=a?Math.max(0,Math.ceil((a.getTime()-Date.now())/864e5)):null,i=null!==s&&s<=3;return e("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(i?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e("span",{children:[null!==s&&s<=0?"Your trial has ended.":null!==s?`Your trial ends in ${s} day${1===s?"":"s"}.`:"You are on a trial."," ","Upgrade to keep access."]}),t(su,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>L(!0),children:"Upgrade Now"})]})})(),e("div",{className:"p-4 sm:p-5 "+(_?"bg-amber-50/50":"bg-gray-50/50"),children:[e("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[t("h3",{className:"text-lg font-semibold text-gray-900",children:o.plan?.name||"No plan assigned"}),e("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+("active"===o.subscription.subscriptionStatus?o.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":"trialing"===o.subscription.subscriptionStatus?"bg-blue-100 text-blue-800":"canceled"===o.subscription.subscriptionStatus?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:["active"===o.subscription.subscriptionStatus&&(o.subscription.cancelAtPeriodEnd?"Canceling":"Active"),"trialing"===o.subscription.subscriptionStatus&&"Trial","canceled"===o.subscription.subscriptionStatus&&"Canceled","past_due"===o.subscription.subscriptionStatus&&"Past Due"]}),"trialing"===o.subscription.subscriptionStatus&&Wk(o.subscription.trialEnd||o.subscription.stripeCurrentPeriodEnd)&&e("span",{className:"text-xs text-gray-500",children:["(ends"," ",Wk(o.subscription.trialEnd||o.subscription.stripeCurrentPeriodEnd),")"]}),_&&e("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[t(ru,{className:"h-3 w-3"}),"Deprecated"]})]}),o.plan?.description&&t("p",{className:"text-sm text-gray-600 mb-3",children:o.plan.description}),e("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e("div",{children:[e("div",{className:"flex items-baseline gap-1",children:[t("span",{className:"text-2xl font-bold text-gray-900",children:h||"N/A"}),h&&"Free"!==h&&g&&t("span",{className:"text-sm text-gray-500",children:g})]}),d&&u&&u>0&&e("div",{className:"text-xs text-gray-500 mt-1",children:["+ ",kv(u,c),"/seat",g]}),d&&u&&u>0&&p>0&&h&&"Free"!==h&&null!=l&&e("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:["Est. total: ",e("span",{className:"font-medium text-gray-700",children:[kv(l+u*p,c),g]}),e("span",{className:"text-gray-400",children:[" (",p," extra seat",1!==p?"s":"",")"]})]})]}),("active"===o.subscription.subscriptionStatus||"trialing"===o.subscription.subscriptionStatus)&&!o.subscription.cancelAtPeriodEnd&&Wk(o.subscription.stripeCurrentPeriodEnd)&&e("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[t(zd,{className:"h-3.5 w-3.5 flex-shrink-0"}),e("span",{children:["Next billing:"," ",t("span",{className:"font-medium text-gray-700",children:Wk(o.subscription.stripeCurrentPeriodEnd)})]})]})]}),_&&e("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",C?.version||"N/A"," - A newer version is available"]}),("active"===o.subscription.subscriptionStatus||"trialing"===o.subscription.subscriptionStatus)&&t("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:"active"===o.subscription.subscriptionStatus&&o.subscription.cancelAtPeriodEnd?t(su,{variant:"outline",size:"sm",onClick:()=>W(!0),disabled:P||b||v,progress:v,children:"Resume Subscription"}):t(su,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>$(!0),disabled:P||b||v,progress:b||P,children:b||P?"Canceling...":"trialing"===o.subscription.subscriptionStatus?"Cancel Trial":"Cancel Subscription"})})]}),"past_due"===o.subscription.subscriptionStatus&&t("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e("div",{className:"flex items-start gap-3",children:[t(ru,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-red-800",children:"Payment past due"}),t("p",{className:"text-sm text-red-700 mt-0.5",children:"Please update your payment method to avoid service interruption. Check your invoices for details."}),t(su,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>G("invoices"),children:"View Invoices"})]})]})}),"past_due"===o.subscription.subscriptionStatus&&o.subscription.dunningState&&"none"!==o.subscription.dunningState&&t("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e("div",{className:"flex items-start gap-3",children:[t(ru,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-red-800",children:"final"===o.subscription.dunningState?"Final warning: Subscription will be suspended":"suspended"===o.subscription.dunningState?"Subscription suspended":"Payment recovery in progress"}),t("p",{className:"text-sm text-red-700 mt-0.5",children:"suspended"===o.subscription.dunningState?"Your subscription has been suspended due to repeated payment failures. Update your payment method to restore access.":"We were unable to process your payment. Please update your payment method to avoid losing access."})]})]})}),"paused"===o.subscription.subscriptionStatus&&t("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e("div",{className:"flex items-start gap-3",children:[t(zd,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-blue-800",children:"Subscription paused"}),t("p",{className:"text-sm text-blue-700 mt-0.5",children:"Your subscription is currently paused. Resume to restore full access."})]})]})}),o.subscription.cancelAtPeriodEnd&&t("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e("div",{className:"flex items-start gap-3",children:[t(zd,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-amber-800",children:"Subscription scheduled for cancellation"}),t("p",{className:"text-sm text-amber-700 mt-0.5",children:Wk(o.subscription.stripeCurrentPeriodEnd)?e(r,{children:["Your subscription will end on"," ",t("span",{className:"font-medium",children:Wk(o.subscription.stripeCurrentPeriodEnd)}),". You'll retain access until then and won't be charged again."]}):"Your subscription will be canceled at the end of the current billing period. You won't be charged again."})]})]})}),o.planVersion&&(()=>{const r=((e,t,r="monthly")=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],o=[];return e.subscriptionItems.forEach(s=>{const i=s.slug;if("feature"===s.type){const t=e.features?.[i]??!1;n.push({item:s,enabled:t})}else if("limit"===s.type){const t=e.limits?.[i]??0;a.push({item:s,value:t})}else if("quota"===s.type){const n=t&&e.pricingVariants?.length?Rk(e,t,i,r):zk(e.quotas?.[i],r);null!=n&&o.push({item:s,value:n})}}),{features:n,limits:a,quotas:o}})(o.planVersion,i,s??"monthly");return r.features.length>0||r.limits.length>0||r.quotas.length>0?t("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e("div",{className:"space-y-5",children:[r.features.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Features"}),t("ul",{className:"space-y-1.5",children:r.features.sort(e=>e.enabled?-1:1).map(({item:r,enabled:n})=>e("li",{className:"flex items-center gap-2 text-sm",children:[t("span",{className:"w-4 text-center shrink-0 "+(n?"text-green-500":"text-gray-300"),children:n?"โ":"โ"}),t("span",{className:n?"text-gray-700":"text-gray-400",children:r.name})]},r._id))})]}),r.limits.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Limits"}),t("ul",{className:"space-y-1.5",children:r.limits.map(({item:r,value:n})=>e("li",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:r.name}),t("span",{className:"font-medium text-gray-900",children:n})]},r._id))})]}),r.quotas.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Usage Quotas"}),t("ul",{className:"space-y-1.5",children:r.quotas.map(({item:r,value:n})=>{const a=Fk(n,r.name.toLowerCase(),{currency:i});return t("li",{className:"text-sm",children:e("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[t("span",{className:"text-gray-600",children:r.name}),t("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:a})]})},r._id)})})]}),d&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Seats"}),e("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:"Members"}),t("span",{className:"font-semibold text-gray-900",children:f})]}),e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:"Included"}),t("span",{className:"text-gray-900",children:m})]}),p>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:"Billable"}),e("span",{className:"font-medium text-amber-600",children:[p," extra"]})]}),u&&u>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:"Per extra seat"}),e("span",{className:"text-gray-900",children:[kv(u,i),g]})]}),d.maxSeats>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:"Limit"}),t("span",{className:"text-gray-900",children:d.maxSeats})]})]})]})]})}):null})()]})})():n.pendingOnboarding?e("div",{className:"border rounded-lg p-6 text-center",children:[e("div",{className:"mb-4",children:[t($d,{className:"h-12 w-12 mx-auto mb-3 text-blue-400"}),t("p",{className:"text-lg font-medium text-gray-700",children:"Start your free trial"}),t("p",{className:"text-sm text-gray-500 mt-1",children:"Try the full plan with no commitment. You can upgrade or cancel anytime."})]}),t(su,{size:"sm",progress:P,onClick:async()=>{try{O(!0);const e=await h({planVersionId:n.pendingOnboarding?.planVersionId??""});e&&"checkoutUrl"in e&&e.checkoutUrl&&(window.location.href=e.checkoutUrl)}catch(e){}finally{O(!1)}},children:"Start Free Trial"}),R&&R.length>0&&t(su,{variant:"ghost",size:"sm",className:"ml-2",onClick:()=>L(!0),children:"View All Plans"})]}):e("div",{className:"border rounded-lg p-6 text-center",children:[e("div",{className:"mb-4",children:[t($d,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),t("p",{className:"text-lg font-medium text-gray-700",children:"You don't have an active subscription"}),t("p",{className:"text-sm text-gray-500 mt-1",children:"Choose a plan to get started with your workspace"})]}),R&&R.length>0&&t(su,{size:"sm",onClick:()=>L(!0),children:"View Pricing Plans"})]})]}),!w&&!N&&e("div",{className:"border rounded-lg p-4 text-center",children:[e("div",{className:"text-gray-500 mb-2",children:[t("p",{className:"font-medium",children:"Unable to load plan information"}),E&&e("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",E]}),!E&&t("p",{className:"text-sm mt-2",children:"No plan groups are available for this workspace. Please contact support if you believe this is an error."})]}),t(su,{variant:"outline",size:"sm",progress:N,onClick:K,disabled:N,className:"mt-4",children:N?"Refreshing...":"Refresh"})]})]}),"invoices"===B&&e(r,{children:[N&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[t(Kd,{className:"h-4 w-4 animate-spin flex-shrink-0"}),t("span",{children:"Loading invoices..."})]}),t($k,{workspaceId:a,hasActiveSubscription:null!==o?.subscription,onViewPricingPlans:()=>G("subscription"),limit:20})]}),R&&R.length>0&&t(p,{fallback:F?t("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t(Kd,{className:"h-5 w-5 animate-spin"}),t("span",{children:"Loading plans..."})]})}):null,children:t(Vk,{open:F,onOpenChange:L,planVersions:R,currentPlanVersionId:Z||null,currentStripePriceId:o?.subscription?.stripePriceId,billingCurrency:n.billingCurrency,currentMemberCount:Array.isArray(n?.users)?n.users.length:void 0,onSelectPlan:async(e,t="monthly",r)=>{if(!a)return;const s=R?.find(t=>t._id===e),i=r??H?.currency??o?.plan?.currency??n?.billingCurrency??"",l=s?Ck(s,i,t):null,c=o?.subscription?.stripePriceId;if(!l||!c||l!==c){O(!0),D(null),M(null);try{let r,n,a;try{const e=new URL(window.location.href);r=e.toString(),n=e.toString()}catch{const e=window.location.protocol||"https:",t=window.location.host||window.location.hostname||"",a=`${e}//${t}${window.location.pathname||"/"}`;r=a,n=a}if(a=o?.subscription?await u(e,{billingInterval:t,successUrl:r,cancelUrl:n}):await h({planVersionId:e,billingInterval:t,currency:i||void 0,successUrl:r,cancelUrl:n}),a&&"checkoutUrl"in a&&a.checkoutUrl)return void(window.location.href=a.checkoutUrl);M("Subscription updated successfully!"),await K()}catch(e){const t=e instanceof Error?e.message:"Failed to process subscription";D(t)}finally{O(!1),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{D(null),M(null)},5e3)}}},loading:P||N})}),t(Gy,{open:V,onOpenChange:W,children:e(qy,{children:[e(Jy,{children:[t(Xy,{children:"Resume Subscription"}),t(Qy,{asChild:!0,children:e("div",{className:"space-y-3",children:[t("p",{children:"Are you sure you want to resume your subscription?"}),e("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t(ru,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e("span",{children:["You will be charged again on"," ",o?.subscription?.stripeCurrentPeriodEnd&&Wk(o.subscription.stripeCurrentPeriodEnd)?t("span",{className:"font-medium",children:Wk(o.subscription.stripeCurrentPeriodEnd)}):"the next billing date"]})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-amber-600 mt-0.5",children:"โข"}),t("span",{children:"Your subscription will continue automatically and you'll be billed according to your plan"})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-blue-600 mt-0.5",children:"โน"}),t("span",{children:"You can cancel anytime before the next billing date if you change your mind"})]})]})]})})]}),e(Yy,{children:[t(tv,{disabled:v,children:"Keep Canceled"}),t(ev,{onClick:async()=>{if(a){W(!1),O(!0),D(null),M(null);try{await y(),M("Subscription has been resumed."),await K()}catch(e){const t=e instanceof Error?e.message:"Failed to resume subscription";D(t)}finally{O(!1),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{D(null),M(null)},5e3)}}},disabled:v,children:v?"Resuming...":"Yes, Resume Subscription"})]})]})}),t(Gy,{open:j,onOpenChange:$,children:e(qy,{children:[e(Jy,{children:[t(Xy,{children:"Cancel Subscription"}),t(Qy,{asChild:!0,children:e("div",{className:"space-y-3",children:[t("p",{children:"Are you sure you want to cancel your subscription?"}),e("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-green-600 mt-0.5",children:"โ"}),e("span",{children:["You'll retain full access to this plan until"," ",o?.subscription?.stripeCurrentPeriodEnd&&Wk(o.subscription.stripeCurrentPeriodEnd)?t("span",{className:"font-medium",children:Wk(o.subscription.stripeCurrentPeriodEnd)}):"the end of your current billing period"]})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-green-600 mt-0.5",children:"โ"}),t("span",{children:"You won't be charged again after cancellation"})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-blue-600 mt-0.5",children:"โน"}),t("span",{children:"You can resume your subscription anytime before it ends"})]})]})]})})]}),e(Yy,{children:[t(tv,{disabled:b,children:"Keep Subscription"}),t(ev,{onClick:async()=>{if(a){$(!1),O(!0),D(null),M(null);try{await g(),M("Subscription will be canceled at the end of the billing period."),await K()}catch(e){const t=e instanceof Error?e.message:"Failed to cancel subscription";D(t)}finally{O(!1),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{D(null),M(null)},5e3)}}},disabled:b,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:b?"Canceling...":"Yes, Cancel Subscription"})]})]})})]}):t("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:t("p",{children:"Invalid workspace ID"})})};function Gk(e){return e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"K":e.toLocaleString()}function Kk(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Hk(e,t){return t+e.toFixed(2)}function Zk(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}catch{return null}}const qk=()=>{const{quotas:r,loading:n,error:a,refetch:o}=Zr(),{response:s}=Wr(),[l,c]=f(!1),d=i(()=>{const e={};if(!s?.planVersion||!s?.subscription)return e;const t=s.planVersion,n=s.subscription,a=n.billingInterval??"monthly",o=n.plan?.currency??"usd",i=wv(o);if(!r)return e;for(const n of Object.keys(r)){const s=Ak(t,o,n,a);if(null==s||s<=0)continue;const l=t.quotas?.[n],c=l?.[a],d=c?.unitSize??1,u=r[n].overage,f=(d>1?Math.ceil(u/d):u)*s/100;e[n]={overageCents:s,unitSize:d,currency:o,currencySymbol:i,estimatedCost:f}}return e},[s,r]),u=i(()=>{const e=s?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=function(e){try{const t=new Date(e);return isNaN(t.getTime())?"":new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t)}catch{return""}}(e);return t?{endDate:t,daysRemaining:Zk(e)}:null},[s]),m=async()=>{c(!0);try{await o()}finally{c(!1)}};if(n&&!r)return t(rv,{});if(a)return e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:"Failed to load usage data"}),t("p",{className:"text-sm mt-1",children:a})]}),t(su,{variant:"outline",size:"sm",onClick:m,disabled:l,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:l?"Retrying...":"Retry"})]});const p=function(e){return[...e].sort(([,e],[,t])=>{if(e.hasOverage&&!t.hasOverage)return-1;if(!e.hasOverage&&t.hasOverage)return 1;const r=e.included>0?e.consumed/e.included:e.consumed>0?1:0;return(t.included>0?t.consumed/t.included:t.consumed>0?1:0)-r})}(r?Object.entries(r):[]);if(0===p.length)return e("div",{className:"border rounded-lg p-8 text-center",children:[t(Fd,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),t("p",{className:"text-sm text-gray-600",children:"No quota usage data available for this workspace."}),t("p",{className:"text-xs text-gray-500 mt-1",children:"Quotas will appear here once your plan includes metered resources."})]});const h=p.filter(([,e])=>e.hasOverage).length,g=p.length>0?Math.round(p.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/p.length):0,b=Object.values(d).reduce((e,t)=>e+t.estimatedCost,0),y=Object.values(d)[0]?.currencySymbol??"$";return e("div",{className:"space-y-6",children:[e("div",{className:"flex items-center justify-between",children:[t("p",{className:"text-sm text-gray-600",children:"Monitor your resource consumption and quotas"}),e(su,{variant:"ghost",size:"sm",onClick:m,disabled:l,children:[t(qd,{className:je("h-3.5 w-3.5 mr-1.5",l&&"animate-spin")}),l?"Refreshing...":"Refresh"]})]}),u&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 text-sm text-gray-600",children:[t(zd,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e("span",{children:["Usage resets on ",t("span",{className:"font-medium text-gray-900",children:u.endDate}),null!==u.daysRemaining&&u.daysRemaining>0&&e("span",{className:"text-gray-500",children:[" (",u.daysRemaining," ",1===u.daysRemaining?"day":"days"," remaining)"]}),null!==u.daysRemaining&&u.daysRemaining<=0&&t("span",{className:"text-amber-600 font-medium",children:" (renewing soon)"})]})]}),e("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:"Total Resources"}),t("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:p.length})]}),e("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:"Overall Usage"}),t("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:g+"%"})]}),e("div",{className:je("border rounded-lg p-3 sm:p-4",h>0?"border-red-200 bg-red-50":"border-gray-200"),children:[t("p",{className:"text-xs text-gray-500 font-medium",children:"In Overage"}),t("p",{className:je("text-lg sm:text-xl font-semibold mt-1",h>0?"text-red-600":"text-gray-900"),children:h})]}),h>0&&b>0&&e("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:"Est. Overage Cost"}),t("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:Hk(b,y)})]})]}),h>0&&t("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e("div",{className:"flex items-start gap-3",children:[t(ru,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e("div",{className:"flex-1",children:[t("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:"Overage Detected"}),e("p",{className:"text-sm text-amber-700",children:[h," ",1===h?"resource has":"resources have"," exceeded the included quota. Additional usage will be billed as overage on your next invoice."]}),b>0&&e("p",{className:"text-sm text-amber-700 font-medium mt-1",children:["Estimated overage charges this period: ",Hk(b,y)]})]})]})}),t("div",{className:"space-y-3",children:p.map(([e,r])=>{const n=(a=r.consumed,(o=r.included)<=0?a>0?100:0:Math.min(a/o*100,100));var a,o;const s=function(e,t){return t?{bar:"bg-red-500",bg:"bg-red-100",badge:"bg-red-100",badgeText:"text-red-800"}:e>=90?{bar:"bg-amber-500",bg:"bg-amber-100",badge:"bg-amber-100",badgeText:"text-amber-800"}:e>=75?{bar:"bg-yellow-500",bg:"bg-yellow-100",badge:"bg-yellow-100",badgeText:"text-yellow-800"}:{bar:"bg-blue-500",bg:"bg-blue-100",badge:"bg-blue-100",badgeText:"text-blue-800"}}(n,r.hasOverage),i=d[e];return t(Jk,{slug:e,quota:r,percent:n,colors:s,pricing:i},e)})})]})};function Jk({slug:r,quota:n,percent:a,colors:o,pricing:s}){return e("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:Kk(r)}),n.hasOverage&&t("span",{className:je("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",o.badge,o.badgeText),children:"Overage"}),!n.hasOverage&&a>=90&&t("span",{className:je("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",o.badge,o.badgeText),children:"Almost full"})]}),e("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[Gk(n.consumed)," / ",Gk(n.included)]})]}),t("div",{className:je("h-2 rounded-full w-full",o.bg),children:t("div",{className:je("h-2 rounded-full transition-all duration-500",o.bar),style:{width:`${a}%`}})}),e("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[e("span",{children:[Math.round(a),"% used"]}),t("span",{children:n.available>0?`${Gk(n.available)} remaining`:n.hasOverage?`${Gk(n.overage)} over limit`:"Fully used"})]}),n.hasOverage&&s&&e("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:"Overage units"}),t("span",{className:"font-medium text-gray-900",children:Gk(n.overage)})]}),e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:"Rate"}),e("span",{className:"font-medium text-gray-900",children:[s.currencySymbol,(s.overageCents/100).toFixed(2),s.unitSize>1?` / ${s.unitSize.toLocaleString()} units`:" / unit"]})]}),s.unitSize>1&&e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:"Billable blocks"}),t("span",{className:"font-medium text-gray-900",children:Math.ceil(n.overage/s.unitSize).toLocaleString()})]}),e("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[t("span",{className:"font-medium text-red-600",children:"Estimated charge"}),t("span",{className:"font-semibold text-red-600",children:Hk(s.estimatedCost,s.currencySymbol)})]})]}),!n.hasOverage&&s&&e("div",{className:"mt-2 text-xs text-gray-500",children:["Overage rate: ",s.currencySymbol,(s.overageCents/100).toFixed(2),s.unitSize>1?` / ${s.unitSize.toLocaleString()} units`:" / unit"]})]})}function Yk(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(o.ref=t?gd(t,e):e),n.cloneElement(r,o)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xk=Symbol("radix.slottable");function Qk(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Xk}var eN=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"});n.forwardRef((e,r)=>t(rp.span,{...e,ref:r,style:{...eN,...e.style}})).displayName="VisuallyHidden";var tN=[" ","Enter","ArrowUp","ArrowDown"],rN=[" ","Enter"],nN="Select",[aN,oN,sN]=Og(nN),[iN]=Km(nN,[sN,hS]),lN=hS(),[cN,dN]=iN(nN),[uN,fN]=iN(nN),mN=r=>{const{__scopeSelect:a,children:o,open:s,defaultOpen:i,onOpenChange:l,value:c,defaultValue:d,onValueChange:u,dir:f,name:m,autoComplete:p,disabled:h,required:g,form:b}=r,y=lN(a),[v,w]=n.useState(null),[x,S]=n.useState(null),[k,N]=n.useState(!1),E=Dg(f),[C,A]=Xm({prop:s,defaultProp:i??!1,onChange:l,caller:nN}),[_,T]=Xm({prop:c,defaultProp:d,onChange:u,caller:nN}),R=n.useRef(null),P=!v||(b||!!v.closest("form")),[O,I]=n.useState(new Set),D=Array.from(O).map(e=>e.props.value).join(";");return t(PS,{...y,children:e(cN,{required:g,scope:a,trigger:v,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:k,onValueNodeHasChildrenChange:N,contentId:Jm(),value:_,onValueChange:T,open:C,onOpenChange:A,dir:E,triggerPointerDownPosRef:R,disabled:h,children:[t(aN.Provider,{scope:a,children:t(uN,{scope:r.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{I(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{I(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:o})}),P?e(YN,{"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:p,value:_,onChange:e=>T(e.target.value),disabled:h,form:b,children:[void 0===_?t("option",{value:""}):null,Array.from(O)]},D):null]})})};mN.displayName=nN;var pN="SelectTrigger",hN=n.forwardRef((e,r)=>{const{__scopeSelect:a,disabled:o=!1,...s}=e,i=lN(a),l=dN(pN,a),c=l.disabled||o,d=bd(r,l.onTriggerChange),u=oN(a),f=n.useRef("touch"),[m,p,h]=QN(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=eE(t,e,r);void 0!==n&&l.onValueChange(n.value)}),g=e=>{c||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t(OS,{asChild:!0,...i,children:t(rp.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":XN(l.value)?"":void 0,...s,ref:d,onClick:Gm(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Gm(s.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Gm(s.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||tN.includes(e.key)&&(g(),e.preventDefault())})})})});hN.displayName=pN;var gN="SelectValue",bN=n.forwardRef((e,n)=>{const{__scopeSelect:a,className:o,style:s,children:i,placeholder:l="",...c}=e,d=dN(gN,a),{onValueNodeHasChildrenChange:u}=d,f=void 0!==i,m=bd(n,d.onValueNodeChange);return bm(()=>{u(f)},[u,f]),t(rp.span,{...c,ref:m,style:{pointerEvents:"none"},children:XN(d.value)?t(r,{children:l}):i})});bN.displayName=gN;var yN=n.forwardRef((e,r)=>{const{__scopeSelect:n,children:a,...o}=e;return t(rp.span,{"aria-hidden":!0,...o,ref:r,children:a||"โผ"})});yN.displayName="SelectIcon";var vN=e=>t(xp,{asChild:!0,...e});vN.displayName="SelectPortal";var wN="SelectContent",xN=n.forwardRef((e,r)=>{const a=dN(wN,e.__scopeSelect),[o,s]=n.useState();if(bm(()=>{s(new DocumentFragment)},[]),!a.open){const r=o;return r?v.createPortal(t(kN,{scope:e.__scopeSelect,children:t(aN.Slot,{scope:e.__scopeSelect,children:t("div",{children:e.children})})}),r):null}return t(CN,{...e,ref:r})});xN.displayName=wN;var SN=10,[kN,NN]=iN(wN),EN=function(e){const r=Yk(e),a=n.forwardRef((e,a)=>{const{children:o,...s}=e,i=n.Children.toArray(o),l=i.find(Qk);if(l){const e=l.props.children,o=i.map(t=>t===l?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,o):null})}return t(r,{...s,ref:a,children:o})});return a.displayName=`${e}.Slot`,a}("SelectContent.RemoveScroll"),CN=n.forwardRef((e,r)=>{const{__scopeSelect:a,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:b,avoidCollisions:y,...v}=e,w=dN(wN,a),[x,S]=n.useState(null),[k,N]=n.useState(null),E=bd(r,e=>S(e)),[C,A]=n.useState(null),[_,T]=n.useState(null),R=oN(a),[P,O]=n.useState(!1),I=n.useRef(!1);n.useEffect(()=>{if(x)return wh(x)},[x]),Ep();const D=n.useCallback(e=>{const[t,...r]=R().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==a)return}},[R,k]),U=n.useCallback(()=>D([C,x]),[D,C,x]);n.useEffect(()=>{P&&U()},[P,U]);const{onOpenChange:M,triggerPointerDownPosRef:z}=w;n.useEffect(()=>{if(x){let e={x:0,y:0};const 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))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():x.contains(r.target)||M(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[x,M,z]),n.useEffect(()=>{const e=()=>M(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[M]);const[F,L]=QN(e=>{const t=R().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=eE(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),j=n.useCallback((e,t,r)=>{const n=!I.current&&!r;(void 0!==w.value&&w.value===t||n)&&(A(e),n&&(I.current=!0))},[w.value]),$=n.useCallback(()=>x?.focus(),[x]),V=n.useCallback((e,t,r)=>{const n=!I.current&&!r;(void 0!==w.value&&w.value===t||n)&&T(e)},[w.value]),W="popper"===o?_N:AN,B=W===_N?{side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:b,avoidCollisions:y}:{};return t(kN,{scope:a,content:x,viewport:k,onViewportChange:N,itemRefCallback:j,selectedItem:C,onItemLeave:$,itemTextRefCallback:V,focusSelectedItem:U,selectedItemText:_,position:o,isPositioned:P,searchRef:F,children:t(mh,{as:EN,allowPinchZoom:!0,children:t(pp,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Gm(s,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t(lp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:t(W,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...v,...B,onPlaced:()=>O(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Gm(v.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=R().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});CN.displayName="SelectContentImpl";var AN=n.forwardRef((e,r)=>{const{__scopeSelect:a,onPlaced:o,...s}=e,i=dN(wN,a),l=NN(wN,a),[c,d]=n.useState(null),[u,f]=n.useState(null),m=bd(r,e=>f(e)),p=oN(a),h=n.useRef(!1),g=n.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:v,focusSelectedItem:w}=l,x=n.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&b&&y&&v){const e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=v.getBoundingClientRect();if("rtl"!==i.dir){const a=n.left-t.left,o=r.left-a,s=e.left-o,i=e.width+s,l=Math.max(i,t.width),d=window.innerWidth-SN,u=Ab(o,[SN,Math.max(SN,d-l)]);c.style.minWidth=i+"px",c.style.left=u+"px"}else{const a=t.right-n.right,o=window.innerWidth-r.right-a,s=window.innerWidth-e.right-o,i=e.width+s,l=Math.max(i,t.width),d=window.innerWidth-SN,u=Ab(o,[SN,Math.max(SN,d-l)]);c.style.minWidth=i+"px",c.style.right=u+"px"}const a=p(),s=window.innerHeight-2*SN,l=b.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),w=f+m+l+parseInt(d.paddingBottom,10)+g,x=Math.min(5*y.offsetHeight,w),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),N=parseInt(S.paddingBottom,10),E=e.top+e.height/2-SN,C=s-E,A=y.offsetHeight/2,_=f+m+(y.offsetTop+A),T=w-_;if(_<=E){const e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-b.offsetTop-b.offsetHeight,r=_+Math.max(C,A+(e?N:0)+t+g);c.style.height=r+"px"}else{const e=a.length>0&&y===a[0].ref.current;c.style.top="0px";const t=Math.max(E,f+b.offsetTop+(e?k:0)+A)+T;c.style.height=t+"px",b.scrollTop=_-E+b.offsetTop}c.style.margin=`${SN}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,c,u,b,y,v,i.dir,o]);bm(()=>x(),[x]);const[S,k]=n.useState();bm(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const N=n.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return t(TN,{scope:a,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:t("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t(rp.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});AN.displayName="SelectItemAlignedPosition";var _N=n.forwardRef((e,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=SN,...s}=e,i=lN(n);return t(IS,{...i,...s,ref:r,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_N.displayName="SelectPopperPosition";var[TN,RN]=iN(wN,{}),PN="SelectViewport",ON=n.forwardRef((a,o)=>{const{__scopeSelect:s,nonce:i,...l}=a,c=NN(PN,s),d=RN(PN,s),u=bd(o,c.onViewportChange),f=n.useRef(0);return e(r,{children:[t("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:i}),t(aN.Slot,{scope:s,children:t(rp.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Gm(l.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=d;if(n?.current&&r){const e=Math.abs(f.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*SN,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),s=Math.max(a,o);if(s<n){const a=s+e,o=Math.min(n,a),i=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})});ON.displayName=PN;var IN="SelectGroup",[DN,UN]=iN(IN);n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,o=Jm();return t(DN,{scope:n,id:o,children:t(rp.div,{role:"group","aria-labelledby":o,...a,ref:r})})}).displayName=IN;var MN="SelectLabel",zN=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,o=UN(MN,n);return t(rp.div,{id:o.id,...a,ref:r})});zN.displayName=MN;var FN="SelectItem",[LN,jN]=iN(FN),$N=n.forwardRef((e,r)=>{const{__scopeSelect:a,value:o,disabled:s=!1,textValue:i,...l}=e,c=dN(FN,a),d=NN(FN,a),u=c.value===o,[f,m]=n.useState(i??""),[p,h]=n.useState(!1),g=bd(r,e=>d.itemRefCallback?.(e,o,s)),b=Jm(),y=n.useRef("touch"),v=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t(LN,{scope:a,value:o,disabled:s,textId:b,isSelected:u,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:t(aN.ItemSlot,{scope:a,value:o,disabled:s,textValue:f,children:t(rp.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:Gm(l.onFocus,()=>h(!0)),onBlur:Gm(l.onBlur,()=>h(!1)),onClick:Gm(l.onClick,()=>{"mouse"!==y.current&&v()}),onPointerUp:Gm(l.onPointerUp,()=>{"mouse"===y.current&&v()}),onPointerDown:Gm(l.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:Gm(l.onPointerMove,e=>{y.current=e.pointerType,s?d.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Gm(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Gm(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(rN.includes(e.key)&&v()," "===e.key&&e.preventDefault())})})})})});$N.displayName=FN;var VN="SelectItemText",WN=n.forwardRef((a,o)=>{const{__scopeSelect:s,className:i,style:l,...c}=a,d=dN(VN,s),u=NN(VN,s),f=jN(VN,s),m=fN(VN,s),[p,h]=n.useState(null),g=bd(o,e=>h(e),f.onItemTextChange,e=>u.itemTextRefCallback?.(e,f.value,f.disabled)),b=p?.textContent,y=n.useMemo(()=>t("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=m;return bm(()=>(w(y),()=>x(y)),[w,x,y]),e(r,{children:[t(rp.span,{id:f.textId,...c,ref:g}),f.isSelected&&d.valueNode&&!d.valueNodeHasChildren?v.createPortal(c.children,d.valueNode):null]})});WN.displayName=VN;var BN="SelectItemIndicator",GN=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e;return jN(BN,n).isSelected?t(rp.span,{"aria-hidden":!0,...a,ref:r}):null});GN.displayName=BN;var KN="SelectScrollUpButton";n.forwardRef((e,r)=>{const a=NN(KN,e.__scopeSelect),o=RN(KN,e.__scopeSelect),[s,i]=n.useState(!1),l=bd(r,o.onScrollButtonChange);return bm(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),s?t(ZN,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=KN;var HN="SelectScrollDownButton";n.forwardRef((e,r)=>{const a=NN(HN,e.__scopeSelect),o=RN(HN,e.__scopeSelect),[s,i]=n.useState(!1),l=bd(r,o.onScrollButtonChange);return bm(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),s?t(ZN,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=HN;var ZN=n.forwardRef((e,r)=>{const{__scopeSelect:a,onAutoScroll:o,...s}=e,i=NN("SelectScrollButton",a),l=n.useRef(null),c=oN(a),d=n.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>d(),[d]),bm(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t(rp.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:Gm(s.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:Gm(s.onPointerMove,()=>{i.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:Gm(s.onPointerLeave,()=>{d()})})}),qN=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e;return t(rp.div,{"aria-hidden":!0,...a,ref:r})});qN.displayName="SelectSeparator";var JN="SelectArrow";n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,o=lN(n),s=dN(JN,n),i=NN(JN,n);return s.open&&"popper"===i.position?t(DS,{...o,...a,ref:r}):null}).displayName=JN;var YN=n.forwardRef(({__scopeSelect:e,value:r,...a},o)=>{const s=n.useRef(null),i=bd(o,s),l=eb(r);return n.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),t(rp.select,{...a,style:{...eN,...a.style},ref:i,defaultValue:r})});function XN(e){return""===e||void 0===e}function QN(e){const t=hm(e),r=n.useRef(""),a=n.useRef(0),o=n.useCallback(e=>{const n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),s=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,o,s]}function eE(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(o=o.filter(e=>e!==r));const s=o.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return s!==r?s:void 0}YN.displayName="SelectBubbleInput";var tE=hN,rE=yN,nE=vN,aE=xN,oE=ON,sE=zN,iE=$N,lE=WN,cE=GN,dE=qN;const uE=mN,fE=n.forwardRef(({className:r,children:n,...a},o)=>e(tE,{ref:o,className:je("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),...a,children:[n,t(rE,{asChild:!0,children:t(mg,{className:"h-4 w-4 opacity-50"})})]}));fE.displayName=tE.displayName;const mE=n.forwardRef(({className:e,children:r,position:a="popper",...o},s)=>{const{container:i}=n.useContext(Eo);return t(nE,{container:i,children:t(aE,{ref:s,className:je("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===a&&"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:a,...o,children:t(oE,{className:je("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});mE.displayName=aE.displayName;n.forwardRef(({className:e,...r},n)=>t(sE,{ref:n,className:je("px-2 py-1.5 text-sm font-semibold",e),...r})).displayName=sE.displayName;const pE=n.forwardRef(({className:r,children:n,...a},o)=>e(iE,{ref:o,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...a,children:[t("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t(cE,{children:t(hg,{className:"h-4 w-4"})})}),t(lE,{children:n})]}));pE.displayName=iE.displayName;n.forwardRef(({className:e,...r},n)=>t(dE,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...r})).displayName=dE.displayName;const hE=({workspace:r})=>{const{user:n}=So(),[a,o]=f(0),[s,i]=f(!1),[l,c]=f([]),[u,m]=f(null),{getUsers:p,removeUser:h,updateUser:g}=Sr(),{settings:b}=mr(),{response:y}=Wr();d(()=>{r&&(i(!0),p(r._id).then(e=>{c(e)}).catch(e=>{Ye(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{i(!1)}))},[r,a]);const v=()=>{o(e=>e+1)};if(s||!r)return t(rv,{});const w=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},x=l.map(e=>({...e,...w(e.user)})),S=l.find(e=>("string"==typeof e.user?e.user:e.user._id)===n?.id)?.role,k="admin"===S,N=y?.subscription,E=y?.planVersion,C=N?.seatPricingEnabled,A=r?.billingCurrency||"usd",_=E?Ok(E,A):null,T=_?.includedSeats??0,R=_?.maxSeats??0,P=l.length,O=C&&R>0&&P>=R,I=b?.workspace.maxWorkspaceUsers??Number.MAX_VALUE,D=C?!O:I>P,U=N?.billingInterval??"monthly",M=E?Ik(E,A,U):null,z=C&&P>=T;return e("div",{children:[!k&&t("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),k&&t("div",{className:"mb-4",children:D?e("div",{children:[t(gE,{onInvite:v,workspaceId:r._id}),z&&M&&M>0&&t("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-amber-600 bg-amber-50 px-3 py-1.5 rounded-md",children:e("span",{children:["Each additional member adds ",e("span",{className:"font-medium",children:[kv(M,A),"/","yearly"===U?"yr":"quarterly"===U?"qtr":"mo"]})," to your subscription"]})})]}):t("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e("div",{children:[t("p",{className:"text-sm font-medium text-red-700",children:O?"Seat limit reached":"Member limit reached"}),t("p",{className:"text-xs text-red-600 mt-0.5",children:O?`Your plan allows up to ${R} members. Upgrade for more seats.`:"Contact your admin to increase the workspace member limit."})]})})}),C&&_&&e("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e("div",{className:"flex items-center justify-between mb-2",children:[t("h4",{className:"text-sm font-semibold text-gray-900",children:"Seats"}),R>0&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(P>=R?"bg-red-100 text-red-700":P>=.8*R?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[P," / ",R]})]}),R>0&&t("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:t("div",{className:"h-1.5 rounded-full transition-all "+(P>=R?"bg-red-500":P>=.8*R?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,P/R*100)}%`}})}),e("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e("div",{children:[t("span",{className:"text-gray-900 font-medium",children:T})," included",M&&M>0&&e("span",{className:"text-gray-400",children:[" ยท ",kv(M,A),"/extra seat"]})]}),R>0?e("span",{children:[Math.max(0,R-P)," available"]}):t("span",{className:"text-gray-400",children:"No seat limit"})]})]}),e("div",{className:"mb-4 flex items-center justify-between",children:[t("div",{children:e("div",{className:"text-sm text-gray-600",children:[P," member",1!==P?"s":""]})}),t("div",{children:t(su,{variant:"ghost",size:"sm",onClick:v,progress:s,children:s?"Refreshing...":"Refresh"})})]}),t("ul",{className:"space-y-2",children:x.map((a,o)=>{const s=a.id===n?.id,i=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===a.id;return e("li",{className:"border rounded p-3",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[t("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:a.name.charAt(0).toUpperCase()}),e("div",{className:"min-w-0",children:[t("div",{className:"font-medium text-sm truncate",children:a.name}),t("div",{className:"text-xs text-gray-500 truncate",children:a.email})]})]}),e("div",{className:"flex items-center gap-1 shrink-0",children:[s&&t("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:"You"}),i&&t("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:"Owner"})]})]}),k&&e("div",{className:"flex items-center gap-2 mt-2 pt-2 border-t border-gray-100 sm:mt-0 sm:pt-0 sm:border-0",children:[e("div",{className:"relative flex-1 sm:flex-initial",children:[e(uE,{disabled:s||!k||i||u===a.id,value:a.role,onValueChange:e=>{return t=r._id,n=a.id,o=e,void(vr(r,n)?Ye(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:t,userId:n,role:o}}):(m(n),g(t,n,{role:o}).then(()=>{v()}).catch(e=>{Ye(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:t,userId:n,role:o}})}).finally(()=>{m(null)})));var t,n,o},children:[t(fE,{children:t(bN,{placeholder:"Select a role"})}),t(mE,{children:r?.roles.map(e=>t(pE,{value:e,children:e},e))})]}),u===a.id&&t("div",{className:"absolute right-8 top-1/2 -translate-y-1/2 pointer-events-none",children:t(Kd,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!s&&!i&&t(su,{variant:"destructive",size:"sm",startIcon:t(tu,{}),onClick:()=>{return e=a.id,void(vr(r,e)?Ye(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):h(r._id,e).then(()=>{v()}).catch(t=>{Ye(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},o)})}),0===l.length&&t("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function gE({onInvite:r,workspaceId:n}){const[a,o]=f(""),[i,l]=f("admin"),[c,u]=f(!1),[m,p]=f(null),[h,g]=f(null),b=s(null),{addUser:y,getWorkspace:v}=Sr();d(()=>()=>{b.current&&clearTimeout(b.current)},[]);const[w,x]=f(null),{settings:S}=mr(),k=S?.workspace.roles??w?.roles??[];d(()=>{n&&v(n).then(x)},[n]);const N=()=>{p(null),g(null),o(""),l("admin")};return e("div",{className:"flex gap-2 flex-col gap-y-2",children:[m&&t("div",{className:"text-red-500 capitalize",children:m}),h&&t("div",{className:"text-green-500 capitalize",children:h}),e("div",{children:[t(uu,{children:"Invite member by email"}),t(Su,{type:"email",value:a,onChange:e=>o(e.target.value),placeholder:"example@example.com"})]}),e("div",{children:[t(uu,{children:"Role"}),e(uE,{value:i,onValueChange:l,children:[t(fE,{children:t(bN,{placeholder:"Select a role"})}),t(mE,{children:k.map(e=>t(pE,{value:e,children:e},e))})]})]}),t("div",{children:t(su,{progress:c,onClick:async()=>{const e=a.trim();if(!e)return void p("Email is required");/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(u(!0),await y(n,e,i).then(()=>{g("User invited successfully"),r?.()}).catch(t=>{Ye(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:i}}),p(t instanceof Error?t.message:"Failed to invite member")}).finally(()=>{u(!1),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{N()},6e3)})):p("Invalid email address format")},disabled:c||!a||!i,children:c?"Inviting...":`Invite as ${i}`})})]})}const bE=({workspace:r,section:n,setSection:a})=>{const{user:o}=So(),s=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===o?.id,i=wr(r,o?.id??null),l=s||"admin"===i?.toLowerCase();return e("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[r&&t("div",{className:"border-b p-2 py-4",children:e("div",{className:"flex items-center gap-x-2",children:[r.image&&r.image.trim()&&t("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:t("img",{src:r.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:r.name})}),e("div",{className:je("flex-1 min-w-0",r.image?"":"pl-2"),children:[t("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:r.name}),t("div",{className:"text-xs text-gray-500",children:r.workspaceId})]})]})}),t(yE,{title:"Account",children:t(vE,{activeSection:n,icon:t(nu,{className:"h-3.5 w-3.5"}),label:"Profile",section:"profile",onClick:()=>a("profile")})}),e(yE,{title:"Workspace",children:[t(vE,{activeSection:n,icon:t(Yd,{className:"h-3.5 w-3.5"}),label:"General",section:"general",onClick:()=>a("general")}),t(vE,{activeSection:n,icon:t(au,{className:"h-3.5 w-3.5"}),label:"Users",section:"users",onClick:()=>a("users")}),t(vE,{activeSection:n,icon:t($d,{className:"h-3.5 w-3.5"}),label:"Plan & Billing",section:"subscription",onClick:()=>a("subscription")}),t(vE,{activeSection:n,icon:t(Fd,{className:"h-3.5 w-3.5"}),label:"Usage",section:"usage",onClick:()=>a("usage")}),t(vE,{activeSection:n,icon:t(Qd,{className:"h-3.5 w-3.5"}),label:"Features",section:"features",onClick:()=>a("features")}),l&&t(vE,{activeSection:n,icon:t(ru,{className:"h-3.5 w-3.5"}),label:"Danger Zone",section:"danger",onClick:()=>a("danger")})]})]})};function yE({title:r,children:n}){return e("div",{className:"px-2 flex flex-col space-y-1",children:[t("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:r}),n]})}function vE({icon:t,label:r,section:n,onClick:a,activeSection:o}){return e("button",{className:je("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-1",n===o?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const wE=({workspace:r,onClose:n,open:a,onOpenChange:o,defaultSection:s="profile",section:i,onSectionChange:l,showTrigger:c=!0,trigger:d})=>{const[u,m]=f(!1),[p,h]=f(s),g=void 0!==a?a:u,b=o||m,y=void 0!==i?i:p,v=l||h;if(!r)return null;const w=t(su,{variant:"outline",size:"icon",children:t(Yd,{className:"h-4 w-4"})});return e(wg,{open:g,onOpenChange:e=>{b(e),!e&&n&&n()},children:[c&&t(xg,{asChild:!0,children:d||w}),e(Ng,{className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[t(Ag,{className:"sr-only",children:"Workspace settings dialog"}),t(bE,{workspace:r,section:y,setSection:v}),e("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e(Cg,{className:"text-xl font-bold mb-4 capitalize",children:["profile"===y&&"Account","general"===y&&"Workspace Settings","users"===y&&"Workspace Members","subscription"===y&&"Plan & Billing","usage"===y&&"Usage","features"===y&&"Workspace Features","danger"===y&&"Danger Zone"]}),e("div",{className:"sm:max-h-[500px] overflow-y-auto",children:["profile"===y&&t(kk,{workspace:r}),"general"===y&&t(Rv,{workspace:r}),"users"===y&&t(hE,{workspace:r}),"subscription"===y&&t(Bk,{workspace:r}),"usage"===y&&t(qk,{}),"features"===y&&t(gv,{workspaceId:r._id?.toString()}),"danger"===y&&t(nv,{workspace:r})]})]})]})]})};var xE=Object.freeze({__proto__:null,WorkspaceSettingsDialog:wE,default:wE});function SE(n){const{isAuthenticated:a,user:o}=So(),s=S(fr()),{workspaces:i,currentWorkspace:l,loading:c,refreshing:u,switchingToId:m,fetchWorkspaces:p,getFeatures:h,refreshWorkspaces:g,setCurrentWorkspace:b,switchToWorkspace:y}=Sr(),{settings:v}=mr(),[w,x]=f(!1),[k,N]=f(0),[E,C]=f(""),A=c||u;d(()=>{a&&s&&(0===i.length?(p(),h()):h())},[a,s]),d(()=>{a&&s&&k>0&&g()},[k,a,s]);const _=i,T=_.filter(e=>e._id!==l?._id).filter(e=>e.name.toLowerCase().includes(E.toLowerCase())),R=v?.workspace.maxWorkspaces??Number.MAX_VALUE,P=_?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===o?.id?.toString()).length,O=R>(P??0);return e(wg,{open:w,onOpenChange:x,children:[t(xg,{children:n.trigger?.(A,l)}),e(Ng,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e(Eg,{children:[e(Cg,{className:"flex items-center gap-2",children:[t(Md,{className:"h-5 w-5"}),"Switch Workspace"]}),t(Ag,{children:"Select a workspace to switch to or create a new one."})]}),!o&&t("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:t("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),o&&e("div",{className:"flex flex-col gap-4",children:[l&&t(kE,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:y,switchingToId:m,onClose:()=>x(!1),setCurrentWorkspace:b,setOpen:x,workspacesToUse:_}),t(by,{}),e("div",{children:[e("div",{className:"flex items-center justify-between",children:[e("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",T.length,")"]}),t("div",{children:t(su,{progress:u,disabled:u,variant:"ghost",onClick:function(){a&&s&&N(e=>e+1)},startIcon:t(Zd,{}),children:u?"Refreshing...":"Refresh"})})]}),e("div",{className:"relative",children:[t(Jd,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),t(Su,{placeholder:"Search workspaces...",value:E,onChange:e=>C(e.target.value),className:"pl-10"})]}),c?e("div",{className:"flex items-center justify-center py-8",children:[t(Kd,{className:"h-6 w-6 animate-spin text-muted-foreground"}),t("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===T.length?e("div",{className:"text-center py-8",children:[t(Md,{className:"mx-auto h-12 w-12 text-muted-foreground"}),t("p",{className:"mt-2 text-sm text-muted-foreground",children:E?"No workspaces found":"No workspaces available"})]}):t(dy,{className:"h-64",children:t("div",{className:"flex flex-col gap-2 my-2.5",children:T.map(e=>{const r=e._id===l?._id;return t(kE,{workspace:e,isCurrentWorkspace:r,switchToWorkspace:y,switchingToId:m,onClose:()=>x(!1),setCurrentWorkspace:b,setOpen:x,workspacesToUse:_},e._id)})})})]}),O&&e(r,{children:[t(by,{}),t(NE,{onCreated:()=>{p()}})]})]})]})]})}function kE(r){const{workspace:n,setCurrentWorkspace:a,setOpen:o,workspacesToUse:s,switchingToId:i}=r,l=r.isCurrentWorkspace??!1,c=i===n._id,d=n.subscription??null,u=null!=d&&"object"==typeof d?d.plan??null:null,f=u?.name??"";return e("div",{className:je("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":l}),children:[e(Vm,{className:"h-8 w-8 flex items-center justify-center",children:[t("div",{children:t(Wm,{src:n.image&&n.image.trim()?n.image:void 0})}),t(Bm,{children:(m=n.name,m.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e("div",{className:"flex-1 min-w-0 max-w-full",children:[t("div",{className:"flex items-center gap-2",children:t("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[t(au,{className:"h-3 w-3"}),e("span",{children:[n.users?.length||0," members"]})]}),f&&t("div",{className:"max-w-fit",children:t("div",{className:"flex items-center gap-1 text-sm text-muted-foreground bg-green-500 text-white rounded-full px-2 py-0.5",children:t("span",{className:"text-xs",children:f})})})]}),e("div",{className:"flex items-center gap-2",children:[l?null:t(su,{size:"sm",disabled:null!==i||c,progress:c,onClick:()=>{r.switchToWorkspace(n).then(()=>o(!1)).catch(e=>{Ye(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:"Switch to"}),t(wE,{workspace:n,onClose:()=>{if(l){const e=s.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(s[e])}}})]})]});var m}function NE(n){const{switching:a}=Sr(),[o,s]=f(!1),[i,l]=f("emoji"),[c,d]=f("๐ข"),[u,m]=f(!1),{createWorkspace:p}=Sr(),h=si({resolver:pd(Nf({name:Ju().min(2,{message:"Workspace name must be at least 2 characters."}),image:Ju().optional()})),defaultValues:{name:"",image:""}});return e(wg,{open:o,onOpenChange:s,children:[t(xg,{asChild:!0,children:e(su,{className:"w-full rounded-none",disabled:a,children:[t(Hd,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),e(Ng,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e(Eg,{children:[t(Cg,{children:"Create New Workspace"}),t(Ag,{children:"Create a new workspace to get started."})]}),t(fu,{...h,children:e("form",{onSubmit:h.handleSubmit(async function(e){let t="";if("emoji"===i)t=_v(c);else if("url"===i&&e.image)try{new URL(e.image),t=e.image}catch{return void h.setError("image",{message:"Please enter a valid URL"})}m(!0);try{await p(e.name,t),s(!1),h.reset(),d("๐ข"),l("emoji"),n?.onCreated?.()}catch(t){Ye(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[t(pu,{control:h.control,name:"name",render:({field:r})=>e(bu,{children:[t(yu,{children:"Workspace Name"}),t(vu,{children:t(Su,{placeholder:"My Awesome Workspace",...r})}),t(xu,{})]})}),e("div",{className:"flex flex-col gap-y-2 my-2",children:[e("div",{children:[t(uu,{className:"text-sm font-medium",children:"Workspace Icon"}),t(wu,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e(Eb,{value:i,onValueChange:e=>l(e),className:"flex flex-col gap-y-2",children:[e("div",{className:"flex items-center gap-x-2 my-1",children:[t(Cb,{value:"emoji",id:"emoji"}),e(uu,{htmlFor:"emoji",className:"flex items-center gap-2",children:[t(Xd,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e("div",{className:"flex items-center gap-x-2 my-1",children:[t(Cb,{value:"url",id:"url"}),e(uu,{htmlFor:"url",className:"flex items-center gap-2",children:[t(Gd,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===i&&e("div",{className:"flex flex-col gap-y-2",children:[e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:"Preview:"}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:c})]}),t(dy,{className:"h-32 w-full rounded-md border",children:t("div",{className:"p-4 grid grid-cols-8 gap-2",children:Tv.map((e,r)=>t("button",{type:"button",onClick:()=>(e=>{d(e),h.setValue("image",_v(e))})(e),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(c===e?"bg-primary text-primary-foreground":""),children:e},r))})})]}),"url"===i&&e("div",{className:"flex flex-col gap-y-2",children:[t(pu,{control:h.control,name:"image",render:({field:r})=>e(bu,{children:[t(yu,{children:"Image URL"}),t(vu,{children:t(Su,{placeholder:"https://example.com/image.png",...r})}),t(wu,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),t(xu,{})]})}),h.watch("image")&&h.watch("image")?.trim()&&e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:"Preview:"}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:t("img",{src:h.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e("div",{className:"flex justify-end gap-3 pt-4",children:[t(su,{type:"button",variant:"outline",onClick:()=>{s(!1),h.reset(),d("๐ข"),l("emoji")},disabled:u,children:"Cancel"}),t(su,{type:"submit",disabled:u,children:u?e(r,{children:[t(Kd,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}function EE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}function CE(){const{response:e}=Wr();return i(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=EE(t.trialEnd)??EE(t.stripeCurrentPeriodEnd),n=EE(t.trialStart),a=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:a,trialEndsAt:r,trialStartedAt:n,isTrialEnding:a<=3}},[e])}function AE(e){const{response:t}=Wr();return i(()=>{const r={hasSeatPricing:!1,memberCount:0,includedSeats:0,maxSeats:0,billableSeats:0,availableSeats:1/0,isAtMax:!1,isNearMax:!1,perSeatPriceCents:null,currency:""};if(!t?.subscription||!e)return r;const n=t.subscription;if(!n.seatPricingEnabled)return{...r,memberCount:e.users?.length??0};const a=t.planVersion,o=e.billingCurrency||"usd",s=a?Ok(a,o):null;if(!s)return{...r,hasSeatPricing:!0,memberCount:e.users?.length??0};const i=e.users?.length??0,l=s.includedSeats??0,c=s.maxSeats??0,d=Math.max(0,i-l),u=c>0?Math.max(0,c-i):1/0,f=c>0&&i>=c,m=c>0&&i>=.8*c&&!f,p=n.billingInterval??"monthly";return{hasSeatPricing:!0,memberCount:i,includedSeats:l,maxSeats:c,billableSeats:d,availableSeats:u,isAtMax:f,isNearMax:m,perSeatPriceCents:a?Ik(a,o,p):null,currency:o}},[t,e])}const _E=(e,t)=>null==e||0===e?"Free":kv(e,t),TE=e=>{switch(e){case"monthly":default:return"/mo";case"quarterly":return"/qtr";case"yearly":return"/yr"}},RE=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case"yearly":n=t/12;break;case"quarterly":n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var PE=Object.freeze({__proto__:null,default:({open:n,onOpenChange:o,planVersions:s,currentPlanVersionId:l,currentStripePriceId:c,billingCurrency:u,currentMemberCount:m,onSelectPlan:p,loading:h=!1})=>{const[g,b]=f(!1),[y,v]=f(null),w=a.useRef(!1),x=i(()=>Pk(c,s),[c,s]),S=x?.interval??null,k=x?.currency??null,N=i(()=>Tk(s),[s]),E=i(()=>{const e=u?.trim().toLowerCase();return e?N.includes(e)?[e]:[]:N},[u,N]),[C,A]=f(S||"monthly"),[_,T]=f(()=>k&&E.includes(k)?k:E.length>0?E[0]:""),R=u?.trim()||_;d(()=>{n&&(A(S||"monthly"),k&&E.includes(k)?T(k):E.length>0&&!E.includes(_)&&T(E[0]))},[n,S,k,E]);const P=i(()=>[...s].sort((e,t)=>e.version-t.version),[s]),O=(e=>{const t=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{t.has(e._id)||t.set(e._id,e)})}),Array.from(t.values())})(P),I=O.filter(e=>"feature"===e.type),D=O.filter(e=>"limit"===e.type),U=O.filter(e=>"quota"===e.type),M=async e=>{if(!(e===l&&S===C||h||g||w.current)){w.current=!0,b(!0),v(e);try{await p(e,C,R),o(!1)}catch(e){}finally{w.current=!1,b(!1),v(null)}}},z=e=>Ek(e,R,C),F=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===R.toLowerCase()),L=h||g,j=e=>{switch(e){case"monthly":default:return"Monthly";case"quarterly":return"Quarterly";case"yearly":return"Yearly"}},$=e=>{const t=e._id===l,r=S===C;if(t&&r)return{label:"Current Plan",variant:"outline",disabled:!0};if(t&&!r)return{label:`Switch to ${j(C)}`,variant:"default",disabled:!1};if(!l)return{label:"Subscribe",variant:"default",disabled:!1};const n=P.findIndex(e=>e._id===l),a=P.findIndex(t=>t._id===e._id);return-1===n||-1===a?{label:"Select",variant:"default",disabled:!1}:a<n?{label:"Downgrade",variant:"outline",disabled:!1}:a>n?{label:"Upgrade",variant:"default",disabled:!1}:{label:"Select",variant:"default",disabled:!1}},V=(e,t,r="monthly")=>{if("feature"===t.type)return e.features?.[t.slug]??!1;if("limit"===t.type)return e.limits?.[t.slug]??null;if("quota"===t.type){const n=Rk(e,R,t.slug,r);return n||zk(e.quotas?.[t.slug],r)}return null},W=(e,t,r)=>{if("feature"===t.type)return!0===e?"โ":"โ";if("limit"===t.type)return null!=e?String(e):"โ";if("quota"===t.type){return Fk("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r})}return"โ"};return t(wg,{open:n,onOpenChange:o,children:e(Ng,{className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e("div",{children:[t(Cg,{className:"text-xl sm:text-2xl font-bold",children:"Choose Your Plan"}),t(Ag,{className:"mt-1 text-sm",children:"Compare plans and select the one that fits your needs"})]}),e("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e("div",{className:"flex items-center gap-2",children:[!u?.trim()&&E.length>1&&e(r,{children:[t("span",{className:"text-sm text-slate-600",children:"Currency"}),t("select",{"aria-label":"Select billing currency",value:_,onChange:e=>T(e.target.value),className:"rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:E.map(e=>{const r=vv(e);return t("option",{value:e,children:r?`${r} ${e.toUpperCase()}`:e.toUpperCase()},e)})})]}),u?.trim()&&e("span",{className:"text-xs text-slate-500",children:["Billing in ",u.toUpperCase()]})]}),t("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-slate-100 rounded-lg w-full sm:w-auto",role:"group","aria-label":"Billing interval",children:["monthly","quarterly","yearly"].map(r=>{const n=S===r;return t("button",{onClick:()=>A(r),"aria-pressed":C===r,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(C===r?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:["monthly"===r&&"Monthly","quarterly"===r&&"Quarterly","yearly"===r&&"Yearly","yearly"===r&&t("span",{className:"text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold",children:"Save"}),n&&l&&t("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:"Current"})]})},r)})})]})]}),t("div",{className:"flex-1 min-h-0 flex flex-col",children:u?.trim()&&0===E.length?e("div",{className:"text-center py-12 px-4",children:[t("p",{className:"text-slate-600 font-medium",children:"No plans available for your billing currency."}),t("p",{className:"text-slate-500 text-sm mt-2",children:"Something went wrong. Please contact support."})]}):0===P.length?t("div",{className:"text-center py-12 text-gray-500",children:t("p",{children:"No plans available"})}):e("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[t("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:t("div",{className:"p-4 space-y-4",children:P.map(r=>{const n=r._id===l,a=$(r),o=L&&r._id===y,s=z(r),i=F(r),c=r.pricingVariants?.length&&r.pricingVariants.some(e=>e.currency?.toLowerCase()===R.toLowerCase())?R:r.plan?.currency??R??"",d=Ek(r,R,"monthly")??0,u="monthly"!==C&&null!==s?RE(d,s,C):null,f=Ok(r,R),p=f?Ik(r,R,C):null;return e("div",{className:"rounded-xl border-2 p-4 "+(n?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e("div",{className:"flex items-start justify-between mb-3",children:[e("div",{children:[t("h3",{className:"text-lg font-bold text-slate-900",children:r.plan.name}),r.plan.description&&t("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:r.plan.description})]}),n&&t("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:"Current"})]}),e("div",{className:"mb-4",children:[e("div",{className:"flex items-baseline gap-1",children:[t("span",{className:"text-2xl font-bold text-slate-900",children:i&&null!==s||i?_E(s,c):"โ"}),null!==s&&s>0&&i&&t("span",{className:"text-sm text-slate-500",children:TE(C)})]}),null!==u&&u>0&&i&&e("span",{className:"text-xs text-emerald-600 font-medium",children:["Save ",u,"% vs monthly"]}),f?.enabled&&p&&p>0&&e("div",{className:"text-xs text-slate-500 mt-1",children:["+ ",kv(p,c),"/seat",TE(C),f.includedSeats>0&&e("span",{className:"text-slate-400",children:[" (",f.includedSeats," included)"]})]})]}),I.length>0&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:"Features"}),t("div",{className:"space-y-1",children:I.map(n=>{const a=V(r,n,C),o="feature"===n.type&&!0===a;return e("div",{className:"flex items-center gap-2 text-sm",children:["feature"===n.type?t("span",o?{className:"text-emerald-500 text-xs",children:"โ"}:{className:"text-slate-300 text-xs",children:"โ"}):null,t("span",{className:o?"text-slate-700":"text-slate-400",children:n.name})]},n._id)})})]}),D.length>0&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:"Limits"}),t("div",{className:"space-y-1",children:D.map(n=>{const a=V(r,n,C);return e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-slate-600",children:n.name}),t("span",{className:"font-medium text-slate-700",children:"number"==typeof a?a.toLocaleString():"โ"})]},n._id)})})]}),f?.enabled&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:"Seats"}),e("div",{className:"space-y-1 text-sm",children:[e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:"Included"}),t("span",{className:"font-medium",children:f.includedSeats||0})]}),e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:"Max"}),t("span",{className:"font-medium",children:f.maxSeats>0?f.maxSeats:"Unlimited"})]}),null!=m&&m>0&&(()=>{const r=Math.max(0,m-(f.includedSeats||0));return e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:"Your billable"}),t("span",{className:"font-medium "+(0===r?"text-emerald-600":"text-amber-600"),children:0===r?"All included":`${r} extra`})]})})()]})]}),t(su,{className:"w-full mt-2",variant:a.variant,disabled:a.disabled||L||!i,progress:o,onClick:()=>M(r._id),children:o?"Processing...":i?a.label:"Unavailable"})]},r._id)})})}),t("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:280+200*P.length+"px",borderCollapse:"separate"},children:[e("colgroup",{children:[t("col",{style:{width:280,minWidth:280}}),P.map(e=>t("col",{style:{width:200,minWidth:200}},e._id))]}),t("thead",{children:e("tr",{className:"align-top",children:[t("th",{className:"sticky top-0 left-0 z-30 p-0 bg-white text-left"}),P.map(r=>{const n=r._id===l,a=$(r),o=L&&r._id===y,s=z(r),i=Ek(r,R,"monthly")??0,c="monthly"!==C&&null!==s?RE(i,s,C):null,d=F(r),u=r.pricingVariants?.length&&r.pricingVariants.some(e=>e.currency?.toLowerCase()===R.toLowerCase())?R:r.plan?.currency??R??"";return t("th",{className:"sticky top-0 z-20 border-b border-slate-200 p-3 shadow-[0_2px_4px_-2px_rgba(0,0,0,0.06)] "+(r._id===l?"bg-blue-50/80":"bg-white"),children:e("div",{className:"flex h-full flex-col gap-3",children:[e("div",{className:"flex items-start justify-between gap-2",children:[t("h3",{className:"text-lg font-bold text-slate-900 truncate",children:r.plan.name}),n&&t("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:"Current"})]}),e("div",{className:"flex flex-col items-start",children:[e("div",{className:"flex items-baseline gap-1",children:[t("span",{className:"text-2xl font-bold text-slate-900",children:d&&null!==s||d?_E(s,u):"โ"}),null!==s&&s>0&&d&&t("span",{className:"text-sm text-slate-500",children:TE(C)})]}),null!==c&&c>0&&d&&e("span",{className:"text-xs text-emerald-600 font-medium mt-0.5",children:["Save ",c,"% vs monthly"]}),(()=>{const t=Ok(r,R);if(!t)return null;const n=Ik(r,R,C);return!n||n<=0?null:e("div",{className:"text-xs text-slate-500 mt-1 border-t border-slate-100 pt-1",children:[e("span",{children:["+ ",kv(n,u),"/seat",TE(C)]}),t.includedSeats>0&&e("span",{className:"text-slate-400",children:[" (",t.includedSeats," included)"]})]})})()]}),r.plan.description&&t("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-left",children:r.plan.description}),t(su,{className:"mt-auto w-full",variant:a.variant,disabled:a.disabled||L||!d,progress:o,onClick:()=>M(r._id),children:o?"Processing...":d?a.label:"Unavailable"})]})},r._id)})]})}),e("tbody",{children:[I.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky left-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:"Features"}),t("td",{colSpan:P.length,className:"border-t border-slate-200 bg-slate-100"})]}),I.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky left-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),P.map(e=>{const n=V(e,r,C),a=e.pricingVariants?.length?R:e.plan?.currency??R??"",o=W(n,r,a),s="feature"===r.type&&!0===n;return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===l?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+(s?"text-emerald-600":"โ"===o?"text-slate-400":"text-slate-700"),children:o})},e._id)})]},r._id))]}),D.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky left-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:"Limits"}),t("td",{colSpan:P.length,className:"border-t border-slate-200 bg-slate-100"})]}),D.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky left-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),P.map(e=>{const n=V(e,r,C),a=e.pricingVariants?.length?R:e.plan?.currency??R??"",o=W(n,r,a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===l?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+("โ"===o?"text-slate-400":"text-slate-700"),children:o})},e._id)})]},r._id))]}),U.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky left-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:"Quotas"}),t("td",{colSpan:P.length,className:"border-t border-slate-200 bg-slate-100"})]}),U.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky left-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),P.map(e=>{const n=V(e,r,C),a=e.pricingVariants?.length?R:e.plan?.currency??R??"",o=W(n,r,a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===l?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+("โ"===o?"text-slate-400":"text-slate-700"),children:o})},e._id)})]},r._id))]}),P.some(e=>{const t=Ok(e,R);return t?.enabled})&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky left-0 z-10 border-t border-emerald-200 bg-emerald-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-emerald-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:"Seats"}),t("td",{colSpan:P.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky left-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:"Included seats"}),t("div",{className:"text-xs text-slate-500 mt-0.5",children:"Free with base price"})]}),P.map(e=>{const r=Ok(e,R);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===l?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.includedSeats||0:"โ"})},e._id)})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky left-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:"Max seats"})}),P.map(e=>{const r=Ok(e,R);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===l?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.maxSeats>0?r.maxSeats:"Unlimited":"โ"})},e._id)})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky left-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:"Per extra seat"})}),P.map(e=>{const r=Ik(e,R,C),n=e.pricingVariants?.length?R:e.plan?.currency??R??"";return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===l?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${kv(r,n)}${TE(C)}`:"โ"})},e._id)})]}),null!=m&&m>0&&e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky left-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:"Your billable seats"}),e("div",{className:"text-xs text-slate-500 mt-0.5",children:[m," member",1!==m?"s":""," in workspace"]})]}),P.map(r=>{const n=Ok(r,R);if(!n?.enabled)return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===l?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm text-slate-400",children:"โ"})},r._id);const a=n.includedSeats||0,o=Math.max(0,m-a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===l?"bg-blue-50/50":"bg-white"),children:0===o?t("span",{className:"text-sm font-medium text-emerald-600",children:"All included"}):e("span",{className:"text-sm font-medium text-amber-600",children:[o," extra seat",1!==o?"s":""]})},r._id)})]})]})]})]})})]})})]})})}});export{x as ApiVersion,it as AuthStatus,dr as BaseApi,Bf as BetaForm,bv as CURRENCY_DISPLAY,yv as CURRENCY_FLAG,xv as PLAN_CURRENCY_CODES,Sv as PLAN_CURRENCY_OPTIONS,Hf as PricingPage,Hr as QuotaUsageContextProvider,Do as SaaSOSProvider,ur as SettingsApi,Vr as SubscriptionContextProvider,Ao as UserApi,Zf as WhenAuthenticated,om as WhenNoSubscription,lm as WhenNotTrialing,dm as WhenQuotaAvailable,um as WhenQuotaExhausted,fm as WhenQuotaOverage,mm as WhenQuotaThreshold,Jf as WhenRoles,am as WhenSubscription,sm as WhenSubscriptionToPlans,cm as WhenTrialEnding,im as WhenTrialing,qf as WhenUnauthenticated,nm as WhenUserFeatureDisabled,rm as WhenUserFeatureEnabled,tm as WhenWorkspaceFeatureDisabled,em as WhenWorkspaceFeatureEnabled,Yf as WhenWorkspaceRoles,pr as WorkspaceApi,SE as WorkspaceSwitcher,Dk as calculateBillableSeats,Uk as calculateSeatOverageCents,Mk as calculateTotalSubscriptionCents,Zt as eventEmitter,kv as formatCents,Nv as formatOverageRate,Ev as formatOverageRateWithLabel,Av as formatQuotaIncludedOverage,Fk as formatQuotaWithPrice,Tk as getAvailableCurrenciesFromPlans,Ek as getBasePriceCents,Pk as getBillingIntervalAndCurrencyFromPriceId,vv as getCurrencyFlag,wv as getCurrencySymbol,_k as getDisplayCurrency,Ik as getPerSeatPriceCents,Nk as getPricingVariant,zk as getQuotaDisplayValue,Rk as getQuotaDisplayWithVariant,Ak as getQuotaOverageCents,Cv as getQuotaUnitLabelFromName,Ok as getSeatPricing,Ck as getStripePriceIdForInterval,Nr as invalidateQuotaUsage,Ht as invalidateSubscription,Lr as useAllQuotaUsage,Ur as useCancelSubscription,Rr as useCreateCheckoutSession,Dr as useInvoice,Ir as useInvoices,_r as usePlanGroup,Tr as usePlanGroupVersions,Cr as usePublicPlanGroupVersion,Er as usePublicPlans,Zr as useQuotaUsageContext,Fr as useQuotaUsageStatus,zr as useRecordUsage,Mr as useResumeSubscription,So as useSaaSAuth,fr as useSaaSOs,mr as useSaaSSettings,Sr as useSaaSWorkspaces,AE as useSeatStatus,Ar as useSubscription,Wr as useSubscriptionContext,Or as useSubscriptionManagement,CE as useTrialStatus,Pr as useUpdateSubscription,jr as useUsageLogs,Xf as useUserAttributes,Qf as useUserFeatures};
|
|
30
|
-
//# sourceMappingURL=index.esm.js.map
|