@buildbase/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +304 -0
- package/dist/index.d.ts +310 -0
- package/dist/index.esm.js +30 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/saas-os.css +3 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/types.d.ts +49 -0
- package/dist/types/components/beta/BetaForm.d.ts +24 -0
- package/dist/types/components/beta/api.d.ts +49 -0
- package/dist/types/components/beta/hooks.d.ts +11 -0
- package/dist/types/components/beta/schema.d.ts +6 -0
- package/dist/types/components/beta/types.d.ts +8 -0
- package/dist/types/components/dropdowns/country/countries.d.ts +7 -0
- package/dist/types/components/dropdowns/country/selectCountry.d.ts +6 -0
- package/dist/types/components/dropdowns/currency/currencies.d.ts +6 -0
- package/dist/types/components/dropdowns/currency/selectCurrency.d.ts +6 -0
- package/dist/types/components/dropdowns/language/languages.d.ts +6 -0
- package/dist/types/components/dropdowns/language/selectLanguage.d.ts +6 -0
- package/dist/types/components/dropdowns/timezone/selectTimeZone.d.ts +6 -0
- package/dist/types/components/dropdowns/timezone/timezones.d.ts +8 -0
- package/dist/types/components/features/index.d.ts +7 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +20 -0
- package/dist/types/components/ui/alert.d.ts +8 -0
- package/dist/types/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/types/components/ui/avatar.d.ts +6 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/button.d.ts +18 -0
- package/dist/types/components/ui/buttonIcon.d.ts +9 -0
- package/dist/types/components/ui/calendar.d.ts +8 -0
- package/dist/types/components/ui/card.d.ts +8 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/command.d.ts +82 -0
- package/dist/types/components/ui/context-menu.d.ts +27 -0
- package/dist/types/components/ui/dateRangePicker.d.ts +9 -0
- package/dist/types/components/ui/dialog.d.ts +19 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/types/components/ui/form.d.ts +23 -0
- package/dist/types/components/ui/heading.d.ts +10 -0
- package/dist/types/components/ui/hover-card.d.ts +6 -0
- package/dist/types/components/ui/input.d.ts +5 -0
- package/dist/types/components/ui/label.d.ts +5 -0
- package/dist/types/components/ui/menubar.d.ts +33 -0
- package/dist/types/components/ui/navigation-menu.d.ts +12 -0
- package/dist/types/components/ui/popover.d.ts +6 -0
- package/dist/types/components/ui/progress.d.ts +4 -0
- package/dist/types/components/ui/radio-group.d.ts +5 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +11 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +28 -0
- package/dist/types/components/ui/skeleton.d.ts +3 -0
- package/dist/types/components/ui/slider.d.ts +4 -0
- package/dist/types/components/ui/switch.d.ts +4 -0
- package/dist/types/components/ui/table.d.ts +10 -0
- package/dist/types/components/ui/tabs.d.ts +7 -0
- package/dist/types/components/ui/textarea.d.ts +5 -0
- package/dist/types/components/ui/toast.d.ts +15 -0
- package/dist/types/components/ui/toaster.d.ts +1 -0
- package/dist/types/components/ui/toggle.d.ts +12 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/components/ui/use-toast.d.ts +44 -0
- package/dist/types/components/user/auth.d.ts +6 -0
- package/dist/types/components/user/role.d.ts +8 -0
- package/dist/types/contexts/AuthContext.d.ts +9 -0
- package/dist/types/contexts/OSContext.d.ts +9 -0
- package/dist/types/contexts/SDKContextProvider.d.ts +15 -0
- package/dist/types/contexts/WorkspaceContext.d.ts +8 -0
- package/dist/types/contexts/actionCreators.d.ts +29 -0
- package/dist/types/contexts/createContext.d.ts +27 -0
- package/dist/types/contexts/index.d.ts +10 -0
- package/dist/types/contexts/reducers/authReducer.d.ts +13 -0
- package/dist/types/contexts/reducers/index.d.ts +3 -0
- package/dist/types/contexts/reducers/osReducer.d.ts +11 -0
- package/dist/types/contexts/reducers/workspaceReducer.d.ts +10 -0
- package/dist/types/contexts/types.d.ts +74 -0
- package/dist/types/contexts/useAppDispatch.d.ts +28 -0
- package/dist/types/contexts/useAppSelector.d.ts +36 -0
- package/dist/types/contexts/utils/reducerHelpers.d.ts +11 -0
- package/dist/types/contexts/utils/storage.d.ts +23 -0
- package/dist/types/hooks/use-mobile.d.ts +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/lib/api-client.d.ts +29 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/providers/ContextConfigProvider.d.ts +15 -0
- package/dist/types/providers/PortalContainer.d.ts +8 -0
- package/dist/types/providers/SaaSOSProvider.d.ts +7 -0
- package/dist/types/providers/auth/hooks.d.ts +10 -0
- package/dist/types/providers/auth/provider.d.ts +8 -0
- package/dist/types/providers/auth/types.d.ts +38 -0
- package/dist/types/providers/auth/utils.d.ts +10 -0
- package/dist/types/providers/os/types.d.ts +9 -0
- package/dist/types/providers/workspace/api.d.ts +33 -0
- package/dist/types/providers/workspace/hooks.d.ts +30 -0
- package/dist/types/providers/workspace/provider.d.ts +9 -0
- package/dist/types/providers/workspace/types.d.ts +38 -0
- package/dist/types/providers/workspace/ui/SettingsDialog.d.ts +8 -0
- package/dist/types/providers/workspace/ui/SettingsFeatures.d.ts +5 -0
- package/dist/types/providers/workspace/ui/SettingsGeneral.d.ts +6 -0
- package/dist/types/providers/workspace/ui/SettingsProfile.d.ts +6 -0
- package/dist/types/providers/workspace/ui/SettingsUsers.d.ts +6 -0
- package/dist/types/providers/workspace/ui/Sidebar.d.ts +10 -0
- package/dist/types/providers/workspace/ui/utils.d.ts +2 -0
- package/dist/types/providers/workspace/utils.d.ts +8 -0
- package/package.json +122 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import a,{createContext as o,useMemo as i,useReducer as s,useEffect as l,forwardRef as c,createElement as u,useState as d,useCallback as f,useLayoutEffect as m}from"react";import*as h from"react-dom";import p from"react-dom";function g({name:t,initialState:n,reducer:r,initializer:l}){const c=o(null),u=o(null),d=o(null),f=()=>{const e=a.useContext(c);if(null===e)throw new Error(`use${t}State must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:({children:t})=>{const[a,o]=s(r,n,l||(e=>e)),f=i(()=>({state:a,dispatch:o}),[a,o]);return e(d.Provider,{value:f,children:e(c.Provider,{value:a,children:e(u.Provider,{value:o,children:t})})})},useContext:()=>{const e=a.useContext(d);if(!e)throw new Error(`use${t}Context must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:f,useDispatch:()=>{const e=a.useContext(u);if(null===e)throw new Error(`use${t}Dispatch must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,t)=>{const n=f(),r=e||(e=>e),o=a.useRef(r),s=a.useRef(void 0);e&&(o.current=r);const l=i(()=>o.current(n),[n]);return void 0!==s.current&&(t||Object.is)(s.current,l)||(s.current=l),void 0!==s.current?s.current:l}}}var y;function v(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return console.warn(`Failed to load ${e} from localStorage:`,t),null}}function b(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}function w(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){console.warn(`Failed to remove ${e} from localStorage:`,t)}}!function(e){e.loading="loading",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(y||(y={}));const S="saas_os_auth_token";function x(){const e=function(e){const t=v(e);if(!t)return null;try{return JSON.parse(t)}catch(t){return console.warn(`Failed to parse ${e} from localStorage:`,t),w(e),null}}(S);return e?new Date(e.expires)>new Date?e:(w(S),null):null}function k(e){!function(e,t){try{b(e,JSON.stringify(t))}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}(S,e)}const T=()=>{const e=x();return{user:e?.user||null,session:e||null,isLoading:!1,isAuthenticated:!!e,isRedirecting:!1,status:e?y.authenticated:y.unauthenticated}},{Provider:A,useState:E,useDispatch:C}=g({name:"Auth",initialState:T(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:y.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:y.unauthenticated};case"SET_SESSION":{const n=t.payload;return k(n),{...e,session:n,user:n.user,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:y.authenticated}}case"REMOVE_SESSION":return w(S),{...e,user:null,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:y.unauthenticated};default:return e}},initializer:T}),N=A,_=E,R=C,{Provider:O,useState:D,useDispatch:M}=g({name:"OS",initialState:{serverUrl:"",version:"",orgId:""},reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return{...e,...t.payload};case"REMOVE_SAAS_OS_CONFIG":return{serverUrl:"",version:"",orgId:""};default:return e}}}),P=O,I=D,L=M,F="saas-workspace-current";const{Provider:z,useState:U,useDispatch:V}=g({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switching:!1,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return{...e,workspaces:t.payload};case"SET_ALL_FEATURES":return{...e,allFeatures:t.payload};case"SET_CURRENT_WORKSPACE":return(n=t.payload._id)?b(F,n):w(F),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return w(F),{...e,currentWorkspace:null};case"SET_IS_INITIALIZED":return{...e,isInitialized:t.payload};case"SET_LOADING":return{...e,loading:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"SET_REFRESHING":return{...e,refreshing:t.payload};case"SET_SWITCHING":return{...e,switching:t.payload};default:return e}var n}}),j=z,$=U,W=V,B=({children:t})=>e(P,{children:e(N,{children:e(j,{children:t})})});function Z(e,t){const n=I(),r=_(),o=$(),s=i(()=>({os:n,auth:r,workspaces:o}),[n,r,o]),l=e||(e=>e),c=a.useRef(l),u=a.useRef(void 0);e&&(c.current=l);const d=i(()=>c.current(s),[s]);return void 0!==u.current&&(t||Object.is)(u.current,d)||(u.current=d),void 0!==u.current?u.current:d}function H(){const e=R(),t=L(),n=W();return i(()=>({auth:e,os:t,workspaces:n}),[e,t,n])}const G=()=>({type:"AUTHENTICATION_STARTED"}),K=()=>({type:"AUTHENTICATION_FAILED"}),q=()=>({type:"REMOVE_SESSION"}),J=e=>({type:"SET_WORKSPACES",payload:e}),Y=e=>({type:"SET_ALL_FEATURES",payload:e}),X=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),Q=()=>({type:"RESET_CURRENT_WORKSPACE"}),ee=e=>({type:"SET_IS_INITIALIZED",payload:e}),te=e=>({type:"SET_LOADING",payload:e}),ne=e=>({type:"SET_ERROR",payload:e}),re=e=>({type:"SET_REFRESHING",payload:e}),ae=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),oe=({config:n,auth:r,children:a})=>{const o=H();return l(()=>{o.os(ae({...n,auth:{clientId:r?.clientId||"",redirectUrl:r?.redirectUrl||""}}))},[n,r,o]),e(t,{children:a})},ie=o({container:null,setContainer:()=>{}});function se({children:t}){const[r,o]=a.useState(null);return n(ie.Provider,{value:{container:r,setContainer:o},children:[t,e("div",{ref:o,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})}const le=({serverUrl:t,version:n,orgId:r,auth:a,children:o})=>e(B,{children:e(se,{children:e(oe,{config:{serverUrl:t,version:n,orgId:r},auth:a,children:o})})});var ce=e=>"checkbox"===e.type,ue=e=>e instanceof Date,de=e=>null==e;const fe=e=>"object"==typeof e;var me=e=>!de(e)&&!Array.isArray(e)&&fe(e)&&!ue(e),he=e=>me(e)&&e.target?ce(e.target)?e.target.checked:e.target.value:e,pe=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),ge="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function ye(e){let t;const n=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(ge&&(e instanceof Blob||r)||!n&&!me(e))return e;if(t=n?[]:Object.create(Object.getPrototypeOf(e)),n||(e=>{const t=e.constructor&&e.constructor.prototype;return me(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=ye(e[n]));else t=e}return t}var ve=e=>/^\w*$/.test(e),be=e=>void 0===e,we=e=>Array.isArray(e)?e.filter(Boolean):[],Se=e=>we(e.replace(/["|']|\]/g,"").split(/\.|\[/)),xe=(e,t,n)=>{if(!t||!me(e))return n;const r=(ve(t)?[t]:Se(t)).reduce((e,t)=>de(e)?e:e[t],e);return be(r)||r===e?be(e[t])?n:e[t]:r},ke=e=>"boolean"==typeof e,Te=(e,t,n)=>{let r=-1;const a=ve(t)?[t]:Se(t),o=a.length,i=o-1;for(;++r<o;){const t=a[r];let o=n;if(r!==i){const n=e[t];o=me(n)||Array.isArray(n)?n:isNaN(+a[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}};const Ae="blur",Ee="focusout",Ce="change",Ne="onBlur",_e="onChange",Re="onSubmit",Oe="onTouched",De="all",Me="max",Pe="min",Ie="maxLength",Le="minLength",Fe="pattern",ze="required",Ue="validate",Ve=a.createContext(null);Ve.displayName="HookFormContext";const je=()=>a.useContext(Ve),$e=e=>{const{children:t,...n}=e;return a.createElement(Ve.Provider,{value:n},t)};var We=(e,t,n,r=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==De&&(t._proxyFormState[a]=!r||De),n&&(n[a]=!0),e[a]}});return a};const Be="undefined"!=typeof window?a.useLayoutEffect:a.useEffect;var Ze=e=>"string"==typeof e,He=(e,t,n,r,a)=>Ze(e)?(r&&t.watch.add(e),xe(n,e,a)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),xe(n,e))):(r&&(t.watchAll=!0),n),Ge=e=>de(e)||!fe(e);function Ke(e,t,n=new WeakSet){if(Ge(e)||Ge(t))return e===t;if(ue(e)&&ue(t))return e.getTime()===t.getTime();const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const r=e[o];if(!a.includes(o))return!1;if("ref"!==o){const e=t[o];if(ue(r)&&ue(e)||me(r)&&me(e)||Array.isArray(r)&&Array.isArray(e)?!Ke(r,e,n):r!==e)return!1}}return!0}function qe(e){const t=je(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i,defaultValue:s}=e,l=pe(o._names.array,n),c=a.useMemo(()=>xe(o._formValues,n,xe(o._defaultValues,n,s)),[o,n,s]),u=function(e){const t=je(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s,compute:l}=e||{},c=a.useRef(o),u=a.useRef(l),d=a.useRef(void 0);u.current=l;const f=a.useMemo(()=>n._getWatch(r,c.current),[n,r]),[m,h]=a.useState(u.current?u.current(f):f);return Be(()=>n._subscribe({name:r,formState:{values:!0},exact:s,callback:e=>{if(!i){const t=He(r,n._names,e.values||n._formValues,!1,c.current);if(u.current){const e=u.current(t);Ke(e,d.current)||(h(e),d.current=e)}else h(t)}}}),[n,i,r,s]),a.useEffect(()=>n._removeUnmounted()),m}({control:o,name:n,defaultValue:c,exact:!0}),d=function(e){const t=je(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[s,l]=a.useState(n._formState),c=a.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Be(()=>n._subscribe({name:o,formState:c.current,exact:i,callback:e=>{!r&&l({...n._formState,...e})}}),[o,r,i]),a.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),a.useMemo(()=>We(s,n,c.current,!1),[s,n])}({control:o,name:n,exact:!0}),f=a.useRef(e),m=a.useRef(o.register(n,{...e.rules,value:u,...ke(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const h=a.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!xe(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!xe(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!xe(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!xe(d.validatingFields,n)},error:{enumerable:!0,get:()=>xe(d.errors,n)}}),[d,n]),p=a.useCallback(e=>m.current.onChange({target:{value:he(e),name:n},type:Ce}),[n]),g=a.useCallback(()=>m.current.onBlur({target:{value:xe(o._formValues,n),name:n},type:Ae}),[n,o._formValues]),y=a.useCallback(e=>{const t=xe(o._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,n]),v=a.useMemo(()=>({name:n,value:u,...ke(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:p,onBlur:g,ref:y}),[n,r,d.disabled,p,g,y,u]);return a.useEffect(()=>{const e=o._options.shouldUnregister||i;o.register(n,{...f.current.rules,...ke(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const n=xe(o._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){const e=ye(xe(o._options.defaultValues,n));Te(o._defaultValues,n,e),be(xe(o._formValues,n))&&Te(o._formValues,n,e)}return!l&&o.register(n),()=>{(l?e&&!o._state.action:e)?o.unregister(n):t(n,!1)}},[n,o,l,i]),a.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),a.useMemo(()=>({field:v,formState:d,fieldState:h}),[v,d,h])}const Je=e=>e.render(qe(e));var Ye=(e,t,n,r,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:a||!0}}:{},Xe=e=>Array.isArray(e)?e:[e],Qe=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},et=e=>me(e)&&!Object.keys(e).length,tt=e=>"file"===e.type,nt=e=>"function"==typeof e,rt=e=>{if(!ge)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},at=e=>"select-multiple"===e.type,ot=e=>"radio"===e.type,it=e=>rt(e)&&e.isConnected;function st(e,t){const n=Array.isArray(t)?t:ve(t)?[t]:Se(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=be(e)?r++:e[t[r++]];return e}(e,n),a=n.length-1,o=n[a];return r&&delete r[o],0!==a&&(me(r)&&et(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!be(e[t]))return!1;return!0}(r))&&st(e,n.slice(0,-1)),e}var lt=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function ct(e,t={}){const n=Array.isArray(e);if(me(e)||n)for(const n in e)Array.isArray(e[n])||me(e[n])&&!lt(e[n])?(t[n]=Array.isArray(e[n])?[]:{},ct(e[n],t[n])):de(e[n])||(t[n]=!0);return t}function ut(e,t,n){const r=Array.isArray(e);if(me(e)||r)for(const r in e)Array.isArray(e[r])||me(e[r])&&!lt(e[r])?be(t)||Ge(n[r])?n[r]=Array.isArray(e[r])?ct(e[r],[]):{...ct(e[r])}:ut(e[r],de(t)?{}:t[r],n[r]):n[r]=!Ke(e[r],t[r]);return n}var dt=(e,t)=>ut(e,t,ct(t));const ft={value:!1,isValid:!1},mt={value:!0,isValid:!0};var ht=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!be(e[0].attributes.value)?be(e[0].value)||""===e[0].value?mt:{value:e[0].value,isValid:!0}:mt:ft}return ft},pt=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>be(e)?e:t?""===e?NaN:e?+e:e:n&&Ze(e)?new Date(e):r?r(e):e;const gt={isValid:!1,value:null};var yt=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,gt):gt;function vt(e){const t=e.ref;return tt(t)?t.files:ot(t)?yt(e.refs).value:at(t)?[...t.selectedOptions].map(({value:e})=>e):ce(t)?ht(e.refs).value:pt(be(t.value)?e.ref.value:t.value,e)}var bt=e=>e instanceof RegExp,wt=e=>be(e)?e:bt(e)?e.source:me(e)?bt(e.value)?e.value.source:e.value:e,St=e=>({isOnSubmit:!e||e===Re,isOnBlur:e===Ne,isOnChange:e===_e,isOnAll:e===De,isOnTouch:e===Oe});const xt="AsyncFunction";var kt=e=>!!e&&!!e.validate&&!!(nt(e.validate)&&e.validate.constructor.name===xt||me(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===xt)),Tt=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const At=(e,t,n,r)=>{for(const a of n||Object.keys(e)){const n=xe(e,a);if(n){const{_f:e,...o}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(At(o,t))break}else if(me(o)&&At(o,t))break}}};function Et(e,t,n){const r=xe(e,n);if(r||ve(n))return{error:r,name:n};const a=n.split(".");for(;a.length;){const r=a.join("."),o=xe(t,r),i=xe(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};if(i&&i.root&&i.root.type)return{name:`${r}.root`,error:i.root};a.pop()}return{name:n}}var Ct=(e,t,n)=>{const r=Xe(xe(e,n));return Te(r,"root",t[n]),Te(e,n,r),e},Nt=e=>Ze(e);function _t(e,t,n="validate"){if(Nt(e)||Array.isArray(e)&&e.every(Nt)||ke(e)&&!e)return{type:n,message:Nt(e)?e:"",ref:t}}var Rt=e=>me(e)&&!bt(e)?e:{value:e,message:""},Ot=async(e,t,n,r,a,o)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:m,validate:h,name:p,valueAsNumber:g,mount:y}=e._f,v=xe(n,p);if(!y||t.has(p))return{};const b=s?s[0]:i,w=e=>{a&&b.reportValidity&&(b.setCustomValidity(ke(e)?"":e||""),b.reportValidity())},S={},x=ot(i),k=ce(i),T=x||k,A=(g||tt(i))&&be(i.value)&&be(v)||rt(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,E=Ye.bind(null,p,r,S),C=(e,t,n,r=Ie,a=Le)=>{const o=e?t:n;S[p]={type:e?r:a,message:o,ref:i,...E(e?r:a,o)}};if(o?!Array.isArray(v)||!v.length:l&&(!T&&(A||de(v))||ke(v)&&!v||k&&!ht(s).isValid||x&&!yt(s).isValid)){const{value:e,message:t}=Nt(l)?{value:!!l,message:l}:Rt(l);if(e&&(S[p]={type:ze,message:t,ref:b,...E(ze,t)},!r))return w(t),S}if(!(A||de(d)&&de(f))){let e,t;const n=Rt(f),a=Rt(d);if(de(v)||isNaN(v)){const r=i.valueAsDate||new Date(v),o=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;Ze(n.value)&&v&&(e=s?o(v)>o(n.value):l?v>n.value:r>new Date(n.value)),Ze(a.value)&&v&&(t=s?o(v)<o(a.value):l?v<a.value:r<new Date(a.value))}else{const r=i.valueAsNumber||(v?+v:v);de(n.value)||(e=r>n.value),de(a.value)||(t=r<a.value)}if((e||t)&&(C(!!e,n.message,a.message,Me,Pe),!r))return w(S[p].message),S}if((c||u)&&!A&&(Ze(v)||o&&Array.isArray(v))){const e=Rt(c),t=Rt(u),n=!de(e.value)&&v.length>+e.value,a=!de(t.value)&&v.length<+t.value;if((n||a)&&(C(n,e.message,t.message),!r))return w(S[p].message),S}if(m&&!A&&Ze(v)){const{value:e,message:t}=Rt(m);if(bt(e)&&!v.match(e)&&(S[p]={type:Fe,message:t,ref:i,...E(Fe,t)},!r))return w(t),S}if(h)if(nt(h)){const e=_t(await h(v,n),b);if(e&&(S[p]={...e,...E(Ue,e.message)},!r))return w(e.message),S}else if(me(h)){let e={};for(const t in h){if(!et(e)&&!r)break;const a=_t(await h[t](v,n),b,t);a&&(e={...a,...E(t,a.message)},w(a.message),r&&(S[p]=e))}if(!et(e)&&(S[p]={ref:b,...e},!r))return S}return w(!0),S};const Dt={mode:Re,reValidateMode:_e,shouldFocusError:!0};function Mt(e={}){let t,n={...Dt,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:nt(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},a={},o=(me(n.defaultValues)||me(n.values))&&ye(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:ye(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const f={array:Qe(),state:Qe()},m=n.criteriaMode===De,h=async e=>{if(!n.disabled&&(u.isValid||d.isValid||e)){const e=n.resolver?et((await b()).errors):await w(a,!0);e!==r.isValid&&f.state.next({isValid:e})}},p=(e,t)=>{!n.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?Te(r.validatingFields,e,t):st(r.validatingFields,e))}),f.state.next({validatingFields:r.validatingFields,isValidating:!et(r.validatingFields)}))},g=(e,t,n,r)=>{const l=xe(a,e);if(l){const a=xe(i,e,be(n)?xe(o,e):n);be(a)||r&&r.defaultChecked||t?Te(i,e,t?a:vt(l._f)):k(e,a),s.mount&&h()}},y=(e,t,a,i,s)=>{let l=!1,c=!1;const m={name:e};if(!n.disabled){if(!a||i){(u.isDirty||d.isDirty)&&(c=r.isDirty,r.isDirty=m.isDirty=S(),l=c!==m.isDirty);const n=Ke(xe(o,e),t);c=!!xe(r.dirtyFields,e),n?st(r.dirtyFields,e):Te(r.dirtyFields,e,!0),m.dirtyFields=r.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!n}if(a){const t=xe(r.touchedFields,e);t||(Te(r.touchedFields,e,a),m.touchedFields=r.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==a)}l&&s&&f.state.next(m)}return l?m:{}},v=(e,a,o,i)=>{const s=xe(r.errors,e),l=(u.isValid||d.isValid)&&ke(a)&&r.isValid!==a;var m;if(n.delayError&&o?(m=()=>((e,t)=>{Te(r.errors,e,t),f.state.next({errors:r.errors})})(e,o),t=e=>{clearTimeout(c),c=setTimeout(m,e)},t(n.delayError)):(clearTimeout(c),t=null,o?Te(r.errors,e,o):st(r.errors,e)),(o?!Ke(s,o):s)||!et(i)||l){const t={...i,...l&&ke(a)?{isValid:a}:{},errors:r.errors,name:e};r={...r,...t},f.state.next(t)}},b=async e=>{p(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const a={};for(const n of e){const e=xe(t,n);e&&Te(a,n,e._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:r}})(e||l.mount,a,n.criteriaMode,n.shouldUseNativeValidation));return p(e),t},w=async(e,t,a={valid:!0})=>{for(const o in e){const s=e[o];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&kt(s._f);d&&u.validatingFields&&p([o],!0);const f=await Ot(s,l.disabled,i,m,n.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&p([o]),f[e.name]&&(a.valid=!1,t))break;!t&&(xe(f,e.name)?c?Ct(r.errors,f,e.name):Te(r.errors,e.name,f[e.name]):st(r.errors,e.name))}!et(c)&&await w(c,t,a)}}return a.valid},S=(e,t)=>!n.disabled&&(e&&t&&Te(i,e,t),!Ke(_(),o)),x=(e,t,n)=>He(e,l,{...s.mount?i:be(t)?o:Ze(e)?{[e]:t}:t},n,t),k=(e,t,n={})=>{const r=xe(a,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&Te(i,e,pt(t,n)),o=rt(n.ref)&&de(t)?"":t,at(n.ref)?[...n.ref.options].forEach(e=>e.selected=o.includes(e.value)):n.refs?ce(n.ref)?n.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):n.refs.forEach(e=>e.checked=e.value===o):tt(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||f.state.next({name:e,values:ye(i)})))}(n.shouldDirty||n.shouldTouch)&&y(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&N(e)},T=(e,t,n)=>{for(const r in t){if(!t.hasOwnProperty(r))return;const o=t[r],i=e+"."+r,s=xe(a,i);(l.array.has(e)||me(o)||s&&!s._f)&&!ue(o)?T(i,o,n):k(i,o,n)}},A=(e,t,n={})=>{const c=xe(a,e),m=l.array.has(e),h=ye(t);Te(i,e,h),m?(f.array.next({name:e,values:ye(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&n.shouldDirty&&f.state.next({name:e,dirtyFields:dt(o,i),isDirty:S(e,h)})):!c||c._f||de(h)?k(e,h,n):T(e,h,n),Tt(e,l)&&f.state.next({...r,name:e}),f.state.next({name:s.mount?e:void 0,values:ye(i)})},E=async e=>{s.mount=!0;const o=e.target;let c=o.name,g=!0;const S=xe(a,c),x=e=>{g=Number.isNaN(e)||ue(e)&&isNaN(e.getTime())||Ke(e,xe(i,c,e))},k=St(n.mode),T=St(n.reValidateMode);if(S){let s,A;const E=o.type?vt(S._f):he(e),C=e.type===Ae||e.type===Ee,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(S._f)&&!n.resolver&&!xe(r.errors,c)&&!S._f.deps||((e,t,n,r,a)=>!a.isOnAll&&(!n&&a.isOnTouch?!(t||e):(n?r.isOnBlur:a.isOnBlur)?!e:!(n?r.isOnChange:a.isOnChange)||e))(C,xe(r.touchedFields,c),r.isSubmitted,T,k),R=Tt(c,l,C);Te(i,c,E),C?o&&o.readOnly||(S._f.onBlur&&S._f.onBlur(e),t&&t(0)):S._f.onChange&&S._f.onChange(e);const O=y(c,E,C),D=!et(O)||R;if(!C&&f.state.next({name:c,type:e.type,values:ye(i)}),_)return(u.isValid||d.isValid)&&("onBlur"===n.mode?C&&h():C||h()),D&&f.state.next({name:c,...R?{}:O});if(!C&&R&&f.state.next({...r}),n.resolver){const{errors:e}=await b([c]);if(x(E),g){const t=Et(r.errors,a,c),n=Et(e,a,t.name||c);s=n.error,c=n.name,A=et(e)}}else p([c],!0),s=(await Ot(S,l.disabled,i,m,n.shouldUseNativeValidation))[c],p([c]),x(E),g&&(s?A=!1:(u.isValid||d.isValid)&&(A=await w(a,!0)));g&&(S._f.deps&&N(S._f.deps),v(c,A,s,O))}},C=(e,t)=>{if(xe(r.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let o,i;const s=Xe(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await b(e);if(e)for(const n of e){const e=xe(t,n);e?Te(r.errors,n,e):st(r.errors,n)}else r.errors=t;return t})(be(e)?e:s);o=et(t),i=e?!s.some(e=>xe(t,e)):o}else e?(i=(await Promise.all(s.map(async e=>{const t=xe(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||r.isValid)&&h()):i=o=await w(a);return f.state.next({...!Ze(e)||(u.isValid||d.isValid)&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors}),t.shouldFocus&&!i&&At(a,C,e?s:l.mount),i},_=e=>{const t={...s.mount?i:o};return be(e)?t:Ze(e)?xe(t,e):e.map(e=>xe(t,e))},R=(e,t)=>({invalid:!!xe((t||r).errors,e),isDirty:!!xe((t||r).dirtyFields,e),error:xe((t||r).errors,e),isValidating:!!xe(r.validatingFields,e),isTouched:!!xe((t||r).touchedFields,e)}),O=(e,t,n)=>{const o=(xe(a,e,{_f:{}})._f||{}).ref,i=xe(r.errors,e)||{},{ref:s,message:l,type:c,...u}=i;Te(r.errors,e,{...u,...t,ref:o}),f.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},D=e=>f.state.subscribe({next:t=>{var n,a,s;n=e.name,a=t.name,s=e.exact,n&&a&&n!==a&&!Xe(n).some(e=>e&&(s?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,n,r)=>{n(e);const{name:a,...o}=e;return et(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!r||De))})(t,e.formState||u,V,e.reRenderRoot)||e.callback({values:{...i},...r,...t,defaultValues:o})}}).unsubscribe,M=(e,t={})=>{for(const s of e?Xe(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(st(a,s),st(i,s)),!t.keepError&&st(r.errors,s),!t.keepDirty&&st(r.dirtyFields,s),!t.keepTouched&&st(r.touchedFields,s),!t.keepIsValidating&&st(r.validatingFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&st(o,s);f.state.next({values:ye(i)}),f.state.next({...r,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&h()},P=({disabled:e,name:t})=>{(ke(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},I=(e,t={})=>{let r=xe(a,e);const i=ke(t.disabled)||ke(n.disabled);return Te(a,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?P({disabled:ke(t.disabled)?t.disabled:n.disabled,name:e}):g(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:wt(t.min),max:wt(t.max),minLength:wt(t.minLength),maxLength:wt(t.maxLength),pattern:wt(t.pattern)}:{},name:e,onChange:E,onBlur:E,ref:i=>{if(i){I(e,t),r=xe(a,e);const n=be(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>ot(e)||ce(e))(n),l=r._f.refs||[];if(s?l.find(e=>e===n):n===r._f.ref)return;Te(a,e,{_f:{...r._f,...s?{refs:[...l.filter(it),n,...Array.isArray(xe(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),g(e,!1,void 0,n)}else r=xe(a,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!pe(l.array,e)||!s.action)&&l.unMount.add(e)}}},L=()=>n.shouldFocusError&&At(a,C,l.mount),F=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=ye(i);if(f.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await b();r.errors=e,c=ye(t)}else await w(a);if(l.disabled.size)for(const e of l.disabled)st(c,e);if(st(r.errors,"root"),et(r.errors)){f.state.next({errors:{}});try{await e(c,o)}catch(e){s=e}}else t&&await t({...r.errors},o),L(),setTimeout(L);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:et(r.errors)&&!s,submitCount:r.submitCount+1,errors:r.errors}),s)throw s},z=(e,t={})=>{const c=e?ye(e):o,d=ye(c),m=et(e),h=m?o:d;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(dt(o,i))]);for(const t of Array.from(e))xe(r.dirtyFields,t)?Te(h,t,xe(i,t)):A(t,xe(h,t))}else{if(ge&&be(e))for(const e of l.mount){const t=xe(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(rt(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)A(e,xe(h,e));else a={}}i=n.shouldUnregister?t.keepDefaultValues?ye(o):{}:ye(h),f.array.next({values:{...h}}),f.state.next({values:{...h}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!n.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!m&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||Ke(e,o))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&i?dt(o,i):r.dirtyFields:t.keepDefaultValues&&e?dt(o,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1,defaultValues:o})},U=(e,t)=>z(nt(e)?e(i):e,t),V=e=>{r={...r,...e}},j={control:{register:I,unregister:M,getFieldState:R,handleSubmit:F,setError:O,_subscribe:D,_runSchema:b,_focusError:L,_getWatch:x,_getDirty:S,_setValid:h,_setFieldArray:(e,t=[],l,c,m=!0,h=!0)=>{if(c&&l&&!n.disabled){if(s.action=!0,h&&Array.isArray(xe(a,e))){const t=l(xe(a,e),c.argA,c.argB);m&&Te(a,e,t)}if(h&&Array.isArray(xe(r.errors,e))){const t=l(xe(r.errors,e),c.argA,c.argB);m&&Te(r.errors,e,t),((e,t)=>{!we(xe(e,t)).length&&st(e,t)})(r.errors,e)}if((u.touchedFields||d.touchedFields)&&h&&Array.isArray(xe(r.touchedFields,e))){const t=l(xe(r.touchedFields,e),c.argA,c.argB);m&&Te(r.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=dt(o,i)),f.state.next({name:e,isDirty:S(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Te(i,e,t)},_setDisabledField:P,_setErrors:e=>{r.errors=e,f.state.next({errors:r.errors,isValid:!1})},_getFieldArray:e=>we(xe(s.mount?i:o,e,n.shouldUnregister?xe(o,e,[]):[])),_reset:z,_resetDefaultValues:()=>nt(n.defaultValues)&&n.defaultValues().then(e=>{U(e,n.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=xe(a,e);t&&(t._f.refs?t._f.refs.every(e=>!it(e)):!it(t._f.ref))&&M(e)}l.unMount=new Set},_disableForm:e=>{ke(e)&&(f.state.next({disabled:e}),At(a,(t,n)=>{const r=xe(a,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEach(t=>{t.disabled=r._f.disabled||e}))},0,!1))},_subjects:f,_proxyFormState:u,get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},get _options(){return n},set _options(e){n={...n,...e}}},subscribe:e=>(s.mount=!0,d={...d,...e.formState},D({...e,formState:d})),trigger:N,register:I,handleSubmit:F,watch:(e,t)=>nt(e)?f.state.subscribe({next:n=>"values"in n&&e(x(void 0,t),n)}):x(e,t,!0),setValue:A,getValues:_,reset:U,resetField:(e,t={})=>{xe(a,e)&&(be(t.defaultValue)?A(e,ye(xe(o,e))):(A(e,t.defaultValue),Te(o,e,ye(t.defaultValue))),t.keepTouched||st(r.touchedFields,e),t.keepDirty||(st(r.dirtyFields,e),r.isDirty=t.defaultValue?S(e,ye(xe(o,e))):S()),t.keepError||(st(r.errors,e),u.isValid&&h()),f.state.next({...r}))},clearErrors:e=>{e&&Xe(e).forEach(e=>st(r.errors,e)),f.state.next({errors:e?r.errors:{}})},unregister:M,setError:O,setFocus:(e,t={})=>{const n=xe(a,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&nt(e.select)&&e.select())}},getFieldState:R};return{...j,formControl:j}}function Pt(e={}){const t=a.useRef(void 0),n=a.useRef(void 0),[r,o]=a.useState({isDirty:!1,isValidating:!1,isLoading:nt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:nt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:n,...a}=Mt(e);t.current={...a,formState:r}}const i=t.current.control;return i._options=e,Be(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),a.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),a.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),a.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),a.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),a.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==r.isDirty&&i._subjects.state.next({isDirty:e})}},[i,r.isDirty]),a.useEffect(()=>{e.values&&!Ke(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,o(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),a.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=We(r,i),t.current}const It=(e,t,n)=>{if(e&&"reportValidity"in e){const r=xe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Lt=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?It(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>It(t,n,e))}},Ft=(e,t)=>{t.shouldUseNativeValidation&&Lt(e,t);const n={};for(const r in e){const a=xe(t.fields,r),o=Object.assign(e[r]||{},{ref:a&&a.ref});if(zt(t.names||Object.keys(e),r)){const e=Object.assign({},xe(n,r));Te(e,"root",o),Te(n,r,e)}else Te(n,r,o)}return n},zt=(e,t)=>{const n=Ut(t);return e.some(e=>Ut(e).match(`^${n}\\.\\d+`))};function Ut(e){return e.replace(/\]|\[/g,"")}function Vt(e,t,n){function r(n,r){var a;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(a=n._zod).traits??(a.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in i.prototype)e in n||Object.defineProperty(n,e,{value:i.prototype[e].bind(n)});n._zod.constr=i,n._zod.def=r}const a=n?.Parent??Object;class o extends a{}function i(e){var t;const a=n?.Parent?new o:this;r(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class jt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $t extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Wt={};function Bt(e){return Wt}function Zt(e,t){return"bigint"==typeof t?t.toString():t}function Ht(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Gt(e){return null==e}function Kt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const qt=Symbol("evaluating");function Jt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==qt)return void 0===r&&(r=qt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Yt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Xt(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Qt(e){return JSON.stringify(e)}const en="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const nn=Ht(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function rn(e){if(!1===tn(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==tn(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function an(e){return rn(e)?{...e}:Array.isArray(e)?[...e]:e}const on=new Set(["string","number","symbol"]);function sn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ln(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function cn(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function un(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function dn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function fn(e){return"string"==typeof e?e:e?.message}function mn(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const a=fn(e.inst?._zod.def?.error?.(e))??fn(t?.error?.(e))??fn(n.customError?.(e))??fn(n.localeError?.(e))??"Invalid input";r.message=a}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function hn(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function pn(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const gn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Zt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},yn=Vt("$ZodError",gn),vn=Vt("$ZodError",gn,{Parent:Error});const bn=e=>(t,n,r,a)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new jt;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>mn(e,o,Bt())));throw en(t,a?.callee),t}return i.value},wn=bn(vn),Sn=e=>async(t,n,r,a)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>mn(e,o,Bt())));throw en(t,a?.callee),t}return i.value},xn=Sn(vn),kn=e=>(t,n,r)=>{const a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new jt;return o.issues.length?{success:!1,error:new(e??yn)(o.issues.map(e=>mn(e,a,Bt())))}:{success:!0,data:o.value}},Tn=kn(vn),An=e=>async(t,n,r)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>mn(e,a,Bt())))}:{success:!0,data:o.value}},En=An(vn),Cn=e=>(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bn(e)(t,n,a)},Nn=e=>(t,n,r)=>bn(e)(t,n,r),_n=e=>async(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Sn(e)(t,n,a)},Rn=e=>async(t,n,r)=>Sn(e)(t,n,r),On=e=>(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return kn(e)(t,n,a)},Dn=e=>(t,n,r)=>kn(e)(t,n,r),Mn=e=>async(t,n,r)=>{const a=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return An(e)(t,n,a)},Pn=e=>async(t,n,r)=>An(e)(t,n,r),In=/^[cC][^\s-]{8,}$/,Ln=/^[0-9a-z]+$/,Fn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zn=/^[0-9a-vA-V]{20}$/,Un=/^[A-Za-z0-9]{27}$/,Vn=/^[a-zA-Z0-9_-]{21}$/,jn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$n=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Wn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Bn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Zn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Gn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Kn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jn=/^[A-Za-z0-9_-]*$/,Yn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Xn=/^\+(?:[0-9]){6,14}[0-9]$/,Qn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",er=new RegExp(`^${Qn}$`);function tr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const nr=/^[^A-Z]*$/,rr=/^[^a-z]*$/,ar=Vt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),or=Vt("$ZodCheckMaxLength",(e,t)=>{var n;ar.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Gt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const a=hn(r);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ir=Vt("$ZodCheckMinLength",(e,t)=>{var n;ar.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Gt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const a=hn(r);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sr=Vt("$ZodCheckLengthEquals",(e,t)=>{var n;ar.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Gt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,a=r.length;if(a===t.length)return;const o=hn(r),i=a>t.length;n.issues.push({origin:o,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),lr=Vt("$ZodCheckStringFormat",(e,t)=>{var n,r;ar.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),cr=Vt("$ZodCheckRegex",(e,t)=>{lr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ur=Vt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nr),lr.init(e,t)}),dr=Vt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rr),lr.init(e,t)}),fr=Vt("$ZodCheckIncludes",(e,t)=>{ar.init(e,t);const n=sn(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),mr=Vt("$ZodCheckStartsWith",(e,t)=>{ar.init(e,t);const n=new RegExp(`^${sn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),hr=Vt("$ZodCheckEndsWith",(e,t)=>{ar.init(e,t);const n=new RegExp(`.*${sn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),pr=Vt("$ZodCheckOverwrite",(e,t)=>{ar.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class gr{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const yr={major:4,minor:1,patch:8},vr=Vt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yr;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,a=un(e);for(const o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,i=o._zod.check(e);if(i instanceof Promise&&!1===n?.async)throw new jt;if(r||i instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=un(e,t)))});else{if(e.issues.length===t)continue;a||(a=un(e,t))}}return r?r.then(()=>e):e},n=(n,a,o)=>{if(un(n))return n.aborted=!0,n;const i=t(a,r,o);if(i instanceof Promise){if(!1===o.async)throw new jt;return i.then(t=>e._zod.parse(t,o))}return e._zod.parse(i,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if("backward"===o.direction){const t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,a,o)):n(t,a,o)}const i=e._zod.parse(a,o);if(i instanceof Promise){if(!1===o.async)throw new jt;return i.then(e=>t(e,r,o))}return t(i,r,o)}}e["~standard"]={validate:t=>{try{const n=Tn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return En(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),br=Vt("$ZodString",(e,t)=>{var n;vr.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),wr=Vt("$ZodStringFormat",(e,t)=>{lr.init(e,t),br.init(e,t)}),Sr=Vt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$n),wr.init(e,t)}),xr=Vt("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Wn(e))}else t.pattern??(t.pattern=Wn());wr.init(e,t)}),kr=Vt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Bn),wr.init(e,t)}),Tr=Vt("$ZodURL",(e,t)=>{wr.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),a=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Yn.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=a.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ar=Vt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),wr.init(e,t)}),Er=Vt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Vn),wr.init(e,t)}),Cr=Vt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=In),wr.init(e,t)}),Nr=Vt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ln),wr.init(e,t)}),_r=Vt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Fn),wr.init(e,t)}),Rr=Vt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zn),wr.init(e,t)}),Or=Vt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Un),wr.init(e,t)}),Dr=Vt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=tr({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Qn}T(?:${r})$`)}(t)),wr.init(e,t)}),Mr=Vt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=er),wr.init(e,t)}),Pr=Vt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${tr(t)}$`)),wr.init(e,t)}),Ir=Vt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jn),wr.init(e,t)}),Lr=Vt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Zn),wr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Fr=Vt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Hn),wr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),zr=Vt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gn),wr.init(e,t)}),Ur=Vt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Kn),wr.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Vr(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const jr=Vt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=qn),wr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Vr(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const $r=Vt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Jn),wr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!Jn.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Vr(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Wr=Vt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Xn),wr.init(e,t)});const Br=Vt("$ZodJWT",(e,t)=>{wr.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const a=JSON.parse(atob(r));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Zr=Vt("$ZodUnknown",(e,t)=>{vr.init(e,t),e._zod.parse=e=>e}),Hr=Vt("$ZodNever",(e,t)=>{vr.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Gr(e,t,n){e.issues.length&&t.issues.push(...dn(n,e.issues)),t.value[n]=e.value}const Kr=Vt("$ZodArray",(e,t)=>{vr.init(e,t),e._zod.parse=(n,r)=>{const a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),n;n.value=Array(a.length);const o=[];for(let e=0;e<a.length;e++){const i=a[e],s=t.element._zod.run({value:i,issues:[]},r);s instanceof Promise?o.push(s.then(t=>Gr(t,n,e))):Gr(s,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function qr(e,t,n,r){e.issues.length&&t.issues.push(...dn(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Jr(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Yr(e,t,n,r,a,o){const i=[],s=a.keySet,l=a.catchall._zod,c=l.def.type;for(const a of Object.keys(t)){if(s.has(a))continue;if("never"===c){i.push(a);continue}const o=l.run({value:t[a],issues:[]},r);o instanceof Promise?e.push(o.then(e=>qr(e,n,a,t))):qr(o,n,a,t)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const Xr=Vt("$ZodObject",(e,t)=>{vr.init(e,t);const n=Ht(()=>Jr(t));Jt(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const r=tn,a=t.catchall;let o;e._zod.parse=(t,i)=>{o??(o=n.value);const s=t.value;if(!r(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const l=[],c=o.shape;for(const e of o.keys){const n=c[e]._zod.run({value:s[e],issues:[]},i);n instanceof Promise?l.push(n.then(n=>qr(n,t,e,s))):qr(n,t,e,s)}return a?Yr(l,s,t,i,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Qr=Vt("$ZodObjectJIT",(e,t)=>{Xr.init(e,t);const n=e._zod.parse,r=Ht(()=>Jr(t));let a;const o=tn,i=!Wt.jitless,s=i&&nn.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=r.value);const f=u.value;return o(f)?i&&s&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new gr(["shape","payload","ctx"]),n=r.value,a=e=>{const t=Qt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let i=0;for(const e of n.keys)o[e]="key_"+i++;t.write("const newResult = {};");for(const e of n.keys){const n=o[e],r=Qt(e);t.write(`const ${n} = ${a(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),u=a(u,d),l?Yr([],f,u,d,c,e):u):n(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function ea(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const a=e.filter(e=>!un(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>mn(e,r,Bt())))}),t)}const ta=Vt("$ZodUnion",(e,t)=>{vr.init(e,t),Jt(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Jt(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Jt(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Jt(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Kt(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(a,o)=>{if(n)return r(a,o);let i=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},o);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>ea(t,a,e,o)):ea(s,a,e,o)}}),na=Vt("$ZodIntersection",(e,t)=>{vr.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,a=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,n])=>aa(e,t,n)):aa(e,a,o)}});function ra(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(rn(e)&&rn(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),a={...e,...t};for(const n of r){const r=ra(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};a[n]=r.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const a=ra(e[r],t[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function aa(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),un(e))return e;const r=ra(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const oa=Vt("$ZodEnum",(e,t)=>{vr.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e),n=Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t);return n}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>on.has(typeof e)).map(e=>"string"==typeof e?sn(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),ia=Vt("$ZodTransform",(e,t)=>{vr.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new $t(e.constructor.name);const a=t.transform(n.value,n);if(r.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(n.value=e,n))}if(a instanceof Promise)throw new jt;return n.value=a,n}});function sa(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const la=Vt("$ZodOptional",(e,t)=>{vr.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Jt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Jt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Kt(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>sa(t,e.value)):sa(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),ca=Vt("$ZodNullable",(e,t)=>{vr.init(e,t),Jt(e._zod,"optin",()=>t.innerType._zod.optin),Jt(e._zod,"optout",()=>t.innerType._zod.optout),Jt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Kt(e.source)}|null)$`):void 0}),Jt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),ua=Vt("$ZodDefault",(e,t)=>{vr.init(e,t),e._zod.optin="optional",Jt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>da(e,t)):da(r,t)}});function da(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const fa=Vt("$ZodPrefault",(e,t)=>{vr.init(e,t),e._zod.optin="optional",Jt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ma=Vt("$ZodNonOptional",(e,t)=>{vr.init(e,t),Jt(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(t=>ha(t,e)):ha(a,e)}});function ha(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const pa=Vt("$ZodCatch",(e,t)=>{vr.init(e,t),Jt(e._zod,"optin",()=>t.innerType._zod.optin),Jt(e._zod,"optout",()=>t.innerType._zod.optout),Jt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>mn(e,n,Bt()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>mn(e,n,Bt()))},input:e.value}),e.issues=[]),e)}}),ga=Vt("$ZodPipe",(e,t)=>{vr.init(e,t),Jt(e._zod,"values",()=>t.in._zod.values),Jt(e._zod,"optin",()=>t.in._zod.optin),Jt(e._zod,"optout",()=>t.out._zod.optout),Jt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ya(e,t.in,n)):ya(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ya(e,t.out,n)):ya(r,t.out,n)}});function ya(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const va=Vt("$ZodReadonly",(e,t)=>{vr.init(e,t),Jt(e._zod,"propValues",()=>t.innerType._zod.propValues),Jt(e._zod,"values",()=>t.innerType._zod.values),Jt(e._zod,"optin",()=>t.innerType._zod.optin),Jt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ba):ba(r)}});function ba(e){return e.value=Object.freeze(e.value),e}const wa=Vt("$ZodCustom",(e,t)=>{ar.init(e,t),vr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(t=>Sa(t,n,r,e));Sa(a,n,r,e)}});function Sa(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(pn(e))}}class xa{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ka(){return new xa}const Ta=ka();function Aa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...cn(t)})}function Ea(e,t){return new or({check:"max_length",...cn(t),maximum:e})}function Ca(e,t){return new ir({check:"min_length",...cn(t),minimum:e})}function Na(e,t){return new sr({check:"length_equals",...cn(t),length:e})}function _a(e){return new pr({check:"overwrite",tx:e})}function Ra(e){const t=function(e,t){const n=new ar({check:"custom",...cn(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(pn(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(pn(r))}},e(n.value,n)));return t}function Oa(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function Da(e,t){for(var n={};e.length;){var r=e[0],a=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[i]={message:s.message,type:s.code}}else n[i]={message:o,type:a};if("unionErrors"in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=n[i].types,c=l&&l[r.code];n[i]=Ye(i,t,n,a,c?[].concat(c,r.message):r.message)}e.shift()}return n}function Ma(e,t){for(var n={};e.length;){var r=e[0],a=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("invalid_union"===r.code&&r.errors.length>0){var s=r.errors[0][0];n[i]={message:s.message,type:s.code}}else n[i]={message:o,type:a};if("invalid_union"===r.code&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var l=n[i].types,c=l&&l[r.code];n[i]=Ye(i,t,n,a,c?[].concat(c,r.message):r.message)}e.shift()}return n}function Pa(e,t,n){if(void 0===n&&(n={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(r,a,o){try{return Promise.resolve(Oa(function(){return Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](r,t)).then(function(e){return o.shouldUseNativeValidation&&Lt({},o),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:Ft(Da(e.errors,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(r,a,o){try{return Promise.resolve(Oa(function(){return Promise.resolve(("sync"===n.mode?wn:xn)(e,r,t)).then(function(e){return o.shouldUseNativeValidation&&Lt({},o),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof yn}(e))return{values:{},errors:Ft(Ma(e.issues,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}function Ia(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Ia(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function La(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Ia(e))&&(r&&(r+=" "),r+=t);return r}const Fa=e=>{const t=ja(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),za(n,t)||Va(e)},getConflictingClassGroupIds:(e,t)=>{const a=n[e]||[];return t&&r[e]?[...a,...r[e]]:a}}},za=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?za(e.slice(1),r):void 0;if(a)return a;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},Ua=/^\[(.+)\]$/,Va=e=>{if(Ua.test(e)){const t=Ua.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ja=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const e in n)$a(n[e],r,e,t);return r},$a=(e,t,n,r)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Wa(t,e)).classGroupId=n)}if("function"==typeof e)return Ba(e)?void $a(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,a])=>{$a(a,Wa(t,e),n,r)})})},Wa=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Ba=e=>e.isThemeGetter,Za=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(a(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):a(e,t)}}},Ha=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,a=0,o=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===r&&0===a){if(":"===s){t.push(e.slice(o,i)),o=i+1;continue}if("/"===s){n=i;continue}}"["===s?r++:"]"===s?r--:"("===s?a++:")"===s&&a--}const i=0===t.length?e:e.substring(o),s=Ga(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>o?n-o:void 0}};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Ga=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,Ka=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let r=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...r.sort(),e),r=[]):r.push(e)}),n.push(...r.sort()),n}},qa=/\s+/;function Ja(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Ya(e))&&(r&&(r+=" "),r+=t);return r}const Ya=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ya(e[r]))&&(n&&(n+=" "),n+=t);return n};function Xa(e,...t){let n,r,a,o=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Za(e.cacheSize),parseClassName:Ha(e),sortModifiers:Ka(e),...Fa(e)}))(l),r=n.cache.get,a=n.cache.set,o=i,i(s)};function i(e){const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,i=[],s=e.trim().split(qa);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!m,p=r(h?f.substring(0,m):f);if(!p){if(!h){l=t+(l.length>0?" "+l:l);continue}if(p=r(f),!p){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=o(u).join(":"),y=d?g+"!":g,v=y+p;if(i.includes(v))continue;i.push(v);const b=a(p,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return a(e,o),o}return function(){return o(Ja.apply(null,arguments))}}const Qa=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},eo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,to=/^\((?:(\w[\w-]*):)?(.+)\)$/i,no=/^\d+\/\d+$/,ro=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ao=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,oo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,io=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,so=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lo=e=>no.test(e),co=e=>!!e&&!Number.isNaN(Number(e)),uo=e=>!!e&&Number.isInteger(Number(e)),fo=e=>e.endsWith("%")&&co(e.slice(0,-1)),mo=e=>ro.test(e),ho=()=>!0,po=e=>ao.test(e)&&!oo.test(e),go=()=>!1,yo=e=>io.test(e),vo=e=>so.test(e),bo=e=>!So(e)&&!Co(e),wo=e=>Po(e,zo,go),So=e=>eo.test(e),xo=e=>Po(e,Uo,po),ko=e=>Po(e,Vo,co),To=e=>Po(e,Lo,go),Ao=e=>Po(e,Fo,vo),Eo=e=>Po(e,$o,yo),Co=e=>to.test(e),No=e=>Io(e,Uo),_o=e=>Io(e,jo),Ro=e=>Io(e,Lo),Oo=e=>Io(e,zo),Do=e=>Io(e,Fo),Mo=e=>Io(e,$o,!0),Po=(e,t,n)=>{const r=eo.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},Io=(e,t,n=!1)=>{const r=to.exec(e);return!!r&&(r[1]?t(r[1]):n)},Lo=e=>"position"===e||"percentage"===e,Fo=e=>"image"===e||"url"===e,zo=e=>"length"===e||"size"===e||"bg-size"===e,Uo=e=>"length"===e,Vo=e=>"number"===e,jo=e=>"family-name"===e,$o=e=>"shadow"===e,Wo=Xa(()=>{const e=Qa("color"),t=Qa("font"),n=Qa("text"),r=Qa("font-weight"),a=Qa("tracking"),o=Qa("leading"),i=Qa("breakpoint"),s=Qa("container"),l=Qa("spacing"),c=Qa("radius"),u=Qa("shadow"),d=Qa("inset-shadow"),f=Qa("text-shadow"),m=Qa("drop-shadow"),h=Qa("blur"),p=Qa("perspective"),g=Qa("aspect"),y=Qa("ease"),v=Qa("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Co,So],w=()=>[Co,So,l],S=()=>[lo,"full","auto",...w()],x=()=>[uo,"none","subgrid",Co,So],k=()=>["auto",{span:["full",uo,Co,So]},uo,Co,So],T=()=>[uo,"auto",Co,So],A=()=>["auto","min","max","fr",Co,So],E=()=>["auto",...w()],C=()=>[lo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],N=()=>[e,Co,So],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ro,To,{position:[Co,So]}],R=()=>["auto","cover","contain",Oo,wo,{size:[Co,So]}],O=()=>[fo,No,xo],D=()=>["","none","full",c,Co,So],M=()=>["",co,No,xo],P=()=>[co,fo,Ro,To],I=()=>["","none",h,Co,So],L=()=>["none",co,Co,So],F=()=>["none",co,Co,So],z=()=>[co,Co,So],U=()=>[lo,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mo],breakpoint:[mo],color:[ho],container:[mo],"drop-shadow":[mo],ease:["in","out","in-out"],font:[bo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mo],shadow:[mo],spacing:["px",co],text:[mo],"text-shadow":[mo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lo,So,Co,g]}],container:["container"],columns:[{columns:[co,So,Co,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[uo,"auto",Co,So]}],basis:[{basis:[lo,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[co,lo,"auto","initial","none",So]}],grow:[{grow:["",co,Co,So]}],shrink:[{shrink:["",co,Co,So]}],order:[{order:[uo,"first","last","none",Co,So]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[s,"screen",...C()]}],"min-w":[{"min-w":[s,"screen","none",...C()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",n,No,xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Co,ko]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fo,So]}],"font-family":[{font:[_o,So,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Co,So]}],"line-clamp":[{"line-clamp":[co,"none",Co,ko]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",Co,So]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Co,So]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[co,"from-font","auto",Co,xo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[co,"auto",Co,So]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Co,So]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Co,So]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},uo,Co,So],radial:["",Co,So],conic:[uo,Co,So]},Do,Ao]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[co,Co,So]}],"outline-w":[{outline:["",co,No,xo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",u,Mo,Eo]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",d,Mo,Eo]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[co,xo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",f,Mo,Eo]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[co,Co,So]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[co]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Co,So]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[co]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Co,So]}],filter:[{filter:["","none",Co,So]}],blur:[{blur:I()}],brightness:[{brightness:[co,Co,So]}],contrast:[{contrast:[co,Co,So]}],"drop-shadow":[{"drop-shadow":["","none",m,Mo,Eo]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",co,Co,So]}],"hue-rotate":[{"hue-rotate":[co,Co,So]}],invert:[{invert:["",co,Co,So]}],saturate:[{saturate:[co,Co,So]}],sepia:[{sepia:["",co,Co,So]}],"backdrop-filter":[{"backdrop-filter":["","none",Co,So]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[co,Co,So]}],"backdrop-contrast":[{"backdrop-contrast":[co,Co,So]}],"backdrop-grayscale":[{"backdrop-grayscale":["",co,Co,So]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[co,Co,So]}],"backdrop-invert":[{"backdrop-invert":["",co,Co,So]}],"backdrop-opacity":[{"backdrop-opacity":[co,Co,So]}],"backdrop-saturate":[{"backdrop-saturate":[co,Co,So]}],"backdrop-sepia":[{"backdrop-sepia":["",co,Co,So]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Co,So]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[co,"initial",Co,So]}],ease:[{ease:["linear","initial",y,Co,So]}],delay:[{delay:[co,Co,So]}],animate:[{animate:["none",v,Co,So]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Co,So]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[Co,So,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Co,So]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Co,So]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[co,No,xo,ko]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Bo(...e){return Wo(La(e))}function Zo(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ho(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Zo(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Zo(e[t],null)}}}}function Go(...e){return r.useCallback(Ho(...e),e)}function Ko(t){const n=Jo(t),a=r.forwardRef((t,a)=>{const{children:o,...i}=t,s=r.Children.toArray(o),l=s.find(Xo);if(l){const t=l.props.children,o=s.map(e=>e===l?r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null:e);return e(n,{...i,ref:a,children:r.isValidElement(t)?r.cloneElement(t,void 0,o):null})}return e(n,{...i,ref:a,children:o})});return a.displayName=`${t}.Slot`,a}var qo=Ko("Slot");function Jo(e){const t=r.forwardRef((e,t)=>{const{children:n,...a}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}(a,n.props);return n.type!==r.Fragment&&(o.ref=t?Ho(t,e):e),r.cloneElement(n,o)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yo=Symbol("radix.slottable");function Xo(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Yo}const Qo=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ei=La,ti=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return ei(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:a,defaultVariants:o}=t,i=Object.keys(a).map(e=>{const t=null==n?void 0:n[e],r=null==o?void 0:o[e];if(null===t)return null;const i=Qo(t)||Qo(r);return a[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...s}[t]):{...o,...s}[t]===n})?[...e,n,r]:e},[]);return ei(e,i,l,null==n?void 0:n.class,null==n?void 0:n.className)},ni=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ri=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},ai=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),oi=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.544.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
var ii={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.544.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/const si=c(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...s},l)=>u("svg",{ref:l,...ii,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:ai("lucide",a),...!o&&!oi(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>u(e,t)),...Array.isArray(o)?o:[o]])),li=(e,t)=>{const n=c(({className:n,...r},a)=>u(si,{ref:a,iconNode:t,className:ai(`lucide-${ni(ri(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ri(e),n},ci=li("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),ui=li("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),di=li("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),fi=li("crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]),mi=li("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),hi=li("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),pi=li("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),gi=li("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),yi=li("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),vi=li("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),bi=li("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),wi=li("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),Si=li("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),xi=li("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ki=li("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Ti=ti("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Ai=r.forwardRef(({className:t,variant:a,progress:o,size:i,startIcon:s,endIcon:l,asChild:c=!1,...u},d)=>{const f=c?qo:"button",m=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(i);return n(f,{disabled:o||u.disabled,className:Bo(Ti({variant:a,size:i,withIcon:null!=o||null!=s||null!=l,className:t})),ref:d,...u,children:[o&&e(hi,{size:m,className:"animate-spin"}),s&&r.cloneElement(s,{size:m}),u.children,l&&r.cloneElement(l,{size:m})]})});
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-react v0.544.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/Ai.displayName="Button";var Ei=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const a=Ko(`Primitive.${n}`),o=r.forwardRef((t,r)=>{const{asChild:o,...i}=t,s=o?a:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...i,ref:r})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});var Ci=r.forwardRef((t,n)=>e(Ei.label,{...t,ref:n,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Ci.displayName="Label";var Ni=Ci;const _i=ti("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ri=r.forwardRef(({className:t,...n},r)=>e(Ni,{ref:r,className:Bo(_i(),t),...n}));Ri.displayName=Ni.displayName;const Oi=$e,Di=r.createContext({}),Mi=({...t})=>e(Di.Provider,{value:{name:t.name},children:e(Je,{...t})}),Pi=()=>{const e=r.useContext(Di),t=r.useContext(Ii),{getFieldState:n,formState:a}=je(),o=n(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},Ii=r.createContext({}),Li=r.forwardRef(({className:t,...n},a)=>{const o=r.useId();return e(Ii.Provider,{value:{id:o},children:e("div",{ref:a,className:Bo("space-y-2",t),...n})})});Li.displayName="FormItem";const Fi=r.forwardRef(({className:t,...n},r)=>{const{error:a,formItemId:o}=Pi();return e(Ri,{ref:r,className:Bo(a&&"text-destructive",t),htmlFor:o,...n})});Fi.displayName="FormLabel";const zi=r.forwardRef(({...t},n)=>{const{error:r,formItemId:a,formDescriptionId:o,formMessageId:i}=Pi();return e(qo,{ref:n,id:a,"aria-describedby":r?`${o} ${i}`:`${o}`,"aria-invalid":!!r,...t})});zi.displayName="FormControl";const Ui=r.forwardRef(({className:t,...n},r)=>{const{formDescriptionId:a}=Pi();return e("p",{ref:r,id:a,className:Bo("text-sm text-muted-foreground",t),...n})});Ui.displayName="FormDescription";const Vi=r.forwardRef(({className:t,children:n,...r},a)=>{const{error:o,formMessageId:i}=Pi(),s=o?String(o?.message):n;return s?e("p",{ref:a,id:i,className:Bo("text-sm font-medium text-destructive",t),...r,children:s}):null});Vi.displayName="FormMessage";const ji=r.forwardRef(({className:t,type:n,...r},a)=>e("input",{type:n,className:Bo("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...r}));function $i({className:t,...n}){return e("div",{className:Bo("animate-pulse rounded-md bg-primary/10",t),...n})}ji.displayName="Input";let Wi=class{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}async fetchConfig(){const e=await fetch(`${this.serverUrl}/api/${this.version}/beta/config?orgId=${this.orgId}`);if(!e.ok)throw new Error(`Failed to fetch beta form configuration: ${e.statusText}`);return e.json()}async submitBetaUser(e){const t=e?.context??{},n=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),r=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),o=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0),i=await fetch(`${this.serverUrl}/api/${this.version}/beta/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orgId:this.orgId,formData:{...e,country:n,language:r,timezone:a,currency:o}})});if(!i.ok)throw new Error(`Failed to submit beta user request: ${i.statusText}`);return i.json()}};const Bi=Vt("ZodISODateTime",(e,t)=>{Dr.init(e,t),ps.init(e,t)});function Zi(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...cn(t)})}(Bi,e)}const Hi=Vt("ZodISODate",(e,t)=>{Mr.init(e,t),ps.init(e,t)});function Gi(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...cn(t)})}(Hi,e)}const Ki=Vt("ZodISOTime",(e,t)=>{Pr.init(e,t),ps.init(e,t)});function qi(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...cn(t)})}(Ki,e)}const Ji=Vt("ZodISODuration",(e,t)=>{Ir.init(e,t),ps.init(e,t)});function Yi(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...cn(t)})}(Ji,e)}const Xi=Vt("ZodError",(e,t)=>{yn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},a=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>a({issues:e}));else if("invalid_key"===t.code)a({issues:t.issues});else if("invalid_element"===t.code)a({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,a=0;for(;a<t.path.length;){const r=t.path[a];a===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Zt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Zt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Qi=bn(Xi),es=Sn(Xi),ts=kn(Xi),ns=An(Xi),rs=Cn(Xi),as=Nn(Xi),os=_n(Xi),is=Rn(Xi),ss=On(Xi),ls=Dn(Xi),cs=Mn(Xi),us=Pn(Xi),ds=Vt("ZodType",(e,t)=>(vr.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>ln(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Qi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ts(e,t,n),e.parseAsync=async(t,n)=>es(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ns(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>rs(e,t,n),e.decode=(t,n)=>as(e,t,n),e.encodeAsync=async(t,n)=>os(e,t,n),e.decodeAsync=async(t,n)=>is(e,t,n),e.safeEncode=(t,n)=>ss(e,t,n),e.safeDecode=(t,n)=>ls(e,t,n),e.safeEncodeAsync=async(t,n)=>cs(e,t,n),e.safeDecodeAsync=async(t,n)=>us(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...cn(n)})}(rl,e,t)}(t,n)),e.superRefine=t=>e.check(Ra(t)),e.overwrite=t=>e.check(_a(t)),e.optional=()=>Gs(e),e.nullable=()=>qs(e),e.nullish=()=>Gs(qs(e)),e.nonoptional=t=>function(e,t){return new Xs({type:"nonoptional",innerType:e,...cn(t)})}(e,t),e.array=()=>{return function(e,t,n){return new e({type:"array",element:t,...cn(n)})}(Us,e,t);var t},e.or=t=>function(e,t){return new $s({type:"union",options:e,...cn(t)})}([e,t]),e.and=t=>new Ws({type:"intersection",left:e,right:t}),e.transform=t=>tl(e,new Zs({type:"transform",transform:t})),e.default=t=>{return n=t,new Js({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():an(n)}});var n},e.prefault=t=>{return n=t,new Ys({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():an(n)}});var n},e.catch=t=>{return new Qs({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>tl(e,t),e.readonly=()=>new nl({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Ta.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Ta.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Ta.get(e);const n=e.clone();return Ta.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fs=Vt("_ZodString",(e,t)=>{br.init(e,t),ds.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new cr({check:"string_format",format:"regex",...cn(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new fr({check:"string_format",format:"includes",...cn(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new mr({check:"string_format",format:"starts_with",...cn(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new hr({check:"string_format",format:"ends_with",...cn(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Ca(...t)),e.max=(...t)=>e.check(Ea(...t)),e.length=(...t)=>e.check(Na(...t)),e.nonempty=(...t)=>e.check(Ca(1,...t)),e.lowercase=t=>e.check(function(e){return new ur({check:"string_format",format:"lowercase",...cn(e)})}(t)),e.uppercase=t=>e.check(function(e){return new dr({check:"string_format",format:"uppercase",...cn(e)})}(t)),e.trim=()=>e.check(_a(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return _a(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(_a(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(_a(e=>e.toUpperCase()))}),ms=Vt("ZodString",(e,t)=>{br.init(e,t),fs.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...cn(t)})}(gs,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...cn(t)})}(bs,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...cn(t)})}(Ps,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...cn(t)})}(ws,t)),e.guid=t=>e.check(Aa(ys,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...cn(t)})}(vs,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...cn(t)})}(vs,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...cn(t)})}(vs,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...cn(t)})}(vs,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...cn(t)})}(Ss,t)),e.guid=t=>e.check(Aa(ys,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...cn(t)})}(xs,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...cn(t)})}(ks,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...cn(t)})}(Ts,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...cn(t)})}(Os,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...cn(t)})}(Ds,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...cn(t)})}(As,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...cn(t)})}(Es,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...cn(t)})}(Cs,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...cn(t)})}(Ns,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...cn(t)})}(_s,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...cn(t)})}(Rs,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...cn(t)})}(Ms,t)),e.datetime=t=>e.check(Zi(t)),e.date=t=>e.check(Gi(t)),e.time=t=>e.check(qi(t)),e.duration=t=>e.check(Yi(t))});function hs(e){return function(e,t){return new e({type:"string",...cn(t)})}(ms,e)}const ps=Vt("ZodStringFormat",(e,t)=>{wr.init(e,t),fs.init(e,t)}),gs=Vt("ZodEmail",(e,t)=>{kr.init(e,t),ps.init(e,t)}),ys=Vt("ZodGUID",(e,t)=>{Sr.init(e,t),ps.init(e,t)}),vs=Vt("ZodUUID",(e,t)=>{xr.init(e,t),ps.init(e,t)}),bs=Vt("ZodURL",(e,t)=>{Tr.init(e,t),ps.init(e,t)}),ws=Vt("ZodEmoji",(e,t)=>{Ar.init(e,t),ps.init(e,t)}),Ss=Vt("ZodNanoID",(e,t)=>{Er.init(e,t),ps.init(e,t)}),xs=Vt("ZodCUID",(e,t)=>{Cr.init(e,t),ps.init(e,t)}),ks=Vt("ZodCUID2",(e,t)=>{Nr.init(e,t),ps.init(e,t)}),Ts=Vt("ZodULID",(e,t)=>{_r.init(e,t),ps.init(e,t)}),As=Vt("ZodXID",(e,t)=>{Rr.init(e,t),ps.init(e,t)}),Es=Vt("ZodKSUID",(e,t)=>{Or.init(e,t),ps.init(e,t)}),Cs=Vt("ZodIPv4",(e,t)=>{Lr.init(e,t),ps.init(e,t)}),Ns=Vt("ZodIPv6",(e,t)=>{Fr.init(e,t),ps.init(e,t)}),_s=Vt("ZodCIDRv4",(e,t)=>{zr.init(e,t),ps.init(e,t)}),Rs=Vt("ZodCIDRv6",(e,t)=>{Ur.init(e,t),ps.init(e,t)}),Os=Vt("ZodBase64",(e,t)=>{jr.init(e,t),ps.init(e,t)}),Ds=Vt("ZodBase64URL",(e,t)=>{$r.init(e,t),ps.init(e,t)}),Ms=Vt("ZodE164",(e,t)=>{Wr.init(e,t),ps.init(e,t)}),Ps=Vt("ZodJWT",(e,t)=>{Br.init(e,t),ps.init(e,t)}),Is=Vt("ZodUnknown",(e,t)=>{Zr.init(e,t),ds.init(e,t)});function Ls(){return new Is({type:"unknown"})}const Fs=Vt("ZodNever",(e,t)=>{Hr.init(e,t),ds.init(e,t)});function zs(e){return function(e,t){return new e({type:"never",...cn(t)})}(Fs,e)}const Us=Vt("ZodArray",(e,t)=>{Kr.init(e,t),ds.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ca(t,n)),e.nonempty=t=>e.check(Ca(1,t)),e.max=(t,n)=>e.check(Ea(t,n)),e.length=(t,n)=>e.check(Na(t,n)),e.unwrap=()=>e.element});const Vs=Vt("ZodObject",(e,t)=>{Qr.init(e,t),ds.init(e,t),Jt(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Bs({type:"enum",entries:n,...cn(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ls()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ls()}),e.strict=()=>e.clone({...e._zod.def,catchall:zs()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!rn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Xt(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Yt(this,"shape",n),n},checks:[]});return ln(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!rn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Yt(this,"shape",n),n},checks:e._zod.def.checks};return ln(e,n)}(e,t),e.merge=t=>function(e,t){const n=Xt(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Yt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ln(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return ln(e,Xt(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Yt(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Xt(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Yt(this,"shape",r),r},checks:[]});return ln(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Xt(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)a[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Yt(this,"shape",a),a},checks:[]});return ln(t,r)}(Hs,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Xt(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(n)for(const t in n){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)a[t]=new e({type:"nonoptional",innerType:r[t]});return Yt(this,"shape",a),a},checks:[]});return ln(t,r)}(Xs,e,t[0])});function js(e,t){const n={type:"object",get shape(){var t;return Yt(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...cn(t)};return new Vs(n)}const $s=Vt("ZodUnion",(e,t)=>{ta.init(e,t),ds.init(e,t),e.options=t.options});const Ws=Vt("ZodIntersection",(e,t)=>{na.init(e,t),ds.init(e,t)});const Bs=Vt("ZodEnum",(e,t)=>{oa.init(e,t),ds.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const a={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);a[r]=t.entries[r]}return new Bs({...t,checks:[],...cn(r),entries:a})},e.exclude=(e,r)=>{const a={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new Bs({...t,checks:[],...cn(r),entries:a})}});const Zs=Vt("ZodTransform",(e,t)=>{ia.init(e,t),ds.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new $t(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(pn(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(pn(t))}};const a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}});const Hs=Vt("ZodOptional",(e,t)=>{la.init(e,t),ds.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Gs(e){return new Hs({type:"optional",innerType:e})}const Ks=Vt("ZodNullable",(e,t)=>{ca.init(e,t),ds.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qs(e){return new Ks({type:"nullable",innerType:e})}const Js=Vt("ZodDefault",(e,t)=>{ua.init(e,t),ds.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Ys=Vt("ZodPrefault",(e,t)=>{fa.init(e,t),ds.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Xs=Vt("ZodNonOptional",(e,t)=>{ma.init(e,t),ds.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Qs=Vt("ZodCatch",(e,t)=>{pa.init(e,t),ds.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const el=Vt("ZodPipe",(e,t)=>{ga.init(e,t),ds.init(e,t),e.in=t.in,e.out=t.out});function tl(e,t){return new el({type:"pipe",in:e,out:t})}const nl=Vt("ZodReadonly",(e,t)=>{va.init(e,t),ds.init(e,t),e.unwrap=()=>e._zod.def.innerType});const rl=Vt("ZodCustom",(e,t)=>{wa.init(e,t),ds.init(e,t)});const al=js({name:hs().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s]*$/,"Name can only contain letters and spaces"),email:hs().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")}),ol={en:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred"},es:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error"},fr:{nameLabel:"Nom",emailLabel:"Email",submitText:"Soumettre",submittingText:"Soumission...",errorMessage:"Une erreur est survenue"},de:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten"},zh:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"提交中...",errorMessage:"发生错误"},ja:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました"},ko:{nameLabel:"이름",emailLabel:"이메일",submitText:"제출",submittingText:"제출 중...",errorMessage:"오류가 발생했습니다"}},il=({onSuccess:r,onError:a,className:o="w-full",fieldClassName:i="flex flex-col gap-1.5 w-full",language:s,customTexts:c={},autoFocus:u=!0,showSuccessMessage:m=!0,hideLogo:h=!1,hideTitles:p=!1})=>{const[g,y]=d("en"),[v,b]=d(!1),[w,S]=d(!1),{submitBetaForm:x,isLoading:k,isSubmitting:T,error:A,config:E,success:C,message:N}=(()=>{const e=Z(e=>e.os),[t,n]=d(null),[r,a]=d(!0),[o,i]=d(!1),[s,c]=d(null),[u,m]=d(!1),[h,p]=d(null);return l(()=>{(async()=>{a(!0);const t=new Wi(e),r=await t.fetchConfig();n(r),a(!1)})()},[e]),{isLoading:r,isSubmitting:o,config:t,error:s,success:u,message:h,submitBetaForm:f(async t=>{if(!e){const e="SaaS OS context is not initialized";return c(e),{success:!1,message:e}}try{i(!0),c(null),m(!1),p(null);const n=new Wi(e),r=await n.submitBetaUser({name:t.name||"",email:t.email}),a="success"===r.status;return m(a),p(r.message),{success:a,message:r.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return c(t),m(!1),p(t),{success:!1,message:t}}finally{i(!1)}},[e])}})();l(()=>{y((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(ol).indexOf(e)?e:"en"})())},[]),l(()=>{C&&m&&(b(!0),S(!0)),A&&S(!0)},[C,m,A]);const _={...ol[s||g],...c},R=Pt({resolver:Pa(al),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});l(()=>{u&&R.setFocus("name")},[u,R]);const O=R.formState.isValid&&!T;return e("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:n("div",k?{className:Bo("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",o),children:[e($i,{className:"h-24 w-24 rounded-lg"}),e($i,{className:"h-6 w-32"}),n("div",{className:"w-full space-y-4",children:[n("div",{className:"space-y-2",children:[e($i,{className:"h-4 w-16"}),e($i,{className:"h-10 w-full"})]}),n("div",{className:"space-y-2",children:[e($i,{className:"h-4 w-16"}),e($i,{className:"h-10 w-full"})]}),e($i,{className:"h-10 w-full"})]})]}:{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!h&&n("div",{className:"flex flex-col items-center justify-center w-full",children:[E?.logo&&e(ll,{logo:E?.logo}),E?.name&&e("div",{children:E?.name})]}),e($e,{...R,children:n("form",{onSubmit:R.handleSubmit(async e=>{try{const t=await x(e);t.success?(r?.(),R.reset(),m&&b(!0),S(!0)):(a?.(t.message),S(!0))}catch(e){a?.(e instanceof Error?e.message:_.errorMessage),S(!0)}}),className:o,noValidate:!0,"aria-busy":T,children:[!w&&n(t,{children:[!p&&E?.screen?.register&&e(sl,{screen:E?.screen?.register}),e(Mi,{control:R.control,name:"name",render:({field:t})=>n(Li,{className:i,children:[e(Fi,{children:_.nameLabel}),e(zi,{children:e(ji,{...t})}),e(Ui,{}),e(Vi,{})]})}),e(Mi,{control:R.control,name:"email",render:({field:t})=>n(Li,{className:i,children:[e(Fi,{children:_.emailLabel}),e(zi,{children:e(ji,{...t})}),e(Ui,{}),e(Vi,{})]})}),e(Ai,{type:"submit",disabled:!O,className:i,children:T?_.submittingText:_.submitText})]}),w&&A&&n("div",{className:"flex flex-col items-center justify-center w-full",children:[n("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e("span",{className:"text-4xl mb-2",role:"img","aria-label":"Error",children:"❗"}),A]}),e("div",{className:"mt-4 flex justify-center",children:e(Ai,{type:"button",onClick:()=>{S(!1),R.reset()},className:i,children:"Try Again"})})]}),w&&v&&N&&e("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:E?.screen?.thankYou&&e(sl,{screen:E?.screen?.thankYou})})]})}),!w&&e("div",{children:n("div",{children:["By submitting this form, you consent to our"," ",e("a",{href:E?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e("a",{href:E?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})};function sl({screen:t}){return n("div",{className:"flex flex-col items-center justify-center w-full",children:[e("p",{className:"text-2xl font-bold",children:t?.title}),e("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function ll({logo:t}){return e("img","string"==typeof t?{src:t,alt:"Logo",className:"max-h-24"}:{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function cl(e,t){return function(){return e.apply(t,arguments)}}const{toString:ul}=Object.prototype,{getPrototypeOf:dl}=Object,{iterator:fl,toStringTag:ml}=Symbol,hl=(pl=Object.create(null),e=>{const t=ul.call(e);return pl[t]||(pl[t]=t.slice(8,-1).toLowerCase())});var pl;const gl=e=>(e=e.toLowerCase(),t=>hl(t)===e),yl=e=>t=>typeof t===e,{isArray:vl}=Array,bl=yl("undefined");function wl(e){return null!==e&&!bl(e)&&null!==e.constructor&&!bl(e.constructor)&&kl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Sl=gl("ArrayBuffer");const xl=yl("string"),kl=yl("function"),Tl=yl("number"),Al=e=>null!==e&&"object"==typeof e,El=e=>{if("object"!==hl(e))return!1;const t=dl(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ml in e||fl in e)},Cl=gl("Date"),Nl=gl("File"),_l=gl("Blob"),Rl=gl("FileList"),Ol=gl("URLSearchParams"),[Dl,Ml,Pl,Il]=["ReadableStream","Request","Response","Headers"].map(gl);function Ll(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),vl(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(wl(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let i;for(r=0;r<o;r++)i=a[r],t.call(null,e[i],i,e)}}function Fl(e,t){if(wl(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,a=n.length;for(;a-- >0;)if(r=n[a],t===r.toLowerCase())return r;return null}const zl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ul=e=>!bl(e)&&e!==zl;const Vl=(jl="undefined"!=typeof Uint8Array&&dl(Uint8Array),e=>jl&&e instanceof jl);var jl;const $l=gl("HTMLFormElement"),Wl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Bl=gl("RegExp"),Zl=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ll(n,(n,a)=>{let o;!1!==(o=t(n,a,e))&&(r[a]=o||n)}),Object.defineProperties(e,r)};const Hl=gl("AsyncFunction"),Gl=(Kl="function"==typeof setImmediate,ql=kl(zl.postMessage),Kl?setImmediate:ql?(Jl=`axios@${Math.random()}`,Yl=[],zl.addEventListener("message",({source:e,data:t})=>{e===zl&&t===Jl&&Yl.length&&Yl.shift()()},!1),e=>{Yl.push(e),zl.postMessage(Jl,"*")}):e=>setTimeout(e));var Kl,ql,Jl,Yl;const Xl="undefined"!=typeof queueMicrotask?queueMicrotask.bind(zl):"undefined"!=typeof process&&process.nextTick||Gl;var Ql={isArray:vl,isArrayBuffer:Sl,isBuffer:wl,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||kl(e.append)&&("formdata"===(t=hl(e))||"object"===t&&kl(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Sl(e.buffer),t},isString:xl,isNumber:Tl,isBoolean:e=>!0===e||!1===e,isObject:Al,isPlainObject:El,isEmptyObject:e=>{if(!Al(e)||wl(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Dl,isRequest:Ml,isResponse:Pl,isHeaders:Il,isUndefined:bl,isDate:Cl,isFile:Nl,isBlob:_l,isRegExp:Bl,isFunction:kl,isStream:e=>Al(e)&&kl(e.pipe),isURLSearchParams:Ol,isTypedArray:Vl,isFileList:Rl,forEach:Ll,merge:function e(){const{caseless:t,skipUndefined:n}=Ul(this)&&this||{},r={},a=(a,o)=>{const i=t&&Fl(r,o)||o;El(r[i])&&El(a)?r[i]=e(r[i],a):El(a)?r[i]=e({},a):vl(a)?r[i]=a.slice():n&&bl(a)||(r[i]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Ll(arguments[e],a);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(Ll(t,(t,r)=>{n&&kl(t)?e[r]=cl(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let a,o,i;const s={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)i=a[o],r&&!r(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==n&&dl(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:hl,kindOfTest:gl,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(vl(e))return e;let t=e.length;if(!Tl(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[fl]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:$l,hasOwnProperty:Wl,hasOwnProp:Wl,reduceDescriptors:Zl,freezeMethods:e=>{Zl(e,(t,n)=>{if(kl(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];kl(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return vl(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Fl,global:zl,isContextDefined:Ul,isSpecCompliantForm:function(e){return!!(e&&kl(e.append)&&"FormData"===e[ml]&&e[fl])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Al(e)){if(t.indexOf(e)>=0)return;if(wl(e))return e;if(!("toJSON"in e)){t[r]=e;const a=vl(e)?[]:{};return Ll(e,(e,t)=>{const o=n(e,r+1);!bl(o)&&(a[t]=o)}),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:Hl,isThenable:e=>e&&(Al(e)||kl(e))&&kl(e.then)&&kl(e.catch),setImmediate:Gl,asap:Xl,isIterable:e=>null!=e&&kl(e[fl])};function ec(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}Ql.inherits(ec,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ql.toJSONObject(this.config),code:this.code,status:this.status}}});const tc=ec.prototype,nc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{nc[e]={value:e}}),Object.defineProperties(ec,nc),Object.defineProperty(tc,"isAxiosError",{value:!0}),ec.from=(e,t,n,r,a,o)=>{const i=Object.create(tc);Ql.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return ec.call(i,s,l,n,r,a),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function rc(e){return Ql.isPlainObject(e)||Ql.isArray(e)}function ac(e){return Ql.endsWith(e,"[]")?e.slice(0,-2):e}function oc(e,t,n){return e?e.concat(t).map(function(e,t){return e=ac(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ic=Ql.toFlatObject(Ql,{},null,function(e){return/^is[A-Z]/.test(e)});function sc(e,t,n){if(!Ql.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Ql.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Ql.isUndefined(t[e])})).metaTokens,a=n.visitor||c,o=n.dots,i=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Ql.isSpecCompliantForm(t);if(!Ql.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Ql.isDate(e))return e.toISOString();if(Ql.isBoolean(e))return e.toString();if(!s&&Ql.isBlob(e))throw new ec("Blob is not supported. Use a Buffer instead.");return Ql.isArrayBuffer(e)||Ql.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,a){let s=e;if(e&&!a&&"object"==typeof e)if(Ql.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Ql.isArray(e)&&function(e){return Ql.isArray(e)&&!e.some(rc)}(e)||(Ql.isFileList(e)||Ql.endsWith(n,"[]"))&&(s=Ql.toArray(e)))return n=ac(n),s.forEach(function(e,r){!Ql.isUndefined(e)&&null!==e&&t.append(!0===i?oc([n],r,o):null===i?n:n+"[]",l(e))}),!1;return!!rc(e)||(t.append(oc(a,n,o),l(e)),!1)}const u=[],d=Object.assign(ic,{defaultVisitor:c,convertValue:l,isVisitable:rc});if(!Ql.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Ql.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Ql.forEach(n,function(n,o){!0===(!(Ql.isUndefined(n)||null===n)&&a.call(t,n,Ql.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])}),u.pop()}}(e),t}function lc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function cc(e,t){this._pairs=[],e&&sc(e,this,t)}const uc=cc.prototype;function dc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fc(e,t,n){if(!t)return e;const r=n&&n.encode||dc;Ql.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let o;if(o=a?a(t,n):Ql.isURLSearchParams(t)?t.toString():new cc(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}uc.append=function(e,t){this._pairs.push([e,t])},uc.toString=function(e){const t=e?function(t){return e.call(this,t,lc)}:lc;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class mc{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ql.forEach(this.handlers,function(t){null!==t&&e(t)})}}var hc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:cc,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const gc="undefined"!=typeof window&&"undefined"!=typeof document,yc="object"==typeof navigator&&navigator||void 0,vc=gc&&(!yc||["ReactNative","NativeScript","NS"].indexOf(yc.product)<0),bc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,wc=gc&&window.location.href||"http://localhost";var Sc={...Object.freeze({__proto__:null,hasBrowserEnv:gc,hasStandardBrowserEnv:vc,hasStandardBrowserWebWorkerEnv:bc,navigator:yc,origin:wc}),...pc};function xc(e){function t(e,n,r,a){let o=e[a++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),s=a>=e.length;if(o=!o&&Ql.isArray(r)?r.length:o,s)return Ql.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i;r[o]&&Ql.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],a)&&Ql.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r<a;r++)o=n[r],t[o]=e[o];return t}(r[o])),!i}if(Ql.isFormData(e)&&Ql.isFunction(e.entries)){const n={};return Ql.forEachEntry(e,(e,r)=>{t(function(e){return Ql.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const kc={transitional:hc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=Ql.isObject(e);a&&Ql.isHTMLForm(e)&&(e=new FormData(e));if(Ql.isFormData(e))return r?JSON.stringify(xc(e)):e;if(Ql.isArrayBuffer(e)||Ql.isBuffer(e)||Ql.isStream(e)||Ql.isFile(e)||Ql.isBlob(e)||Ql.isReadableStream(e))return e;if(Ql.isArrayBufferView(e))return e.buffer;if(Ql.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return sc(e,new Sc.classes.URLSearchParams,{visitor:function(e,t,n,r){return Sc.isNode&&Ql.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=Ql.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return sc(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(Ql.isString(e))try{return(t||JSON.parse)(e),Ql.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||kc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Ql.isResponse(e)||Ql.isReadableStream(e))return e;if(e&&Ql.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw ec.from(e,ec.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Sc.classes.FormData,Blob:Sc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ql.forEach(["delete","get","head","post","put","patch"],e=>{kc.headers[e]={}});const Tc=Ql.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Ac=Symbol("internals");function Ec(e){return e&&String(e).trim().toLowerCase()}function Cc(e){return!1===e||null==e?e:Ql.isArray(e)?e.map(Cc):String(e)}function Nc(e,t,n,r,a){return Ql.isFunction(r)?r.call(this,t,n):(a&&(t=n),Ql.isString(t)?Ql.isString(r)?-1!==t.indexOf(r):Ql.isRegExp(r)?r.test(t):void 0:void 0)}let _c=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=Ec(t);if(!a)throw new Error("header name must be a non-empty string");const o=Ql.findKey(r,a);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Cc(e))}const o=(e,t)=>Ql.forEach(e,(e,n)=>a(e,n,t));if(Ql.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Ql.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,a;return e&&e.split("\n").forEach(function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!n||t[n]&&Tc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Ql.isObject(e)&&Ql.isIterable(e)){let n,r,a={};for(const t of e){if(!Ql.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[r=t[0]]=(n=a[r])?Ql.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=Ec(e)){const n=Ql.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Ql.isFunction(t))return t.call(this,e,n);if(Ql.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ec(e)){const n=Ql.findKey(this,e);return!(!n||void 0===this[n]||t&&!Nc(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=Ec(e)){const a=Ql.findKey(n,e);!a||t&&!Nc(0,n[a],a,t)||(delete n[a],r=!0)}}return Ql.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!Nc(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return Ql.forEach(this,(r,a)=>{const o=Ql.findKey(n,a);if(o)return t[o]=Cc(r),void delete t[a];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(a):String(a).trim();i!==a&&delete t[a],t[i]=Cc(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ql.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Ql.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Ac]=this[Ac]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ec(e);t[r]||(!function(e,t){const n=Ql.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})})}(n,e),t[r]=!0)}return Ql.isArray(e)?e.forEach(r):r(e),this}};function Rc(e,t){const n=this||kc,r=t||n,a=_c.from(r.headers);let o=r.data;return Ql.forEach(e,function(e){o=e.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function Oc(e){return!(!e||!e.__CANCEL__)}function Dc(e,t,n){ec.call(this,null==e?"canceled":e,ec.ERR_CANCELED,t,n),this.name="CanceledError"}function Mc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ec("Request failed with status code "+n.status,[ec.ERR_BAD_REQUEST,ec.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}_c.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ql.reduceDescriptors(_c.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Ql.freezeMethods(_c),Ql.inherits(Dc,ec,{__CANCEL__:!0});const Pc=(e,t,n=3)=>{let r=0;const a=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,o=0,i=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[i];a||(a=l),n[o]=s,r[o]=l;let u=i,d=0;for(;u!==o;)d+=n[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),l-a<t)return;const f=c&&l-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,a=0,o=1e3/t;const i=(t,o=Date.now())=>{a=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-a;s>=o?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},o-s)))},()=>n&&i(n)]}(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,s=o-r,l=a(s);r=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:s,rate:l||void 0,estimated:l&&i&&o<=i?(i-o)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ic=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Lc=e=>(...t)=>Ql.asap(()=>e(...t));var Fc=Sc.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Sc.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Sc.origin),Sc.navigator&&/(msie|trident)/i.test(Sc.navigator.userAgent)):()=>!0,zc=Sc.hasStandardBrowserEnv?{write(e,t,n,r,a,o){const i=[e+"="+encodeURIComponent(t)];Ql.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Ql.isString(r)&&i.push("path="+r),Ql.isString(a)&&i.push("domain="+a),!0===o&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Uc(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Vc=e=>e instanceof _c?{...e}:e;function jc(e,t){t=t||{};const n={};function r(e,t,n,r){return Ql.isPlainObject(e)&&Ql.isPlainObject(t)?Ql.merge.call({caseless:r},e,t):Ql.isPlainObject(t)?Ql.merge({},t):Ql.isArray(t)?t.slice():t}function a(e,t,n,a){return Ql.isUndefined(t)?Ql.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function o(e,t){if(!Ql.isUndefined(t))return r(void 0,t)}function i(e,t){return Ql.isUndefined(t)?Ql.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,a,o){return o in t?r(n,a):o in e?r(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,n)=>a(Vc(e),Vc(t),0,!0)};return Ql.forEach(Object.keys({...e,...t}),function(r){const o=l[r]||a,i=o(e[r],t[r],r);Ql.isUndefined(i)&&o!==s||(n[r]=i)}),n}var $c=e=>{const t=jc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:s}=t;if(t.headers=i=_c.from(i),t.url=fc(Uc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Ql.isFormData(n))if(Sc.hasStandardBrowserEnv||Sc.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Ql.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(Sc.hasStandardBrowserEnv&&(r&&Ql.isFunction(r)&&(r=r(t)),r||!1!==r&&Fc(t.url))){const e=a&&o&&zc.read(o);e&&i.set(a,e)}return t};var Wc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=$c(e);let a=r.data;const o=_c.from(r.headers).normalize();let i,s,l,c,u,{responseType:d,onUploadProgress:f,onDownloadProgress:m}=r;function h(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let p=new XMLHttpRequest;function g(){if(!p)return;const r=_c.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());Mc(function(e){t(e),h()},function(e){n(e),h()},{data:d&&"text"!==d&&"json"!==d?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p}),p=null}p.open(r.method.toUpperCase(),r.url,!0),p.timeout=r.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(n(new ec("Request aborted",ec.ECONNABORTED,e,p)),p=null)},p.onerror=function(t){const r=new ec(t&&t.message?t.message:"Network Error",ec.ERR_NETWORK,e,p);r.event=t||null,n(r),p=null},p.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||hc;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ec(t,a.clarifyTimeoutError?ec.ETIMEDOUT:ec.ECONNABORTED,e,p)),p=null},void 0===a&&o.setContentType(null),"setRequestHeader"in p&&Ql.forEach(o.toJSON(),function(e,t){p.setRequestHeader(t,e)}),Ql.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),d&&"json"!==d&&(p.responseType=r.responseType),m&&([l,u]=Pc(m,!0),p.addEventListener("progress",l)),f&&p.upload&&([s,c]=Pc(f),p.upload.addEventListener("progress",s),p.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(i=t=>{p&&(n(!t||t.type?new Dc(null,e,p):t),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Sc.protocols.indexOf(y)?n(new ec("Unsupported protocol "+y+":",ec.ERR_BAD_REQUEST,e)):p.send(a||null)})};const Bc=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const a=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof ec?t:new Dc(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,a(new ec(`timeout ${t} of ms exceeded`,ec.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)}),e=null)};e.forEach(e=>e.addEventListener("abort",a));const{signal:s}=r;return s.unsubscribe=()=>Ql.asap(i),s}},Zc=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,a=0;for(;a<n;)r=a+t,yield e.slice(a,r),a=r},Hc=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Gc=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of Hc(e))yield*Zc(n,t)}(e,t);let o,i=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=i+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),a.return())},{highWaterMark:2})},{isFunction:Kc}=Ql,qc=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ql.global),{ReadableStream:Jc,TextEncoder:Yc}=Ql.global,Xc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Qc=e=>{e=Ql.merge.call({skipUndefined:!0},qc,e);const{fetch:t,Request:n,Response:r}=e,a=t?Kc(t):"function"==typeof fetch,o=Kc(n),i=Kc(r);if(!a)return!1;const s=a&&Kc(Jc),l=a&&("function"==typeof Yc?(c=new Yc,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const u=o&&s&&Xc(()=>{let e=!1;const t=new n(Sc.origin,{body:new Jc,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&s&&Xc(()=>Ql.isReadableStream(new r("").body)),f={stream:d&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ec(`Response type '${e}' is not supported`,ec.ERR_NOT_SUPPORT,n)})});const m=async(e,t)=>{const r=Ql.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Ql.isBlob(e))return e.size;if(Ql.isSpecCompliantForm(e)){const t=new n(Sc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Ql.isArrayBufferView(e)||Ql.isArrayBuffer(e)?e.byteLength:(Ql.isURLSearchParams(e)&&(e+=""),Ql.isString(e)?(await l(e)).byteLength:void 0)})(t):r};return async e=>{let{url:a,method:i,data:s,signal:l,cancelToken:c,timeout:h,onDownloadProgress:p,onUploadProgress:g,responseType:y,headers:v,withCredentials:b="same-origin",fetchOptions:w}=$c(e),S=t||fetch;y=y?(y+"").toLowerCase():"text";let x=Bc([l,c&&c.toAbortSignal()],h),k=null;const T=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let A;try{if(g&&u&&"get"!==i&&"head"!==i&&0!==(A=await m(v,s))){let e,t=new n(a,{method:"POST",body:s,duplex:"half"});if(Ql.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,n]=Ic(A,Pc(Lc(g)));s=Gc(t.body,65536,e,n)}}Ql.isString(b)||(b=b?"include":"omit");const t=o&&"credentials"in n.prototype,l={...w,signal:x,method:i.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};k=o&&new n(a,l);let c=await(o?S(k,w):S(a,l));const h=d&&("stream"===y||"response"===y);if(d&&(p||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=Ql.toFiniteNumber(c.headers.get("content-length")),[n,a]=p&&Ic(t,Pc(Lc(p),!0))||[];c=new r(Gc(c.body,65536,n,()=>{a&&a(),T&&T()}),e)}y=y||"text";let E=await f[Ql.findKey(f,y)||"text"](c,e);return!h&&T&&T(),await new Promise((t,n)=>{Mc(t,n,{data:E,headers:_c.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ec("Network Error",ec.ERR_NETWORK,e,k),{cause:t.cause||t});throw ec.from(t,t&&t.code,e,k)}}},eu=new Map,tu=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let i,s,l=o.length,c=eu;for(;l--;)i=o[l],s=c.get(i),void 0===s&&c.set(i,s=l?new Map:Qc(t)),c=s;return s};tu();const nu={http:null,xhr:Wc,fetch:{get:tu}};Ql.forEach(nu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const ru=e=>`- ${e}`,au=e=>Ql.isFunction(e)||null===e||!1===e;var ou=(e,t)=>{e=Ql.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let i=0;i<n;i++){let n;if(r=e[i],a=r,!au(r)&&(a=nu[(n=String(r)).toLowerCase()],void 0===a))throw new ec(`Unknown adapter '${n}'`);if(a&&(Ql.isFunction(a)||(a=a.get(t))))break;o[n||"#"+i]=a}if(!a){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new ec("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(ru).join("\n"):" "+ru(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return a};function iu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Dc(null,e)}function su(e){iu(e),e.headers=_c.from(e.headers),e.data=Rc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ou(e.adapter||kc.adapter,e)(e).then(function(t){return iu(e),t.data=Rc.call(e,e.transformResponse,t),t.headers=_c.from(t.headers),t},function(t){return Oc(t)||(iu(e),t&&t.response&&(t.response.data=Rc.call(e,e.transformResponse,t.response),t.response.headers=_c.from(t.response.headers))),Promise.reject(t)})}const lu="1.12.2",cu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cu[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const uu={};cu.transitional=function(e,t,n){function r(e,t){return"[Axios v"+lu+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,o)=>{if(!1===e)throw new ec(r(a," has been removed"+(t?" in "+t:"")),ec.ERR_DEPRECATED);return t&&!uu[a]&&(uu[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,o)}},cu.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var du={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ec("options must be an object",ec.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],i=t[o];if(i){const t=e[o],n=void 0===t||i(t,o,e);if(!0!==n)throw new ec("option "+o+" must be "+n,ec.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ec("Unknown option "+o,ec.ERR_BAD_OPTION)}},validators:cu};const fu=du.validators;let mu=class{constructor(e){this.defaults=e||{},this.interceptors={request:new mc,response:new mc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=jc(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&du.assertOptions(n,{silentJSONParsing:fu.transitional(fu.boolean),forcedJSONParsing:fu.transitional(fu.boolean),clarifyTimeoutError:fu.transitional(fu.boolean)},!1),null!=r&&(Ql.isFunction(r)?t.paramsSerializer={serialize:r}:du.assertOptions(r,{encode:fu.function,serialize:fu.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),du.assertOptions(t,{baseUrl:fu.spelling("baseURL"),withXsrfToken:fu.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&Ql.merge(a.common,a[t.method]);a&&Ql.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=_c.concat(o,a);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[su.bind(this),void 0];for(e.unshift(...i),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=i.length;let f=t;for(;d<u;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=su.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return fc(Uc((e=jc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Ql.forEach(["delete","get","head","options"],function(e){mu.prototype[e]=function(t,n){return this.request(jc(n||{},{method:e,url:t,data:(n||{}).data}))}}),Ql.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,a){return this.request(jc(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}mu.prototype[e]=t(),mu.prototype[e+"Form"]=t(!0)});const hu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(hu).forEach(([e,t])=>{hu[t]=e});const pu=function e(t){const n=new mu(t),r=cl(mu.prototype.request,n);return Ql.extend(r,mu.prototype,n,{allOwnKeys:!0}),Ql.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(jc(t,n))},r}(kc);pu.Axios=mu,pu.CanceledError=Dc,pu.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,a){n.reason||(n.reason=new Dc(e,r,a),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},pu.isCancel=Oc,pu.VERSION=lu,pu.toFormData=sc,pu.AxiosError=ec,pu.Cancel=pu.CanceledError,pu.all=function(e){return Promise.all(e)},pu.spread=function(e){return function(t){return e.apply(null,t)}},pu.isAxiosError=function(e){return Ql.isObject(e)&&!0===e.isAxiosError},pu.mergeConfig=jc,pu.AxiosHeaders=_c,pu.formToJSON=e=>xc(Ql.isHTMLForm(e)?new FormData(e):e),pu.getAdapter=ou,pu.HttpStatusCode=hu,pu.default=pu;const{Axios:gu,AxiosError:yu,CanceledError:vu,isCancel:bu,CancelToken:wu,VERSION:Su,all:xu,Cancel:ku,isAxiosError:Tu,spread:Au,toFormData:Eu,AxiosHeaders:Cu,HttpStatusCode:Nu,formToJSON:_u,getAdapter:Ru,mergeConfig:Ou}=pu,Du="undefined"!=typeof window;const Mu=new class{constructor(e={}){this.client=pu.create({baseURL:e.baseURL||"https://api.example.com",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json",...e.headers}}),this.client.interceptors.request.use(e=>{const t=this.getAuthToken();return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>e,e=>(401===e.response?.status&&this.handleUnauthorized(),Promise.reject(e)))}getAuthToken(){return Du?localStorage.getItem("auth_token"):null}handleUnauthorized(){Du&&localStorage.removeItem("auth_token")}async get(e,t){const n=await this.client.get(e,t);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async post(e,t,n){const r=await this.client.post(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async put(e,t,n){const r=await this.client.put(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async delete(e,t){const n=await this.client.delete(e,t);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async patch(e,t,n){const r=await this.client.patch(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}setAuthToken(e){Du&&localStorage.setItem("auth_token",e)}removeAuthToken(){Du&&localStorage.removeItem("auth_token")}setBaseURL(e){this.client.defaults.baseURL=e}setHeader(e,t){this.client.defaults.headers.common[e]=t}removeHeader(e){delete this.client.defaults.headers.common[e]}};class Pu{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}getAuthHeader(){const e=function(){if("undefined"==typeof window)return null;const e=localStorage.getItem("saas_os_auth_token");try{return e?JSON.parse(e).accessToken:null}catch(e){return null}}();let t={};return e&&(t.Authorization=`Bearer ${e}`),t}async getWorkspaces(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch workspaces");return e.json()}async createWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to create workspace");return t.json()}async updateWorkspace(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!n.ok)throw new Error("Failed to update workspace");return n.json()}async deleteWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"DELETE",headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to delete workspace");return t.json()}async getWorkspaceUsers(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users`,{headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to fetch workspace users");return t.json()}async addUser(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/add`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!n.ok){const e=await n.json();throw new Error(e.message||"Failed to invite member")}return n.json()}async removeUser(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"DELETE",headers:this.getAuthHeader()});if(!n.ok){const e=await n.json();throw new Error(e.message||"Failed to remove user")}return n.json()}async updateUser(e,t,n){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(n)});if(!r.ok){const e=await r.json();throw new Error(e.message||"Failed to update user")}return r.json()}async getFeatures(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/features`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch features");return e.json()}async updateFeature(e,t,n){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/features`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify({features:{[t]:n}})});if(!r.ok)throw new Error("Failed to update feature");return r.json()}async getWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to fetch workspace");return t.json()}async getProfile(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch profile");return e.json()}async updateUserProfile(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to update user profile");return t.json()}}function Iu(t,n=[]){let a=[];const o=()=>{const e=a.map(e=>r.createContext(e));return function(n){const a=n?.[t]||e;return r.useMemo(()=>({[`__scope${t}`]:{...n,[t]:a}}),[n,a])}};return o.scopeName=t,[function(n,o){const i=r.createContext(o),s=a.length;a=[...a,o];const l=n=>{const{scope:a,children:o,...l}=n,c=a?.[t]?.[s]||i,u=r.useMemo(()=>l,Object.values(l));return e(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(e,a){const l=a?.[t]?.[s]||i,c=r.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${n}\``)}]},Lu(o,...n)]}function Lu(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const a=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Fu(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var zu,Uu=globalThis?.document?r.useLayoutEffect:()=>{},Vu={exports:{}},ju={};var $u,Wu,Bu={};
|
|
21
|
+
/**
|
|
22
|
+
* @license React
|
|
23
|
+
* use-sync-external-store-shim.development.js
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the MIT license found in the
|
|
28
|
+
* LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/var Zu=(Wu||(Wu=1,"production"===process.env.NODE_ENV?Vu.exports=function(){if(zu)return ju;zu=1;var e=a,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),l=n({inst:{value:a,getSnapshot:t}}),c=l[0].inst,u=l[1];return o(function(){c.value=a,c.getSnapshot=t,s(c)&&u({inst:c})},[e,a,t]),r(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(a),a};return ju.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,ju}():Vu.exports=($u||($u=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}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,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(a,u){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 d=u();if(!c){var f=u();n(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=(f=r({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[a,d,u]),o(function(){return e(m)&&h({inst:m}),a(function(){e(m)&&h({inst:m})})},[a]),s(d),d};Bu.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Bu)),Vu.exports);function Hu(){return()=>{}}var Gu="Avatar",[Ku,qu]=Iu(Gu),[Ju,Yu]=Ku(Gu),Xu=r.forwardRef((t,n)=>{const{__scopeAvatar:a,...o}=t,[i,s]=r.useState("idle");return e(Ju,{scope:a,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:e(Ei.span,{...o,ref:n})})});Xu.displayName=Gu;var Qu="AvatarImage",ed=r.forwardRef((t,n)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:i=()=>{},...s}=t,l=Yu(Qu,a),c=function(e,{referrerPolicy:t,crossOrigin:n}){const a=Zu.useSyncExternalStore(Hu,()=>!0,()=>!1),o=r.useRef(null),i=a?(o.current||(o.current=new window.Image),o.current):null,[s,l]=r.useState(()=>rd(i,e));return Uu(()=>{l(rd(i,e))},[i,e]),Uu(()=>{const e=e=>()=>{l(e)};if(!i)return;const r=e("loaded"),a=e("error");return i.addEventListener("load",r),i.addEventListener("error",a),t&&(i.referrerPolicy=t),"string"==typeof n&&(i.crossOrigin=n),()=>{i.removeEventListener("load",r),i.removeEventListener("error",a)}},[i,n,t]),s}(o,s),u=Fu(e=>{i(e),l.onImageLoadingStatusChange(e)});return Uu(()=>{"idle"!==c&&u(c)},[c,u]),"loaded"===c?e(Ei.img,{...s,ref:n,src:o}):null});ed.displayName=Qu;var td="AvatarFallback",nd=r.forwardRef((t,n)=>{const{__scopeAvatar:a,delayMs:o,...i}=t,s=Yu(td,a),[l,c]=r.useState(void 0===o);return r.useEffect(()=>{if(void 0!==o){const e=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(e)}},[o]),l&&"loaded"!==s.imageLoadingStatus?e(Ei.span,{...i,ref:n}):null});function rd(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}nd.displayName=td;var ad=Xu,od=ed,id=nd;const sd=r.forwardRef(({className:t,...n},r)=>e(ad,{ref:r,className:Bo("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...n}));sd.displayName=ad.displayName;const ld=r.forwardRef(({className:t,...n},r)=>e(od,{ref:r,className:Bo("aspect-square h-full w-full",t),...n}));ld.displayName=od.displayName;const cd=r.forwardRef(({className:t,...n},r)=>e(id,{ref:r,className:Bo("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...n}));function ud(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}cd.displayName=id.displayName;var dd=r[" useId ".trim().toString()]||(()=>{}),fd=0;function md(e){const[t,n]=r.useState(dd());return Uu(()=>{n(e=>e??String(fd++))},[e]),t?`radix-${t}`:""}var hd=r[" useInsertionEffect ".trim().toString()]||Uu;function pd({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[o,i,s]=function({defaultProp:e,onChange:t}){const[n,a]=r.useState(e),o=r.useRef(n),i=r.useRef(t);return hd(()=>{i.current=t},[t]),r.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,a,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:o;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${a} is changing from ${t} to ${n}. 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 u=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,u]}var gd,yd="dismissableLayer.update",vd="dismissableLayer.pointerDownOutside",bd="dismissableLayer.focusOutside",wd=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sd=r.forwardRef((t,n)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=r.useContext(wd),[f,m]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,p]=r.useState({}),g=Go(n,e=>m(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,x=w>=b,k=function(e,t=globalThis?.document){const n=Fu(e),a=r.useRef(!1),o=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!a.current){let r=function(){kd(vd,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);a.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));x&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},h),T=function(e,t=globalThis?.document){const n=Fu(e),a=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!a.current){kd(bd,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const n=Fu(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),r.useEffect(()=>{if(f)return a&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(gd=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),xd(),()=>{a&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=gd)}},[f,h,a,d]),r.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),xd())},[f,d]),r.useEffect(()=>{const e=()=>p({});return document.addEventListener(yd,e),()=>document.removeEventListener(yd,e)},[]),e(Ei.div,{...u,ref:g,style:{pointerEvents:S?x?"auto":"none":void 0,...t.style},onFocusCapture:ud(t.onFocusCapture,T.onFocusCapture),onBlurCapture:ud(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ud(t.onPointerDownCapture,k.onPointerDownCapture)})});Sd.displayName="DismissableLayer";function xd(){const e=new CustomEvent(yd);document.dispatchEvent(e)}function kd(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?function(e,t){e&&h.flushSync(()=>e.dispatchEvent(t))}(a,o):a.dispatchEvent(o)}r.forwardRef((t,n)=>{const a=r.useContext(wd),o=r.useRef(null),i=Go(n,o);return r.useEffect(()=>{const e=o.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),e(Ei.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Td="focusScope.autoFocusOnMount",Ad="focusScope.autoFocusOnUnmount",Ed={bubbles:!1,cancelable:!0},Cd=r.forwardRef((t,n)=>{const{loop:a=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=t,[c,u]=r.useState(null),d=Fu(i),f=Fu(s),m=r.useRef(null),h=Go(n,e=>u(e)),p=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(o){let e=function(e){if(p.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:Od(m.current,{select:!0})},t=function(e){if(p.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Od(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Od(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,c,p.paused]),r.useEffect(()=>{if(c){Dd.add(p);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(Td,Ed);c.addEventListener(Td,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Od(r,{select:t}),document.activeElement!==n)return}((e=Nd(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Od(c))}return()=>{c.removeEventListener(Td,d),setTimeout(()=>{const e=new CustomEvent(Ad,Ed);c.addEventListener(Ad,f),c.dispatchEvent(e),e.defaultPrevented||Od(t??document.body,{select:!0}),c.removeEventListener(Ad,f),Dd.remove(p)},0)}}var e},[c,d,f,p]);const g=r.useCallback(e=>{if(!a&&!o)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,o]=function(e){const t=Nd(e),n=_d(t,e),r=_d(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||n!==o?e.shiftKey&&n===r&&(e.preventDefault(),a&&Od(o,{select:!0})):(e.preventDefault(),a&&Od(r,{select:!0})):n===t&&e.preventDefault()}},[a,o,p.paused]);return e(Ei.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function Nd(e){const t=[],n=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(;n.nextNode();)t.push(n.currentNode);return t}function _d(e,t){for(const n of e)if(!Rd(n,{upTo:t}))return n}function Rd(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 Od(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Cd.displayName="FocusScope";var Dd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Md(e,t),e.unshift(t)},remove(t){e=Md(e,t),e[0]?.resume()}}}();function Md(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Pd=r.forwardRef((t,n)=>{const{container:a,...o}=t,[i,s]=r.useState(!1);Uu(()=>s(!0),[]);const l=a||i&&globalThis?.document?.body;return l?p.createPortal(e(Ei.div,{...o,ref:n}),l):null});Pd.displayName="Portal";var Id=e=>{const{present:t,children:n}=e,a=function(e){const[t,n]=r.useState(),a=r.useRef(null),o=r.useRef(e),i=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Ld(a.current);i.current="mounted"===l?e:"none"},[l]),Uu(()=>{const t=a.current,n=o.current;if(n!==e){const r=i.current,a=Ld(t);if(e)c("MOUNT");else if("none"===a||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,c]),Uu(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=Ld(a.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(i.current=Ld(a.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{a.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),i=Go(a.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||a.isPresent?r.cloneElement(o,{ref:i}):null};function Ld(e){return e?.animationName||"none"}Id.displayName="Presence";var Fd=0;function zd(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ud()),document.body.insertAdjacentElement("beforeend",e[1]??Ud()),Fd++,()=>{1===Fd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Fd--}},[])}function Ud(){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 Vd=function(){return Vd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Vd.apply(this,arguments)};function jd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}"function"==typeof SuppressedError&&SuppressedError;var $d="right-scroll-bar-position",Wd="width-before-scroll-bar";function Bd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Zd="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,Hd=new WeakMap;function Gd(e,t){var n,r,a,o=(n=null,r=function(t){return e.forEach(function(e){return Bd(e,t)})},(a=d(function(){return{value:n,callback:r,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=r,a.facade);return Zd(function(){var t=Hd.get(o);if(t){var n=new Set(t),r=new Set(e),a=o.current;n.forEach(function(e){r.has(e)||Bd(e,null)}),r.forEach(function(e){n.has(e)||Bd(e,a)})}Hd.set(o,e)},[e]),o}function Kd(e){return e}var qd=function(e){var t=e.sideCar,n=jd(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 r.createElement(a,Vd({},n))};qd.isSideCarExport=!0;var Jd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Kd);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var a=t(e,r);return n.push(a),function(){n=n.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var a=n;n=[],a.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(o)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=Vd({async:!0,ssr:!1},e),t}(),Yd=function(){},Xd=r.forwardRef(function(e,t){var n=r.useRef(null),a=r.useState({onScrollCapture:Yd,onWheelCapture:Yd,onTouchMoveCapture:Yd}),o=a[0],i=a[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,h=e.noRelative,p=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,w=e.gapMode,S=jd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=m,k=Gd([n,t]),T=Vd(Vd({},S),o);return r.createElement(r.Fragment,null,d&&r.createElement(x,{sideCar:Jd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),s?r.cloneElement(r.Children.only(l),Vd(Vd({},T),{ref:k})):r.createElement(b,Vd({},T,{className:c,ref:k}),l))});Xd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xd.classNames={fullWidth:Wd,zeroRight:$d};function Qd(){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 ef=function(){var e=0,t=null;return{add:function(n){var r,a;0==e&&(t=Qd())&&(a=n,(r=t).styleSheet?r.styleSheet.cssText=a:r.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)}}},tf=function(){var e,t=(e=ef(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},nf={left:0,top:0,right:0,gap:0},rf=function(e){return parseInt(e||"",10)||0},af=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return nf;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[rf(n),rf(r),rf(a)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},of=tf(),sf="data-scroll-locked",lf=function(e,t,n,r){var a=e.left,o=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(sf,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat($d," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Wd," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat($d," .").concat($d," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Wd," .").concat(Wd," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(sf,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},cf=function(){var e=parseInt(document.body.getAttribute(sf)||"0",10);return isFinite(e)?e:0},uf=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=void 0===a?"margin":a;r.useEffect(function(){return document.body.setAttribute(sf,(cf()+1).toString()),function(){var e=cf()-1;e<=0?document.body.removeAttribute(sf):document.body.setAttribute(sf,e.toString())}},[]);var i=r.useMemo(function(){return af(o)},[o]);return r.createElement(of,{styles:lf(i,!t,o,n?"":"!important")})},df=!1;if("undefined"!=typeof window)try{var ff=Object.defineProperty({},"passive",{get:function(){return df=!0,!0}});window.addEventListener("test",ff,ff),window.removeEventListener("test",ff,ff)}catch(e){df=!1}var mf=!!df&&{passive:!1},hf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},pf=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),gf(e,r)){var a=yf(e,r);if(a[1]>a[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gf=function(e,t){return"v"===e?function(e){return hf(e,"overflowY")}(t):function(e){return hf(e,"overflowX")}(t)},yf=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},vf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bf=function(e){return[e.deltaX,e.deltaY]},wf=function(e){return e&&"current"in e?e.current:e},Sf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},xf=0,kf=[];function Tf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Af,Ef=(Af=function(e){var t=r.useRef([]),n=r.useRef([0,0]),a=r.useRef(),o=r.useState(xf++)[0],i=r.useState(tf)[0],s=r.useRef(e);r.useEffect(function(){s.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(wf),!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=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,o=vf(e),i=n.current,l="deltaX"in e?e.deltaX:i[0]-o[0],c="deltaY"in e?e.deltaY:i[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=pf(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=pf(d,u)),!f)return!1;if(!a.current&&"changedTouches"in e&&(l||c)&&(a.current=r),!r)return!0;var m=a.current||r;return function(e,t,n,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=a*r,i=n.target,s=t.contains(i),l=!1,c=o>0,u=0,d=0;do{if(!i)break;var f=yf(e,i),m=f[0],h=f[1]-f[2]-a*m;(m||h)&&gf(e,i)&&(u+=h,d+=m);var p=i.parentNode;i=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(m,t,e,"h"===m?l:c)},[]),c=r.useCallback(function(e){var n=e;if(kf.length&&kf[kf.length-1]===i){var r="deltaY"in n?bf(n):vf(n),a=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,a=r,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)n.cancelable&&n.preventDefault();else if(!a){var o=(s.current.shards||[]).map(wf).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?l(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=r.useCallback(function(e,n,r,a){var o={name:e,delta:n,target:r,should:a,shadowParent:Tf(r)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=r.useCallback(function(e){n.current=vf(e),a.current=void 0},[]),f=r.useCallback(function(t){u(t.type,bf(t),t.target,l(t,e.lockRef.current))},[]),m=r.useCallback(function(t){u(t.type,vf(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return kf.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,mf),document.addEventListener("touchmove",c,mf),document.addEventListener("touchstart",d,mf),function(){kf=kf.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,mf),document.removeEventListener("touchmove",c,mf),document.removeEventListener("touchstart",d,mf)}},[]);var h=e.removeScrollBar,p=e.inert;return r.createElement(r.Fragment,null,p?r.createElement(i,{styles:Sf(o)}):null,h?r.createElement(uf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Jd.useMedium(Af),qd),Cf=r.forwardRef(function(e,t){return r.createElement(Xd,Vd({},e,{ref:t,sideCar:Ef}))});Cf.classNames=Xd.classNames;var Nf=new WeakMap,_f=new WeakMap,Rf={},Of=0,Df=function(e){return e&&(e.host||Df(e.parentNode))},Mf=function(e,t,n,r){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Df(t);return n&&e.contains(n)?n:(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]);Rf[n]||(Rf[n]=new WeakMap);var o=Rf[n],i=[],s=new Set,l=new Set(a),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),a=null!==t&&"false"!==t,l=(Nf.get(e)||0)+1,c=(o.get(e)||0)+1;Nf.set(e,l),o.set(e,c),i.push(e),1===l&&a&&_f.set(e,!0),1===c&&e.setAttribute(n,"true"),a||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Of++,function(){i.forEach(function(e){var t=Nf.get(e)-1,a=o.get(e)-1;Nf.set(e,t),o.set(e,a),t||(_f.has(e)||e.removeAttribute(r),_f.delete(e)),a||e.removeAttribute(n)}),--Of||(Nf=new WeakMap,Nf=new WeakMap,_f=new WeakMap,Rf={})}},Pf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=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?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Mf(r,a,n,"aria-hidden")):function(){return null}},If="Dialog",[Lf,Ff]=Iu(If),[zf,Uf]=Lf(If),Vf=t=>{const{__scopeDialog:n,children:a,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=t,c=r.useRef(null),u=r.useRef(null),[d,f]=pd({prop:o,defaultProp:i??!1,onChange:s,caller:If});return e(zf,{scope:n,triggerRef:c,contentRef:u,contentId:md(),titleId:md(),descriptionId:md(),open:d,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:l,children:a})};Vf.displayName=If;var jf="DialogTrigger",$f=r.forwardRef((t,n)=>{const{__scopeDialog:r,...a}=t,o=Uf(jf,r),i=Go(n,o.triggerRef);return e(Ei.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":lm(o.open),...a,ref:i,onClick:ud(t.onClick,o.onOpenToggle)})});$f.displayName=jf;var Wf="DialogPortal",[Bf,Zf]=Lf(Wf,{forceMount:void 0}),Hf=t=>{const{__scopeDialog:n,forceMount:a,children:o,container:i}=t,s=Uf(Wf,n);return e(Bf,{scope:n,forceMount:a,children:r.Children.map(o,t=>e(Id,{present:a||s.open,children:e(Pd,{asChild:!0,container:i,children:t})}))})};Hf.displayName=Wf;var Gf="DialogOverlay",Kf=r.forwardRef((t,n)=>{const r=Zf(Gf,t.__scopeDialog),{forceMount:a=r.forceMount,...o}=t,i=Uf(Gf,t.__scopeDialog);return i.modal?e(Id,{present:a||i.open,children:e(Jf,{...o,ref:n})}):null});Kf.displayName=Gf;var qf=Ko("DialogOverlay.RemoveScroll"),Jf=r.forwardRef((t,n)=>{const{__scopeDialog:r,...a}=t,o=Uf(Gf,r);return e(Cf,{as:qf,allowPinchZoom:!0,shards:[o.contentRef],children:e(Ei.div,{"data-state":lm(o.open),...a,ref:n,style:{pointerEvents:"auto",...a.style}})})}),Yf="DialogContent",Xf=r.forwardRef((t,n)=>{const r=Zf(Yf,t.__scopeDialog),{forceMount:a=r.forceMount,...o}=t,i=Uf(Yf,t.__scopeDialog);return e(Id,{present:a||i.open,children:i.modal?e(Qf,{...o,ref:n}):e(em,{...o,ref:n})})});Xf.displayName=Yf;var Qf=r.forwardRef((t,n)=>{const a=Uf(Yf,t.__scopeDialog),o=r.useRef(null),i=Go(n,a.contentRef,o);return r.useEffect(()=>{const e=o.current;if(e)return Pf(e)},[]),e(tm,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ud(t.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:ud(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:ud(t.onFocusOutside,e=>e.preventDefault())})}),em=r.forwardRef((t,n)=>{const a=Uf(Yf,t.__scopeDialog),o=r.useRef(!1),i=r.useRef(!1);return e(tm,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||a.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,r=a.triggerRef.current?.contains(n);r&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),tm=r.forwardRef((a,o)=>{const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,...u}=a,d=Uf(Yf,i),f=r.useRef(null),m=Go(o,f);return zd(),n(t,{children:[e(Cd,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:c,children:e(Sd,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":lm(d.open),...u,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),n(t,{children:[e(fm,{titleId:d.titleId}),e(mm,{contentRef:f,descriptionId:d.descriptionId})]})]})}),nm="DialogTitle",rm=r.forwardRef((t,n)=>{const{__scopeDialog:r,...a}=t,o=Uf(nm,r);return e(Ei.h2,{id:o.titleId,...a,ref:n})});rm.displayName=nm;var am="DialogDescription",om=r.forwardRef((t,n)=>{const{__scopeDialog:r,...a}=t,o=Uf(am,r);return e(Ei.p,{id:o.descriptionId,...a,ref:n})});om.displayName=am;var im="DialogClose",sm=r.forwardRef((t,n)=>{const{__scopeDialog:r,...a}=t,o=Uf(im,r);return e(Ei.button,{type:"button",...a,ref:n,onClick:ud(t.onClick,()=>o.onOpenChange(!1))})});function lm(e){return e?"open":"closed"}sm.displayName=im;var cm="DialogTitleWarning",[um,dm]=function(t,n){const a=r.createContext(n),o=t=>{const{children:n,...o}=t,i=r.useMemo(()=>o,Object.values(o));return e(a.Provider,{value:i,children:n})};return o.displayName=t+"Provider",[o,function(e){const o=r.useContext(a);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(cm,{contentName:Yf,titleName:nm,docsSlug:"dialog"}),fm=({titleId:e})=>{const t=dm(cm),n=`\`${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 r.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},mm=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dm("DialogDescriptionWarning").contentName}}.`;return r.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},hm=Vf,pm=$f,gm=Hf,ym=Kf,vm=Xf,bm=rm,wm=om,Sm=sm;function xm(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var km=["color"],Tm=c(function(e,t){var n=e.color,r=void 0===n?"currentColor":n,a=xm(e,km);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Am=["color"],Em=c(function(e,t){var n=e.color,r=void 0===n?"currentColor":n,a=xm(e,Am);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Cm=["color"],Nm=c(function(e,t){var n=e.color,r=void 0===n?"currentColor":n,a=xm(e,Cm);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_m=["color"],Rm=c(function(e,t){var n=e.color,r=void 0===n?"currentColor":n,a=xm(e,_m);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:r,fillRule:"evenodd",clipRule:"evenodd"}))});const Om=hm,Dm=pm,Mm=gm,Pm=r.forwardRef(({className:t,...n},r)=>e(ym,{ref:r,className:Bo("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",t),...n}));Pm.displayName=ym.displayName;const Im=r.forwardRef(({className:t,children:a,...o},i)=>{const{container:s}=r.useContext(ie);return n(Mm,{container:s,children:[e(Pm,{}),n(vm,{ref:i,className:Bo("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",t),...o,children:[a,n(Sm,{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:[e(Nm,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"Close"})]})]})]})});Im.displayName=vm.displayName;const Lm=({className:t,...n})=>e("div",{className:Bo("flex flex-col space-y-1.5 text-center sm:text-left",t),...n});Lm.displayName="DialogHeader";const Fm=r.forwardRef(({className:t,...n},r)=>e(bm,{ref:r,className:Bo("text-lg font-semibold leading-none tracking-tight",t),...n}));Fm.displayName=bm.displayName;const zm=r.forwardRef(({className:t,...n},r)=>e(wm,{ref:r,className:Bo("text-sm text-muted-foreground",t),...n}));function Um(t){const n=t+"CollectionProvider",[r,o]=Iu(n),[i,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:n,children:r}=t,o=a.useRef(null),s=a.useRef(new Map).current;return e(i,{scope:n,itemMap:s,collectionRef:o,children:r})};l.displayName=n;const c=t+"CollectionSlot",u=Ko(c),d=a.forwardRef((t,n)=>{const{scope:r,children:a}=t,o=Go(n,s(c,r).collectionRef);return e(u,{ref:o,children:a})});d.displayName=c;const f=t+"CollectionItemSlot",m="data-radix-collection-item",h=Ko(f),p=a.forwardRef((t,n)=>{const{scope:r,children:o,...i}=t,l=a.useRef(null),c=Go(n,l),u=s(f,r);return a.useEffect(()=>(u.itemMap.set(l,{ref:l,...i}),()=>{u.itemMap.delete(l)})),e(h,{[m]:"",ref:c,children:o})});return p.displayName=f,[{Provider:l,Slot:d,ItemSlot:p},function(e){const n=s(t+"CollectionConsumer",e),r=a.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current));return r},[n.collectionRef,n.itemMap]);return r},o]}zm.displayName=wm.displayName;var Vm=r.createContext(void 0);function jm(e){const t=r.useContext(Vm);return e||t||"ltr"}var $m="rovingFocusGroup.onEntryFocus",Wm={bubbles:!1,cancelable:!0},Bm="RovingFocusGroup",[Zm,Hm,Gm]=Um(Bm),[Km,qm]=Iu(Bm,[Gm]),[Jm,Ym]=Km(Bm),Xm=r.forwardRef((t,n)=>e(Zm.Provider,{scope:t.__scopeRovingFocusGroup,children:e(Zm.Slot,{scope:t.__scopeRovingFocusGroup,children:e(Qm,{...t,ref:n})})}));Xm.displayName=Bm;var Qm=r.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:a,orientation:o,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=t,h=r.useRef(null),p=Go(n,h),g=jm(s),[y,v]=pd({prop:l,defaultProp:c??null,onChange:u,caller:Bm}),[b,w]=r.useState(!1),S=Fu(d),x=Hm(a),k=r.useRef(!1),[T,A]=r.useState(0);return r.useEffect(()=>{const e=h.current;if(e)return e.addEventListener($m,S),()=>e.removeEventListener($m,S)},[S]),e(Jm,{scope:a,orientation:o,dir:g,loop:i,currentTabStopId:y,onItemFocus:r.useCallback(e=>v(e),[v]),onItemShiftTab:r.useCallback(()=>w(!0),[]),onFocusableItemAdd:r.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>A(e=>e-1),[]),children:e(Ei.div,{tabIndex:b||0===T?-1:0,"data-orientation":o,...m,ref:p,style:{outline:"none",...t.style},onMouseDown:ud(t.onMouseDown,()=>{k.current=!0}),onFocus:ud(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent($m,Wm);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter(e=>e.focusable);rh([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:ud(t.onBlur,()=>w(!1))})})}),eh="RovingFocusGroupItem",th=r.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:a,focusable:o=!0,active:i=!1,tabStopId:s,children:l,...c}=t,u=md(),d=s||u,f=Ym(eh,a),m=f.currentTabStopId===d,h=Hm(a),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:y}=f;return r.useEffect(()=>{if(o)return p(),()=>g()},[o,p,g]),e(Zm.ItemSlot,{scope:a,id:d,focusable:o,active:i,children:e(Ei.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:ud(t.onMouseDown,e=>{o?f.onItemFocus(d):e.preventDefault()}),onFocus:ud(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:ud(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:nh[r]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=f.loop?function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(n,r+1):n.slice(r+1)}setTimeout(()=>rh(n))}}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=y}):l})})});th.displayName=eh;var nh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rh(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var ah=Xm,oh=th;function ih(e){const[t,n]=r.useState(void 0);return Uu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let a,o;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}function sh(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var lh="Radio",[ch,uh]=Iu(lh),[dh,fh]=ch(lh),mh=r.forwardRef((t,a)=>{const{__scopeRadio:o,name:i,checked:s=!1,required:l,disabled:c,value:u="on",onCheck:d,form:f,...m}=t,[h,p]=r.useState(null),g=Go(a,e=>p(e)),y=r.useRef(!1),v=!h||(f||!!h.closest("form"));return n(dh,{scope:o,checked:s,disabled:c,children:[e(Ei.button,{type:"button",role:"radio","aria-checked":s,"data-state":yh(s),"data-disabled":c?"":void 0,disabled:c,value:u,...m,ref:g,onClick:ud(t.onClick,e=>{s||d?.(),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),v&&e(gh,{control:h,bubbles:!y.current,name:i,value:u,checked:s,required:l,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});mh.displayName=lh;var hh="RadioIndicator",ph=r.forwardRef((t,n)=>{const{__scopeRadio:r,forceMount:a,...o}=t,i=fh(hh,r);return e(Id,{present:a||i.checked,children:e(Ei.span,{"data-state":yh(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})})});ph.displayName=hh;var gh=r.forwardRef(({__scopeRadio:t,control:n,checked:a,bubbles:o=!0,...i},s)=>{const l=r.useRef(null),c=Go(l,s),u=sh(a),d=ih(n);return r.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&n){const t=new Event("click",{bubbles:o});n.call(e,a),e.dispatchEvent(t)}},[u,a,o]),e(Ei.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:c,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function yh(e){return e?"checked":"unchecked"}gh.displayName="RadioBubbleInput";var vh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],bh="RadioGroup",[wh,Sh]=Iu(bh,[qm,uh]),xh=qm(),kh=uh(),[Th,Ah]=wh(bh),Eh=r.forwardRef((t,n)=>{const{__scopeRadioGroup:r,name:a,defaultValue:o,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=t,h=xh(r),p=jm(u),[g,y]=pd({prop:i,defaultProp:o??null,onChange:f,caller:bh});return e(Th,{scope:r,name:a,required:s,disabled:l,value:g,onValueChange:y,children:e(ah,{asChild:!0,...h,orientation:c,dir:p,loop:d,children:e(Ei.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:p,...m,ref:n})})})});Eh.displayName=bh;var Ch="RadioGroupItem",Nh=r.forwardRef((t,n)=>{const{__scopeRadioGroup:a,disabled:o,...i}=t,s=Ah(Ch,a),l=s.disabled||o,c=xh(a),u=kh(a),d=r.useRef(null),f=Go(n,d),m=s.value===i.value,h=r.useRef(!1);return r.useEffect(()=>{const e=e=>{vh.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e(oh,{asChild:!0,...c,focusable:!l,active:m,children:e(mh,{disabled:l,required:s.required,checked:m,...u,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:ud(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:ud(i.onFocus,()=>{h.current&&d.current?.click()})})})});Nh.displayName=Ch;var _h=r.forwardRef((t,n)=>{const{__scopeRadioGroup:r,...a}=t,o=kh(r);return e(ph,{...o,...a,ref:n})});_h.displayName="RadioGroupIndicator";var Rh=Eh,Oh=Nh,Dh=_h;const Mh=r.forwardRef(({className:t,...n},r)=>e(Rh,{className:Bo("grid gap-2",t),...n,ref:r}));Mh.displayName=Rh.displayName;const Ph=r.forwardRef(({className:t,...n},r)=>e(Oh,{ref:r,className:Bo("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",t),...n,children:e(Dh,{className:"flex items-center justify-center",children:e(Em,{className:"h-3.5 w-3.5 fill-primary"})})}));function Ih(e,[t,n]){return Math.min(n,Math.max(t,e))}Ph.displayName=Oh.displayName;var Lh="ScrollArea",[Fh,zh]=Iu(Lh),[Uh,Vh]=Fh(Lh),jh=r.forwardRef((t,n)=>{const{__scopeScrollArea:a,type:o="hover",dir:i,scrollHideDelay:s=600,...l}=t,[c,u]=r.useState(null),[d,f]=r.useState(null),[m,h]=r.useState(null),[p,g]=r.useState(null),[y,v]=r.useState(null),[b,w]=r.useState(0),[S,x]=r.useState(0),[k,T]=r.useState(!1),[A,E]=r.useState(!1),C=Go(n,e=>u(e)),N=jm(i);return e(Uh,{scope:a,type:o,dir:N,scrollHideDelay:s,scrollArea:c,viewport:d,onViewportChange:f,content:m,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:T,scrollbarY:y,onScrollbarYChange:v,scrollbarYEnabled:A,onScrollbarYEnabledChange:E,onCornerWidthChange:w,onCornerHeightChange:x,children:e(Ei.div,{dir:N,...l,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":S+"px",...t.style}})})});jh.displayName=Lh;var $h="ScrollAreaViewport",Wh=r.forwardRef((a,o)=>{const{__scopeScrollArea:i,children:s,nonce:l,...c}=a,u=Vh($h,i),d=Go(o,r.useRef(null),u.onViewportChange);return n(t,{children:[e("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}),e(Ei.div,{"data-radix-scroll-area-viewport":"",...c,ref:d,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...a.style},children:e("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Wh.displayName=$h;var Bh="ScrollAreaScrollbar",Zh=r.forwardRef((t,n)=>{const{forceMount:a,...o}=t,i=Vh(Bh,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=i,c="horizontal"===t.orientation;return r.useEffect(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===i.type?e(Hh,{...o,ref:n,forceMount:a}):"scroll"===i.type?e(Gh,{...o,ref:n,forceMount:a}):"auto"===i.type?e(Kh,{...o,ref:n,forceMount:a}):"always"===i.type?e(qh,{...o,ref:n}):null});Zh.displayName=Bh;var Hh=r.forwardRef((t,n)=>{const{forceMount:a,...o}=t,i=Vh(Bh,t.__scopeScrollArea),[s,l]=r.useState(!1);return r.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),l(!0)},r=()=>{t=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[i.scrollArea,i.scrollHideDelay]),e(Id,{present:a||s,children:e(Kh,{"data-state":s?"visible":"hidden",...o,ref:n})})}),Gh=r.forwardRef((t,n)=>{const{forceMount:a,...o}=t,i=Vh(Bh,t.__scopeScrollArea),s="horizontal"===t.orientation,l=hp(()=>u("SCROLL_END"),100),[c,u]=(d="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"}},r.useReducer((e,t)=>f[e][t]??e,d));var d,f;return r.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,i.scrollHideDelay,u]),r.useEffect(()=>{const e=i.viewport,t=s?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(u("SCROLL"),l()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[i.viewport,s,u,l]),e(Id,{present:a||"hidden"!==c,children:e(qh,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:n,onPointerEnter:ud(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:ud(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Kh=r.forwardRef((t,n)=>{const a=Vh(Bh,t.__scopeScrollArea),{forceMount:o,...i}=t,[s,l]=r.useState(!1),c="horizontal"===t.orientation,u=hp(()=>{if(a.viewport){const e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;l(c?e:t)}},10);return pp(a.viewport,u),pp(a.content,u),e(Id,{present:o||s,children:e(qh,{"data-state":s?"visible":"hidden",...i,ref:n})})}),qh=r.forwardRef((t,n)=>{const{orientation:a="vertical",...o}=t,i=Vh(Bh,t.__scopeScrollArea),s=r.useRef(null),l=r.useRef(0),[c,u]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=lp(c.viewport,c.content),f={...o,sizes:c,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,n,r="ltr"){const a=cp(n),o=a/2,i=t||o,s=a-i,l=n.scrollbar.paddingStart+i,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d="ltr"===r?[0,u]:[-1*u,0];return dp([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===a?e(Jh,{...f,ref:n,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=up(i.viewport.scrollLeft,c,i.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===a?e(Yh,{...f,ref:n,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=up(i.viewport.scrollTop,c);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),Jh=r.forwardRef((t,n)=>{const{sizes:a,onSizesChange:o,...i}=t,s=Vh(Bh,t.__scopeScrollArea),[l,c]=r.useState(),u=r.useRef(null),d=Go(n,u,s.onScrollbarXChange);return r.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e(ep,{"data-orientation":"horizontal",...i,ref:d,sizes:a,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":cp(a)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollLeft+e.deltaX;t.onWheelScroll(r),fp(r,n)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:sp(l.paddingLeft),paddingEnd:sp(l.paddingRight)}})}})}),Yh=r.forwardRef((t,n)=>{const{sizes:a,onSizesChange:o,...i}=t,s=Vh(Bh,t.__scopeScrollArea),[l,c]=r.useState(),u=r.useRef(null),d=Go(n,u,s.onScrollbarYChange);return r.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e(ep,{"data-orientation":"vertical",...i,ref:d,sizes:a,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":cp(a)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollTop+e.deltaY;t.onWheelScroll(r),fp(r,n)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:sp(l.paddingTop),paddingEnd:sp(l.paddingBottom)}})}})}),[Xh,Qh]=Fh(Bh),ep=r.forwardRef((t,n)=>{const{__scopeScrollArea:a,sizes:o,hasThumb:i,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:m,...h}=t,p=Vh(Bh,a),[g,y]=r.useState(null),v=Go(n,e=>y(e)),b=r.useRef(null),w=r.useRef(""),S=p.viewport,x=o.content-o.viewport,k=Fu(f),T=Fu(u),A=hp(m,10);function E(e){if(b.current){const t=e.clientX-b.current.left,n=e.clientY-b.current.top;d({x:t,y:n})}}return r.useEffect(()=>{const e=e=>{const t=e.target,n=g?.contains(t);n&&k(e,x)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[S,g,x,k]),r.useEffect(T,[o,T]),pp(g,A),pp(p.content,A),e(Xh,{scope:a,scrollbar:g,hasThumb:i,onThumbChange:Fu(s),onThumbPointerUp:Fu(l),onThumbPositionChange:T,onThumbPointerDown:Fu(c),children:e(Ei.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:ud(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),b.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(e)}}),onPointerMove:ud(t.onPointerMove,E),onPointerUp:ud(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),tp="ScrollAreaThumb",np=r.forwardRef((t,n)=>{const{forceMount:r,...a}=t,o=Qh(tp,t.__scopeScrollArea);return e(Id,{present:r||o.hasThumb,children:e(rp,{ref:n,...a})})}),rp=r.forwardRef((t,n)=>{const{__scopeScrollArea:a,style:o,...i}=t,s=Vh(tp,a),l=Qh(tp,a),{onThumbPositionChange:c}=l,u=Go(n,e=>l.onThumbChange(e)),d=r.useRef(void 0),f=hp(()=>{d.current&&(d.current(),d.current=void 0)},100);return r.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(f(),!d.current){const t=mp(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,f,c]),e(Ei.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:ud(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;l.onThumbPointerDown({x:n,y:r})}),onPointerUp:ud(t.onPointerUp,l.onThumbPointerUp)})});np.displayName=tp;var ap="ScrollAreaCorner",op=r.forwardRef((t,n)=>{const r=Vh(ap,t.__scopeScrollArea),a=Boolean(r.scrollbarX&&r.scrollbarY);return"scroll"!==r.type&&a?e(ip,{...t,ref:n}):null});op.displayName=ap;var ip=r.forwardRef((t,n)=>{const{__scopeScrollArea:a,...o}=t,i=Vh(ap,a),[s,l]=r.useState(0),[c,u]=r.useState(0),d=Boolean(s&&c);return pp(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),pp(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),l(e)}),d?e(Ei.div,{...o,ref:n,style:{width:s,height:c,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function sp(e){return e?parseInt(e,10):0}function lp(e,t){const n=e/t;return isNaN(n)?0:n}function cp(e){const t=lp(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function up(e,t,n="ltr"){const r=cp(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,i=t.content-t.viewport,s=o-r,l=Ih(e,"ltr"===n?[0,i]:[-1*i,0]);return dp([0,i],[0,s])(l)}function dp(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function fp(e,t){return e>0&&e<t}var mp=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,s=n.top!==o.top;(i||s)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function hp(e,t){const n=Fu(e),a=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(a.current),[]),r.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function pp(e,t){const n=Fu(t);Uu(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var gp=jh,yp=Wh,vp=op;const bp=r.forwardRef(({className:t,children:r,...a},o)=>n(gp,{ref:o,className:Bo("relative overflow-hidden",t),...a,children:[e(yp,{className:"h-full w-full rounded-[inherit]",children:r}),e(wp,{}),e(vp,{})]}));bp.displayName=gp.displayName;const wp=r.forwardRef(({className:t,orientation:n="vertical",...r},a)=>e(Zh,{ref:a,orientation:n,className:Bo("flex touch-none select-none transition-colors","vertical"===n&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===n&&"h-2.5 border-t border-t-transparent p-[1px]",t),...r,children:e(np,{className:Bo("relative rounded-full bg-border","vertical"===n&&"flex-1")})}));wp.displayName=Zh.displayName;var Sp="horizontal",xp=["horizontal","vertical"],kp=r.forwardRef((t,n)=>{const{decorative:r,orientation:a=Sp,...o}=t,i=function(e){return xp.includes(e)}(a)?a:Sp,s=r?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e(Ei.div,{"data-orientation":i,...s,...o,ref:n})});kp.displayName="Separator";var Tp=kp;const Ap=r.forwardRef(({className:t,orientation:n="horizontal",decorative:r=!0,...a},o)=>e(Tp,{ref:o,decorative:r,orientation:n,className:Bo("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...a}));Ap.displayName=Tp.displayName;var Ep="Switch",[Cp,Np]=Iu(Ep),[_p,Rp]=Cp(Ep),Op=r.forwardRef((t,a)=>{const{__scopeSwitch:o,name:i,checked:s,defaultChecked:l,required:c,disabled:u,value:d="on",onCheckedChange:f,form:m,...h}=t,[p,g]=r.useState(null),y=Go(a,e=>g(e)),v=r.useRef(!1),b=!p||(m||!!p.closest("form")),[w,S]=pd({prop:s,defaultProp:l??!1,onChange:f,caller:Ep});return n(_p,{scope:o,checked:w,disabled:u,children:[e(Ei.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":Ip(w),"data-disabled":u?"":void 0,disabled:u,value:d,...h,ref:y,onClick:ud(t.onClick,e=>{S(e=>!e),b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),b&&e(Pp,{control:p,bubbles:!v.current,name:i,value:d,checked:w,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});Op.displayName=Ep;var Dp="SwitchThumb",Mp=r.forwardRef((t,n)=>{const{__scopeSwitch:r,...a}=t,o=Rp(Dp,r);return e(Ei.span,{"data-state":Ip(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:n})});Mp.displayName=Dp;var Pp=r.forwardRef(({__scopeSwitch:t,control:n,checked:a,bubbles:o=!0,...i},s)=>{const l=r.useRef(null),c=Go(l,s),u=sh(a),d=ih(n);return r.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&n){const t=new Event("click",{bubbles:o});n.call(e,a),e.dispatchEvent(t)}},[u,a,o]),e("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:c,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ip(e){return e?"checked":"unchecked"}Pp.displayName="SwitchBubbleInput";var Lp=Op,Fp=Mp;const zp=r.forwardRef(({className:t,...n},r)=>e(Lp,{className:Bo("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",t),...n,ref:r,children:e(Fp,{className:Bo("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")})}));zp.displayName=Lp.displayName;const Up=({workspaceId:t})=>{const[r,a]=d({}),{allFeatures:o,updateFeature:i,getWorkspace:s}=SA(),[c,u]=d(null),f=Z(e=>e.auth.user);if(l(()=>{s(t).then(u)},[t]),!c)return n("div",{className:"space-y-3.5",children:[e($i,{className:"h-10 w-full"}),e($i,{className:"h-10 w-full"}),e($i,{className:"h-10 w-full"})]});const m=c?.users.find(e=>("string"==typeof e?e:e._id)===f?.id)?.role,h="admin"===m?.toLowerCase();return e("div",{children:n("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!h&&e("div",{className:"text-red-500",children:"Only workspace admin can change the features."}),!o.length&&e("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),o.length>0&&e("div",{className:"flex flex-col gap-y-3.5",children:o.map(t=>{const o=c?.features?.[t.slug];return n("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[n("div",{className:"flex gap-x-2 flex-col",children:[e("h3",{className:"font-medium text-ellipsis",children:t.name}),e("p",{className:"text-muted-foreground",children:t.description})]}),e(zp,{disabled:r[t.slug]||!h,checked:o??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!c)return;a(n=>({...n,[e]:t}));const n=await i(c._id,e,t);u(n),a(t=>({...t,[e]:!1}))}(t.slug,e)})]},t._id)})})]})})};function Vp(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}</text></svg>`}const jp=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],$p=({workspace:t})=>{const[r,a]=d(!1),[o,i]=d("emoji"),[s,l]=d(),{updateWorkspace:c}=SA(),u=Z(e=>e.auth.user),f=Pt({resolver:Pa(js({name:hs().min(2,{message:"Workspace name must be at least 2 characters."}),image:hs().optional()})),defaultValues:{name:t.name||"",image:t.image||""}});if(!t)return e("div",{children:e("div",{className:"text-gray-500",children:"Loading workspace settings..."})});const m=t?.users.find(e=>("string"==typeof e?e:e._id)===u?.id)?.role,h="admin"===m?.toLowerCase();return n("div",{children:[!h&&e("div",{className:"text-red-500",children:"Only workspace admin can change the workspace settings."}),e(Oi,{...f,children:n("form",{onSubmit:f.handleSubmit(async function(e){a(!0);try{await c(t,e)}catch(e){console.error("Failed to update workspace:",e)}finally{a(!1)}}),className:"space-y-6",children:[e(Mi,{control:f.control,name:"name",render:({field:t})=>n(Li,{children:[e(Fi,{children:"Name"}),e(zi,{children:e(ji,{placeholder:"My Awesome Workspace",...t,disabled:!h})}),e(Vi,{})]})}),n("div",{className:"space-y-4",children:[n("div",{children:[e(Ri,{className:"text-sm font-medium",children:"Icon"}),e(Ui,{children:"Choose an emoji or upload a custom image for your workspace."})]}),n(Mh,{value:o,disabled:!h,onValueChange:e=>i(e),className:"flex flex-col space-y-3",children:[n("div",{className:"flex items-center space-x-2",children:[e(Ph,{value:"emoji",id:"emoji"}),n(Ri,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e(bi,{className:"h-4 w-4"}),"Choose Emoji"]})]}),n("div",{className:"flex items-center space-x-2",children:[e(Ph,{value:"url",id:"url"}),n(Ri,{htmlFor:"url",className:"flex items-center gap-2",children:[e(mi,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&n("div",{className:"space-y-3",children:[n("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),n("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[s&&e("span",{className:"text-2xl",children:s}),!s&&e("img",{src:f.watch("image")})]})]}),e(bp,{className:"h-32 w-full rounded-md border",children:e("div",{className:"p-4 grid grid-cols-8 gap-2",children:jp.map((t,n)=>e("button",{type:"button",onClick:()=>(e=>{l(e),f.setValue("image",Vp(e))})(t),disabled:!h,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(s===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===o&&n("div",{className:"space-y-3",children:[e(Mi,{control:f.control,name:"image",render:({field:t})=>n(Li,{children:[e(Fi,{children:"Image URL"}),e(zi,{children:e(ji,{placeholder:"https://example.com/image.png",...t,disabled:!h})}),e(Ui,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e(Vi,{})]})}),f.watch("image")&&n("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e("img",{src:f.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e("div",{className:"flex justify-end gap-3 pt-4",children:h&&e(Ai,{type:"submit",disabled:r,progress:r,children:"Update Workspace"})})]})})]})};var Wp=.999,Bp=/[\\\/_+.#"@\[\(\{&]/,Zp=/[\\\/_+.#"@\[\(\{&]/g,Hp=/[\s-]/,Gp=/[\s-]/g;function Kp(e,t,n,r,a,o,i){if(o===t.length)return a===e.length?1:.99;var s=`${a},${o}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,f=r.charAt(o),m=n.indexOf(f,a),h=0;m>=0;)(l=Kp(e,t,n,r,m+1,o+1,i))>h&&(m===a?l*=1:Bp.test(e.charAt(m-1))?(l*=.8,(u=e.slice(a,m-1).match(Zp))&&a>0&&(l*=Math.pow(Wp,u.length))):Hp.test(e.charAt(m-1))?(l*=.9,(d=e.slice(a,m-1).match(Gp))&&a>0&&(l*=Math.pow(Wp,d.length))):(l*=.17,a>0&&(l*=Math.pow(Wp,m-a))),e.charAt(m)!==t.charAt(o)&&(l*=.9999)),(l<.1&&n.charAt(m-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(m-1)!==r.charAt(o))&&(.1*(c=Kp(e,t,n,r,m+1,o+2,i))>l&&(l=.1*c)),l>h&&(h=l),m=n.indexOf(f,m+1);return i[s]=h,h}function qp(e){return e.toLowerCase().replace(Gp," ")}function Jp(e,t,n){return Kp(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,qp(e),qp(t),0,0,{})}var Yp='[cmdk-group=""]',Xp='[cmdk-group-items=""]',Qp='[cmdk-item=""]',eg=`${Qp}:not([aria-disabled="true"])`,tg="cmdk-item-select",ng="data-value",rg=(e,t,n)=>Jp(e,t,n),ag=r.createContext(void 0),og=()=>r.useContext(ag),ig=r.createContext(void 0),sg=()=>r.useContext(ig),lg=r.createContext(void 0),cg=r.forwardRef((e,t)=>{let n=kg(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=kg(()=>new Set),o=kg(()=>new Map),i=kg(()=>new Map),s=kg(()=>new Set),l=Sg(e),{label:c,children:u,value:d,onValueChange:f,filter:m,shouldFilter:h,loop:p,disablePointerSelection:g=!1,vimBindings:y=!0,...v}=e,b=md(),w=md(),S=md(),x=r.useRef(null),k=Eg();xg(()=>{if(void 0!==d){let e=d.trim();n.current.value=e,T.emit()}},[d]),xg(()=>{k(6,R)},[]);let T=r.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var a,o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)_(),C(),k(1,N);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(S);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(k(7,()=>{var e;n.current.selectedItemId=null==(e=O())?void 0:e.id,T.emit()}),r||k(5,R),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}T.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),A=r.useMemo(()=>({value:(e,t,r)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),k(2,()=>{C(),T.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,()=>{_(),C(),n.current.value||N(),T.emit()}),()=>{i.current.delete(e),a.current.delete(e),n.current.filtered.items.delete(e);let t=O();k(4,()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&N(),T.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{i.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:S,labelId:w,listInnerRef:x}),[]);function E(e,t){var r,a;let o=null!=(a=null==(r=l.current)?void 0:r.filter)?a:rg;return e?o(e,n.current.search,t):0}function C(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=o.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;D().sort((t,n)=>{var r,a;let o=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(r=e.get(i))?r:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(Xp);t?t.appendChild(e.parentElement===t?e:e.closest(`${Xp} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Xp} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=x.current)?void 0:t.querySelector(`${Yp}[${ng}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function N(){let e=D().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ng);T.setState("value",t||void 0)}function _(){var e,t,r,s;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=a.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of a.current){let a=E(null!=(t=null==(e=i.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(r=i.current.get(o))?void 0:r.keywords)?s:[]);n.current.filtered.items.set(o,a),a>0&&c++}for(let[e,t]of o.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function R(){var e,t,n;let r=O();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(Yp))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=x.current)?void 0:e.querySelector(`${Qp}[aria-selected="true"]`)}function D(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(eg))||[])}function M(e){let t=D()[e];t&&T.setState("value",t.getAttribute(ng))}function P(e){var t;let n=O(),r=D(),a=r.findIndex(e=>e===n),o=r[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?r[r.length-1]:a+e===r.length?r[0]:r[a+e]),o&&T.setState("value",o.getAttribute(ng))}function I(e){let t,n=O(),r=null==n?void 0:n.closest(Yp);for(;r&&!t;)r=e>0?bg(r,Yp):wg(r,Yp),t=null==r?void 0:r.querySelector(eg);t?T.setState("value",t.getAttribute(ng)):P(e)}let L=()=>M(D().length-1),F=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):P(1)},z=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?I(-1):P(-1)};return r.createElement(Ei.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":y&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":y&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),M(0);break;case"End":e.preventDefault(),L();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(tg);t.dispatchEvent(e)}}}}},r.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:Ng},c),Cg(e,e=>r.createElement(ig.Provider,{value:T},r.createElement(ag.Provider,{value:A},e))))}),ug=r.forwardRef((e,t)=>{var n,a;let o=md(),i=r.useRef(null),s=r.useContext(lg),l=og(),c=Sg(e),u=null!=(a=null==(n=c.current)?void 0:n.forceMount)?a:null==s?void 0:s.forceMount;xg(()=>{if(!u)return l.item(o,null==s?void 0:s.id)},[u]);let d=Ag(o,i,[e.value,e.children,i],e.keywords),f=sg(),m=Tg(e=>e.value&&e.value===d.current),h=Tg(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function p(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){f.setState("value",d.current,!0)}if(r.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(tg,p),()=>t.removeEventListener(tg,p)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:y,value:v,onSelect:b,forceMount:w,keywords:S,...x}=e;return r.createElement(Ei.div,{ref:Ho(i,t),...x,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!m,"data-disabled":!!y,"data-selected":!!m,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:p},e.children)}),dg=r.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:o,...i}=e,s=md(),l=r.useRef(null),c=r.useRef(null),u=md(),d=og(),f=Tg(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(s)));xg(()=>d.group(s),[]),Ag(s,l,[e.value,e.heading,c]);let m=r.useMemo(()=>({id:s,forceMount:o}),[o]);return r.createElement(Ei.div,{ref:Ho(l,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&r.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Cg(e,e=>r.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},r.createElement(lg.Provider,{value:m},e))))}),fg=r.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,o=r.useRef(null),i=Tg(e=>!e.search);return n||i?r.createElement(Ei.div,{ref:Ho(o,t),...a,"cmdk-separator":"",role:"separator"}):null}),mg=r.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,o=null!=e.value,i=sg(),s=Tg(e=>e.search),l=Tg(e=>e.selectedItemId),c=og();return r.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),r.createElement(Ei.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:s,onChange:e=>{o||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),hg=r.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...o}=e,i=r.useRef(null),s=r.useRef(null),l=Tg(e=>e.selectedItemId),c=og();return r.useEffect(()=>{if(s.current&&i.current){let e,t=s.current,n=i.current,r=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}},[]),r.createElement(Ei.div,{ref:Ho(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":a,id:c.listId},Cg(e,e=>r.createElement("div",{ref:Ho(s,c.listInnerRef),"cmdk-list-sizer":""},e)))}),pg=r.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:o,contentClassName:i,container:s,...l}=e;return r.createElement(hm,{open:n,onOpenChange:a},r.createElement(gm,{container:s},r.createElement(ym,{"cmdk-overlay":"",className:o}),r.createElement(vm,{"aria-label":e.label,"cmdk-dialog":"",className:i},r.createElement(cg,{ref:t,...l}))))}),gg=r.forwardRef((e,t)=>Tg(e=>0===e.filtered.count)?r.createElement(Ei.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),yg=r.forwardRef((e,t)=>{let{progress:n,children:a,label:o="Loading...",...i}=e;return r.createElement(Ei.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Cg(e,e=>r.createElement("div",{"aria-hidden":!0},e)))}),vg=Object.assign(cg,{List:hg,Item:ug,Input:mg,Group:dg,Separator:fg,Dialog:pg,Empty:gg,Loading:yg});function bg(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wg(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Sg(e){let t=r.useRef(e);return xg(()=>{t.current=e}),t}var xg="undefined"==typeof window?r.useEffect:r.useLayoutEffect;function kg(e){let t=r.useRef();return void 0===t.current&&(t.current=e()),t}function Tg(e){let t=sg(),n=()=>e(t.snapshot());return r.useSyncExternalStore(t.subscribe,n,n)}function Ag(e,t,n,a=[]){let o=r.useRef(),i=og();return xg(()=>{var r;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=a.map(e=>e.trim());i.value(e,s,l),null==(r=t.current)||r.setAttribute(ng,s),o.current=s}),o}var Eg=()=>{let[e,t]=r.useState(),n=kg(()=>new Map);return xg(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Cg({asChild:e,children:t},n){return e&&r.isValidElement(t)?r.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var Ng={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const _g=r.forwardRef(({className:t,...n},r)=>e(vg,{ref:r,className:Bo("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));_g.displayName=vg.displayName;const Rg=r.forwardRef(({className:t,...r},a)=>n("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e(Rm,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e(vg.Input,{ref:a,className:Bo("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",t),...r})]}));Rg.displayName=vg.Input.displayName;const Og=r.forwardRef(({className:t,...n},r)=>e(vg.List,{ref:r,className:Bo("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...n}));Og.displayName=vg.List.displayName;r.forwardRef((t,n)=>e(vg.Empty,{ref:n,className:"py-6 text-center text-sm",...t})).displayName=vg.Empty.displayName;const Dg=r.forwardRef(({className:t,...n},r)=>e(vg.Group,{ref:r,className:Bo("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",t),...n}));Dg.displayName=vg.Group.displayName;r.forwardRef(({className:t,...n},r)=>e(vg.Separator,{ref:r,className:Bo("-mx-1 h-px bg-border",t),...n})).displayName=vg.Separator.displayName;const Mg=r.forwardRef(({className:t,...n},r)=>e(vg.Item,{ref:r,className:Bo("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",t),...n}));Mg.displayName=vg.Item.displayName;const Pg=["top","right","bottom","left"],Ig=Math.min,Lg=Math.max,Fg=Math.round,zg=Math.floor,Ug=e=>({x:e,y:e}),Vg={left:"right",right:"left",bottom:"top",top:"bottom"},jg={start:"end",end:"start"};function $g(e,t,n){return Lg(e,Ig(t,n))}function Wg(e,t){return"function"==typeof e?e(t):e}function Bg(e){return e.split("-")[0]}function Zg(e){return e.split("-")[1]}function Hg(e){return"x"===e?"y":"x"}function Gg(e){return"y"===e?"height":"width"}const Kg=new Set(["top","bottom"]);function qg(e){return Kg.has(Bg(e))?"y":"x"}function Jg(e){return Hg(qg(e))}function Yg(e){return e.replace(/start|end/g,e=>jg[e])}const Xg=["left","right"],Qg=["right","left"],ey=["top","bottom"],ty=["bottom","top"];function ny(e,t,n,r){const a=Zg(e);let o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Qg:Xg:t?Xg:Qg;case"left":case"right":return t?ey:ty;default:return[]}}(Bg(e),"start"===n,r);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Yg)))),o}function ry(e){return e.replace(/left|right|bottom|top/g,e=>Vg[e])}function ay(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 oy(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function iy(e,t,n){let{reference:r,floating:a}=e;const o=qg(t),i=Jg(t),s=Gg(i),l=Bg(t),c="y"===o,u=r.x+r.width/2-a.width/2,d=r.y+r.height/2-a.height/2,f=r[s]/2-a[s]/2;let m;switch(l){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-a.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Zg(t)){case"start":m[i]-=f*(n&&c?-1:1);break;case"end":m[i]+=f*(n&&c?-1:1)}return m}async function sy(e,t){var n;void 0===t&&(t={});const{x:r,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=Wg(t,e),h=ay(m),p=s[f?"floating"===d?"reference":"floating":d],g=oy(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(p)))||n?p:p.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},w=oy(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function ly(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cy(e){return Pg.some(t=>e[t]>=0)}const uy=new Set(["left","top"]);function dy(){return"undefined"!=typeof window}function fy(e){return py(e)?(e.nodeName||"").toLowerCase():"#document"}function my(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function hy(e){var t;return null==(t=(py(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function py(e){return!!dy()&&(e instanceof Node||e instanceof my(e).Node)}function gy(e){return!!dy()&&(e instanceof Element||e instanceof my(e).Element)}function yy(e){return!!dy()&&(e instanceof HTMLElement||e instanceof my(e).HTMLElement)}function vy(e){return!(!dy()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof my(e).ShadowRoot)}const by=new Set(["inline","contents"]);function wy(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Dy(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!by.has(a)}const Sy=new Set(["table","td","th"]);function xy(e){return Sy.has(fy(e))}const ky=[":popover-open",":modal"];function Ty(e){return ky.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Ay=["transform","translate","scale","rotate","perspective"],Ey=["transform","translate","scale","rotate","perspective","filter"],Cy=["paint","layout","strict","content"];function Ny(e){const t=_y(),n=gy(e)?Dy(e):e;return Ay.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Ey.some(e=>(n.willChange||"").includes(e))||Cy.some(e=>(n.contain||"").includes(e))}function _y(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ry=new Set(["html","body","#document"]);function Oy(e){return Ry.has(fy(e))}function Dy(e){return my(e).getComputedStyle(e)}function My(e){return gy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Py(e){if("html"===fy(e))return e;const t=e.assignedSlot||e.parentNode||vy(e)&&e.host||hy(e);return vy(t)?t.host:t}function Iy(e){const t=Py(e);return Oy(t)?e.ownerDocument?e.ownerDocument.body:e.body:yy(t)&&wy(t)?t:Iy(t)}function Ly(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=Iy(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=my(a);if(o){const e=Fy(i);return t.concat(i,i.visualViewport||[],wy(a)?a:[],e&&n?Ly(e):[])}return t.concat(a,Ly(a,[],n))}function Fy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zy(e){const t=Dy(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=yy(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=Fg(n)!==o||Fg(r)!==i;return s&&(n=o,r=i),{width:n,height:r,$:s}}function Uy(e){return gy(e)?e:e.contextElement}function Vy(e){const t=Uy(e);if(!yy(t))return Ug(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=zy(t);let i=(o?Fg(n.width):n.width)/r,s=(o?Fg(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const jy=Ug(0);function $y(e){const t=my(e);return _y()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:jy}function Wy(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=Uy(e);let i=Ug(1);t&&(r?gy(r)&&(i=Vy(r)):i=Vy(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==my(e))&&t}(o,n,r)?$y(o):Ug(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const e=my(o),t=r&&gy(r)?my(r):r;let n=e,a=Fy(n);for(;a&&r&&t!==n;){const e=Vy(a),t=a.getBoundingClientRect(),r=Dy(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=my(a),a=Fy(n)}}return oy({width:u,height:d,x:l,y:c})}function By(e,t){const n=My(e).scrollLeft;return t?t.left+n:Wy(hy(e)).left+n}function Zy(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-By(e,n),y:n.top+t.scrollTop}}const Hy=new Set(["absolute","fixed"]);function Gy(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=my(e),r=hy(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=_y();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}const c=By(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-a);i<=25&&(o-=i)}else c<=25&&(o+=c);return{width:o,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=hy(e),n=My(e),r=e.ownerDocument.body,a=Lg(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Lg(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+By(e);const s=-n.scrollTop;return"rtl"===Dy(r).direction&&(i+=Lg(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:s}}(hy(e));else if(gy(t))r=function(e,t){const n=Wy(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=yy(e)?Vy(e):Ug(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}(t,n);else{const n=$y(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oy(r)}function Ky(e,t){const n=Py(e);return!(n===t||!gy(n)||Oy(n))&&("fixed"===Dy(n).position||Ky(n,t))}function qy(e,t,n){const r=yy(t),a=hy(t),o="fixed"===n,i=Wy(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Ug(0);function c(){l.x=By(a)}if(r||!r&&!o)if(("body"!==fy(t)||wy(a))&&(s=My(t)),r){const e=Wy(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!r&&a&&c();const u=!a||r||o?Ug(0):Zy(a,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Jy(e){return"static"===Dy(e).position}function Yy(e,t){if(!yy(e)||"fixed"===Dy(e).position)return null;if(t)return t(e);let n=e.offsetParent;return hy(e)===n&&(n=n.ownerDocument.body),n}function Xy(e,t){const n=my(e);if(Ty(e))return n;if(!yy(e)){let t=Py(e);for(;t&&!Oy(t);){if(gy(t)&&!Jy(t))return t;t=Py(t)}return n}let r=Yy(e,t);for(;r&&xy(r)&&Jy(r);)r=Yy(r,t);return r&&Oy(r)&&Jy(r)&&!Ny(r)?n:r||function(e){let t=Py(e);for(;yy(t)&&!Oy(t);){if(Ny(t))return t;if(Ty(t))return null;t=Py(t)}return null}(e)||n}const Qy={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o="fixed"===a,i=hy(r),s=!!t&&Ty(t.floating);if(r===i||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ug(1);const u=Ug(0),d=yy(r);if((d||!d&&!o)&&(("body"!==fy(r)||wy(i))&&(l=My(r)),yy(r))){const e=Wy(r);c=Vy(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||o?Ug(0):Zy(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:hy,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o="clippingAncestors"===n?Ty(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ly(e,[],!1).filter(e=>gy(e)&&"body"!==fy(e)),a=null;const o="fixed"===Dy(e).position;let i=o?Py(e):e;for(;gy(i)&&!Oy(i);){const t=Dy(i),n=Ny(i);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&Hy.has(a.position)||wy(i)&&!n&&Ky(e,i))?r=r.filter(e=>e!==i):a=t,i=Py(i)}return t.set(e,r),r}(t,this._c):[].concat(n),i=[...o,r],s=i[0],l=i.reduce((e,n)=>{const r=Gy(t,n,a);return e.top=Lg(r.top,e.top),e.right=Ig(r.right,e.right),e.bottom=Ig(r.bottom,e.bottom),e.left=Lg(r.left,e.left),e},Gy(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Xy,getElementRects:async function(e){const t=this.getOffsetParent||Xy,n=this.getDimensions,r=await n(e.floating);return{reference:qy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=zy(e);return{width:t,height:n}},getScale:Vy,isElement:gy,isRTL:function(e){return"rtl"===Dy(e).direction}};function ev(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tv(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Uy(e),u=a||o?[...c?Ly(c):[],...Ly(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const a=hy(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(s||t(),!f||!m)return;const h={rootMargin:-zg(d)+"px "+-zg(a.clientWidth-(u+f))+"px "+-zg(a.clientHeight-(d+m))+"px "+-zg(u)+"px",threshold:Lg(0,Ig(1,l))||1};let p=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!p)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||ev(c,e.getBoundingClientRect())||i(),p=!1}try{r=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),o}(c,n):null;let f,m=-1,h=null;i&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p=l?Wy(e):null;return l&&function t(){const r=Wy(e);p&&!ev(p,r)&&n();p=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const nv=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:a}=e,o=await(null==r.isRTL?void 0:r.isRTL(a.floating)),i=Bg(n),s=Zg(n),l="y"===qg(n),c=uy.has(i)?-1:1,u=o&&l?-1:1,d=Wg(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(m="end"===s?-1*h:h),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},rv=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Wg(e,t),c={x:n,y:r},u=await sy(t,l),d=qg(Bg(a)),f=Hg(d);let m=c[f],h=c[d];if(o){const e="y"===f?"bottom":"right";m=$g(m+u["y"===f?"top":"left"],m,m-u[e])}if(i){const e="y"===d?"bottom":"right";h=$g(h+u["y"===d?"top":"left"],h,h-u[e])}const p=s.fn({...t,[f]:m,[d]:h});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:o,[d]:i}}}}}},av=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...g}=Wg(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const y=Bg(a),v=qg(s),b=Bg(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),S=f||(b||!p?[ry(s)]:function(e){const t=ry(e);return[Yg(e),t,Yg(t)]}(s)),x="none"!==h;!f&&x&&S.push(...ny(s,p,h,w));const k=[s,...S],T=await sy(t,g),A=[];let E=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&A.push(T[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Zg(e),a=Jg(e),o=Gg(a);let i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ry(i)),[i,ry(i)]}(a,i,w);A.push(T[e[0]],T[e[1]])}if(E=[...E,{placement:a,overflows:A}],!A.every(e=>e<=0)){var C,N;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==qg(t))||E.every(e=>qg(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:E},reset:{placement:t}}}let n=null==(N=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!n)switch(m){case"bestFit":{var _;const e=null==(_=E.filter(e=>{if(x){const t=qg(e.placement);return t===v||"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:_[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}},ov=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Wg(e,t),u=await sy(t,c),d=Bg(a),f=Zg(a),m="y"===qg(a),{width:h,height:p}=o.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=p-u.top-u.bottom,b=h-u.left-u.right,w=Ig(p-u[g],v),S=Ig(h-u[y],b),x=!t.middlewareData.shift;let k=w,T=S;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(T=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(k=v),x&&!f){const e=Lg(u.left,0),t=Lg(u.right,0),n=Lg(u.top,0),r=Lg(u.bottom,0);m?T=h-2*(0!==e||0!==t?e+t:Lg(u.left,u.right)):k=p-2*(0!==n||0!==r?n+r:Lg(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:k});const A=await i.getDimensions(s.floating);return h!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}},iv=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Wg(e,t);switch(r){case"referenceHidden":{const e=ly(await sy(t,{...a,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cy(e)}}}case"escaped":{const e=ly(await sy(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cy(e)}}}default:return{}}}}},sv=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Wg(e,t)||{};if(null==c)return{};const d=ay(u),f={x:n,y:r},m=Jg(a),h=Gg(m),p=await i.getDimensions(c),g="y"===m,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=o.reference[h]+o.reference[m]-f[m]-o.floating[h],S=f[m]-o.reference[m],x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let k=x?x[b]:0;k&&await(null==i.isElement?void 0:i.isElement(x))||(k=s.floating[b]||o.floating[h]);const T=w/2-S/2,A=k/2-p[h]/2-1,E=Ig(d[y],A),C=Ig(d[v],A),N=E,_=k-p[h]-C,R=k/2-p[h]/2+T,O=$g(N,R,_),D=!l.arrow&&null!=Zg(a)&&R!==O&&o.reference[h]/2-(R<N?E:C)-p[h]/2<0,M=D?R<N?R-N:R-_:0;return{[m]:f[m]+M,data:{[m]:O,centerOffset:R-O-M,...D&&{alignmentOffset:M}},reset:D}}}),lv=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Wg(e,t),u={x:n,y:r},d=qg(a),f=Hg(d);let m=u[f],h=u[d];const p=Wg(s,t),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+g.mainAxis,n=o.reference[f]+o.reference[e]-g.mainAxis;m<t?m=t:m>n&&(m=n)}if(c){var y,v;const e="y"===f?"width":"height",t=uy.has(Bg(a)),n=o.reference[d]-o.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=o.reference[d]+o.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:m,[d]:h}}}},cv=(e,t,n)=>{const r=new Map,a={platform:Qy,...n},o={...a.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=iy(c,r,l),f=r,m={},h=0;for(let n=0;n<s.length;n++){const{name:o,fn:p}=s[n],{x:g,y:y,data:v,reset:b}=await p({x:u,y:d,initialPlacement:r,placement:f,strategy:a,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,m={...m,[o]:{...m[o],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:u,y:d}=iy(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:a,middlewareData:m}})(e,t,{...a,platform:o})};var uv="undefined"!=typeof document?m:function(){};function dv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!dv(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!==r--;){const n=a[r];if(("_owner"!==n||!e.$$typeof)&&!dv(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function fv(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mv(e,t){const n=fv(e);return Math.round(t*n)/n}function hv(e){const t=r.useRef(e);return uv(()=>{t.current=e}),t}const pv=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(a=n,{}.hasOwnProperty.call(a,"current"))?null!=n.current?sv({element:n.current,padding:r}).fn(t):{}:n?sv({element:n,padding:r}).fn(t):{};var a}}),gv=(e,t)=>({...nv(e),options:[e,t]}),yv=(e,t)=>({...rv(e),options:[e,t]}),vv=(e,t)=>({...lv(e),options:[e,t]}),bv=(e,t)=>({...av(e),options:[e,t]}),wv=(e,t)=>({...ov(e),options:[e,t]}),Sv=(e,t)=>({...iv(e),options:[e,t]}),xv=(e,t)=>({...pv(e),options:[e,t]});var kv=r.forwardRef((t,n)=>{const{children:r,width:a=10,height:o=5,...i}=t;return e(Ei.svg,{...i,ref:n,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:e("polygon",{points:"0,0 30,0 15,10"})})});kv.displayName="Arrow";var Tv=kv,Av="Popper",[Ev,Cv]=Iu(Av),[Nv,_v]=Ev(Av),Rv=t=>{const{__scopePopper:n,children:a}=t,[o,i]=r.useState(null);return e(Nv,{scope:n,anchor:o,onAnchorChange:i,children:a})};Rv.displayName=Av;var Ov="PopperAnchor",Dv=r.forwardRef((t,n)=>{const{__scopePopper:a,virtualRef:o,...i}=t,s=_v(Ov,a),l=r.useRef(null),c=Go(n,l),u=r.useRef(null);return r.useEffect(()=>{const e=u.current;u.current=o?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),o?null:e(Ei.div,{...i,ref:c})});Dv.displayName=Ov;var Mv="PopperContent",[Pv,Iv]=Ev(Mv),Lv=r.forwardRef((t,n)=>{const{__scopePopper:a,side:o="bottom",sideOffset:i=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=t,b=_v(Mv,a),[w,S]=r.useState(null),x=Go(n,e=>S(e)),[k,T]=r.useState(null),A=ih(k),E=A?.width??0,C=A?.height??0,N=o+("center"!==s?"-"+s:""),_="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(d)?d:[d],O=R.length>0,D={padding:_,boundary:R.filter(Vv),altBoundary:O},{refs:M,floatingStyles:P,placement:I,isPositioned:L,middlewareData:F}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=r.useState(a);dv(m,a)||p(a);const[g,y]=r.useState(null),[v,b]=r.useState(null),w=r.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=r.useCallback(e=>{e!==A.current&&(A.current=e,b(e))},[]),x=i||g,k=s||v,T=r.useRef(null),A=r.useRef(null),E=r.useRef(d),C=null!=c,N=hv(c),_=hv(o),R=hv(u),O=r.useCallback(()=>{if(!T.current||!A.current)return;const e={placement:t,strategy:n,middleware:m};_.current&&(e.platform=_.current),cv(T.current,A.current,e).then(e=>{const t={...e,isPositioned:!1!==R.current};D.current&&!dv(E.current,t)&&(E.current=t,h.flushSync(()=>{f(t)}))})},[m,t,n,_,R]);uv(()=>{!1===u&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const D=r.useRef(!1);uv(()=>(D.current=!0,()=>{D.current=!1}),[]),uv(()=>{if(x&&(T.current=x),k&&(A.current=k),x&&k){if(N.current)return N.current(x,k,O);O()}},[x,k,O,N,C]);const M=r.useMemo(()=>({reference:T,floating:A,setReference:w,setFloating:S}),[w,S]),P=r.useMemo(()=>({reference:x,floating:k}),[x,k]),I=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=mv(P.floating,d.x),r=mv(P.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...fv(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,P.floating,d.x,d.y]);return r.useMemo(()=>({...d,update:O,refs:M,elements:P,floatingStyles:I}),[d,O,M,P,I])}({strategy:"fixed",placement:N,whileElementsMounted:(...e)=>tv(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[gv({mainAxis:i+C,alignmentAxis:l}),u&&yv({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?vv():void 0,...D}),u&&bv({...D}),wv({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),k&&xv({element:k,padding:c}),jv({arrowWidth:E,arrowHeight:C}),p&&Sv({strategy:"referenceHidden",...D})]}),[z,U]=$v(I),V=Fu(y);Uu(()=>{L&&V?.()},[L,V]);const j=F.arrow?.x,$=F.arrow?.y,W=0!==F.arrow?.centerOffset,[B,Z]=r.useState();return Uu(()=>{w&&Z(window.getComputedStyle(w).zIndex)},[w]),e("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:L?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e(Pv,{scope:a,placedSide:z,onArrowChange:T,arrowX:j,arrowY:$,shouldHideArrow:W,children:e(Ei.div,{"data-side":z,"data-align":U,...v,ref:x,style:{...v.style,animation:L?void 0:"none"}})})})});Lv.displayName=Mv;var Fv="PopperArrow",zv={top:"bottom",right:"left",bottom:"top",left:"right"},Uv=r.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=Iv(Fv,r),i=zv[o.placedSide];return e("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]: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:e(Tv,{...a,ref:n,style:{...a.style,display:"block"}})})});function Vv(e){return null!==e}Uv.displayName=Fv;var jv=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,i=o?0:e.arrowWidth,s=o?0:e.arrowHeight,[l,c]=$v(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+i/2,f=(a.arrow?.y??0)+s/2;let m="",h="";return"bottom"===l?(m=o?u:`${d}px`,h=-s+"px"):"top"===l?(m=o?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(m=-s+"px",h=o?u:`${f}px`):"left"===l&&(m=`${r.floating.width+s}px`,h=o?u:`${f}px`),{data:{x:m,y:h}}}});function $v(e){const[t,n="center"]=e.split("-");return[t,n]}var Wv=Rv,Bv=Dv,Zv=Lv,Hv=Uv,Gv="Popover",[Kv,qv]=Iu(Gv,[Cv]),Jv=Cv(),[Yv,Xv]=Kv(Gv),Qv=t=>{const{__scopePopover:n,children:a,open:o,defaultOpen:i,onOpenChange:s,modal:l=!1}=t,c=Jv(n),u=r.useRef(null),[d,f]=r.useState(!1),[m,h]=pd({prop:o,defaultProp:i??!1,onChange:s,caller:Gv});return e(Wv,{...c,children:e(Yv,{scope:n,contentId:md(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:r.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:l,children:a})})};Qv.displayName=Gv;var eb="PopoverAnchor";r.forwardRef((t,n)=>{const{__scopePopover:a,...o}=t,i=Xv(eb,a),s=Jv(a),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return r.useEffect(()=>(l(),()=>c()),[l,c]),e(Bv,{...s,...o,ref:n})}).displayName=eb;var tb="PopoverTrigger",nb=r.forwardRef((t,n)=>{const{__scopePopover:r,...a}=t,o=Xv(tb,r),i=Jv(r),s=Go(n,o.triggerRef),l=e(Ei.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":hb(o.open),...a,ref:s,onClick:ud(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:e(Bv,{asChild:!0,...i,children:l})});nb.displayName=tb;var rb="PopoverPortal",[ab,ob]=Kv(rb,{forceMount:void 0}),ib=t=>{const{__scopePopover:n,forceMount:r,children:a,container:o}=t,i=Xv(rb,n);return e(ab,{scope:n,forceMount:r,children:e(Id,{present:r||i.open,children:e(Pd,{asChild:!0,container:o,children:a})})})};ib.displayName=rb;var sb="PopoverContent",lb=r.forwardRef((t,n)=>{const r=ob(sb,t.__scopePopover),{forceMount:a=r.forceMount,...o}=t,i=Xv(sb,t.__scopePopover);return e(Id,{present:a||i.open,children:i.modal?e(ub,{...o,ref:n}):e(db,{...o,ref:n})})});lb.displayName=sb;var cb=Ko("PopoverContent.RemoveScroll"),ub=r.forwardRef((t,n)=>{const a=Xv(sb,t.__scopePopover),o=r.useRef(null),i=Go(n,o),s=r.useRef(!1);return r.useEffect(()=>{const e=o.current;if(e)return Pf(e)},[]),e(Cf,{as:cb,allowPinchZoom:!0,children:e(fb,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ud(t.onCloseAutoFocus,e=>{e.preventDefault(),s.current||a.triggerRef.current?.focus()}),onPointerDownOutside:ud(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:ud(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),db=r.forwardRef((t,n)=>{const a=Xv(sb,t.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return e(fb,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||a.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,r=a.triggerRef.current?.contains(n);r&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),fb=r.forwardRef((t,n)=>{const{__scopePopover:r,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=t,m=Xv(sb,r),h=Jv(r);return zd(),e(Cd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:i,children:e(Sd,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e(Zv,{"data-state":hb(m.open),role:"dialog",id:m.contentId,...h,...f,ref:n,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)"}})})})}),mb="PopoverClose";r.forwardRef((t,n)=>{const{__scopePopover:r,...a}=t,o=Xv(mb,r);return e(Ei.button,{type:"button",...a,ref:n,onClick:ud(t.onClick,()=>o.onOpenChange(!1))})}).displayName=mb;function hb(e){return e?"open":"closed"}r.forwardRef((t,n)=>{const{__scopePopover:r,...a}=t,o=Jv(r);return e(Hv,{...o,...a,ref:n})}).displayName="PopoverArrow";var pb=ib,gb=lb;const yb=Qv,vb=nb,bb=r.forwardRef(({className:t,align:n="center",sideOffset:a=4,...o},i)=>{const{container:s}=r.useContext(ie);return e(pb,{container:s,children:e(gb,{ref:i,align:n,sideOffset:a,className:Bo("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",t),...o})})});bb.displayName=gb.displayName;const wb={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"},Sb={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"},xb=[{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=Sb[e.code]||"USD",n=wb[t]||"";return{value:e.code,flag:(r=e.code,r.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:n};var r});function kb(t){const[r,a]=d(t.value||""),[o,i]=d(!1),s=xb.find(e=>e.value==r);return n(yb,{open:o,onOpenChange:i,children:[e(vb,{asChild:!0,children:n(Ai,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&n("div",{children:[String(s.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&e("span",{className:"text-muted-foreground",children:"Choose country"}),e(di,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(bb,{className:"p-0 overflow-hidden text-ellipsis",children:n(_g,{children:[e(Rg,{placeholder:"Choose country..."}),e(Og,{children:e(Dg,{children:xb.map(o=>n(Mg,{className:Bo("whitespace-nowrap text-left",{"text-green-500":r===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const n=o.value;a(n),t.onChange&&"function"==typeof t.onChange&&t.onChange(n),i(!1)},children:[r===o.value&&e(ui,{className:Bo("mr-2 h-4 w-4 text-green-400",r===o.value?"opacity-100":"opacity-0")}),String(o.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.flag})]},o.value))})})]})})]})}const Tb=xb.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Ab=Array.from(new Set(Tb.map(e=>e.value))).map(e=>Tb.find(t=>t.value===e)).filter(e=>void 0!==e);function Eb(t){const[r,a]=d(t.value||""),[o,i]=d(!1),s=Ab.find(e=>e.value==r);return n(yb,{open:o,onOpenChange:i,children:[e(vb,{asChild:!0,children:n(Ai,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&n("div",{children:[String(s.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.icon})]}),!s&&e("span",{className:"text-muted-foreground",children:"Choose Currency"}),e(di,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(bb,{className:"p-0 overflow-hidden text-ellipsis",children:n(_g,{children:[e(Rg,{placeholder:"Choose currency..."}),e(Og,{children:e(Dg,{children:Ab.map(o=>n(Mg,{className:Bo("whitespace-nowrap text-left",{"text-green-500":r===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const n=o.value;a(n),t.onChange&&"function"==typeof t.onChange&&t.onChange(n),i(!1)},children:[r===o.value&&e(ui,{className:Bo("mr-2 h-4 w-4 text-green-400",r===o.value?"opacity-100":"opacity-0")}),String(o.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.icon})]},o.value))})})]})})]})}class Cb extends Error{}class Nb extends Cb{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class _b extends Cb{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Rb extends Cb{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ob extends Cb{}class Db extends Cb{constructor(e){super(`Invalid unit ${e}`)}}class Mb extends Cb{}class Pb extends Cb{constructor(){super("Zone is an abstract class")}}const Ib="numeric",Lb="short",Fb="long",zb={year:Ib,month:Ib,day:Ib},Ub={year:Ib,month:Lb,day:Ib},Vb={year:Ib,month:Lb,day:Ib,weekday:Lb},jb={year:Ib,month:Fb,day:Ib},$b={year:Ib,month:Fb,day:Ib,weekday:Fb},Wb={hour:Ib,minute:Ib},Bb={hour:Ib,minute:Ib,second:Ib},Zb={hour:Ib,minute:Ib,second:Ib,timeZoneName:Lb},Hb={hour:Ib,minute:Ib,second:Ib,timeZoneName:Fb},Gb={hour:Ib,minute:Ib,hourCycle:"h23"},Kb={hour:Ib,minute:Ib,second:Ib,hourCycle:"h23"},qb={hour:Ib,minute:Ib,second:Ib,hourCycle:"h23",timeZoneName:Lb},Jb={hour:Ib,minute:Ib,second:Ib,hourCycle:"h23",timeZoneName:Fb},Yb={year:Ib,month:Ib,day:Ib,hour:Ib,minute:Ib},Xb={year:Ib,month:Ib,day:Ib,hour:Ib,minute:Ib,second:Ib},Qb={year:Ib,month:Lb,day:Ib,hour:Ib,minute:Ib},ew={year:Ib,month:Lb,day:Ib,hour:Ib,minute:Ib,second:Ib},tw={year:Ib,month:Lb,day:Ib,weekday:Lb,hour:Ib,minute:Ib},nw={year:Ib,month:Fb,day:Ib,hour:Ib,minute:Ib,timeZoneName:Lb},rw={year:Ib,month:Fb,day:Ib,hour:Ib,minute:Ib,second:Ib,timeZoneName:Lb},aw={year:Ib,month:Fb,day:Ib,weekday:Fb,hour:Ib,minute:Ib,timeZoneName:Fb},ow={year:Ib,month:Fb,day:Ib,weekday:Fb,hour:Ib,minute:Ib,second:Ib,timeZoneName:Fb};class iw{get type(){throw new Pb}get name(){throw new Pb}get ianaName(){return this.name}get isUniversal(){throw new Pb}offsetName(e,t){throw new Pb}formatOffset(e,t){throw new Pb}offset(e){throw new Pb}equals(e){throw new Pb}get isValid(){throw new Pb}}let sw=null;class lw extends iw{static get instance(){return null===sw&&(sw=new lw),sw}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return NS(e,t,n)}formatOffset(e,t){return DS(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const cw=new Map;const uw={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const dw=new Map;class fw extends iw{static create(e){let t=dw.get(e);return void 0===t&&dw.set(e,t=new fw(e)),t}static resetCache(){dw.clear(),cw.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=fw.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return NS(e,t,n,this.name)}formatOffset(e,t){return DS(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const n=function(e){let t=cw.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),cw.set(e,t)),t}(this.name);let[r,a,o,i,s,l,c]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:a}=n[e],o=uw[t];"era"===t?r[o]=a:sS(o)||(r[o]=parseInt(a,10))}return r}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,o,i,s,l,c,u]=r;return[i,a,o,s,l,c,u]}(n,t);"BC"===i&&(r=1-Math.abs(r));let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(TS({year:r,month:a,day:o,hour:24===s?0:s,minute:l,second:c,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let mw={};const hw=new Map;function pw(e,t={}){const n=JSON.stringify([e,t]);let r=hw.get(n);return void 0===r&&(r=new Intl.DateTimeFormat(e,t),hw.set(n,r)),r}const gw=new Map;const yw=new Map;let vw=null;const bw=new Map;function ww(e){let t=bw.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),bw.set(e,t)),t}const Sw=new Map;function xw(e,t,n,r){const a=e.listingMode();return"error"===a?null:"en"===a?n(t):r(t)}class kw{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:a,...o}=n;if(!t||Object.keys(o).length>0){const t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=gw.get(n);return void 0===r&&(r=new Intl.NumberFormat(e,t),gw.set(n,r)),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return gS(this.floor?Math.floor(e):wS(e,3),this.padTo)}}class Tw{constructor(e,t,n){let r;if(this.opts=n,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&fw.create(n).valid?(r=n,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||r,this.dtf=pw(t,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Aw{constructor(e,t,n){this.opts={style:"long",...n},!t&&uS()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let o=yw.get(a);return void 0===o&&(o=new Intl.RelativeTimeFormat(e,t),yw.set(a,o)),o}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&o){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${a[e][0]}`;case-1:return n?"yesterday":`last ${a[e][0]}`;case 0:return n?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,s=Math.abs(t),l=1===s,c=a[e],u=r?l?c[1]:c[2]||c[1]:l?a[e][0]:e;return i?`${s} ${u} ago`:`in ${s} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const Ew={firstDay:1,minimalDays:4,weekend:[6,7]};class Cw{static fromOpts(e){return Cw.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,a=!1){const o=e||Zw.defaultLocale,i=o||(a?"en-US":vw||(vw=(new Intl.DateTimeFormat).resolvedOptions().locale,vw)),s=t||Zw.defaultNumberingSystem,l=n||Zw.defaultOutputCalendar,c=hS(r)||Zw.defaultWeekSettings;return new Cw(i,s,l,c,o)}static resetCache(){vw=null,hw.clear(),gw.clear(),yw.clear(),bw.clear(),Sw.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return Cw.create(e,t,n,r)}constructor(e,t,n,r,a){const[o,i,s]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(-1===n)return[e];{let t,r;try{t=pw(e).resolvedOptions(),r=e}catch(a){const o=e.substring(0,n);t=pw(o).resolvedOptions(),r=o}const{numberingSystem:a,calendar:o}=t;return[r,a,o]}}(e);this.locale=o,this.numberingSystem=t||i||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===ww(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Cw.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,hS(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return xw(this,e,FS,()=>{const n="ja"===this.intl||this.intl.startsWith("ja-"),r=(t&=!n)?{month:e,day:"numeric"}:{month:e},a=t?"format":"standalone";if(!this.monthsCache[a][e]){const t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,"month");this.monthsCache[a][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=$k.utc(2009,n,1);t.push(e(r))}return t}(t)}return this.monthsCache[a][e]})}weekdays(e,t=!1){return xw(this,e,jS,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=$k.utc(2016,11,13+n);t.push(e(r))}return t}(e=>this.extract(e,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return xw(this,void 0,()=>$S,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[$k.utc(2016,11,13,9),$k.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return xw(this,e,HS,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[$k.utc(-40,1,1),$k.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new kw(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Tw(e,this.intl,t)}relFormatter(e={}){return new Aw(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const n=JSON.stringify([e,t]);let r=mw[n];return r||(r=new Intl.ListFormat(e,t),mw[n]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||ww(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:dS()?function(e){let t=Sw.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...Ew,...t}),Sw.set(e,t)}return t}(this.locale):Ew}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Nw=null;class _w extends iw{static get utcInstance(){return null===Nw&&(Nw=new _w(0)),Nw}static instance(e){return 0===e?_w.utcInstance:new _w(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new _w(_S(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${DS(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${DS(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return DS(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Rw extends iw{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ow(e,t){if(sS(e)||null===e)return t;if(e instanceof iw)return e;if(function(e){return"string"==typeof e}(e)){const n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?lw.instance:"utc"===n||"gmt"===n?_w.utcInstance:_w.parseSpecifier(n)||fw.create(e)}return lS(e)?_w.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new Rw(e)}const Dw={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mw={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Pw=Dw.hanidec.replace(/[\[|\]]/g,"").split("");const Iw=new Map;function Lw({numberingSystem:e},t=""){const n=e||"latn";let r=Iw.get(n);void 0===r&&(r=new Map,Iw.set(n,r));let a=r.get(t);return void 0===a&&(a=new RegExp(`${Dw[n]}${t}`),r.set(t,a)),a}let Fw,zw=()=>Date.now(),Uw="system",Vw=null,jw=null,$w=null,Ww=60,Bw=null;class Zw{static get now(){return zw}static set now(e){zw=e}static set defaultZone(e){Uw=e}static get defaultZone(){return Ow(Uw,lw.instance)}static get defaultLocale(){return Vw}static set defaultLocale(e){Vw=e}static get defaultNumberingSystem(){return jw}static set defaultNumberingSystem(e){jw=e}static get defaultOutputCalendar(){return $w}static set defaultOutputCalendar(e){$w=e}static get defaultWeekSettings(){return Bw}static set defaultWeekSettings(e){Bw=hS(e)}static get twoDigitCutoffYear(){return Ww}static set twoDigitCutoffYear(e){Ww=e%100}static get throwOnInvalid(){return Fw}static set throwOnInvalid(e){Fw=e}static resetCaches(){Cw.resetCache(),fw.resetCache(),$k.resetCache(),Iw.clear()}}class Hw{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Gw=[0,31,59,90,120,151,181,212,243,273,304,334],Kw=[0,31,60,91,121,152,182,213,244,274,305,335];function qw(e,t){return new Hw("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Jw(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return 0===a?7:a}function Yw(e,t,n){return n+(SS(e)?Kw:Gw)[t-1]}function Xw(e,t){const n=SS(e)?Kw:Gw,r=n.findIndex(e=>e<t);return{month:r+1,day:t-n[r]}}function Qw(e,t){return(e-t+7)%7+1}function eS(e,t=4,n=1){const{year:r,month:a,day:o}=e,i=Yw(r,a,o),s=Qw(Jw(r,a,o),n);let l,c=Math.floor((i-s+14-t)/7);return c<1?(l=r-1,c=ES(l,t,n)):c>ES(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...MS(e)}}function tS(e,t=4,n=1){const{weekYear:r,weekNumber:a,weekday:o}=e,i=Qw(Jw(r,1,t),n),s=xS(r);let l,c=7*a+o-i-7+t;c<1?(l=r-1,c+=xS(l)):c>s?(l=r+1,c-=xS(r)):l=r;const{month:u,day:d}=Xw(l,c);return{year:l,month:u,day:d,...MS(e)}}function nS(e){const{year:t,month:n,day:r}=e;return{year:t,ordinal:Yw(t,n,r),...MS(e)}}function rS(e){const{year:t,ordinal:n}=e,{month:r,day:a}=Xw(t,n);return{year:t,month:r,day:a,...MS(e)}}function aS(e,t){if(!sS(e.localWeekday)||!sS(e.localWeekNumber)||!sS(e.localWeekYear)){if(!sS(e.weekday)||!sS(e.weekNumber)||!sS(e.weekYear))throw new Ob("Cannot mix locale-based week fields with ISO-based week fields");return sS(e.localWeekday)||(e.weekday=e.localWeekday),sS(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),sS(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function oS(e){const t=cS(e.year),n=pS(e.month,1,12),r=pS(e.day,1,kS(e.year,e.month));return t?n?!r&&qw("day",e.day):qw("month",e.month):qw("year",e.year)}function iS(e){const{hour:t,minute:n,second:r,millisecond:a}=e,o=pS(t,0,23)||24===t&&0===n&&0===r&&0===a,i=pS(n,0,59),s=pS(r,0,59),l=pS(a,0,999);return o?i?s?!l&&qw("millisecond",a):qw("second",r):qw("minute",n):qw("hour",t)}function sS(e){return void 0===e}function lS(e){return"number"==typeof e}function cS(e){return"number"==typeof e&&e%1==0}function uS(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function dS(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function fS(e,t,n){if(0!==e.length)return e.reduce((e,r)=>{const a=[t(r),r];return e&&n(e[0],a[0])===e[0]?e:a},null)[1]}function mS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function hS(e){if(null==e)return null;if("object"!=typeof e)throw new Mb("Week settings must be an object");if(!pS(e.firstDay,1,7)||!pS(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!pS(e,1,7)))throw new Mb("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function pS(e,t,n){return cS(e)&&e>=t&&e<=n}function gS(e,t=2){let n;return n=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),n}function yS(e){return sS(e)||null===e||""===e?void 0:parseInt(e,10)}function vS(e){return sS(e)||null===e||""===e?void 0:parseFloat(e)}function bS(e){if(!sS(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function wS(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function SS(e){return e%4==0&&(e%100!=0||e%400==0)}function xS(e){return SS(e)?366:365}function kS(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?SS(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function TS(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function AS(e,t,n){return-Qw(Jw(e,1,t),n)+t-1}function ES(e,t=4,n=1){const r=AS(e,t,n),a=AS(e+1,t,n);return(xS(e)-r+a)/7}function CS(e){return e>99?e:e>Zw.twoDigitCutoffYear?1900+e:2e3+e}function NS(e,t,n,r=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const i={timeZoneName:t,...o},s=new Intl.DateTimeFormat(n,i).formatToParts(a).find(e=>"timezonename"===e.type.toLowerCase());return s?s.value:null}function _S(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function RS(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new Mb(`Invalid unit value ${e}`);return t}function OS(e,t){const n={};for(const r in e)if(mS(e,r)){const a=e[r];if(null==a)continue;n[t(r)]=RS(a)}return n}function DS(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${gS(n,2)}:${gS(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${gS(n,2)}${gS(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function MS(e){return function(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}(e,["hour","minute","second","millisecond"])}const PS=["January","February","March","April","May","June","July","August","September","October","November","December"],IS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],LS=["J","F","M","A","M","J","J","A","S","O","N","D"];function FS(e){switch(e){case"narrow":return[...LS];case"short":return[...IS];case"long":return[...PS];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const zS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],US=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],VS=["M","T","W","T","F","S","S"];function jS(e){switch(e){case"narrow":return[...VS];case"short":return[...US];case"long":return[...zS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const $S=["AM","PM"],WS=["Before Christ","Anno Domini"],BS=["BC","AD"],ZS=["B","A"];function HS(e){switch(e){case"narrow":return[...ZS];case"short":return[...BS];case"long":return[...WS];default:return null}}function GS(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const KS={D:zb,DD:Ub,DDD:jb,DDDD:$b,t:Wb,tt:Bb,ttt:Zb,tttt:Hb,T:Gb,TT:Kb,TTT:qb,TTTT:Jb,f:Yb,ff:Qb,fff:nw,ffff:aw,F:Xb,FF:ew,FFF:rw,FFFF:ow};class qS{static create(e,t={}){return new qS(e,t)}static parseFormat(e){let t=null,n="",r=!1;const a=[];for(let o=0;o<e.length;o++){const i=e.charAt(o);"'"===i?((n.length>0||r)&&a.push({literal:r||/^\s+$/.test(n),val:""===n?"'":n}),t=null,n="",r=!r):r||i===t?n+=i:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=i,t=i)}return n.length>0&&a.push({literal:r||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(e){return KS[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return gS(e,t);const r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,a=(t,n)=>this.loc.extract(e,t,n),o=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>n?function(e){return $S[e.hour<12?0:1]}(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),s=(t,r)=>n?function(e,t){return FS(t)[e.month-1]}(e,t):a(r?{month:t}:{month:t,day:"numeric"},"month"),l=(t,r)=>n?function(e,t){return jS(t)[e.weekday-1]}(e,t):a(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const n=qS.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},u=t=>n?function(e,t){return HS(t)[e.year<0?0:1]}(e,t):a({era:t},"era");return GS(qS.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return r?a({day:"numeric"},"day"):this.num(e.day);case"dd":return r?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return s("short",!0);case"LLLL":return s("long",!0);case"LLLLL":return s("narrow",!0);case"M":return r?a({month:"numeric"},"month"):this.num(e.month);case"MM":return r?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return s("short",!1);case"MMMM":return s("long",!1);case"MMMMM":return s("narrow",!1);case"y":return r?a({year:"numeric"},"year"):this.num(e.year);case"yy":return r?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}})}formatDurationFromString(e,t){const n="negativeLargestOnly"===this.opts.signMode?-1:1,r=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},a=qS.parseFormat(t),o=a.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),i=e.shiftTo(...o.map(r).filter(e=>e));return GS(a,((e,t)=>a=>{const o=r(a);if(o){const r=t.isNegativeDuration&&o!==t.largestUnit?n:1;let i;return i="negativeLargestOnly"===this.opts.signMode&&o!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(o)*r,a.length,i)}return a})(i,{isNegativeDuration:i<0,largestUnit:Object.keys(i.values)[0]}))}}const JS=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function YS(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function XS(...e){return t=>e.reduce(([e,n,r],a)=>{const[o,i,s]=a(t,r);return[{...e,...o},i||n,s]},[{},null,1]).slice(0,2)}function QS(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function ex(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=yS(t[n+a]);return[r,null,n+a]}}const tx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,nx=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,rx=RegExp(`${nx.source}${`(?:${tx.source}?(?:\\[(${JS.source})\\])?)?`}`),ax=RegExp(`(?:[Tt]${rx.source})?`),ox=ex("weekYear","weekNumber","weekDay"),ix=ex("year","ordinal"),sx=RegExp(`${nx.source} ?(?:${tx.source}|(${JS.source}))?`),lx=RegExp(`(?: ${sx.source})?`);function cx(e,t,n){const r=e[t];return sS(r)?n:yS(r)}function ux(e,t){return[{hours:cx(e,t,0),minutes:cx(e,t+1,0),seconds:cx(e,t+2,0),milliseconds:bS(e[t+3])},null,t+4]}function dx(e,t){const n=!e[t]&&!e[t+1],r=_S(e[t+1],e[t+2]);return[{},n?null:_w.instance(r),t+3]}function fx(e,t){return[{},e[t]?fw.create(e[t]):null,t+1]}const mx=RegExp(`^T?${nx.source}$`),hx=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function px(e){const[t,n,r,a,o,i,s,l,c]=e,u="-"===t[0],d=l&&"-"===l[0],f=(e,t=!1)=>void 0!==e&&(t||e&&u)?-e:e;return[{years:f(vS(n)),months:f(vS(r)),weeks:f(vS(a)),days:f(vS(o)),hours:f(vS(i)),minutes:f(vS(s)),seconds:f(vS(l),"-0"===l),milliseconds:f(bS(c),d)}]}const gx={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function yx(e,t,n,r,a,o,i){const s={year:2===t.length?CS(yS(t)):yS(t),month:IS.indexOf(n)+1,day:yS(r),hour:yS(a),minute:yS(o)};return i&&(s.second=yS(i)),e&&(s.weekday=e.length>3?zS.indexOf(e)+1:US.indexOf(e)+1),s}const vx=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function bx(e){const[,t,n,r,a,o,i,s,l,c,u,d]=e,f=yx(t,a,r,n,o,i,s);let m;return m=l?gx[l]:c?0:_S(u,d),[f,new _w(m)]}const wx=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Sx=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,xx=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function kx(e){const[,t,n,r,a,o,i,s]=e;return[yx(t,a,r,n,o,i,s),_w.utcInstance]}function Tx(e){const[,t,n,r,a,o,i,s]=e;return[yx(t,s,n,r,a,o,i),_w.utcInstance]}const Ax=YS(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ax),Ex=YS(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ax),Cx=YS(/(\d{4})-?(\d{3})/,ax),Nx=YS(rx),_x=XS(function(e,t){return[{year:cx(e,t),month:cx(e,t+1,1),day:cx(e,t+2,1)},null,t+3]},ux,dx,fx),Rx=XS(ox,ux,dx,fx),Ox=XS(ix,ux,dx,fx),Dx=XS(ux,dx,fx);const Mx=XS(ux);const Px=YS(/(\d{4})-(\d\d)-(\d\d)/,lx),Ix=YS(sx),Lx=XS(ux,dx,fx);const Fx="Invalid Duration",zx={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Ux={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...zx},Vx=365.2425,jx=30.436875,$x={years:{quarters:4,months:12,weeks:52.1775,days:Vx,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:jx,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...zx},Wx=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Bx=Wx.slice(0).reverse();function Zx(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new qx(r)}function Hx(e,t){let n=t.milliseconds??0;for(const r of Bx.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Gx(e,t){const n=Hx(e,t)<0?-1:1;Wx.reduceRight((r,a)=>{if(sS(t[a]))return r;if(r){const o=t[r]*n,i=e[a][r],s=Math.floor(o/i);t[a]+=s*n,t[r]-=s*i*n}return a},null),Wx.reduce((n,r)=>{if(sS(t[r]))return n;if(n){const a=t[n]%1;t[n]-=a,t[r]+=a*e[n][r]}return r},null)}function Kx(e){const t={};for(const[n,r]of Object.entries(e))0!==r&&(t[n]=r);return t}class qx{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let n=t?$x:Ux;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||Cw.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return qx.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new Mb("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new qx({values:OS(e,qx.normalizeUnit),loc:Cw.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(lS(e))return qx.fromMillis(e);if(qx.isDuration(e))return e;if("object"==typeof e)return qx.fromObject(e);throw new Mb(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=function(e){return QS(e,[hx,px])}(e);return n?qx.fromObject(n,t):qx.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=function(e){return QS(e,[mx,Mx])}(e);return n?qx.fromObject(n,t):qx.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Mb("need to specify a reason the Duration is invalid");const n=e instanceof Hw?e:new Hw(e,t);if(Zw.throwOnInvalid)throw new Rb(n);return new qx({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new Db(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?qS.create(this.loc,n).formatDurationFromString(this,e):Fx}toHuman(e={}){if(!this.isValid)return Fx;const t=!1!==e.showZeros,n=Wx.map(n=>{const r=this.values[n];return sS(r)||0===r&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=wS(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return $k.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Hx(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=qx.fromDurationLike(e),n={};for(const e of Wx)(mS(t.values,e)||mS(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Zx(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=qx.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=RS(e(this.values[n],n));return Zx(this,{values:t},!0)}get(e){return this[qx.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Zx(this,{values:{...this.values,...OS(e,qx.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){return Zx(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Gx(this.matrix,e),Zx(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return Zx(this,{values:Kx(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>qx.normalizeUnit(e));const t={},n={},r=this.toObject();let a;for(const o of Wx)if(e.indexOf(o)>=0){a=o;let e=0;for(const t in n)e+=this.matrix[t][o]*n[t],n[t]=0;lS(r[o])&&(e+=r[o]);const i=Math.trunc(e);t[o]=i,n[o]=(1e3*e-1e3*i)/1e3}else lS(r[o])&&(n[o]=r[o]);for(const e in n)0!==n[e]&&(t[a]+=e===a?n[e]:n[e]/this.matrix[a][e]);return Gx(this.matrix,t),Zx(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Zx(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return Zx(this,{values:Kx(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const n of Wx)if(!t(this.values[n],e.values[n]))return!1;return!0}}const Jx="Invalid Interval";class Yx{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Mb("need to specify a reason the Interval is invalid");const n=e instanceof Hw?e:new Hw(e,t);if(Zw.throwOnInvalid)throw new _b(n);return new Yx({invalid:n})}static fromDateTimes(e,t){const n=Wk(e),r=Wk(t),a=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Yx.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:Yx.invalid("missing or invalid end"):Yx.invalid("missing or invalid start")}(n,r);return null==a?new Yx({start:n,end:r}):a}static after(e,t){const n=qx.fromDurationLike(t),r=Wk(e);return Yx.fromDateTimes(r,r.plus(n))}static before(e,t){const n=qx.fromDurationLike(t),r=Wk(e);return Yx.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){let e,a,o,i;try{e=$k.fromISO(n,t),a=e.isValid}catch(r){a=!1}try{o=$k.fromISO(r,t),i=o.isValid}catch(r){i=!1}if(a&&i)return Yx.fromDateTimes(e,o);if(a){const n=qx.fromISO(r,t);if(n.isValid)return Yx.after(e,n)}else if(i){const e=qx.fromISO(n,t);if(e.isValid)return Yx.before(o,e)}}return Yx.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const n=this.start.startOf(e,t);let r;return r=t?.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Yx.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Wk).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),n=[];let{s:r}=this,a=0;for(;r<this.e;){const e=t[a]||this.e,o=+e>+this.e?this.e:e;n.push(Yx.fromDateTimes(r,o)),r=o,a+=1}return n}splitBy(e){const t=qx.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,{s:r}=this,a=1;const o=[];for(;r<this.e;){const e=this.start.plus(t.mapUnits(e=>e*a));n=+e>+this.e?this.e:e,o.push(Yx.fromDateTimes(r,n)),r=n,a+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>=n?null:Yx.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return Yx.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],a=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(const e of o)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!==+e.time&&r.push(Yx.fromDateTimes(t,e.time)),t=null);return Yx.merge(r)}difference(...e){return Yx.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Jx}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=zb,t={}){return this.isValid?qS.create(this.s.loc.clone(t),e).formatInterval(this):Jx}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Jx}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Jx}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Jx}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Jx}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):qx.invalid(this.invalidReason)}mapEndpoints(e){return Yx.fromDateTimes(e(this.s),e(this.e))}}class Xx{static hasDST(e=Zw.defaultZone){const t=$k.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return fw.isValidZone(e)}static normalizeZone(e){return Ow(e,Zw.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Cw.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Cw.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Cw.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:a="gregory"}={}){return(r||Cw.create(t,n,a)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:a="gregory"}={}){return(r||Cw.create(t,n,a)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Cw.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Cw.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Cw.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Cw.create(t,null,"gregory").eras(e)}static features(){return{relative:uS(),localeWeek:dS()}}}function Qx(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(qx.fromMillis(r).as("days"))}function ek(e,t,n,r){let[a,o,i,s]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Qx(e,t);return(n-n%7)/7}],["days",Qx]],a={},o=e;let i,s;for(const[l,c]of r)n.indexOf(l)>=0&&(i=l,a[l]=c(e,t),s=o.plus(a),s>t?(a[l]--,(e=o.plus(a))>t&&(s=e,a[l]--,e=o.plus(a))):e=s);return[e,a,s,i]}(e,t,n);const l=t-a,c=n.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(i<t&&(i=a.plus({[s]:1})),i!==a&&(o[s]=(o[s]||0)+l/(i-a)));const u=qx.fromObject(o,r);return c.length>0?qx.fromMillis(l,r).shiftTo(...c).plus(u):u}function tk(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(-1!==e[n].search(Dw.hanidec))t+=Pw.indexOf(e[n]);else for(const e in Mw){const[n,a]=Mw[e];r>=n&&r<=a&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}const nk=`[ ${String.fromCharCode(160)}]`,rk=new RegExp(nk,"g");function ak(e){return e.replace(/\./g,"\\.?").replace(rk,nk)}function ok(e){return e.replace(/\./g,"").replace(rk," ").toLowerCase()}function ik(e,t){return null===e?null:{regex:RegExp(e.map(ak).join("|")),deser:([n])=>e.findIndex(e=>ok(n)===ok(e))+t}}function sk(e,t){return{regex:e,deser:([,e,t])=>_S(e,t),groups:t}}function lk(e){return{regex:e,deser:([e])=>e}}const ck={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let uk=null;function dk(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const n=hk(qS.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)))}class fk{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=dk(qS.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const n=Lw(t),r=Lw(t,"{2}"),a=Lw(t,"{3}"),o=Lw(t,"{4}"),i=Lw(t,"{6}"),s=Lw(t,"{1,2}"),l=Lw(t,"{1,3}"),c=Lw(t,"{1,6}"),u=Lw(t,"{1,9}"),d=Lw(t,"{2,4}"),f=Lw(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},h=(h=>{if(e.literal)return m(h);switch(h.val){case"G":return ik(t.eras("short"),0);case"GG":return ik(t.eras("long"),0);case"y":return tk(c);case"yy":case"kk":return tk(d,CS);case"yyyy":case"kkkk":return tk(o);case"yyyyy":return tk(f);case"yyyyyy":return tk(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return tk(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return tk(r);case"MMM":return ik(t.months("short",!0),1);case"MMMM":return ik(t.months("long",!0),1);case"LLL":return ik(t.months("short",!1),1);case"LLLL":return ik(t.months("long",!1),1);case"o":case"S":return tk(l);case"ooo":case"SSS":return tk(a);case"u":return lk(u);case"uu":return lk(s);case"uuu":case"E":case"c":return tk(n);case"a":return ik(t.meridiems(),0);case"EEE":return ik(t.weekdays("short",!1),1);case"EEEE":return ik(t.weekdays("long",!1),1);case"ccc":return ik(t.weekdays("short",!0),1);case"cccc":return ik(t.weekdays("long",!0),1);case"Z":case"ZZ":return sk(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return sk(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return lk(/[a-z_+-/]{1,256}?/i);case" ":return lk(/[^\S\n\r]/);default:return m(h)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return h.token=e,h}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=function(e){const t=e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"");return[`^${t}$`,e]}(this.units);this.regex=RegExp(e,"i"),this.handlers=t}}explainFromTokens(e){if(this.isValid){const[t,n]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const a in n)if(mS(n,a)){const o=n[a],i=o.groups?o.groups+1:1;!o.literal&&o.token&&(e[o.token.val[0]]=o.deser(r.slice(t,t+i))),t+=i}return[r,e]}return[r,{}]}(e,this.regex,this.handlers),[r,a,o]=n?function(e){let t,n=null;sS(e.z)||(n=fw.create(e.z)),sS(e.Z)||(n||(n=new _w(e.Z)),t=e.Z),sS(e.q)||(e.M=3*(e.q-1)+1),sS(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),sS(e.u)||(e.S=bS(e.u));const r=Object.keys(e).reduce((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t},{});return[r,n,t]}(n):[null,null,void 0];if(mS(n,"a")&&mS(n,"H"))throw new Ob("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:a,specificOffset:o}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function mk(e,t,n){return new fk(e,n).explainFromTokens(t)}function hk(e,t){if(!e)return null;const n=qS.create(t,e).dtFormatter((uk||(uk=$k.fromMillis(1555555555555)),uk)),r=n.formatToParts(),a=n.resolvedOptions();return r.map(t=>function(e,t,n){const{type:r,value:a}=e;if("literal"===r){const e=/^\s+$/.test(a);return{literal:!e,val:e?" ":a}}const o=t[r];let i=r;"hour"===r&&(i=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");let s=ck[i];if("object"==typeof s&&(s=s[o]),s)return{literal:!1,val:s}}(t,e,a))}const pk="Invalid DateTime",gk=864e13;function yk(e){return new Hw("unsupported zone",`the zone "${e.name}" is not supported`)}function vk(e){return null===e.weekData&&(e.weekData=eS(e.c)),e.weekData}function bk(e){return null===e.localWeekData&&(e.localWeekData=eS(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function wk(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new $k({...n,...t,old:n})}function Sk(e,t,n){let r=e-60*t*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=60*(a-t)*1e3;const o=n.offset(r);return a===o?[r,a]:[e-60*Math.min(a,o)*1e3,Math.max(a,o)]}function xk(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function kk(e,t,n){return Sk(TS(e),t,n)}function Tk(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o={...e.c,year:r,month:a,day:Math.min(e.c.day,kS(r,a))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},i=qx.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=TS(o);let[l,c]=Sk(s,n,e.zone);return 0!==i&&(l+=i,c=e.zone.offset(l)),{ts:l,o:c}}function Ak(e,t,n,r,a,o){const{setZone:i,zone:s}=n;if(e&&0!==Object.keys(e).length||t){const r=t||s,a=$k.fromObject(e,{...n,zone:r,specificOffset:o});return i?a:a.setZone(s)}return $k.invalid(new Hw("unparsable",`the input "${a}" can't be parsed as ${r}`))}function Ek(e,t,n=!0){return e.isValid?qS.create(Cw.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ck(e,t,n){const r=e.c.year>9999||e.c.year<0;let a="";if(r&&e.c.year>=0&&(a+="+"),a+=gS(e.c.year,r?6:4),"year"===n)return a;if(t){if(a+="-",a+=gS(e.c.month),"month"===n)return a;a+="-"}else if(a+=gS(e.c.month),"month"===n)return a;return a+=gS(e.c.day),a}function Nk(e,t,n,r,a,o,i){let s=!n||0!==e.c.millisecond||0!==e.c.second,l="";switch(i){case"day":case"month":case"year":break;default:if(l+=gS(e.c.hour),"hour"===i)break;if(t){if(l+=":",l+=gS(e.c.minute),"minute"===i)break;s&&(l+=":",l+=gS(e.c.second))}else{if(l+=gS(e.c.minute),"minute"===i)break;s&&(l+=gS(e.c.second))}if("second"===i)break;!s||r&&0===e.c.millisecond||(l+=".",l+=gS(e.c.millisecond,3))}return a&&(e.isOffsetFixed&&0===e.offset&&!o?l+="Z":e.o<0?(l+="-",l+=gS(Math.trunc(-e.o/60)),l+=":",l+=gS(Math.trunc(-e.o%60))):(l+="+",l+=gS(Math.trunc(e.o/60)),l+=":",l+=gS(Math.trunc(e.o%60)))),o&&(l+="["+e.zone.ianaName+"]"),l}const _k={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Rk={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ok={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Dk=["year","month","day","hour","minute","second","millisecond"],Mk=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Pk=["year","ordinal","hour","minute","second","millisecond"];function Ik(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Db(e);return t}function Lk(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ik(e)}}function Fk(e,t){const n=Ow(t.zone,Zw.defaultZone);if(!n.isValid)return $k.invalid(yk(n));const r=Cw.fromObject(t);let a,o;if(sS(e.year))a=Zw.now();else{for(const t of Dk)sS(e[t])&&(e[t]=_k[t]);const t=oS(e)||iS(e);if(t)return $k.invalid(t);const r=function(e){if(void 0===Vk&&(Vk=Zw.now()),"iana"!==e.type)return e.offset(Vk);const t=e.name;let n=jk.get(t);return void 0===n&&(n=e.offset(Vk),jk.set(t,n)),n}(n);[a,o]=kk(e,r,n)}return new $k({ts:a,zone:n,loc:r,o:o})}function zk(e,t,n){const r=!!sS(n.round)||n.round,a=sS(n.rounding)?"trunc":n.rounding,o=(e,o)=>{e=wS(e,r||n.calendary?0:2,n.calendary?"round":a);return t.loc.clone(n).relFormatter(n).format(e,o)},i=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return o(i(n.unit),n.unit);for(const e of n.units){const t=i(e);if(Math.abs(t)>=1)return o(t,e)}return o(e>t?-0:0,n.units[n.units.length-1])}function Uk(e){let t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}let Vk;const jk=new Map;class $k{constructor(e){const t=e.zone||Zw.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Hw("invalid input"):null)||(t.isValid?null:yk(t));this.ts=sS(e.ts)?Zw.now():e.ts;let r=null,a=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,a]=[e.old.c,e.old.o];else{const o=lS(e.o)&&!e.old?e.o:t.offset(this.ts);r=xk(this.ts,o),n=Number.isNaN(r.year)?new Hw("invalid input"):null,r=n?null:r,a=n?null:o}}this._zone=t,this.loc=e.loc||Cw.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=a,this.isLuxonDateTime=!0}static now(){return new $k({})}static local(){const[e,t]=Uk(arguments),[n,r,a,o,i,s,l]=t;return Fk({year:n,month:r,day:a,hour:o,minute:i,second:s,millisecond:l},e)}static utc(){const[e,t]=Uk(arguments),[n,r,a,o,i,s,l]=t;return e.zone=_w.utcInstance,Fk({year:n,month:r,day:a,hour:o,minute:i,second:s,millisecond:l},e)}static fromJSDate(e,t={}){const n=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(n))return $k.invalid("invalid input");const r=Ow(t.zone,Zw.defaultZone);return r.isValid?new $k({ts:n,zone:r,loc:Cw.fromObject(t)}):$k.invalid(yk(r))}static fromMillis(e,t={}){if(lS(e))return e<-gk||e>gk?$k.invalid("Timestamp out of range"):new $k({ts:e,zone:Ow(t.zone,Zw.defaultZone),loc:Cw.fromObject(t)});throw new Mb(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(lS(e))return new $k({ts:1e3*e,zone:Ow(t.zone,Zw.defaultZone),loc:Cw.fromObject(t)});throw new Mb("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=Ow(t.zone,Zw.defaultZone);if(!n.isValid)return $k.invalid(yk(n));const r=Cw.fromObject(t),a=OS(e,Lk),{minDaysInFirstWeek:o,startOfWeek:i}=aS(a,r),s=Zw.now(),l=sS(t.specificOffset)?n.offset(s):t.specificOffset,c=!sS(a.ordinal),u=!sS(a.year),d=!sS(a.month)||!sS(a.day),f=u||d,m=a.weekYear||a.weekNumber;if((f||c)&&m)throw new Ob("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new Ob("Can't mix ordinal dates with month/day");const h=m||a.weekday&&!f;let p,g,y=xk(s,l);h?(p=Mk,g=Rk,y=eS(y,o,i)):c?(p=Pk,g=Ok,y=nS(y)):(p=Dk,g=_k);let v=!1;for(const e of p){sS(a[e])?a[e]=v?g[e]:y[e]:v=!0}const b=h?function(e,t=4,n=1){const r=cS(e.weekYear),a=pS(e.weekNumber,1,ES(e.weekYear,t,n)),o=pS(e.weekday,1,7);return r?a?!o&&qw("weekday",e.weekday):qw("week",e.weekNumber):qw("weekYear",e.weekYear)}(a,o,i):c?function(e){const t=cS(e.year),n=pS(e.ordinal,1,xS(e.year));return t?!n&&qw("ordinal",e.ordinal):qw("year",e.year)}(a):oS(a),w=b||iS(a);if(w)return $k.invalid(w);const S=h?tS(a,o,i):c?rS(a):a,[x,k]=kk(S,l,n),T=new $k({ts:x,zone:n,o:k,loc:r});return a.weekday&&f&&e.weekday!==T.weekday?$k.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${T.toISO()}`):T.isValid?T:$k.invalid(T.invalid)}static fromISO(e,t={}){const[n,r]=function(e){return QS(e,[Ax,_x],[Ex,Rx],[Cx,Ox],[Nx,Dx])}(e);return Ak(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return QS(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[vx,bx])}(e);return Ak(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return QS(e,[wx,kx],[Sx,kx],[xx,Tx])}(e);return Ak(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(sS(e)||sS(t))throw new Mb("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:a=null}=n,o=Cw.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),[i,s,l,c]=function(e,t,n){const{result:r,zone:a,specificOffset:o,invalidReason:i}=mk(e,t,n);return[r,a,o,i]}(o,e,t);return c?$k.invalid(c):Ak(i,s,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return $k.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return QS(e,[Px,_x],[Ix,Lx])}(e);return Ak(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Mb("need to specify a reason the DateTime is invalid");const n=e instanceof Hw?e:new Hw(e,t);if(Zw.throwOnInvalid)throw new Nb(n);return new $k({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=hk(e,Cw.fromObject(t));return n?n.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return dk(qS.parseFormat(e),Cw.fromObject(t)).map(e=>e.val).join("")}static resetCache(){Vk=void 0,jk.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?vk(this).weekYear:NaN}get weekNumber(){return this.isValid?vk(this).weekNumber:NaN}get weekday(){return this.isValid?vk(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?bk(this).weekday:NaN}get localWeekNumber(){return this.isValid?bk(this).weekNumber:NaN}get localWeekYear(){return this.isValid?bk(this).weekYear:NaN}get ordinal(){return this.isValid?nS(this.c).ordinal:NaN}get monthShort(){return this.isValid?Xx.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Xx.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Xx.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Xx.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=TS(this.c),r=this.zone.offset(n-e),a=this.zone.offset(n+e),o=this.zone.offset(n-r*t),i=this.zone.offset(n-a*t);if(o===i)return[this];const s=n-o*t,l=n-i*t,c=xk(s,o),u=xk(l,i);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[wk(this,{ts:s}),wk(this,{ts:l})]:[this]}get isInLeapYear(){return SS(this.year)}get daysInMonth(){return kS(this.year,this.month)}get daysInYear(){return this.isValid?xS(this.year):NaN}get weeksInWeekYear(){return this.isValid?ES(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ES(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=qS.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(_w.instance(e),t)}toLocal(){return this.setZone(Zw.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=Ow(e,Zw.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=kk(n,t,e)}return wk(this,{ts:r,zone:e})}return $k.invalid(yk(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return wk(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=OS(e,Lk),{minDaysInFirstWeek:n,startOfWeek:r}=aS(t,this.loc),a=!sS(t.weekYear)||!sS(t.weekNumber)||!sS(t.weekday),o=!sS(t.ordinal),i=!sS(t.year),s=!sS(t.month)||!sS(t.day),l=i||s,c=t.weekYear||t.weekNumber;if((l||o)&&c)throw new Ob("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&o)throw new Ob("Can't mix ordinal dates with month/day");let u;a?u=tS({...eS(this.c,n,r),...t},n,r):sS(t.ordinal)?(u={...this.toObject(),...t},sS(t.day)&&(u.day=Math.min(kS(u.year,u.month),u.day))):u=rS({...nS(this.c),...t});const[d,f]=kk(u,this.o,this.zone);return wk(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;return wk(this,Tk(this,qx.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return wk(this,Tk(this,qx.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=qx.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}if("weeks"===r)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1;if("quarters"===r){const e=Math.ceil(this.month/3);n.month=3*(e-1)+1}return this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?qS.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):pk}toLocaleString(e=zb,t={}){return this.isValid?qS.create(this.loc.clone(t),e).formatDateTime(this):pk}toLocaleParts(e={}){return this.isValid?qS.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:a=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;const i="extended"===e;let s=Ck(this,i,o=Ik(o));return Dk.indexOf(o)>=3&&(s+="T"),s+=Nk(this,i,t,n,r,a,o),s}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?Ck(this,"extended"===e,Ik(t)):null}toISOWeekDate(){return Ek(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:a=!1,format:o="extended",precision:i="milliseconds"}={}){if(!this.isValid)return null;return i=Ik(i),(r&&Dk.indexOf(i)>=3?"T":"")+Nk(this,"extended"===o,t,e,n,a,i)}toRFC2822(){return Ek(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ek(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ck(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),Ek(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():pk}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return qx.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=(s=t,Array.isArray(s)?s:[s]).map(qx.normalizeUnit),o=e.valueOf()>this.valueOf(),i=ek(o?this:e,o?e:this,a,r);var s;return o?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff($k.now(),e,t)}until(e){return this.isValid?Yx.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(t,n)<=r&&r<=a.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||$k.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(r=e.unit,a=void 0),zk(t,this.plus(n),{...e,numeric:"always",units:r,unit:a})}toRelativeCalendar(e={}){return this.isValid?zk(e.base||$k.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every($k.isDateTime))throw new Mb("min requires all arguments be DateTimes");return fS(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every($k.isDateTime))throw new Mb("max requires all arguments be DateTimes");return fS(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:a=null}=n;return mk(Cw.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return $k.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:r=null}=t,a=Cw.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return new fk(a,e)}static fromFormatParser(e,t,n={}){if(sS(e)||sS(t))throw new Mb("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:a=null}=n,o=Cw.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0});if(!o.equals(t.locale))throw new Mb(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:i,zone:s,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?$k.invalid(c):Ak(i,s,n,`format ${t.format}`,e,l)}static get DATE_SHORT(){return zb}static get DATE_MED(){return Ub}static get DATE_MED_WITH_WEEKDAY(){return Vb}static get DATE_FULL(){return jb}static get DATE_HUGE(){return $b}static get TIME_SIMPLE(){return Wb}static get TIME_WITH_SECONDS(){return Bb}static get TIME_WITH_SHORT_OFFSET(){return Zb}static get TIME_WITH_LONG_OFFSET(){return Hb}static get TIME_24_SIMPLE(){return Gb}static get TIME_24_WITH_SECONDS(){return Kb}static get TIME_24_WITH_SHORT_OFFSET(){return qb}static get TIME_24_WITH_LONG_OFFSET(){return Jb}static get DATETIME_SHORT(){return Yb}static get DATETIME_SHORT_WITH_SECONDS(){return Xb}static get DATETIME_MED(){return Qb}static get DATETIME_MED_WITH_SECONDS(){return ew}static get DATETIME_MED_WITH_WEEKDAY(){return tw}static get DATETIME_FULL(){return nw}static get DATETIME_FULL_WITH_SECONDS(){return rw}static get DATETIME_HUGE(){return aw}static get DATETIME_HUGE_WITH_SECONDS(){return ow}}function Wk(e){if($k.isDateTime(e))return e;if(e&&e.valueOf&&lS(e.valueOf()))return $k.fromJSDate(e);if(e&&"object"==typeof e)return $k.fromObject(e);throw new Mb(`Unknown datetime argument: ${e}, of type ${typeof e}`)}let Bk=[{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:"🇮🇱"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"}];Bk=Bk.filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)),Bk.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Zk=Bk.filter(e=>$k.local().setLocale(e.code).isValid).filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function Hk(t){const[r,a]=d(t.value||""),[o,i]=d(!1),s=Zk.find(e=>e.value==r);return n(yb,{open:o,onOpenChange:i,children:[e(vb,{asChild:!0,children:n(Ai,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s&&n("div",{children:[String(s.label).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&"Choose language",e(di,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(bb,{className:"p-0 overflow-hidden text-ellipsis",children:n(_g,{children:[e(Rg,{placeholder:"Choose timezone..."}),e(Og,{children:e(Dg,{children:Zk.map(o=>n(Mg,{className:Bo("whitespace-nowrap text-left",{"text-green-500":r===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const n=o.value;a(n),t.onChange&&"function"==typeof t.onChange&&t.onChange(n),i(!1)},children:[r===o.value&&e(ui,{className:Bo("mr-2 h-4 w-4 text-green-400",r===o.value?"opacity-100":"opacity-0")}),String(o.label).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.flag})]},o.value))})})]})})]})}const Gk=[{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 n=t.utc;for(let r=0;r<n.length;r++){const a=n[r],o=t.text;let i=o.substring(o.indexOf("(")+1,o.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,n)=>t===n.findIndex(t=>t.value===e.value));function Kk(t){const[r,a]=d(t.value||""),[o,i]=d(!1),s=Gk.find(e=>e.value==r);return n(yb,{open:o,onOpenChange:i,children:[e(vb,{asChild:!0,children:n(Ai,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text||"Choose timezone",e(di,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(bb,{className:"p-0 overflow-hidden text-ellipsis",children:n(_g,{children:[e(Rg,{placeholder:"Choose timezone..."}),e(Og,{children:e(Dg,{children:Gk.map(o=>n(Mg,{className:Bo("whitespace-nowrap text-left",{"text-green-500":r===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const n=o.value;a(n),t.onChange&&"function"==typeof t.onChange&&t.onChange(n),i(!1)},children:[r===o.value&&e(ui,{className:Bo("mr-2 h-4 w-4 text-green-400",r===o.value?"opacity-100":"opacity-0")}),String(o.text).trim()]},o.value))})})]})})]})}const qk=({workspace:t})=>{const{updateUserProfile:r,getProfile:a}=SA(),[o,i]=d(!1),[s,c]=d(),[u,f]=d(0),m=Pt({resolver:Pa(js({name:hs().min(2,{message:"Name must be at least 2 characters."}),country:hs().optional(),timezone:hs().optional(),language:hs().optional(),currency:hs().optional()})),defaultValues:{name:s?.name||"",country:s?.country||"",timezone:s?.timezone||"",language:s?.language||"",currency:s?.currency||""}});return l(()=>{a().then(e=>{c(e),m.setValue("name",e.name),m.setValue("country",e.country),m.setValue("timezone",e.timezone),m.setValue("language",e.language),m.setValue("currency",e.currency)})},[u]),s?n("div",{children:[e("div",{className:"space-y-4",children:e(Oi,{...m,children:n("form",{onSubmit:m.handleSubmit(async function(e){i(!0),await r({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),i(!1)}),className:"space-y-4",children:[n("div",{children:[e("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e(ji,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:s?.email})]}),e(Mi,{disabled:o,control:m.control,name:"name",render:({field:t})=>n(Li,{children:[e(Fi,{children:"Name"}),e(zi,{children:e(ji,{...t})}),e(Vi,{})]})}),n("div",{className:"flex gap-y-2 my-4 flex-col",children:[n("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Language"}),e(Hk,{value:m.getValues("language"),onChange:e=>{m.setValue("language",e)}})]}),n("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Country"}),e(kb,{value:m.getValues("country"),onChange:e=>{m.setValue("country",e)}})]}),n("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Currency"}),e(Eb,{value:m.getValues("currency"),onChange:e=>{m.setValue("currency",e)}})]}),n("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Timezone"}),e(Kk,{value:m.getValues("timezone"),onChange:e=>{m.setValue("timezone",e)}})]})]}),n("div",{className:"flex justify-end gap-x-2",children:[e(Ai,{type:"submit",progress:o,disabled:o,children:"Save"}),e(Ai,{type:"button",variant:"outline",onClick:()=>{f(e=>e+1)},disabled:o,children:"Reset"})]})]})})}),s?.image&&n("div",{children:[e("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),e("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover"})})]})]}):e("div",{children:"Loading..."})};var Jk=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"});r.forwardRef((t,n)=>e(Ei.span,{...t,ref:n,style:{...Jk,...t.style}})).displayName="VisuallyHidden";var Yk=[" ","Enter","ArrowUp","ArrowDown"],Xk=[" ","Enter"],Qk="Select",[eT,tT,nT]=Um(Qk),[rT,aT]=Iu(Qk,[nT,Cv]),oT=Cv(),[iT,sT]=rT(Qk),[lT,cT]=rT(Qk),uT=t=>{const{__scopeSelect:a,children:o,open:i,defaultOpen:s,onOpenChange:l,value:c,defaultValue:u,onValueChange:d,dir:f,name:m,autoComplete:h,disabled:p,required:g,form:y}=t,v=oT(a),[b,w]=r.useState(null),[S,x]=r.useState(null),[k,T]=r.useState(!1),A=jm(f),[E,C]=pd({prop:i,defaultProp:s??!1,onChange:l,caller:Qk}),[N,_]=pd({prop:c,defaultProp:u,onChange:d,caller:Qk}),R=r.useRef(null),O=!b||(y||!!b.closest("form")),[D,M]=r.useState(new Set),P=Array.from(D).map(e=>e.props.value).join(";");return e(Wv,{...v,children:n(iT,{required:g,scope:a,trigger:b,onTriggerChange:w,valueNode:S,onValueNodeChange:x,valueNodeHasChildren:k,onValueNodeHasChildrenChange:T,contentId:md(),value:N,onValueChange:_,open:E,onOpenChange:C,dir:A,triggerPointerDownPosRef:R,disabled:p,children:[e(eT.Provider,{scope:a,children:e(lT,{scope:t.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{M(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),O?n(KT,{"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:h,value:N,onChange:e=>_(e.target.value),disabled:p,form:y,children:[void 0===N?e("option",{value:""}):null,Array.from(D)]},P):null]})})};uT.displayName=Qk;var dT="SelectTrigger",fT=r.forwardRef((t,n)=>{const{__scopeSelect:a,disabled:o=!1,...i}=t,s=oT(a),l=sT(dT,a),c=l.disabled||o,u=Go(n,l.onTriggerChange),d=tT(a),f=r.useRef("touch"),[m,h,p]=JT(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),r=YT(t,e,n);void 0!==r&&l.onValueChange(r.value)}),g=e=>{c||(l.onOpenChange(!0),p()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e(Bv,{asChild:!0,...s,children:e(Ei.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":qT(l.value)?"":void 0,...i,ref:u,onClick:ud(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:ud(i.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:ud(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Yk.includes(e.key)&&(g(),e.preventDefault())})})})});fT.displayName=dT;var mT="SelectValue",hT=r.forwardRef((n,r)=>{const{__scopeSelect:a,className:o,style:i,children:s,placeholder:l="",...c}=n,u=sT(mT,a),{onValueNodeHasChildrenChange:d}=u,f=void 0!==s,m=Go(r,u.onValueNodeChange);return Uu(()=>{d(f)},[d,f]),e(Ei.span,{...c,ref:m,style:{pointerEvents:"none"},children:qT(u.value)?e(t,{children:l}):s})});hT.displayName=mT;var pT=r.forwardRef((t,n)=>{const{__scopeSelect:r,children:a,...o}=t;return e(Ei.span,{"aria-hidden":!0,...o,ref:n,children:a||"▼"})});pT.displayName="SelectIcon";var gT=t=>e(Pd,{asChild:!0,...t});gT.displayName="SelectPortal";var yT="SelectContent",vT=r.forwardRef((t,n)=>{const a=sT(yT,t.__scopeSelect),[o,i]=r.useState();if(Uu(()=>{i(new DocumentFragment)},[]),!a.open){const n=o;return n?h.createPortal(e(wT,{scope:t.__scopeSelect,children:e(eT.Slot,{scope:t.__scopeSelect,children:e("div",{children:t.children})})}),n):null}return e(kT,{...t,ref:n})});vT.displayName=yT;var bT=10,[wT,ST]=rT(yT),xT=Ko("SelectContent.RemoveScroll"),kT=r.forwardRef((t,n)=>{const{__scopeSelect:a,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=t,w=sT(yT,a),[S,x]=r.useState(null),[k,T]=r.useState(null),A=Go(n,e=>x(e)),[E,C]=r.useState(null),[N,_]=r.useState(null),R=tT(a),[O,D]=r.useState(!1),M=r.useRef(!1);r.useEffect(()=>{if(S)return Pf(S)},[S]),zd();const P=r.useCallback(e=>{const[t,...n]=R().map(e=>e.ref.current),[r]=n.slice(-1),a=document.activeElement;for(const n of e){if(n===a)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&k&&(k.scrollTop=0),n===r&&k&&(k.scrollTop=k.scrollHeight),n?.focus(),document.activeElement!==a)return}},[R,k]),I=r.useCallback(()=>P([E,S]),[P,E,S]);r.useEffect(()=>{O&&I()},[O,I]);const{onOpenChange:L,triggerPointerDownPosRef:F}=w;r.useEffect(()=>{if(S){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():S.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[S,L,F]),r.useEffect(()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[L]);const[z,U]=JT(e=>{const t=R().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=YT(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),V=r.useCallback((e,t,n)=>{const r=!M.current&&!n;(void 0!==w.value&&w.value===t||r)&&(C(e),r&&(M.current=!0))},[w.value]),j=r.useCallback(()=>S?.focus(),[S]),$=r.useCallback((e,t,n)=>{const r=!M.current&&!n;(void 0!==w.value&&w.value===t||r)&&_(e)},[w.value]),W="popper"===o?AT:TT,B=W===AT?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return e(wT,{scope:a,content:S,viewport:k,onViewportChange:T,itemRefCallback:V,selectedItem:E,onItemLeave:j,itemTextRefCallback:$,focusSelectedItem:I,selectedItemText:N,position:o,isPositioned:O,searchRef:z,children:e(Cf,{as:xT,allowPinchZoom:!0,children:e(Cd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ud(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e(Sd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:e(W,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...B,onPlaced:()=>D(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ud(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(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 n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})});kT.displayName="SelectContentImpl";var TT=r.forwardRef((t,n)=>{const{__scopeSelect:a,onPlaced:o,...i}=t,s=sT(yT,a),l=ST(yT,a),[c,u]=r.useState(null),[d,f]=r.useState(null),m=Go(n,e=>f(e)),h=tT(a),p=r.useRef(!1),g=r.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=l,S=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==s.dir){const a=r.left-t.left,o=n.left-a,i=e.left-o,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-bT,d=Ih(o,[bT,Math.max(bT,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const a=t.right-r.right,o=window.innerWidth-n.right-a,i=window.innerWidth-e.right-o,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-bT,d=Ih(o,[bT,Math.max(bT,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const a=h(),i=window.innerHeight-2*bT,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=f+m+l+parseInt(u.paddingBottom,10)+g,S=Math.min(5*v.offsetHeight,w),x=window.getComputedStyle(y),k=parseInt(x.paddingTop,10),T=parseInt(x.paddingBottom,10),A=e.top+e.height/2-bT,E=i-A,C=v.offsetHeight/2,N=f+m+(v.offsetTop+C),_=w-N;if(N<=A){const e=a.length>0&&v===a[a.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=N+Math.max(E,C+(e?T:0)+t+g);c.style.height=n+"px"}else{const e=a.length>0&&v===a[0].ref.current;c.style.top="0px";const t=Math.max(A,f+y.offsetTop+(e?k:0)+C)+_;c.style.height=t+"px",y.scrollTop=N-A+y.offsetTop}c.style.margin=`${bT}px 0`,c.style.minHeight=S+"px",c.style.maxHeight=i+"px",o?.(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,o]);Uu(()=>S(),[S]);const[x,k]=r.useState();Uu(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const T=r.useCallback(e=>{e&&!0===g.current&&(S(),w?.(),g.current=!1)},[S,w]);return e(ET,{scope:a,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:e("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:e(Ei.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});TT.displayName="SelectItemAlignedPosition";var AT=r.forwardRef((t,n)=>{const{__scopeSelect:r,align:a="start",collisionPadding:o=bT,...i}=t,s=oT(r);return e(Zv,{...s,...i,ref:n,align:a,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});AT.displayName="SelectPopperPosition";var[ET,CT]=rT(yT,{}),NT="SelectViewport",_T=r.forwardRef((a,o)=>{const{__scopeSelect:i,nonce:s,...l}=a,c=ST(NT,i),u=CT(NT,i),d=Go(o,c.onViewportChange),f=r.useRef(0);return n(t,{children:[e("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:s}),e(eT.Slot,{scope:i,children:e(Ei.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:ud(l.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=u;if(r?.current&&n){const e=Math.abs(f.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*bT,a=parseFloat(n.style.minHeight),o=parseFloat(n.style.height),i=Math.max(a,o);if(i<r){const a=i+e,o=Math.min(r,a),s=a-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})});_T.displayName=NT;var RT="SelectGroup",[OT,DT]=rT(RT);r.forwardRef((t,n)=>{const{__scopeSelect:r,...a}=t,o=md();return e(OT,{scope:r,id:o,children:e(Ei.div,{role:"group","aria-labelledby":o,...a,ref:n})})}).displayName=RT;var MT="SelectLabel",PT=r.forwardRef((t,n)=>{const{__scopeSelect:r,...a}=t,o=DT(MT,r);return e(Ei.div,{id:o.id,...a,ref:n})});PT.displayName=MT;var IT="SelectItem",[LT,FT]=rT(IT),zT=r.forwardRef((t,n)=>{const{__scopeSelect:a,value:o,disabled:i=!1,textValue:s,...l}=t,c=sT(IT,a),u=ST(IT,a),d=c.value===o,[f,m]=r.useState(s??""),[h,p]=r.useState(!1),g=Go(n,e=>u.itemRefCallback?.(e,o,i)),y=md(),v=r.useRef("touch"),b=()=>{i||(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 e(LT,{scope:a,value:o,disabled:i,textId:y,isSelected:d,onItemTextChange:r.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e(eT.ItemSlot,{scope:a,value:o,disabled:i,textValue:f,children:e(Ei.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:g,onFocus:ud(l.onFocus,()=>p(!0)),onBlur:ud(l.onBlur,()=>p(!1)),onClick:ud(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:ud(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:ud(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:ud(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ud(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:ud(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Xk.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});zT.displayName=IT;var UT="SelectItemText",VT=r.forwardRef((a,o)=>{const{__scopeSelect:i,className:s,style:l,...c}=a,u=sT(UT,i),d=ST(UT,i),f=FT(UT,i),m=cT(UT,i),[p,g]=r.useState(null),y=Go(o,e=>g(e),f.onItemTextChange,e=>d.itemTextRefCallback?.(e,f.value,f.disabled)),v=p?.textContent,b=r.useMemo(()=>e("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=m;return Uu(()=>(w(b),()=>S(b)),[w,S,b]),n(t,{children:[e(Ei.span,{id:f.textId,...c,ref:y}),f.isSelected&&u.valueNode&&!u.valueNodeHasChildren?h.createPortal(c.children,u.valueNode):null]})});VT.displayName=UT;var jT="SelectItemIndicator",$T=r.forwardRef((t,n)=>{const{__scopeSelect:r,...a}=t;return FT(jT,r).isSelected?e(Ei.span,{"aria-hidden":!0,...a,ref:n}):null});$T.displayName=jT;var WT="SelectScrollUpButton";r.forwardRef((t,n)=>{const a=ST(WT,t.__scopeSelect),o=CT(WT,t.__scopeSelect),[i,s]=r.useState(!1),l=Go(n,o.onScrollButtonChange);return Uu(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?e(ZT,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=WT;var BT="SelectScrollDownButton";r.forwardRef((t,n)=>{const a=ST(BT,t.__scopeSelect),o=CT(BT,t.__scopeSelect),[i,s]=r.useState(!1),l=Go(n,o.onScrollButtonChange);return Uu(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?e(ZT,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=BT;var ZT=r.forwardRef((t,n)=>{const{__scopeSelect:a,onAutoScroll:o,...i}=t,s=ST("SelectScrollButton",a),l=r.useRef(null),c=tT(a),u=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>u(),[u]),Uu(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e(Ei.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:ud(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:ud(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:ud(i.onPointerLeave,()=>{u()})})}),HT=r.forwardRef((t,n)=>{const{__scopeSelect:r,...a}=t;return e(Ei.div,{"aria-hidden":!0,...a,ref:n})});HT.displayName="SelectSeparator";var GT="SelectArrow";r.forwardRef((t,n)=>{const{__scopeSelect:r,...a}=t,o=oT(r),i=sT(GT,r),s=ST(GT,r);return i.open&&"popper"===s.position?e(Hv,{...o,...a,ref:n}):null}).displayName=GT;var KT=r.forwardRef(({__scopeSelect:t,value:n,...a},o)=>{const i=r.useRef(null),s=Go(o,i),l=sh(n);return r.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[l,n]),e(Ei.select,{...a,style:{...Jk,...a.style},ref:s,defaultValue:n})});function qT(e){return""===e||void 0===e}function JT(e){const t=Fu(e),n=r.useRef(""),a=r.useRef(0),o=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,o,i]}function YT(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(e,Math.max(a,0));1===r.length&&(o=o.filter(e=>e!==n));const i=o.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==n?i:void 0}KT.displayName="SelectBubbleInput";var XT=fT,QT=pT,eA=gT,tA=vT,nA=_T,rA=PT,aA=zT,oA=VT,iA=$T,sA=HT;const lA=uT,cA=r.forwardRef(({className:t,children:r,...a},o)=>n(XT,{ref:o,className:Bo("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",t),...a,children:[r,e(QT,{asChild:!0,children:e(Tm,{className:"h-4 w-4 opacity-50"})})]}));cA.displayName=XT.displayName;const uA=r.forwardRef(({className:t,children:n,position:a="popper",...o},i)=>{const{container:s}=r.useContext(ie);return e(eA,{container:s,children:e(tA,{ref:i,className:Bo("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",t),position:a,...o,children:e(nA,{className:Bo("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})})});uA.displayName=tA.displayName;r.forwardRef(({className:t,...n},r)=>e(rA,{ref:r,className:Bo("px-2 py-1.5 text-sm font-semibold",t),...n})).displayName=rA.displayName;const dA=r.forwardRef(({className:t,children:r,...a},o)=>n(aA,{ref:o,className:Bo("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",t),...a,children:[e("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e(iA,{children:e(Em,{className:"h-4 w-4"})})}),e(oA,{children:r})]}));dA.displayName=aA.displayName;r.forwardRef(({className:t,...n},r)=>e(sA,{ref:r,className:Bo("-mx-1 my-1 h-px bg-muted",t),...n})).displayName=sA.displayName;const fA=({workspace:t})=>{const r=Z(e=>e.auth.user),[a,o]=d(0),[i,s]=d(!1),[c,u]=d([]),{getUsers:f,removeUser:m,updateUser:h}=SA();l(()=>{t&&(s(!0),f(t._id).then(e=>{u(e)}).catch(e=>{console.error(e)}).finally(()=>{s(!1)}))},[t,a]);const p=()=>{o(e=>e+1)};if(!t)return e("div",{children:e("div",{className:"text-gray-500",children:"Loading workspace members..."})});const g=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},y=c.map(e=>({...e,...g(e.user)})),v=c.find(e=>("string"==typeof e.user?e.user:e.user._id)===r?.id)?.role,b="admin"===v;return n("div",{children:[!b&&e("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),b&&e("div",{className:"mb-4",children:e(mA,{onInvite:p,workspaceId:t._id})}),n("div",{className:"mb-4 flex items-center justify-between",children:[e("div",{children:n("div",{className:"text-sm text-gray-600 mb-2",children:[c.length," member",1!==c.length?"s":""]})}),e("div",{children:e(Ai,{variant:"ghost",size:"sm",onClick:p,progress:i,startIcon:e(gi,{}),children:"Refresh"})})]}),e("ul",{className:"space-y-2",children:y.map((a,o)=>{const i=a.id===r?.id;return n("li",{className:"flex items-center justify-between border rounded-lg p-3",children:[n("div",{className:"flex items-center space-x-3",children:[e("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium",children:a.name.charAt(0).toUpperCase()}),n("div",{children:[e("div",{className:"font-medium",children:a.name}),e("div",{className:"text-xs text-gray-500",children:a.email})]})]}),n("div",{className:"flex items-center gap-x-1",children:[e("div",{children:n(lA,{disabled:i||!b,value:a.role,onValueChange:e=>{return n=t._id,r=a.id,void h(n,r,{role:e}).then(()=>{p()});var n,r},children:[e(cA,{children:e(hT,{placeholder:"Select a role"})}),e(uA,{children:t?.roles.map(t=>e(dA,{value:t,children:t},t))})]})}),i&&e("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),!i&&b&&e(Ai,{variant:"destructive",size:"sm",startIcon:e(Si,{}),onClick:()=>{var e;e=a.id,m(t._id,e).then(()=>{p()})}})]})]},o)})}),0===c.length&&e("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function mA({onInvite:t,workspaceId:r}){const[a,o]=d(""),[i,s]=d("admin"),[c,u]=d(!1),[f,m]=d(null),[h,p]=d(null),{addUser:g,getWorkspace:y}=SA(),[v,b]=d(null);l(()=>{r&&y(r).then(b)},[r]);const w=()=>{m(null),p(null),o(""),s("admin")};return n("div",{className:"flex gap-2 flex-col gap-y-2",children:[f&&e("div",{className:"text-red-500 capitalize",children:f}),h&&e("div",{className:"text-green-500 capitalize",children:h}),n("div",{children:[e(Ri,{children:"Invite member by email"}),e(ji,{type:"email",value:a,onChange:e=>o(e.target.value),placeholder:"example@example.com"})]}),n("div",{children:[e(Ri,{children:"Role"}),n(lA,{value:i,onValueChange:s,children:[e(cA,{children:e(hT,{placeholder:"Select a role"})}),e(uA,{children:v?.roles.map(t=>e(dA,{value:t,children:t},t))})]})]}),e("div",{children:e(Ai,{progress:c,onClick:async()=>{const e=a.trim();if(!e)return void m("Email is required");/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(u(!0),await g(r,e,i).then(()=>{p("User invited successfully"),t?.()}).catch(e=>{console.error(e),m(e.message||"Failed to invite member")}).finally(()=>{u(!1),setTimeout(()=>{w()},6e3)})):m("Invalid email address format")},disabled:c||!a||!i,children:c?"Inviting...":`Invite as ${i}`})})]})}const hA=({workspace:t,section:r,setSection:a})=>n("div",{className:"w-56 h-full flex flex-col px-2 py-2",children:[t&&e("div",{className:"mb-6 pb-4 border-b",children:n("div",{className:"flex items-center space-x-2 mb-2",children:[e("div",{className:"w-12 h-12 bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",children:e("img",{src:t.image,className:"w-full h-full object-contain"})}),n("div",{children:[e("div",{className:"font-medium text-sm",children:t.name}),e("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),n("div",{className:"mb-6",children:[e("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:"Account"}),n("button",{className:Bo("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","profile"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("profile"),children:[e(xi,{className:"h-4 w-4"})," Profile"]})]}),n("div",{children:[e("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:"Workspace"}),n("button",{className:Bo("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","general"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("general"),children:[e(vi,{className:"h-4 w-4"})," General"]}),n("button",{className:Bo("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","users"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("users"),children:[e(ki,{className:"h-4 w-4"})," Users"]}),n("button",{className:Bo("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","features"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("features"),children:[e(wi,{className:"h-4 w-4"})," Features"]})]})]}),pA=({workspace:t,onClose:r})=>{const[a,o]=d(!1),[i,s]=d("profile");return t?n(Om,{open:a,onOpenChange:e=>{o(e),e||r()},children:[e(Dm,{children:e(Ai,{variant:"outline",size:"icon",children:e(vi,{className:"h-4 w-4"})})}),n(Im,{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",children:[e(hA,{workspace:t,section:i,setSection:s}),n("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[n("h2",{className:"text-xl font-bold mb-4 capitalize",children:["profile"===i&&"Account","general"===i&&"Workspace Settings","users"===i&&"Workspace Members","features"===i&&"Workspace Features"]}),n("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===i&&e(qk,{workspace:t}),"general"===i&&e($p,{workspace:t}),"users"===i&&e(fA,{workspace:t}),"features"===i&&e(Up,{workspaceId:t._id?.toString()})]})]})]})]}):null};function gA(t){const{workspaces:r,currentWorkspace:a,loading:o,refreshing:i}=Z(e=>e.workspaces),s=Z(e=>e.auth.user),[c,u]=d(!1),[f,m]=d(0),[h,p]=d(""),{fetchWorkspaces:g,getFeatures:y,refreshWorkspaces:v,setCurrentWorkspace:b}=SA();l(()=>{g(),y()},[]),l(()=>{v(),y()},[f]);const w=r.filter(e=>e.name.toLowerCase().includes(h.toLowerCase())),S=e=>e.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return n(Om,{open:c,onOpenChange:u,children:[e(Dm,{children:t.trigger?.(a)}),n(Im,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e(Lm,{children:n(Fm,{className:"flex items-center gap-2",children:[e(ci,{className:"h-5 w-5"}),"Switch Workspace"]})}),!s&&e("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),s&&n("div",{className:"flex flex-col gap-4",children:[n("div",{className:"relative",children:[e(yi,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e(ji,{placeholder:"Search workspaces...",value:h,onChange:e=>p(e.target.value),className:"pl-10"})]}),a&&n("div",{children:[e("div",{className:"text-sm font-medium text-muted-foreground",children:"Current Workspace"}),n("div",{className:"flex items-center gap-3 rounded-lg border-2 p-3 border-border bg-muted text-muted-foreground",children:[n(sd,{className:"h-8 w-8 flex items-center justify-center",children:[e("div",{children:e(ld,{src:a.image})}),e(cd,{children:S(a.name)})]}),n("div",{className:"flex-1 min-w-0",children:[e("div",{className:"flex items-center gap-2",children:e("span",{className:"font-medium truncate",children:a.name})}),n("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e(ki,{className:"h-3 w-3"}),n("span",{children:[a.users?.length||0," members"]})]})]})]})]}),e(Ap,{}),n("div",{children:[n("div",{className:"flex items-center justify-between",children:[n("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",w.length,")"]}),e("div",{children:e(Ai,{progress:i,disabled:i,variant:"outline",onClick:function(){m(e=>e+1)},startIcon:e(gi,{}),children:i?"Refreshing...":"Refresh"})})]}),o?n("div",{className:"flex items-center justify-center py-8",children:[e(hi,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===w.length?n("div",{className:"text-center py-8",children:[e(ci,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e("p",{className:"mt-2 text-sm text-muted-foreground",children:h?"No workspaces found":"No workspaces available"})]}):e(bp,{className:"h-64",children:e("div",{className:"flex flex-col gap-2 my-2.5",children:w.map(o=>{const i=o?.users?.length||0,l=o.createdBy===s?.id,c=o._id===a?._id;return n("div",{className:Bo("w-full justify-start h-auto p-3 rounded-none flex border border-border ",c&&"bg-muted"),children:[n(sd,{className:"h-8 w-8 mr-3",children:[e(ld,{src:o.image}),e(cd,{children:S(o.name)})]}),n("div",{className:"flex-1 min-w-0 text-left",children:[n("div",{className:"flex items-center gap-2",children:[e("span",{className:"font-medium truncate",children:o.name}),l&&e(fi,{className:"h-3 w-3 text-amber-500"})]}),n("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e(ki,{className:"h-3 w-3"}),n("span",{children:[i," member",1!==i?"s":""]})]})]}),n("div",{className:"flex items-center gap-2",children:[e(Ai,{size:"sm",disabled:c,onClick:async()=>{await t.onWorkspaceChange(o),b(o),u(!1)},children:c?"Current":"Switch to"}),e(pA,{workspace:o,onClose:()=>{if(a){const e=r.findIndex(e=>e._id?.toString()===a._id?.toString());-1!==e&&b(r[e])}}})]})]},o._id)})})})]}),e(Ap,{}),e(yA,{onCreated:()=>{g()}})]})]})]})}function yA(r){const[a,o]=d(!1),[i,s]=d("emoji"),[l,c]=d("🏢"),[u,f]=d(!1),{createWorkspace:m}=SA(),h=Pt({resolver:Pa(js({name:hs().min(2,{message:"Workspace name must be at least 2 characters."}),image:hs().optional()})),defaultValues:{name:"",image:""}});return n(Om,{open:a,onOpenChange:o,children:[e(Dm,{children:n(Ai,{className:"w-full rounded-none",children:[e(pi,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),n(Im,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[n(Lm,{children:[e(Fm,{children:"Create New Workspace"}),e(zm,{children:"Create a new workspace to get started."})]}),e(Oi,{...h,children:n("form",{onSubmit:h.handleSubmit(async function(e){let t="";if("emoji"===i)t=Vp(l);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"})}f(!0);try{await m(e.name,t),o(!1),h.reset(),c("🏢"),s("emoji"),r?.onCreated?.()}catch(e){console.error("Failed to create workspace:",e)}finally{f(!1)}}),children:[e(Mi,{control:h.control,name:"name",render:({field:t})=>n(Li,{children:[e(Fi,{children:"Workspace Name"}),e(zi,{children:e(ji,{placeholder:"My Awesome Workspace",...t})}),e(Vi,{})]})}),n("div",{className:"flex flex-col gap-y-2 my-2",children:[n("div",{children:[e(Ri,{className:"text-sm font-medium",children:"Workspace Icon"}),e(Ui,{children:"Choose an emoji or upload a custom image for your workspace."})]}),n(Mh,{value:i,onValueChange:e=>s(e),className:"flex flex-col gap-y-2",children:[n("div",{className:"flex items-center gap-x-2 my-1",children:[e(Ph,{value:"emoji",id:"emoji"}),n(Ri,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e(bi,{className:"h-4 w-4"}),"Choose Emoji"]})]}),n("div",{className:"flex items-center gap-x-2 my-1",children:[e(Ph,{value:"url",id:"url"}),n(Ri,{htmlFor:"url",className:"flex items-center gap-2",children:[e(mi,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===i&&n("div",{className:"flex flex-col gap-y-2",children:[n("div",{className:"flex items-center gap-3",children:[e("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})]}),e(bp,{className:"h-32 w-full rounded-md border",children:e("div",{className:"p-4 grid grid-cols-8 gap-2",children:jp.map((t,n)=>e("button",{type:"button",onClick:()=>(e=>{c(e),h.setValue("image",Vp(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(l===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===i&&n("div",{className:"flex flex-col gap-y-2",children:[e(Mi,{control:h.control,name:"image",render:({field:t})=>n(Li,{children:[e(Fi,{children:"Image URL"}),e(zi,{children:e(ji,{placeholder:"https://example.com/image.png",...t})}),e(Ui,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e(Vi,{})]})}),h.watch("image")&&n("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e("img",{src:h.watch("image"),alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),n("div",{className:"flex justify-end gap-3 pt-4",children:[e(Ai,{type:"button",variant:"outline",onClick:()=>{o(!1),h.reset(),c("🏢"),s("emoji")},disabled:u,children:"Cancel"}),e(Ai,{type:"submit",disabled:u,children:u?n(t,{children:[e(hi,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}const vA="saas-workspace-current",bA=()=>v(vA),wA=(e,t)=>!!e&&t.some(t=>t._id===e),SA=()=>{const e=H(),t=Z(e=>e.os),n=i(()=>new Pu(t),[t]),r=Z(e=>e.workspaces);l(()=>{if(!r.isInitialized){const t=bA();if(e.workspaces(ee(!0)),t){const e=r.workspaces.find(e=>e._id===t);if(e){if(e._id===r.currentWorkspace?._id)return;a(e)}}}},[r.isInitialized,r.workspaces,r.currentWorkspace,e]);const a=f(t=>{t._id!==r.currentWorkspace?._id&&t&&e.workspaces(X(t))},[r.currentWorkspace,e]),o=f(()=>{e.workspaces(Q())},[e]),s=f(async()=>{if(!r.loading){e.workspaces(te(!0)),e.workspaces(ne(null));try{const t=await n.getWorkspaces();if(e.workspaces(J(t)),t.length>0){const e=bA();if(e&&wA(e,t)){const n=t.find(t=>t._id===e);n&&a(n)}else t.length>0&&(r.currentWorkspace||a(t[0]))}}catch(t){e.workspaces(ne(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(te(!1))}}},[n,r.loading,r.currentWorkspace,e,a]),c=f(async()=>{if(!r.refreshing){e.workspaces(re(!0));try{const t=await n.getWorkspaces();e.workspaces(J(t))}catch(e){}finally{e.workspaces(re(!1))}}},[n,r.refreshing,e]),u=f(async(t,a)=>{const o=await n.createWorkspace({name:t,image:a});e.workspaces(J([...r.workspaces,o]))},[n,r.workspaces,e]),d=f(async(t,a)=>{const o=await n.updateWorkspace(t._id,a);e.workspaces(J(r.workspaces.map(e=>e._id===t._id?o:e)))},[n,r.workspaces,e]),m=f(async()=>{const t=await n.getFeatures();return e.workspaces(Y(t)),t},[n,e]),h=f(async(e,t,r)=>await n.updateFeature(e,t,r),[n]);l(()=>{if(r.currentWorkspace?._id){const e=r.workspaces.find(e=>e._id===r.currentWorkspace?._id);if(e){if(e._id===r.currentWorkspace._id)return;a(e)}else if(r.workspaces.length>0){if(r.workspaces[0]._id===r.currentWorkspace._id)return;a(r.workspaces[0])}}},[r.currentWorkspace?._id,r.workspaces,a]);const p=f(async e=>await n.getWorkspaceUsers(e),[n]),g=f(async(e,t,r)=>await n.addUser(e,{email:t,role:r}),[n]),y=f(async(e,t)=>await n.removeUser(e,t),[n]),v=f(async(e,t,r)=>await n.updateUser(e,t,r),[n]),b=f(async e=>await n.updateUserProfile(e),[n]),w=f(async()=>await n.getProfile(),[n]),S=f(async e=>await n.getWorkspace(e),[n]);return{workspaces:r.workspaces,loading:r.loading,error:r.error,fetchWorkspaces:s,refreshWorkspaces:c,refreshing:r.refreshing,WorkspaceSwitcher:gA,currentWorkspace:r.currentWorkspace,setCurrentWorkspace:a,resetCurrentWorkspace:o,createWorkspace:u,allFeatures:r.allFeatures,getFeatures:m,updateFeature:h,getWorkspace:S,switching:r.switching,updateWorkspace:d,getUsers:p,addUser:g,removeUser:y,updateUser:v,getProfile:w,updateUserProfile:b}};function xA(){const e=H(),t=Z(e=>e.auth),n=Z(e=>e.os),{serverUrl:r,orgId:a,auth:o}=n,{resetCurrentWorkspace:s}=SA(),l=f(async()=>{e.auth(G());try{const t=await Mu.post(`${r}/api/v1/auth/request`,{orgId:a,clientId:o?.clientId,redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth(K()),new Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth(K()),console.error("Sign in error:",t),t}},[r,a,o,e]),c=f(async()=>{try{e.auth(q()),s()}catch(e){console.error("Logout error:",e)}},[e,s]);return i(()=>({user:t.user,session:t.session,isLoading:t.isLoading,isAuthenticated:t.isAuthenticated,isRedirecting:t.isRedirecting,status:t.status,signIn:l,signOut:c}),[t,l,c])}const kA=e=>{const{children:t}=e,{status:n}=xA();return n!==y.authenticated?null:t},TA=e=>{const{children:t}=e,{status:n}=xA();return n===y.authenticated?null:t},AA=e=>{const{children:t,fallback:n,roles:r}=e,{user:a}=xA();return r.includes(a?.role??"")?t:n||null},EA=e=>{const{children:t,fallback:n,roles:r}=e,{user:a}=xA(),{currentWorkspace:o}=SA(),i=o?.users.find(e=>e._id===a?.id);return i&&r.includes(i?.role??"")?t:n||null},CA=e=>{const{children:t,slug:n}=e,{currentWorkspace:r}=SA(),a=r?.features?.[n];return a?t:null},NA=e=>{const{children:t,slug:n}=e,{currentWorkspace:r}=SA(),a=r?.features?.[n];return a?null:t};export{il as BetaForm,le as SaaSOSProvider,kA as WhenAuthenticated,AA as WhenRoles,TA as WhenUnauthenticated,NA as WhenWorkspaceFeatureDisabled,CA as WhenWorkspaceFeatureEnabled,EA as WhenWorkspaceRoles,gA as WorkspaceSwitcher,H as useAppDispatch,Z as useAppSelector,xA as useSaaSAuth,SA as useSaaSWorkspaces};
|
|
30
|
+
//# sourceMappingURL=index.esm.js.map
|