@bluealba/pae-ui-react-core 4.2.2-develop-1364 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +4 -3
- package/dist/index.systemjs.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.systemjs.js
CHANGED
|
@@ -206,7 +206,7 @@ to {
|
|
|
206
206
|
> * {
|
|
207
207
|
pointer-events: auto;
|
|
208
208
|
}
|
|
209
|
-
`,jr=16,mp=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:i,containerClassName:s})=>{let{toasts:a,handlers:l}=Hf(n);return d.createElement("div",{style:{position:"fixed",zIndex:9999,top:jr,left:jr,right:jr,bottom:jr,pointerEvents:"none",...i},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(u=>{let f=u.position||t,h=l.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),m=pp(f,h);return d.createElement(fp,{id:u.id,key:u.id,onHeightUpdate:l.updateHeight,className:u.visible?hp:"",style:m},u.type==="custom"?Pr(u.message,u):o?o(u):d.createElement(dp,{toast:u,position:f}))}))},na=ke;const ra=E("useNotifications",()=>({notify:fe((t,n,r)=>{const o={style:{background:"var(--platform-background-primary-color)",color:"var(--platform-text-primary-color)"}};n==="warning"||n==="info"?na(t,{...o,icon:n==="warning"?"⚠️":"ℹ️"}):na[n](t,o),r&&console.error(r)},[])}));var vn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Yt=typeof window>"u"||"Deno"in globalThis;function Ce(){}function gp(e,t){return typeof e=="function"?e(t):e}function qo(e){return typeof e=="number"&&e>=0&&e!==1/0}function oa(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rt(e,t){return typeof e=="function"?e(t):e}function He(e,t){return typeof e=="function"?e(t):e}function ia(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Ko(s,t.options))return!1}else if(!Zn(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function sa(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Zt(t.options.mutationKey)!==Zt(i))return!1}else if(!Zn(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ko(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zt)(e)}function Zt(e){return JSON.stringify(e,(t,n)=>Yo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Zn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Zn(e[n],t[n])):!1}function Qo(e,t){if(e===t)return e;const n=aa(e)&&aa(t);if(n||Yo(e)&&Yo(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let u=0;u<s;u++){const f=n?u:i[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,l++):(a[f]=Qo(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function kr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function aa(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yo(e){if(!la(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!la(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function la(e){return Object.prototype.toString.call(e)==="[object Object]"}function vp(e){return new Promise(t=>{setTimeout(t,e)})}function Zo(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){try{return Qo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Qo(e,t)}return t}function yp(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function bp(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Lr=Symbol();function ca(e,t){return e.queryFn===Lr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Lr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ua(e,t){return typeof e=="function"?e(...t):!!e}var wp=(Ku=class extends vn{constructor(){super();D(this,ln);D(this,kt);D(this,In);O(this,In,t=>{if(!Yt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,kt)||this.setEventListener(_(this,In))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,kt))==null||t.call(this),O(this,kt,void 0))}setEventListener(t){var n;O(this,In,t),(n=_(this,kt))==null||n.call(this),O(this,kt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,ln)!==t&&(O(this,ln,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,ln)=="boolean"?_(this,ln):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ln=new WeakMap,kt=new WeakMap,In=new WeakMap,Ku),Xo=new wp,_p=(Qu=class extends vn{constructor(){super();D(this,jn,!0);D(this,Lt);D(this,kn);O(this,kn,t=>{if(!Yt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Lt)||this.setEventListener(_(this,kn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Lt))==null||t.call(this),O(this,Lt,void 0))}setEventListener(t){var n;O(this,kn,t),(n=_(this,Lt))==null||n.call(this),O(this,Lt,t(this.setOnline.bind(this)))}setOnline(t){_(this,jn)!==t&&(O(this,jn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,jn)}},jn=new WeakMap,Lt=new WeakMap,kn=new WeakMap,Qu),Nr=new _p;function Jo(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function xp(e){return Math.min(1e3*2**e,3e4)}function da(e){return(e??"online")==="online"?Nr.isOnline():!0}var fa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ei(e){return e instanceof fa}function pa(e){let t=!1,n=0,r=!1,o;const i=Jo(),s=p=>{var v;r||(m(new fa(p)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Xo.isFocused()&&(e.networkMode==="always"||Nr.isOnline())&&e.canRun(),f=()=>da(e.networkMode)&&e.canRun(),h=p=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,p),o==null||o(),i.resolve(p))},m=p=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,p),o==null||o(),i.reject(p))},g=()=>new Promise(p=>{var v;o=y=>{(r||u())&&p(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(r)return;let p;const v=n===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(h).catch(y=>{var R;if(r)return;const w=e.retry??(Yt?0:3),C=e.retryDelay??xp,S=typeof C=="function"?C(n,y):C,T=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,y);if(t||!T){m(y);return}n++,(R=e.onFail)==null||R.call(e,n,y),vp(S).then(()=>u()?void 0:g()).then(()=>{t?m(y):x()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?x():g().then(x),i)}}var Cp=e=>setTimeout(e,0);function Sp(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Cp;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ye=Sp(),ha=(Yu=class{constructor(){D(this,cn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qo(this.gcTime)&&O(this,cn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yt?1/0:5*60*1e3))}clearGcTimeout(){_(this,cn)&&(clearTimeout(_(this,cn)),O(this,cn,void 0))}},cn=new WeakMap,Yu),Ep=(Zu=class extends ha{constructor(t){super();D(this,Qe);D(this,Ln);D(this,Nn);D(this,Me);D(this,un);D(this,xe);D(this,cr);D(this,dn);O(this,dn,!1),O(this,cr,t.defaultOptions),this.setOptions(t.options),this.observers=[],O(this,un,t.client),O(this,Me,_(this,un).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,O(this,Ln,Tp(this.options)),this.state=t.state??_(this,Ln),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,xe))==null?void 0:t.promise}setOptions(t){this.options={..._(this,cr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Me).remove(this)}setData(t,n){const r=Zo(this.state.data,t,this.options);return V(this,Qe,xt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){V(this,Qe,xt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=_(this,xe))==null?void 0:r.promise;return(o=_(this,xe))==null||o.cancel(t),n?n.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ln))}isActive(){return this.observers.some(t=>He(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Rt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!oa(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,xe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,xe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Me).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,xe)&&(_(this,dn)?_(this,xe).cancel({revert:!0}):_(this,xe).cancelRetry()),this.scheduleGc()),_(this,Me).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||V(this,Qe,xt).call(this,{type:"invalidate"})}fetch(t,n){var u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,xe))return _(this,xe).continueRetry(),_(this,xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(O(this,dn,!0),r.signal)})},i=()=>{const m=ca(this.options,n),x=(()=>{const p={client:_(this,un),queryKey:this.queryKey,meta:this.meta};return o(p),p})();return O(this,dn,!1),this.options.persister?this.options.persister(m,x,this):m(x)},a=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,un),state:this.state,fetchFn:i};return o(m),m})();(u=this.options.behavior)==null||u.onFetch(a,this),O(this,Nn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&V(this,Qe,xt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=m=>{var g,x,p,v;ei(m)&&m.silent||V(this,Qe,xt).call(this,{type:"error",error:m}),ei(m)||((x=(g=_(this,Me).config).onError)==null||x.call(g,m,this),(v=(p=_(this,Me).config).onSettled)==null||v.call(p,this.state.data,m,this)),this.scheduleGc()};return O(this,xe,pa({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var g,x,p,v;if(m===void 0){console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(y){l(y);return}(x=(g=_(this,Me).config).onSuccess)==null||x.call(g,m,this),(v=(p=_(this,Me).config).onSettled)==null||v.call(p,m,this.state.error,this),this.scheduleGc()},onError:l,onFail:(m,g)=>{V(this,Qe,xt).call(this,{type:"failed",failureCount:m,error:g})},onPause:()=>{V(this,Qe,xt).call(this,{type:"pause"})},onContinue:()=>{V(this,Qe,xt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),_(this,xe).start()}},Ln=new WeakMap,Nn=new WeakMap,Me=new WeakMap,un=new WeakMap,xe=new WeakMap,cr=new WeakMap,dn=new WeakMap,Qe=new WeakSet,xt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ma(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return ei(o)&&o.revert&&_(this,Nn)?{..._(this,Nn),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Me).notify({query:this,type:"updated",action:t})})},Zu);function ma(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:da(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Tp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rp=(Xu=class extends vn{constructor(t={}){super();D(this,st);this.config=t,O(this,st,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Ko(o,n);let s=this.get(i);return s||(s=new Ep({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){_(this,st).has(t.queryHash)||(_(this,st).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,st).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,st).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,st).get(t)}getAll(){return[..._(this,st).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ia(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ia(t,r)):n}notify(t){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},st=new WeakMap,Xu),Pp=(Ju=class extends ha{constructor(t){super();D(this,lt);D(this,at);D(this,Ee);D(this,fn);this.mutationId=t.mutationId,O(this,Ee,t.mutationCache),O(this,at,[]),this.state=t.state||ga(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,at).includes(t)||(_(this,at).push(t),this.clearGcTimeout(),_(this,Ee).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){O(this,at,_(this,at).filter(n=>n!==t)),this.scheduleGc(),_(this,Ee).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,at).length||(this.state.status==="pending"?this.scheduleGc():_(this,Ee).remove(this))}continue(){var t;return((t=_(this,fn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,a,l,u,f,h,m,g,x,p,v,y,w,C,S,T,R,P,L;const n=()=>{V(this,lt,qt).call(this,{type:"continue"})};O(this,fn,pa({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,N)=>{V(this,lt,qt).call(this,{type:"failed",failureCount:j,error:N})},onPause:()=>{V(this,lt,qt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Ee).canRun(this)}));const r=this.state.status==="pending",o=!_(this,fn).canStart();try{if(r)n();else{V(this,lt,qt).call(this,{type:"pending",variables:t,isPaused:o}),await((s=(i=_(this,Ee).config).onMutate)==null?void 0:s.call(i,t,this));const N=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));N!==this.state.context&&V(this,lt,qt).call(this,{type:"pending",context:N,variables:t,isPaused:o})}const j=await _(this,fn).start();return await((f=(u=_(this,Ee).config).onSuccess)==null?void 0:f.call(u,j,t,this.state.context,this)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,j,t,this.state.context)),await((x=(g=_(this,Ee).config).onSettled)==null?void 0:x.call(g,j,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,j,null,t,this.state.context)),V(this,lt,qt).call(this,{type:"success",data:j}),j}catch(j){try{throw await((w=(y=_(this,Ee).config).onError)==null?void 0:w.call(y,j,t,this.state.context,this)),await((S=(C=this.options).onError)==null?void 0:S.call(C,j,t,this.state.context)),await((R=(T=_(this,Ee).config).onSettled)==null?void 0:R.call(T,void 0,j,this.state.variables,this.state.context,this)),await((L=(P=this.options).onSettled)==null?void 0:L.call(P,void 0,j,t,this.state.context)),j}finally{V(this,lt,qt).call(this,{type:"error",error:j})}}finally{_(this,Ee).runNext(this)}}},at=new WeakMap,Ee=new WeakMap,fn=new WeakMap,lt=new WeakSet,qt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ye.batch(()=>{_(this,at).forEach(r=>{r.onMutationUpdate(t)}),_(this,Ee).notify({mutation:this,type:"updated",action:t})})},Ju);function ga(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ap=(ed=class extends vn{constructor(t={}){super();D(this,yt);D(this,Ye);D(this,ur);this.config=t,O(this,yt,new Set),O(this,Ye,new Map),O(this,ur,0)}build(t,n,r){const o=new Pp({mutationCache:this,mutationId:++Ao(this,ur)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){_(this,yt).add(t);const n=Dr(t);if(typeof n=="string"){const r=_(this,Ye).get(n);r?r.push(t):_(this,Ye).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,yt).delete(t)){const n=Dr(t);if(typeof n=="string"){const r=_(this,Ye).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&_(this,Ye).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Dr(t);if(typeof n=="string"){const r=_(this,Ye).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Dr(t);if(typeof n=="string"){const o=(r=_(this,Ye).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ye.batch(()=>{_(this,yt).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,yt).clear(),_(this,Ye).clear()})}getAll(){return Array.from(_(this,yt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sa(n,r))}findAll(t={}){return this.getAll().filter(n=>sa(t,n))}notify(t){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ce))))}},yt=new WeakMap,Ye=new WeakMap,ur=new WeakMap,ed);function Dr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function va(e){return{onFetch:(t,n)=>{var f,h,m,g,x;const r=t.options,o=(m=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],s=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const v=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},y=ca(t.options,t.fetchOptions),w=async(C,S,T)=>{if(p)return Promise.reject();if(S==null&&C.pages.length)return Promise.resolve(C);const P=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:S,direction:T?"backward":"forward",meta:t.options.meta};return v(B),B})(),L=await y(P),{maxPages:j}=t.options,N=T?bp:yp;return{pages:N(C.pages,L,j),pageParams:N(C.pageParams,S,j)}};if(o&&i.length){const C=o==="backward",S=C?Op:ya,T={pages:i,pageParams:s},R=S(r,T);a=await w(T,R,C)}else{const C=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:ya(r,a);if(l>0&&S==null)break;a=await w(a,S),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function ya(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Op(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ip=(td=class{constructor(e={}){D(this,he);D(this,Nt);D(this,Dt);D(this,Dn);D(this,Mn);D(this,Mt);D(this,$n);D(this,Fn);O(this,he,e.queryCache||new Rp),O(this,Nt,e.mutationCache||new Ap),O(this,Dt,e.defaultOptions||{}),O(this,Dn,new Map),O(this,Mn,new Map),O(this,Mt,0)}mount(){Ao(this,Mt)._++,_(this,Mt)===1&&(O(this,$n,Xo.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,he).onFocus())})),O(this,Fn,Nr.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,he).onOnline())})))}unmount(){var e,t;Ao(this,Mt)._--,_(this,Mt)===0&&((e=_(this,$n))==null||e.call(this),O(this,$n,void 0),(t=_(this,Fn))==null||t.call(this),O(this,Fn,void 0))}isFetching(e){return _(this,he).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Nt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,he).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,he).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,he).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=_(this,he).get(r.queryHash),i=o==null?void 0:o.state.data,s=gp(t,i);if(s!==void 0)return _(this,he).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return ye.batch(()=>_(this,he).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,he).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,he);ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,he);return ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ye.batch(()=>_(this,he).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ce).catch(Ce)}invalidateQueries(e,t={}){return ye.batch(()=>(_(this,he).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ye.batch(()=>_(this,he).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ce)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ce)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,he).build(this,t);return n.isStaleByTime(Rt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ce).catch(Ce)}fetchInfiniteQuery(e){return e.behavior=va(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ce).catch(Ce)}ensureInfiniteQueryData(e){return e.behavior=va(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nr.isOnline()?_(this,Nt).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,he)}getMutationCache(){return _(this,Nt)}getDefaultOptions(){return _(this,Dt)}setDefaultOptions(e){O(this,Dt,e)}setQueryDefaults(e,t){_(this,Dn).set(Zt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Dn).values()],n={};return t.forEach(r=>{Zn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,Mn).set(Zt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Mn).values()],n={};return t.forEach(r=>{Zn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Dt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ko(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Lr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Dt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,he).clear(),_(this,Nt).clear()}},he=new WeakMap,Nt=new WeakMap,Dt=new WeakMap,Dn=new WeakMap,Mn=new WeakMap,Mt=new WeakMap,$n=new WeakMap,Fn=new WeakMap,td),jp=(nd=class extends vn{constructor(t,n){super();D(this,ne);D(this,Oe);D(this,Q);D(this,dr);D(this,Te);D(this,pn);D(this,Bn);D(this,$t);D(this,Ft);D(this,fr);D(this,Un);D(this,Wn);D(this,hn);D(this,mn);D(this,Bt);D(this,Hn,new Set);this.options=n,O(this,Oe,t),O(this,Ft,null),O(this,$t,Jo()),this.options.experimental_prefetchInRender||_(this,$t).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Q).addObserver(this),ba(_(this,Q),this.options)?V(this,ne,pr).call(this):this.updateResult(),V(this,ne,ps).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ti(_(this,Q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ti(_(this,Q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,V(this,ne,hs).call(this),V(this,ne,ms).call(this),_(this,Q).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,Q);if(this.options=_(this,Oe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof He(this.options.enabled,_(this,Q))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");V(this,ne,gs).call(this),_(this,Q).setOptions(this.options),n._defaulted&&!kr(this.options,n)&&_(this,Oe).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Q),observer:this});const o=this.hasListeners();o&&wa(_(this,Q),r,this.options,n)&&V(this,ne,pr).call(this),this.updateResult(),o&&(_(this,Q)!==r||He(this.options.enabled,_(this,Q))!==He(n.enabled,_(this,Q))||Rt(this.options.staleTime,_(this,Q))!==Rt(n.staleTime,_(this,Q)))&&V(this,ne,us).call(this);const i=V(this,ne,ds).call(this);o&&(_(this,Q)!==r||He(this.options.enabled,_(this,Q))!==He(n.enabled,_(this,Q))||i!==_(this,Bt))&&V(this,ne,fs).call(this,i)}getOptimisticResult(t){const n=_(this,Oe).getQueryCache().build(_(this,Oe),t),r=this.createResult(n,t);return Lp(this,r)&&(O(this,Te,r),O(this,Bn,this.options),O(this,pn,_(this,Q).state)),r}getCurrentResult(){return _(this,Te)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){_(this,Hn).add(t)}getCurrentQuery(){return _(this,Q)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Oe).defaultQueryOptions(t),r=_(this,Oe).getQueryCache().build(_(this,Oe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return V(this,ne,pr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Te)))}createResult(t,n){var j;const r=_(this,Q),o=this.options,i=_(this,Te),s=_(this,pn),a=_(this,Bn),u=t!==r?t.state:_(this,dr),{state:f}=t;let h={...f},m=!1,g;if(n._optimisticResults){const N=this.hasListeners(),B=!N&&ba(t,n),U=N&&wa(t,r,n,o);(B||U)&&(h={...h,...ma(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:p,status:v}=h;g=h.data;let y=!1;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let N;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(N=i.data,y=!0):N=typeof n.placeholderData=="function"?n.placeholderData((j=_(this,Wn))==null?void 0:j.state.data,_(this,Wn)):n.placeholderData,N!==void 0&&(v="success",g=Zo(i==null?void 0:i.data,N,n),m=!0)}if(n.select&&g!==void 0&&!y)if(i&&g===(s==null?void 0:s.data)&&n.select===_(this,fr))g=_(this,Un);else try{O(this,fr,n.select),g=n.select(g),g=Zo(i==null?void 0:i.data,g,n),O(this,Un,g),O(this,Ft,null)}catch(N){O(this,Ft,N)}_(this,Ft)&&(x=_(this,Ft),g=_(this,Un),p=Date.now(),v="error");const w=h.fetchStatus==="fetching",C=v==="pending",S=v==="error",T=C&&w,R=g!==void 0,L={status:v,fetchStatus:h.fetchStatus,isPending:C,isSuccess:v==="success",isError:S,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:S&&!R,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&R,isStale:ni(t,n),refetch:this.refetch,promise:_(this,$t)};if(this.options.experimental_prefetchInRender){const N=H=>{L.status==="error"?H.reject(L.error):L.data!==void 0&&H.resolve(L.data)},B=()=>{const H=O(this,$t,L.promise=Jo());N(H)},U=_(this,$t);switch(U.status){case"pending":t.queryHash===r.queryHash&&N(U);break;case"fulfilled":(L.status==="error"||L.data!==U.value)&&B();break;case"rejected":(L.status!=="error"||L.error!==U.reason)&&B();break}}return L}updateResult(){const t=_(this,Te),n=this.createResult(_(this,Q),this.options);if(O(this,pn,_(this,Q).state),O(this,Bn,this.options),_(this,pn).data!==void 0&&O(this,Wn,_(this,Q)),kr(n,t))return;O(this,Te,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!_(this,Hn).size)return!0;const s=new Set(i??_(this,Hn));return this.options.throwOnError&&s.add("error"),Object.keys(_(this,Te)).some(a=>{const l=a;return _(this,Te)[l]!==t[l]&&s.has(l)})};V(this,ne,vd).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&V(this,ne,ps).call(this)}},Oe=new WeakMap,Q=new WeakMap,dr=new WeakMap,Te=new WeakMap,pn=new WeakMap,Bn=new WeakMap,$t=new WeakMap,Ft=new WeakMap,fr=new WeakMap,Un=new WeakMap,Wn=new WeakMap,hn=new WeakMap,mn=new WeakMap,Bt=new WeakMap,Hn=new WeakMap,ne=new WeakSet,pr=function(t){V(this,ne,gs).call(this);let n=_(this,Q).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ce)),n},us=function(){V(this,ne,hs).call(this);const t=Rt(this.options.staleTime,_(this,Q));if(Yt||_(this,Te).isStale||!qo(t))return;const r=oa(_(this,Te).dataUpdatedAt,t)+1;O(this,hn,setTimeout(()=>{_(this,Te).isStale||this.updateResult()},r))},ds=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Q)):this.options.refetchInterval)??!1},fs=function(t){V(this,ne,ms).call(this),O(this,Bt,t),!(Yt||He(this.options.enabled,_(this,Q))===!1||!qo(_(this,Bt))||_(this,Bt)===0)&&O(this,mn,setInterval(()=>{(this.options.refetchIntervalInBackground||Xo.isFocused())&&V(this,ne,pr).call(this)},_(this,Bt)))},ps=function(){V(this,ne,us).call(this),V(this,ne,fs).call(this,V(this,ne,ds).call(this))},hs=function(){_(this,hn)&&(clearTimeout(_(this,hn)),O(this,hn,void 0))},ms=function(){_(this,mn)&&(clearInterval(_(this,mn)),O(this,mn,void 0))},gs=function(){const t=_(this,Oe).getQueryCache().build(_(this,Oe),this.options);if(t===_(this,Q))return;const n=_(this,Q);O(this,Q,t),O(this,dr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},vd=function(t){ye.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,Te))}),_(this,Oe).getQueryCache().notify({query:_(this,Q),type:"observerResultsUpdated"})})},nd);function kp(e,t){return He(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ba(e,t){return kp(e,t)||e.state.data!==void 0&&ti(e,t,t.refetchOnMount)}function ti(e,t,n){if(He(t.enabled,e)!==!1&&Rt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ni(e,t)}return!1}function wa(e,t,n,r){return(e!==t||He(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ni(e,n)}function ni(e,t){return He(t.enabled,e)!==!1&&e.isStaleByTime(Rt(t.staleTime,e))}function Lp(e,t){return!kr(e.getCurrentResult(),t)}var Np=(rd=class extends vn{constructor(n,r){super();D(this,wt);D(this,Ut);D(this,Wt);D(this,Ie);D(this,bt);O(this,Ut,n),this.setOptions(r),this.bindMethods(),V(this,wt,Oo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=_(this,Ut).defaultMutationOptions(n),kr(this.options,r)||_(this,Ut).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Ie),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Zt(r.mutationKey)!==Zt(this.options.mutationKey)?this.reset():((o=_(this,Ie))==null?void 0:o.state.status)==="pending"&&_(this,Ie).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Ie))==null||n.removeObserver(this)}onMutationUpdate(n){V(this,wt,Oo).call(this),V(this,wt,vs).call(this,n)}getCurrentResult(){return _(this,Wt)}reset(){var n;(n=_(this,Ie))==null||n.removeObserver(this),O(this,Ie,void 0),V(this,wt,Oo).call(this),V(this,wt,vs).call(this)}mutate(n,r){var o;return O(this,bt,r),(o=_(this,Ie))==null||o.removeObserver(this),O(this,Ie,_(this,Ut).getMutationCache().build(_(this,Ut),this.options)),_(this,Ie).addObserver(this),_(this,Ie).execute(n)}},Ut=new WeakMap,Wt=new WeakMap,Ie=new WeakMap,bt=new WeakMap,wt=new WeakSet,Oo=function(){var r;const n=((r=_(this,Ie))==null?void 0:r.state)??ga();O(this,Wt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vs=function(n){ye.batch(()=>{var r,o,i,s,a,l,u,f;if(_(this,bt)&&this.hasListeners()){const h=_(this,Wt).variables,m=_(this,Wt).context;(n==null?void 0:n.type)==="success"?((o=(r=_(this,bt)).onSuccess)==null||o.call(r,n.data,h,m),(s=(i=_(this,bt)).onSettled)==null||s.call(i,n.data,null,h,m)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,bt)).onError)==null||l.call(a,n.error,h,m),(f=(u=_(this,bt)).onSettled)==null||f.call(u,void 0,n.error,h,m))}this.listeners.forEach(h=>{h(_(this,Wt))})})},rd),_a=d.createContext(void 0),ri=e=>{const t=d.useContext(_a);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Dp=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(_a.Provider,{value:e,children:t})),xa=d.createContext(!1),Mp=()=>d.useContext(xa);xa.Provider;function $p(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Fp=d.createContext($p()),Bp=()=>d.useContext(Fp),Up=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Wp=e=>{d.useEffect(()=>{e.clearReset()},[e])},Hp=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||ua(n,[e.error,r])),Vp=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zp=(e,t)=>e.isLoading&&e.isFetching&&!t,Gp=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ca=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qp(e,t,n){var h,m,g,x,p;if(typeof e!="object"||Array.isArray(e))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Mp(),o=Bp(),i=ri(),s=i.defaultQueryOptions(e);(m=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||m.call(h,s),s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),s._optimisticResults=r?"isRestoring":"optimistic",Vp(s),Up(s,o),Wp(o);const a=!i.getQueryCache().get(s.queryHash),[l]=d.useState(()=>new t(i,s)),u=l.getOptimisticResult(s),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(v=>{const y=f?l.subscribe(ye.batchCalls(v)):Ce;return l.updateResult(),y},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(s)},[s,l]),Gp(s,u))throw Ca(s,l,o);if(Hp({result:u,errorResetBoundary:o,throwOnError:s.throwOnError,query:i.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if((x=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||x.call(g,s,u),s.experimental_prefetchInRender&&!Yt&&zp(u,r)){const v=a?Ca(s,l,o):(p=i.getQueryCache().get(s.queryHash))==null?void 0:p.promise;v==null||v.catch(Ce).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function Sa(e,t){return qp(e,jp)}function Mr(e,t){const n=ri(),[r]=d.useState(()=>new Np(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const o=d.useSyncExternalStore(d.useCallback(s=>r.subscribe(ye.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=d.useCallback((s,a)=>{r.mutate(s,a).catch(Ce)},[r]);if(o.error&&ua(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const $r={STALE_TIME:1e3*60*5,GC_TIME:1e3*60*10,RETRY_COUNT:1,RETRY_DELAY:1e3},Ea={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:$r.STALE_TIME,gcTime:$r.GC_TIME,retry:$r.RETRY_COUNT,retryDelay:$r.RETRY_DELAY,enable:!0},Fr=e=>e instanceof Error?e.message:String(e),Kp=E("useResourceActions",(e,t,n)=>{const r=ri(),{notify:o}=ra(),{createFn:i,readFn:s,readByIdFn:a,updateFn:l,deleteFn:u,partialUpdateFn:f}=n,h=()=>{r.invalidateQueries({queryKey:[e]})},m=(S,T,R,P)=>o(P!=null&&P.overrideSuccessMessage?P==null?void 0:P.overrideSuccessMessage(S,T):R,"success"),g=(S,T,R,P)=>o(P!=null&&P.overrideErrorMessage?P==null?void 0:P.overrideErrorMessage(S,T):R,"error");return{useCreate:S=>Mr({mutationFn:T=>i(T),onSuccess:T=>{h(),m(t,T,`${t} created successfully`,S)},onError:T=>{g(t,T,`Error creating ${t}: ${Fr(T)}`,S)}}),useReadQuery:S=>Sa({queryKey:[e],queryFn:s,...Ea,...S}),useReadByIdQuery:(S,T)=>Sa({queryKey:[e,S],queryFn:()=>a(S),...Ea,enabled:!!S,...T}),useUpdate:S=>Mr({mutationFn:({id:T,data:R})=>l(T,R),onSuccess:T=>{h(),m(t,T,`${t} updated successfully`,S)},onError:T=>{g(t,T,`Error updating ${t}: ${Fr(T)}`,S)}}),usePartialUpdate:S=>f&&Mr({mutationFn:({id:T,data:R})=>f(T,R),onSuccess:T=>{h(),m(t,T,`${t} updated successfully`,S)},onError:T=>{g(t,T,`Error updating ${t}: ${Fr(T)}`,S)}}),useDelete:S=>Mr({mutationFn:T=>u(T),onSuccess:()=>{h(),m(t,null,`${t} deleted successfully`,S)},onError:T=>{g(t,T,`Error deleting ${t}: ${Fr(T)}`,S)}}),invalidateQueries:h}}),L0=E("useResource",(e,t)=>Kp(e,t,{createFn:n=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r=>r.json()),deleteFn:n=>fetch(`${e}/${n}`,{method:"DELETE"}).then(r=>{if(!r.ok)throw new Error(`Error deleting: ${r.status}`)}),readByIdFn:n=>fetch(`${e}/${n}`).then(r=>r.json()),readFn:()=>fetch(e).then(n=>n.json()),updateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json()),partialUpdateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json())})),Qp={SINGLE_TENANT:"single-tenant"},Yp={COOKIE:"cookie"},oi="tenant",Ta="tenant",Ra="tenant",Zp=Qp.SINGLE_TENANT,Xp=Yp.COOKIE,Jp={mode:Zp,clientSideMode:Xp,tenantIDPProvisioningStrategy:"none"};class eh{setTenant(t,n){const r=new URL(window.location.href);r.searchParams.set(Ta,t.name),window.location.href=r.toString()}getCurrentTenantName(){const t=new URL(window.location.href);return new URLSearchParams(t.search).get(Ta)}}class th{setTenant(t,n){sessionStorage.setItem(Ra,t.name),window.location.reload()}getCurrentTenantName(){return sessionStorage.getItem(Ra)}}/*! js-cookie v3.0.5 | MIT */function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var nh={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ii(e,t){function n(o,i,s){if(!(typeof document>"u")){s=Br({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],s={},a=0;a<i.length;a++){var l=i[a].split("="),u=l.slice(1).join("=");try{var f=decodeURIComponent(l[0]);if(s[f]=e.read(u,f),o===f)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Br({},i,{expires:-1}))},withAttributes:function(o){return ii(this.converter,Br({},this.attributes,o))},withConverter:function(o){return ii(Br({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var si=ii(nh,{path:"/"});class rh{setTenant(t,n){t?si.set(oi,t.name):si.remove(oi),window.location.reload()}getCurrentTenantName(){return si.get(oi)}}class oh{extractSubdomain(t){if(t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t))return"";const n=t.split(".");if(n.length<2||n.length===2||n[0]==="www"&&n.length===3)return"";const o=(n[0]==="www"?n.slice(1):n).slice(0,-2);return o.length>0?o.join("."):""}getBaseDomain(t){const n=t.split(".");return t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t)||n.length<=2?t:n.slice(-2).join(".")}setTenant(t,n){var u;const r=(u=n.urlPatterns)==null?void 0:u.find(f=>f.patternType==="subdomain"&&f.tenantId===t.id&&f.isActive);if(!r)throw new Error(`No active subdomain pattern found for tenant '${t.name}'`);const o=new URL(window.location.href),i=r.patternValue,s=o.hostname,a=this.getBaseDomain(s),l=i?`${i}.${a}`:a;o.hostname=l,window.location.href=o.toString()}getCurrentTenantName(){const t=window.location.hostname;return this.extractSubdomain(t)||null}}const Pa={queryParams:new eh,sessionStorage:new th,cookie:new rh,subdomain:new oh},ih=e=>{const t=Pa[e.clientSideMode];if(!t)throw new Error(`Client side tenant mode '${e.clientSideMode}' is not supported ${JSON.stringify({strategies:Pa},null,2)}`);return t},sh=(e,t,n)=>{const r=t.find(i=>i.name===n);if(!r)throw Error("No tenant permission");return ih(e).setTenant(r,e),r},N0=E("useTenants",()=>{const[e,t]=vr(),{tenants:n=[],currentTenant:r,tenantConfig:o=Jp}=e,i=fe(s=>{const a=sh(o,n,s);t({...e,currentTenant:a})},[o,e]);return{tenants:n,currentTenant:r,tenantConfig:o,selectTenant:i}});function ah(e){if(!e.ok)throw console.error(e),new Error(e.statusText)}async function Ur(e,t,n,r){const o=await e(`/user-states/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,r);return ah(o),o}class Wr{static async get(t,n,r){const i=await Ur(t,n,r,{method:"GET",headers:{"Content-Type":"application/json"}});return i.status===204?null:await i.json()}static async create(t,n,r,o){const i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Ur(t,n,r,i)).json()}static async update(t,n,r,o){const i={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Ur(t,n,r,i)).json()}static async delete(t,n,r){return await Ur(t,n,r,{method:"DELETE",headers:{"Content-Type":"application/json"}}),null}}const D0=E("useUserState",e=>{const t=Ms("@bluealba/pae-nestjs-gateway-service"),n=Yd();if(!n)throw new Error("You must call the useUserState hook within a PAE application.");const[r,o]=W(null),[i,s]=W(!1),[a,l]=W(!1),[u,f]=W(null),h=(w,C)=>fe(async({newValue:S,shouldThrowError:T}={})=>{try{l(!0),f(null);const R=await w(t,n,e,S);return o(R),R?R.value:null}catch(R){if(f(R==null?void 0:R.message),console.error(`Failed to ${C} ${e}:`,R),T)throw R;return null}finally{l(!1)}},[t,n,e]),m=h(Wr.get,"fetch"),g=h(Wr.create,"create"),x=h(Wr.update,"update"),p=h(Wr.delete,"delete"),v=fe(async()=>{try{await m()}finally{s(!0)}},[m]);te(()=>{v()},[v]);const y=fe(async(w,C=!1)=>r==null?await g({newValue:w,shouldThrowError:C}):await x({newValue:w,shouldThrowError:C}),[r,g,x]);return{value:r?r.value:null,hasFetched:i,loading:a,error:u,setValue:y,createValue:g,updateValue:x,deleteValue:p}}),Aa="__PAE_EXTENSION_POINT_REACT_CONTENT_EMPTY__",M0=E("ExtendExtensionPoint",({module:e,point:t,children:n})=>(sf(e,t,n??Aa),null)),lh=E("ExtensionPoint",({name:e,children:t,...n})=>{const r=of(e);if(r===Aa)return null;if(!r)return c.jsx(c.Fragment,{children:t??null});if(ch(r)){const o=r;return c.jsx(o,{...n})}else return r}),ch=e=>typeof e=="function",$0=E("extensionPoint",(e,t)=>{const n=r=>(t=t||e.displayName||e.name||"?",c.jsx(lh,{name:t,...r,children:c.jsx(e,{...r})}));return n.displayName=`extensionPoint(${t})`,n}),Oa="single-spa:app-change";function uh(){const[e,t]=W(Ia());return te(()=>{const n=()=>{t(Ia())};return window.addEventListener(Oa,n),()=>{window.removeEventListener(Oa,n)}},[]),e}function Ia(){return gr.getAppNames().reduce((t,n)=>(gr.getAppStatus(n)?t[n]=gr.getAppStatus(n):t[n]="NOT_LOADED",t),{})}function dh(e){const n=uh()[e]??"LOAD_ERROR";return{statusName:n,isLoading:n==="LOADING_SOURCE_CODE"||n==="BOOTSTRAPPING"||n==="MOUNTING",isMounted:n==="MOUNTED",isBroken:n==="SKIP_BECAUSE_BROKEN"||n==="LOAD_ERROR"}}const ja=({appName:e})=>c.jsx("div",{children:c.jsxs("p",{children:["Loading ",e,"..."]})});ja.displayName="BaseLoading";const ka=({appName:e})=>c.jsxs("div",{children:[c.jsx("p",{children:"Something went wrong..."}),c.jsxs("p",{children:["Failed to load ",e]})]});ka.displayName="BaseError";const fh={display:"flex",flexDirection:"column",flex:1},La=q((e,t)=>c.jsx("div",{ref:t,style:fh,...e}));La.displayName="BaseContainer";const ph="pae-app:",hh=E("ModulePlaceHolder",q(({appName:e,LoadingComponent:t=ja,ErrorComponent:n=ka,ContainerComponent:r=La,...o},i)=>{const s=dh(e);return c.jsxs(r,{ref:i,...o,id:`${ph}${e}`,children:[s.isLoading&&c.jsx(t,{appName:e}),s.isBroken&&c.jsx(n,{appName:e})]})}));hh.displayName="ModulePlaceHolder";const Na=E("Authorized",({operations:e,children:t,forbiddenContent:n})=>{var o;const{hasAccess:r}=wr();if(!r(...e)){if(!n)return null;if(typeof n=="function")if((o=n==null?void 0:n.prototype)!=null&&o.isReactComponent){const i=n;return c.jsx(i,{operations:e})}else return n({operations:e});return Ue.isValidElement(n)?n:null}return t});Na.displayName="Authorized";const F0=E("PlatformEventListener",({eventName:e,listener:t})=>(af(e,t),null)),mh=()=>c.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M8.737 8.737a21.49 21.49 0 0 1 3.308-2.724m0 0c3.063-2.026 5.99-2.641 7.331-1.3 1.827 1.828.026 6.591-4.023 10.64-4.049 4.049-8.812 5.85-10.64 4.023-1.33-1.33-.736-4.218 1.249-7.253m6.083-6.11c-3.063-2.026-5.99-2.641-7.331-1.3-1.827 1.828-.026 6.591 4.023 10.64m3.308-9.34a21.497 21.497 0 0 1 3.308 2.724m2.775 3.386c1.985 3.035 2.579 5.923 1.248 7.253-1.336 1.337-4.245.732-7.295-1.275M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})}),gh=E("ApplicationIcon",({applicationName:e})=>{const t=Bd(e);if(t)if(typeof t=="function"){const n=t;return c.jsx(n,{})}else return t;return c.jsx(mh,{})});gh.displayName="ApplicationIcon";const Da=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});Da.displayName="DarkModeIcon";const Ma=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:"matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,0,0)",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});Ma.displayName="LightModeIcon";const ai={container:"container__zBqbk",expanded:"expanded__EbsIr",label:"label__cdMnm"};function $a(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=$a(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function k(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$a(e))&&(r&&(r+=" "),r+=t);return r}const vh=e=>e.toLowerCase().trim().split(" ").join("-"),yh=e=>`${vh(e)}-theme`,bh=E("useTheme",()=>{const{platformName:e="Platform"}=Os(),t=yh(e),[n,r]=W(()=>{const i=localStorage.getItem(t);return i==="light"||i==="dark"?i:"light"}),o=i=>{localStorage.setItem(t,i),r(i)};return te(()=>{document.documentElement.setAttribute("data-theme",n)},[n]),{theme:n,setTheme:o}}),Hr={spinner:"spinner__fakUN","spinner-rotation":"spinner-rotation__wUmPV",spinnerRotation:"spinner-rotation__wUmPV",button:"button__8FA9H","button--contained-primary":"button--contained-primary__stkTx",buttonContainedPrimary:"button--contained-primary__stkTx","button--outlined-primary":"button--outlined-primary__KZ1ww",buttonOutlinedPrimary:"button--outlined-primary__KZ1ww","button--text-primary":"button--text-primary__GLTfm",buttonTextPrimary:"button--text-primary__GLTfm","button--contained-danger":"button--contained-danger__L9ehT",buttonContainedDanger:"button--contained-danger__L9ehT","button--outlined-danger":"button--outlined-danger__eoYLd",buttonOutlinedDanger:"button--outlined-danger__eoYLd","button--text-danger":"button--text-danger__Sw-ha",buttonTextDanger:"button--text-danger__Sw-ha",icon:"icon__--umH"},li=E("Button",q(({variant:e="contained",colorScheme:t="primary",loading:n=!1,IconComponent:r,className:o,children:i,...s},a)=>{const l=k(Hr.button,Hr[`button--${e}-${t}`],o);return c.jsxs("button",{ref:a,className:l,...s,children:[n?c.jsx("div",{className:Hr.spinner}):r&&c.jsx(r,{className:Hr.icon}),i]})}));li.displayName="Button";const Vr={Badges:"Badges__5jpum",badges:"Badges__5jpum",Badge:"Badge__95MWM",badge:"Badge__95MWM","Badge--primary":"Badge--primary__Rx-bS",badgePrimary:"Badge--primary__Rx-bS","Badge--secondary":"Badge--secondary__d92bT",badgeSecondary:"Badge--secondary__d92bT","Badge--success":"Badge--success__Kdo98",badgeSuccess:"Badge--success__Kdo98","Badge--warning":"Badge--warning__bf-Nn",badgeWarning:"Badge--warning__bf-Nn","Badge--danger":"Badge--danger__HTj39",badgeDanger:"Badge--danger__HTj39","Badge--small":"Badge--small__y93Pj",badgeSmall:"Badge--small__y93Pj","Badge--regular":"Badge--regular__aT5AL",badgeRegular:"Badge--regular__aT5AL","Badge--large":"Badge--large__wORCH",badgeLarge:"Badge--large__wORCH"},ci={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in ci)Object.freeze(ci[e]);const Fa=Object.freeze(ci);var Ba={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function wh(e){var f,h;var t,n=[],r=1,o;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),Fa[e])n=Fa[e].slice(),o="rgb";else if(e==="transparent")r=0,o="rgb",n=[0,0,0];else if(e[0]==="#"){var i=e.slice(1),s=i.length,a=s<=4;r=1,a?(n=[parseInt(i[0]+i[0],16),parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16)],s===4&&(r=parseInt(i[3]+i[3],16)/255)):(n=[parseInt(i[0]+i[1],16),parseInt(i[2]+i[3],16),parseInt(i[4]+i[5],16)],s===8&&(r=parseInt(i[6]+i[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),o="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var l=t[1];o=l.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=n.shift()),n=n.map(function(m,g){if(m[m.length-1]==="%")return m=parseFloat(m)/100,g===3?m:o==="rgb"?m*255:o[0]==="h"||o[0]==="l"&&!g?m*100:o==="lab"?m*125:o==="lch"?g<2?m*150:m*360:o[0]==="o"&&!g?m:o==="oklab"?m*.4:o==="oklch"?g<2?m*.4:m*360:m;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(Ba[m]!==void 0)return Ba[m];if(m.endsWith("deg"))return parseFloat(m);if(m.endsWith("turn"))return parseFloat(m)*360;if(m.endsWith("grad"))return parseFloat(m)*360/400;if(m.endsWith("rad"))return parseFloat(m)*180/Math.PI}return m==="none"?0:parseFloat(m)}),r=n.length>u?n.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(m){return parseFloat(m)}),o=((h=(f=e.match(/([a-z])/ig))==null?void 0:f.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:o,values:n,alpha:r}}const _h=(e,t)=>{const{space:n,values:r}=wh(e);return n[0]==="h"?`${n}a(${r[0]}, ${r[1]}%, ${r[2]}%, ${t})`:`${n}a(${r}, ${t})`},Ua=E("Badge",q(({children:e,color:t,className:n,customColor:r,size:o="small",style:i,...s},a)=>{const l=r?{color:r,background:_h(r,.1)}:{},u=k(Vr.Badge,Vr[`Badge--${o}`],{[Vr[`Badge--${t}`]]:!!t},n);return c.jsx("span",{ref:a,className:u,style:{...i,...l},...s,children:e})}));Ua.displayName="Badge";const Wa=E("Badges",q(({children:e,className:t,...n},r)=>{const o=k(Vr.Badges,t);return c.jsx("div",{ref:r,className:o,...n,children:e})}));Wa.displayName="Badges";const xh=E("ClipboardIcon",({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...i})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...i,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]})),Ch=E("ClipboardCheckIcon",({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...i})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...i,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),c.jsx("path",{d:"m9 12 2 2 4-4"})]})),Sh={CopyToClipboardButton:"CopyToClipboardButton__2Nd2m"},fb=E("CopyToClipboardButton",({content:e})=>{const[t,n]=Eh(),{notify:r}=ra(),o=t?Ch:xh,i=fe(async()=>{await n(e)&&r("Copied to the Clipboard !","success")},[e,r]);return c.jsx(o,{className:Sh.CopyToClipboardButton,size:18,onClick:i})}),Eh=()=>{const[e,t]=W(!1);return[e,async r=>{try{return await navigator.clipboard.writeText(r),t(!0),setTimeout(()=>t(!1),2e3),!0}catch(o){return console.error("Failed to copy text: ",o),!1}}]},Ha={FieldGroup:"FieldGroup__Q2JCV",fieldGroup:"FieldGroup__Q2JCV","FieldGroup--horizontal":"FieldGroup--horizontal__kpfL1",fieldGroupHorizontal:"FieldGroup--horizontal__kpfL1","FieldGroup--vertical":"FieldGroup--vertical__FLo-Q",fieldGroupVertical:"FieldGroup--vertical__FLo-Q"},Th=E("FieldGroup",q(({children:e,className:t,orientation:n="vertical",...r},o)=>{const i=k(Ha.FieldGroup,Ha[`FieldGroup--${n}`],t);return c.jsx("div",{ref:o,className:i,...r,children:e})}));Th.displayName="FieldGroup";const Va={Input:"Input__uS0sb",Error:"Error__-DQpw"},ui=E("Input",q(({className:e,error:t,...n},r)=>{const o=k(Va.Input,t&&Va.Error,e);return c.jsx("input",{ref:r,className:o,...n})}));ui.displayName="Input";const Rh={Error:"Error__N4OP5"},Ph=E("InputError",q(({children:e,className:t,...n},r)=>{const o=k(Rh.Error,t);return c.jsx("span",{ref:r,className:o,...n,children:e})}));Ph.displayName="InputError";const za={Label:"Label__VYUvW",Error:"Error__Eu6DI"},Ah=E("Label",q(({children:e,className:t,error:n,...r},o)=>{const i=k(za.Label,n&&za.Error,t);return c.jsx("label",{ref:o,className:i,...r,children:e})}));Ah.displayName="Label";const di={Select:"Select__giqpe",Chevron:"Chevron__YvhBd"},Ga=q(({children:e,className:t,...n},r)=>{const o=k(di.Option,t);return c.jsx("option",{ref:r,className:o,...n,children:e})});Ga.displayName="Option";const qa=E("Select",q(({children:e,className:t,...n},r)=>{const o=k(di.Select,t);return c.jsxs("div",{className:o,children:[c.jsx("select",{ref:r,...n,children:e}),c.jsx("div",{className:di.Chevron,children:c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}));qa.displayName="Select",qa.Option=Ga;function Ka(e,[t,n]){return Math.min(n,Math.max(t,e))}function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Oh(e,t){const n=d.createContext(t),r=i=>{const{children:s,...a}=i,l=d.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=d.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Xn(e,t=[]){let n=[];function r(i,s){const a=d.createContext(s),l=n.length;n=[...n,s];const u=h=>{var y;const{scope:m,children:g,...x}=h,p=((y=m==null?void 0:m[e])==null?void 0:y[l])||a,v=d.useMemo(()=>x,Object.values(x));return c.jsx(p.Provider,{value:v,children:g})};u.displayName=i+"Provider";function f(h,m){var p;const g=((p=m==null?void 0:m[e])==null?void 0:p[l])||a,x=d.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,f]}const o=()=>{const i=n.map(s=>d.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Ih(o,...t)]}function Ih(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Qa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yn(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Qa(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Qa(e[o],null)}}}}function de(...e){return d.useCallback(yn(...e),e)}function Ya(e){const t=jh(e),n=d.forwardRef((r,o)=>{const{children:i,...s}=r,a=d.Children.toArray(i),l=a.find(Lh);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function jh(e){const t=d.forwardRef((n,r)=>{const{children:o,...i}=n;if(d.isValidElement(o)){const s=Dh(o),a=Nh(i,o.props);return o.type!==d.Fragment&&(a.ref=r?yn(r,s):s),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kh=Symbol("radix.slottable");function Lh(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kh}function Nh(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Dh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mh(e){const t=e+"CollectionProvider",[n,r]=Xn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,w=Ue.useRef(null),C=Ue.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:C,collectionRef:w,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Ya(a),u=Ue.forwardRef((p,v)=>{const{scope:y,children:w}=p,C=i(a,y),S=de(v,C.collectionRef);return c.jsx(l,{ref:S,children:w})});u.displayName=a;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=Ya(f),g=Ue.forwardRef((p,v)=>{const{scope:y,children:w,...C}=p,S=Ue.useRef(null),T=de(v,S),R=i(f,y);return Ue.useEffect(()=>(R.itemMap.set(S,{ref:S,...C}),()=>void R.itemMap.delete(S))),c.jsx(m,{[h]:"",ref:T,children:w})});g.displayName=f;function x(p){const v=i(e+"CollectionConsumer",p);return Ue.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const C=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((R,P)=>C.indexOf(R.ref.current)-C.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:g},x,r]}var $h=d.createContext(void 0);function Fh(e){const t=d.useContext($h);return e||t||"ltr"}function Bh(e){const t=Uh(e),n=d.forwardRef((r,o)=>{const{children:i,...s}=r,a=d.Children.toArray(i),l=a.find(Hh);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Uh(e){const t=d.forwardRef((n,r)=>{const{children:o,...i}=n;if(d.isValidElement(o)){const s=zh(o),a=Vh(i,o.props);return o.type!==d.Fragment&&(a.ref=r?yn(r,s):s),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wh=Symbol("radix.slottable");function Hh(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wh}function Vh(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function zh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=Gh.reduce((e,t)=>{const n=Bh(`Primitive.${t}`),r=d.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qh(e,t){e&&Gn.flushSync(()=>e.dispatchEvent(t))}function Xt(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Kh(e,t=globalThis==null?void 0:globalThis.document){const n=Xt(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qh="DismissableLayer",fi="dismissableLayer.update",Yh="dismissableLayer.pointerDownOutside",Zh="dismissableLayer.focusOutside",Za,Xa=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zr=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=d.useContext(Xa),[f,h]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),x=de(t,P=>h(P)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,T=e1(P=>{const L=P.target,j=[...u.branches].some(N=>N.contains(L));!S||j||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},m),R=t1(P=>{const L=P.target;[...u.branches].some(N=>N.contains(L))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},m);return Kh(P=>{w===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Za=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Ja(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Za)}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Ja())},[f,u]),d.useEffect(()=>{const P=()=>g({});return document.addEventListener(fi,P),()=>document.removeEventListener(fi,P)},[]),c.jsx(le.div,{...l,ref:x,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,R.onFocusCapture),onBlurCapture:X(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,T.onPointerDownCapture)})});zr.displayName=Qh;var Xh="DismissableLayerBranch",Jh=d.forwardRef((e,t)=>{const n=d.useContext(Xa),r=d.useRef(null),o=de(t,r);return d.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(le.div,{...e,ref:o})});Jh.displayName=Xh;function e1(e,t=globalThis==null?void 0:globalThis.document){const n=Xt(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){el(Yh,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function t1(e,t=globalThis==null?void 0:globalThis.document){const n=Xt(e),r=d.useRef(!1);return d.useEffect(()=>{const o=i=>{i.target&&!r.current&&el(Zh,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ja(){const e=new CustomEvent(fi);document.dispatchEvent(e)}function el(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?qh(o,i):o.dispatchEvent(i)}var pi=0;function tl(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nl()),document.body.insertAdjacentElement("beforeend",e[1]??nl()),pi++,()=>{pi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pi--}},[])}function nl(){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 hi="focusScope.autoFocusOnMount",mi="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},n1="FocusScope",gi=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=d.useState(null),u=Xt(o),f=Xt(i),h=d.useRef(null),m=de(t,p=>l(p)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let p=function(C){if(g.paused||!a)return;const S=C.target;a.contains(S)?h.current=S:Pt(h.current,{select:!0})},v=function(C){if(g.paused||!a)return;const S=C.relatedTarget;S!==null&&(a.contains(S)||Pt(h.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&Pt(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,g.paused]),d.useEffect(()=>{if(a){sl.add(g);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(hi,rl);a.addEventListener(hi,u),a.dispatchEvent(y),y.defaultPrevented||(r1(l1(ol(a)),{select:!0}),document.activeElement===p&&Pt(a))}return()=>{a.removeEventListener(hi,u),setTimeout(()=>{const y=new CustomEvent(mi,rl);a.addEventListener(mi,f),a.dispatchEvent(y),y.defaultPrevented||Pt(p??document.body,{select:!0}),a.removeEventListener(mi,f),sl.remove(g)},0)}}},[a,u,f,g]);const x=d.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[C,S]=o1(w);C&&S?!p.shiftKey&&y===S?(p.preventDefault(),n&&Pt(C,{select:!0})):p.shiftKey&&y===C&&(p.preventDefault(),n&&Pt(S,{select:!0})):y===w&&p.preventDefault()}},[n,r,g.paused]);return c.jsx(le.div,{tabIndex:-1,...s,ref:m,onKeyDown:x})});gi.displayName=n1;function r1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pt(r,{select:t}),document.activeElement!==n)return}function o1(e){const t=ol(e),n=il(t,e),r=il(t.reverse(),e);return[n,r]}function ol(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function il(e,t){for(const n of e)if(!i1(n,{upTo:t}))return n}function i1(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function s1(e){return e instanceof HTMLInputElement&&"select"in e}function Pt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&s1(e)&&t&&e.select()}}var sl=a1();function a1(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=al(e,t),e.unshift(t)},remove(t){var n;e=al(e,t),(n=e[0])==null||n.resume()}}}function al(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function l1(e){return e.filter(t=>t.tagName!=="A")}var _e=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},c1=d[" useId ".trim().toString()]||(()=>{}),u1=0;function Jt(e){const[t,n]=d.useState(c1());return _e(()=>{n(r=>r??String(u1++))},[e]),e||(t?`radix-${t}`:"")}const d1=["top","right","bottom","left"],At=Math.min,Le=Math.max,Gr=Math.round,qr=Math.floor,et=e=>({x:e,y:e}),f1={left:"right",right:"left",bottom:"top",top:"bottom"},p1={start:"end",end:"start"};function vi(e,t,n){return Le(e,At(t,n))}function ht(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function bn(e){return e.split("-")[1]}function yi(e){return e==="x"?"y":"x"}function bi(e){return e==="y"?"height":"width"}const h1=new Set(["top","bottom"]);function tt(e){return h1.has(mt(e))?"y":"x"}function wi(e){return yi(tt(e))}function m1(e,t,n){n===void 0&&(n=!1);const r=bn(e),o=wi(e),i=bi(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Kr(s)),[s,Kr(s)]}function g1(e){const t=Kr(e);return[_i(e),t,_i(t)]}function _i(e){return e.replace(/start|end/g,t=>p1[t])}const ll=["left","right"],cl=["right","left"],v1=["top","bottom"],y1=["bottom","top"];function b1(e,t,n){switch(e){case"top":case"bottom":return n?t?cl:ll:t?ll:cl;case"left":case"right":return t?v1:y1;default:return[]}}function w1(e,t,n,r){const o=bn(e);let i=b1(mt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(_i)))),i}function Kr(e){return e.replace(/left|right|bottom|top/g,t=>f1[t])}function _1(e){return{top:0,right:0,bottom:0,left:0,...e}}function ul(e){return typeof e!="number"?_1(e):{top:e,right:e,bottom:e,left:e}}function Qr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function dl(e,t,n){let{reference:r,floating:o}=e;const i=tt(t),s=wi(t),a=bi(s),l=mt(t),u=i==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(bn(t)){case"start":g[s]-=m*(n&&u?-1:1);break;case"end":g[s]+=m*(n&&u?-1:1);break}return g}async function x1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=ht(t,e),x=ul(g),v=a[m?h==="floating"?"reference":"floating":h],y=Qr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},T=Qr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:C,strategy:l}):w);return{top:(y.top-T.top+x.top)/S.y,bottom:(T.bottom-y.bottom+x.bottom)/S.y,left:(y.left-T.left+x.left)/S.x,right:(T.right-y.right+x.right)/S.x}}const C1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=dl(u,r,l),m=r,g={},x=0;for(let v=0;v<a.length;v++){var p;const{name:y,fn:w}=a[v],{x:C,y:S,data:T,reset:R}=await w({x:f,y:h,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:u,platform:{...s,detectOverflow:(p=s.detectOverflow)!=null?p:x1},elements:{reference:e,floating:t}});f=C??f,h=S??h,g={...g,[y]:{...g[y],...T}},R&&x<=50&&(x++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(u=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:f,y:h}=dl(u,m,l)),v=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:g}},S1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=ht(e,t)||{};if(u==null)return{};const h=ul(f),m={x:n,y:r},g=wi(o),x=bi(g),p=await s.getDimensions(u),v=g==="y",y=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[g]-m[g]-i.floating[x],T=m[g]-i.reference[g],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=R?R[C]:0;(!P||!await(s.isElement==null?void 0:s.isElement(R)))&&(P=a.floating[C]||i.floating[x]);const L=S/2-T/2,j=P/2-p[x]/2-1,N=At(h[y],j),B=At(h[w],j),U=N,H=P-p[x]-B,z=P/2-p[x]/2+L,se=vi(U,z,H),G=!l.arrow&&bn(o)!=null&&z!==se&&i.reference[x]/2-(z<U?N:B)-p[x]/2<0,Z=G?z<U?z-U:z-H:0;return{[g]:m[g]+Z,data:{[g]:se,centerOffset:z-se-Z,...G&&{alignmentOffset:Z}},reset:G}}}),E1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:p=!0,...v}=ht(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=mt(o),w=tt(a),C=mt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=m||(C||!p?[Kr(a)]:g1(a)),R=x!=="none";!m&&R&&T.push(...w1(a,p,x,S));const P=[a,...T],L=await l.detectOverflow(t,v),j=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&j.push(L[y]),h){const z=m1(o,s,S);j.push(L[z[0]],L[z[1]])}if(N=[...N,{placement:o,overflows:j}],!j.every(z=>z<=0)){var B,U;const z=(((B=i.flip)==null?void 0:B.index)||0)+1,se=P[z];if(se&&(!(h==="alignment"?w!==tt(se):!1)||N.every($=>tt($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:z,overflows:N},reset:{placement:se}};let G=(U=N.filter(Z=>Z.overflows[0]<=0).sort((Z,$)=>Z.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!G)switch(g){case"bestFit":{var H;const Z=(H=N.filter($=>{if(R){const ae=tt($.placement);return ae===w||ae==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ae=>ae>0).reduce((ae,we)=>ae+we,0)]).sort(($,ae)=>$[1]-ae[1])[0])==null?void 0:H[0];Z&&(G=Z);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function fl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pl(e){return d1.some(t=>e[t]>=0)}const T1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=ht(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=fl(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:pl(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=fl(s,n.floating);return{data:{escapedOffsets:a,escaped:pl(a)}}}default:return{}}}}},hl=new Set(["left","top"]);async function R1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=mt(n),a=bn(n),l=tt(n)==="y",u=hl.has(s)?-1:1,f=i&&l?-1:1,h=ht(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),l?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const P1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await R1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},A1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:w,y:C}=y;return{x:w,y:C}}},...u}=ht(e,t),f={x:n,y:r},h=await i.detectOverflow(t,u),m=tt(mt(o)),g=yi(m);let x=f[g],p=f[m];if(s){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=x+h[y],S=x-h[w];x=vi(C,x,S)}if(a){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",C=p+h[y],S=p-h[w];p=vi(C,p,S)}const v=l.fn({...t,[g]:x,[m]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:s,[m]:a}}}}}},O1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ht(e,t),f={x:n,y:r},h=tt(o),m=yi(h);let g=f[m],x=f[h];const p=ht(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const C=m==="y"?"height":"width",S=i.reference[m]-i.floating[C]+v.mainAxis,T=i.reference[m]+i.reference[C]-v.mainAxis;g<S?g=S:g>T&&(g=T)}if(u){var y,w;const C=m==="y"?"width":"height",S=hl.has(mt(o)),T=i.reference[h]-i.floating[C]+(S&&((y=s.offset)==null?void 0:y[h])||0)+(S?0:v.crossAxis),R=i.reference[h]+i.reference[C]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?v.crossAxis:0);x<T?x=T:x>R&&(x=R)}return{[m]:g,[h]:x}}}},I1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ht(e,t),f=await s.detectOverflow(t,u),h=mt(o),m=bn(o),g=tt(o)==="y",{width:x,height:p}=i.floating;let v,y;h==="top"||h==="bottom"?(v=h,y=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=h,v=m==="end"?"top":"bottom");const w=p-f.top-f.bottom,C=x-f.left-f.right,S=At(p-f[v],w),T=At(x-f[y],C),R=!t.middlewareData.shift;let P=S,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),R&&!m){const N=Le(f.left,0),B=Le(f.right,0),U=Le(f.top,0),H=Le(f.bottom,0);g?L=x-2*(N!==0||B!==0?N+B:Le(f.left,f.right)):P=p-2*(U!==0||H!==0?U+H:Le(f.top,f.bottom))}await l({...t,availableWidth:L,availableHeight:P});const j=await s.getDimensions(a.floating);return x!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function Yr(){return typeof window<"u"}function wn(e){return ml(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nt(e){var t;return(t=(ml(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ml(e){return Yr()?e instanceof Node||e instanceof Ne(e).Node:!1}function Ve(e){return Yr()?e instanceof Element||e instanceof Ne(e).Element:!1}function rt(e){return Yr()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function gl(e){return!Yr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}const j1=new Set(["inline","contents"]);function Jn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ze(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!j1.has(o)}const k1=new Set(["table","td","th"]);function L1(e){return k1.has(wn(e))}const N1=[":popover-open",":modal"];function Zr(e){return N1.some(t=>{try{return e.matches(t)}catch{return!1}})}const D1=["transform","translate","scale","rotate","perspective"],M1=["transform","translate","scale","rotate","perspective","filter"],$1=["paint","layout","strict","content"];function xi(e){const t=Ci(),n=Ve(e)?ze(e):e;return D1.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||M1.some(r=>(n.willChange||"").includes(r))||$1.some(r=>(n.contain||"").includes(r))}function F1(e){let t=Ot(e);for(;rt(t)&&!_n(t);){if(xi(t))return t;if(Zr(t))return null;t=Ot(t)}return null}function Ci(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const B1=new Set(["html","body","#document"]);function _n(e){return B1.has(wn(e))}function ze(e){return Ne(e).getComputedStyle(e)}function Xr(e){return Ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ot(e){if(wn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gl(e)&&e.host||nt(e);return gl(t)?t.host:t}function vl(e){const t=Ot(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&Jn(t)?t:vl(t)}function er(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=vl(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Si(s);return t.concat(s,s.visualViewport||[],Jn(o)?o:[],a&&n?er(a):[])}return t.concat(o,er(o,[],n))}function Si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yl(e){const t=ze(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=rt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Gr(n)!==i||Gr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ei(e){return Ve(e)?e:e.contextElement}function xn(e){const t=Ei(e);if(!rt(t))return et(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=yl(t);let s=(i?Gr(n.width):n.width)/r,a=(i?Gr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const U1=et(0);function bl(e){const t=Ne(e);return!Ci()||!t.visualViewport?U1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function W1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function en(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ei(e);let s=et(1);t&&(r?Ve(r)&&(s=xn(r)):s=xn(e));const a=W1(i,n,r)?bl(i):et(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(i){const m=Ne(i),g=r&&Ve(r)?Ne(r):r;let x=m,p=Si(x);for(;p&&r&&g!==x;){const v=xn(p),y=p.getBoundingClientRect(),w=ze(p),C=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,S=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,h*=v.y,l+=C,u+=S,x=Ne(p),p=Si(x)}}return Qr({width:f,height:h,x:l,y:u})}function Jr(e,t){const n=Xr(e).scrollLeft;return t?t.left+n:en(nt(e)).left+n}function wl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Jr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function H1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=nt(r),a=t?Zr(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=et(1);const f=et(0),h=rt(r);if((h||!h&&!i)&&((wn(r)!=="body"||Jn(s))&&(l=Xr(r)),rt(r))){const g=en(r);u=xn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=s&&!h&&!i?wl(s,l):et(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function V1(e){return Array.from(e.getClientRects())}function z1(e){const t=nt(e),n=Xr(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jr(e);const a=-n.scrollTop;return ze(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const _l=25;function G1(e,t){const n=Ne(e),r=nt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const f=Ci();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Jr(r);if(u<=0){const f=r.ownerDocument,h=f.body,m=getComputedStyle(h),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-g);x<=_l&&(i-=x)}else u<=_l&&(i+=u);return{width:i,height:s,x:a,y:l}}const q1=new Set(["absolute","fixed"]);function K1(e,t){const n=en(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=rt(e)?xn(e):et(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function xl(e,t,n){let r;if(t==="viewport")r=G1(e,n);else if(t==="document")r=z1(nt(e));else if(Ve(t))r=K1(t,n);else{const o=bl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qr(r)}function Cl(e,t){const n=Ot(e);return n===t||!Ve(n)||_n(n)?!1:ze(n).position==="fixed"||Cl(n,t)}function Q1(e,t){const n=t.get(e);if(n)return n;let r=er(e,[],!1).filter(a=>Ve(a)&&wn(a)!=="body"),o=null;const i=ze(e).position==="fixed";let s=i?Ot(e):e;for(;Ve(s)&&!_n(s);){const a=ze(s),l=xi(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&q1.has(o.position)||Jn(s)&&!l&&Cl(e,s))?r=r.filter(f=>f!==s):o=a,s=Ot(s)}return t.set(e,r),r}function Y1(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Zr(t)?[]:Q1(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const h=xl(t,f,o);return u.top=Le(h.top,u.top),u.right=At(h.right,u.right),u.bottom=At(h.bottom,u.bottom),u.left=Le(h.left,u.left),u},xl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Z1(e){const{width:t,height:n}=yl(e);return{width:t,height:n}}function X1(e,t,n){const r=rt(t),o=nt(t),i=n==="fixed",s=en(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=et(0);function u(){l.x=Jr(o)}if(r||!r&&!i)if((wn(t)!=="body"||Jn(o))&&(a=Xr(t)),r){const g=en(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&u();i&&!r&&o&&u();const f=o&&!r&&!i?wl(o,a):et(0),h=s.left+a.scrollLeft-l.x-f.x,m=s.top+a.scrollTop-l.y-f.y;return{x:h,y:m,width:s.width,height:s.height}}function Ti(e){return ze(e).position==="static"}function Sl(e,t){if(!rt(e)||ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return nt(e)===n&&(n=n.ownerDocument.body),n}function El(e,t){const n=Ne(e);if(Zr(e))return n;if(!rt(e)){let o=Ot(e);for(;o&&!_n(o);){if(Ve(o)&&!Ti(o))return o;o=Ot(o)}return n}let r=Sl(e,t);for(;r&&L1(r)&&Ti(r);)r=Sl(r,t);return r&&_n(r)&&Ti(r)&&!xi(r)?n:r||F1(e)||n}const J1=async function(e){const t=this.getOffsetParent||El,n=this.getDimensions,r=await n(e.floating);return{reference:X1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function em(e){return ze(e).direction==="rtl"}const tm={convertOffsetParentRelativeRectToViewportRelativeRect:H1,getDocumentElement:nt,getClippingRect:Y1,getOffsetParent:El,getElementRects:J1,getClientRects:V1,getDimensions:Z1,getScale:xn,isElement:Ve,isRTL:em};function Tl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nm(e,t){let n=null,r;const o=nt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:f,top:h,width:m,height:g}=u;if(a||t(),!m||!g)return;const x=qr(h),p=qr(o.clientWidth-(f+m)),v=qr(o.clientHeight-(h+g)),y=qr(f),C={rootMargin:-x+"px "+-p+"px "+-v+"px "+-y+"px",threshold:Le(0,At(1,l))||1};let S=!0;function T(R){const P=R[0].intersectionRatio;if(P!==l){if(!S)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!Tl(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,C)}n.observe(e)}return s(!0),i}function rm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ei(e),f=o||i?[...u?er(u):[],...er(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const h=u&&a?nm(u,n):null;let m=-1,g=null;s&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let x,p=l?en(e):null;l&&v();function v(){const y=en(e);p&&!Tl(p,y)&&n(),p=y,x=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h==null||h(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(x)}}const om=P1,im=A1,sm=E1,am=I1,lm=T1,Rl=S1,cm=O1,um=(e,t,n)=>{const r=new Map,o={platform:tm,...n},i={...o.platform,_c:r};return C1(e,t,{...o,platform:i})};var dm=typeof document<"u",fm=function(){},eo=dm?ys:fm;function to(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!to(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!to(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Al(e,t){const n=Pl(e);return Math.round(t*n)/n}function Ri(e){const t=d.useRef(e);return eo(()=>{t.current=e}),t}function pm(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,h]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);to(m,r)||g(r);const[x,p]=d.useState(null),[v,y]=d.useState(null),w=d.useCallback($=>{$!==R.current&&(R.current=$,p($))},[]),C=d.useCallback($=>{$!==P.current&&(P.current=$,y($))},[]),S=i||x,T=s||v,R=d.useRef(null),P=d.useRef(null),L=d.useRef(f),j=l!=null,N=Ri(l),B=Ri(o),U=Ri(u),H=d.useCallback(()=>{if(!R.current||!P.current)return;const $={placement:t,strategy:n,middleware:m};B.current&&($.platform=B.current),um(R.current,P.current,$).then(ae=>{const we={...ae,isPositioned:U.current!==!1};z.current&&!to(L.current,we)&&(L.current=we,Gn.flushSync(()=>{h(we)}))})},[m,t,n,B,U]);eo(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const z=d.useRef(!1);eo(()=>(z.current=!0,()=>{z.current=!1}),[]),eo(()=>{if(S&&(R.current=S),T&&(P.current=T),S&&T){if(N.current)return N.current(S,T,H);H()}},[S,T,H,N,j]);const se=d.useMemo(()=>({reference:R,floating:P,setReference:w,setFloating:C}),[w,C]),G=d.useMemo(()=>({reference:S,floating:T}),[S,T]),Z=d.useMemo(()=>{const $={position:n,left:0,top:0};if(!G.floating)return $;const ae=Al(G.floating,f.x),we=Al(G.floating,f.y);return a?{...$,transform:"translate("+ae+"px, "+we+"px)",...Pl(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ae,top:we}},[n,a,G.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:H,refs:se,elements:G,floatingStyles:Z}),[f,H,se,G,Z])}const hm=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Rl({element:r.current,padding:o}).fn(n):{}:r?Rl({element:r,padding:o}).fn(n):{}}}},mm=(e,t)=>({...om(e),options:[e,t]}),gm=(e,t)=>({...im(e),options:[e,t]}),vm=(e,t)=>({...cm(e),options:[e,t]}),ym=(e,t)=>({...sm(e),options:[e,t]}),bm=(e,t)=>({...am(e),options:[e,t]}),wm=(e,t)=>({...lm(e),options:[e,t]}),_m=(e,t)=>({...hm(e),options:[e,t]});var xm="Arrow",Ol=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return c.jsx(le.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ol.displayName=xm;var Cm=Ol;function Sm(e){const[t,n]=d.useState(void 0);return _e(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Pi="Popper",[Il,no]=Xn(Pi),[Em,jl]=Il(Pi),kl=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return c.jsx(Em,{scope:t,anchor:r,onAnchorChange:o,children:n})};kl.displayName=Pi;var Ll="PopperAnchor",Nl=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=jl(Ll,n),s=d.useRef(null),a=de(t,s),l=d.useRef(null);return d.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:c.jsx(le.div,{...o,ref:a})});Nl.displayName=Ll;var Ai="PopperContent",[Tm,Rm]=Il(Ai),Dl=d.forwardRef((e,t)=>{var M,re,ge,J,oe,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...p}=e,v=jl(Ai,n),[y,w]=d.useState(null),C=de(t,Re=>w(Re)),[S,T]=d.useState(null),R=Sm(S),P=(R==null?void 0:R.width)??0,L=(R==null?void 0:R.height)??0,j=r+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(u)?u:[u],U=B.length>0,H={padding:N,boundary:B.filter(Am),altBoundary:U},{refs:z,floatingStyles:se,placement:G,isPositioned:Z,middlewareData:$}=pm({strategy:"fixed",placement:j,whileElementsMounted:(...Re)=>rm(...Re,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[mm({mainAxis:o+L,alignmentAxis:s}),l&&gm({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vm():void 0,...H}),l&&ym({...H}),bm({...H,apply:({elements:Re,rects:Fe,availableWidth:ut,availableHeight:Xe})=>{const{width:Gt,height:Po}=Fe.reference,_t=Re.floating.style;_t.setProperty("--radix-popper-available-width",`${ut}px`),_t.setProperty("--radix-popper-available-height",`${Xe}px`),_t.setProperty("--radix-popper-anchor-width",`${Gt}px`),_t.setProperty("--radix-popper-anchor-height",`${Po}px`)}}),S&&_m({element:S,padding:a}),Om({arrowWidth:P,arrowHeight:L}),m&&wm({strategy:"referenceHidden",...H})]}),[ae,we]=Fl(G),$e=Xt(x);_e(()=>{Z&&($e==null||$e())},[Z,$e]);const Ht=(M=$.arrow)==null?void 0:M.x,Vt=(re=$.arrow)==null?void 0:re.y,ct=((ge=$.arrow)==null?void 0:ge.centerOffset)!==0,[zt,Ze]=d.useState();return _e(()=>{y&&Ze(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:Z?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:zt,"--radix-popper-transform-origin":[(J=$.transformOrigin)==null?void 0:J.x,(oe=$.transformOrigin)==null?void 0:oe.y].join(" "),...((ee=$.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Tm,{scope:n,placedSide:ae,onArrowChange:T,arrowX:Ht,arrowY:Vt,shouldHideArrow:ct,children:c.jsx(le.div,{"data-side":ae,"data-align":we,...p,ref:C,style:{...p.style,animation:Z?void 0:"none"}})})})});Dl.displayName=Ai;var Ml="PopperArrow",Pm={top:"bottom",right:"left",bottom:"top",left:"right"},$l=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Rm(Ml,r),s=Pm[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(Cm,{...o,ref:n,style:{...o.style,display:"block"}})})});$l.displayName=Ml;function Am(e){return e!==null}var Om=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,f]=Fl(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let x="",p="";return u==="bottom"?(x=s?h:`${m}px`,p=`${-l}px`):u==="top"?(x=s?h:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(x=`${-l}px`,p=s?h:`${g}px`):u==="left"&&(x=`${r.floating.width+l}px`,p=s?h:`${g}px`),{data:{x,y:p}}}});function Fl(e){const[t,n="center"]=e.split("-");return[t,n]}var Bl=kl,Ul=Nl,Wl=Dl,Hl=$l,Im="Portal",Oi=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=d.useState(!1);_e(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?_s.createPortal(c.jsx(le.div,{...r,ref:t}),s):null});Oi.displayName=Im;function jm(e){const t=km(e),n=d.forwardRef((r,o)=>{const{children:i,...s}=r,a=d.Children.toArray(i),l=a.find(Nm);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function km(e){const t=d.forwardRef((n,r)=>{const{children:o,...i}=n;if(d.isValidElement(o)){const s=Mm(o),a=Dm(i,o.props);return o.type!==d.Fragment&&(a.ref=r?yn(r,s):s),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lm=Symbol("radix.slottable");function Nm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lm}function Dm(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Mm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $m=d[" useInsertionEffect ".trim().toString()]||_e;function ro({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=Fm({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=d.useCallback(f=>{var h;if(a){const m=Bm(f)?f(e):f;m!==e&&((h=s.current)==null||h.call(s,m))}else i(f)},[a,e,i,s]);return[l,u]}function Fm({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),o=d.useRef(n),i=d.useRef(t);return $m(()=>{i.current=t},[t]),d.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Bm(e){return typeof e=="function"}function Um(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vl=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"}),Wm="VisuallyHidden",zl=d.forwardRef((e,t)=>c.jsx(le.span,{...e,ref:t,style:{...Vl,...e.style}}));zl.displayName=Wm;var Hm=zl,Vm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cn=new WeakMap,oo=new WeakMap,io={},Ii=0,Gl=function(e){return e&&(e.host||Gl(e.parentNode))},zm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Gl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gm=function(e,t,n,r){var o=zm(t,Array.isArray(e)?e:[e]);io[n]||(io[n]=new WeakMap);var i=io[n],s=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var f=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),x=g!==null&&g!=="false",p=(Cn.get(m)||0)+1,v=(i.get(m)||0)+1;Cn.set(m,p),i.set(m,v),s.push(m),p===1&&x&&oo.set(m,!0),v===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Ii++,function(){s.forEach(function(h){var m=Cn.get(h)-1,g=i.get(h)-1;Cn.set(h,m),i.set(h,g),m||(oo.has(h)||h.removeAttribute(r),oo.delete(h)),g||h.removeAttribute(n)}),Ii--,Ii||(Cn=new WeakMap,Cn=new WeakMap,oo=new WeakMap,io={})}},ql=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Vm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Gm(r,o,n,"aria-hidden")):function(){return null}},so="right-scroll-bar-position",ao="width-before-scroll-bar",qm="with-scroll-bars-hidden",Km="--removed-body-scroll-bar-size";function ji(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qm(e,t){var n=W(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ym=typeof window<"u"?d.useLayoutEffect:d.useEffect,Kl=new WeakMap;function Zm(e,t){var n=Qm(null,function(r){return e.forEach(function(o){return ji(o,r)})});return Ym(function(){var r=Kl.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||ji(a,null)}),i.forEach(function(a){o.has(a)||ji(a,s)})}Kl.set(n,e)},[e]),n}function Xm(e){return e}function Jm(e,t){t===void 0&&(t=Xm);var n=[],r=!1,o={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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var f=s;s=[],f.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return o}function eg(e){e===void 0&&(e={});var t=Jm(null);return t.options=Je({async:!0,ssr:!1},e),t}var Ql=function(e){var t=e.sideCar,n=Fs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Je({},n))};Ql.isSideCarExport=!0;function tg(e,t){return e.useMedium(t),Ql}var Yl=eg(),ki=function(){},lo=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ki,onWheelCapture:ki,onTouchMoveCapture:ki}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,g=e.noRelative,x=e.noIsolation,p=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,C=e.gapMode,S=Fs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,R=Zm([n,t]),P=Je(Je({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(T,{sideCar:Yl,removeScrollBar:u,shards:h,noRelative:g,noIsolation:x,inert:p,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:C}),s?d.cloneElement(d.Children.only(a),Je(Je({},P),{ref:R})):d.createElement(w,Je({},P,{className:l,ref:R}),a))});lo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lo.classNames={fullWidth:ao,zeroRight:so};var ng=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rg(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ng();return t&&e.setAttribute("nonce",t),e}function og(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ig(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rg())&&(og(t,n),ig(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ag=function(){var e=sg();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zl=function(){var e=ag(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},lg={left:0,top:0,right:0,gap:0},Li=function(e){return parseInt(e||"",10)||0},cg=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Li(n),Li(r),Li(o)]},ug=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lg;var t=cg(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])}},dg=Zl(),Sn="data-scroll-locked",fg=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
209
|
+
`,jr=16,mp=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:i,containerClassName:s})=>{let{toasts:a,handlers:l}=Hf(n);return d.createElement("div",{style:{position:"fixed",zIndex:9999,top:jr,left:jr,right:jr,bottom:jr,pointerEvents:"none",...i},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(u=>{let f=u.position||t,h=l.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),m=pp(f,h);return d.createElement(fp,{id:u.id,key:u.id,onHeightUpdate:l.updateHeight,className:u.visible?hp:"",style:m},u.type==="custom"?Pr(u.message,u):o?o(u):d.createElement(dp,{toast:u,position:f}))}))},na=ke;const ra=E("useNotifications",()=>({notify:fe((t,n,r)=>{const o={style:{background:"var(--platform-background-primary-color)",color:"var(--platform-text-primary-color)"}};n==="warning"||n==="info"?na(t,{...o,icon:n==="warning"?"⚠️":"ℹ️"}):na[n](t,o),r&&console.error(r)},[])}));var vn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Yt=typeof window>"u"||"Deno"in globalThis;function Ce(){}function gp(e,t){return typeof e=="function"?e(t):e}function qo(e){return typeof e=="number"&&e>=0&&e!==1/0}function oa(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rt(e,t){return typeof e=="function"?e(t):e}function He(e,t){return typeof e=="function"?e(t):e}function ia(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Ko(s,t.options))return!1}else if(!Zn(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function sa(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Zt(t.options.mutationKey)!==Zt(i))return!1}else if(!Zn(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ko(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zt)(e)}function Zt(e){return JSON.stringify(e,(t,n)=>Yo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Zn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Zn(e[n],t[n])):!1}function Qo(e,t){if(e===t)return e;const n=aa(e)&&aa(t);if(n||Yo(e)&&Yo(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let u=0;u<s;u++){const f=n?u:i[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,l++):(a[f]=Qo(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function kr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function aa(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yo(e){if(!la(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!la(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function la(e){return Object.prototype.toString.call(e)==="[object Object]"}function vp(e){return new Promise(t=>{setTimeout(t,e)})}function Zo(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){try{return Qo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Qo(e,t)}return t}function yp(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function bp(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Lr=Symbol();function ca(e,t){return e.queryFn===Lr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Lr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ua(e,t){return typeof e=="function"?e(...t):!!e}var wp=(Ku=class extends vn{constructor(){super();D(this,ln);D(this,kt);D(this,In);O(this,In,t=>{if(!Yt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,kt)||this.setEventListener(_(this,In))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,kt))==null||t.call(this),O(this,kt,void 0))}setEventListener(t){var n;O(this,In,t),(n=_(this,kt))==null||n.call(this),O(this,kt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,ln)!==t&&(O(this,ln,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,ln)=="boolean"?_(this,ln):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ln=new WeakMap,kt=new WeakMap,In=new WeakMap,Ku),Xo=new wp,_p=(Qu=class extends vn{constructor(){super();D(this,jn,!0);D(this,Lt);D(this,kn);O(this,kn,t=>{if(!Yt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Lt)||this.setEventListener(_(this,kn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Lt))==null||t.call(this),O(this,Lt,void 0))}setEventListener(t){var n;O(this,kn,t),(n=_(this,Lt))==null||n.call(this),O(this,Lt,t(this.setOnline.bind(this)))}setOnline(t){_(this,jn)!==t&&(O(this,jn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,jn)}},jn=new WeakMap,Lt=new WeakMap,kn=new WeakMap,Qu),Nr=new _p;function Jo(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function xp(e){return Math.min(1e3*2**e,3e4)}function da(e){return(e??"online")==="online"?Nr.isOnline():!0}var fa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ei(e){return e instanceof fa}function pa(e){let t=!1,n=0,r=!1,o;const i=Jo(),s=p=>{var v;r||(m(new fa(p)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Xo.isFocused()&&(e.networkMode==="always"||Nr.isOnline())&&e.canRun(),f=()=>da(e.networkMode)&&e.canRun(),h=p=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,p),o==null||o(),i.resolve(p))},m=p=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,p),o==null||o(),i.reject(p))},g=()=>new Promise(p=>{var v;o=y=>{(r||u())&&p(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(r)return;let p;const v=n===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(h).catch(y=>{var R;if(r)return;const w=e.retry??(Yt?0:3),C=e.retryDelay??xp,S=typeof C=="function"?C(n,y):C,T=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,y);if(t||!T){m(y);return}n++,(R=e.onFail)==null||R.call(e,n,y),vp(S).then(()=>u()?void 0:g()).then(()=>{t?m(y):x()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?x():g().then(x),i)}}var Cp=e=>setTimeout(e,0);function Sp(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Cp;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ye=Sp(),ha=(Yu=class{constructor(){D(this,cn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qo(this.gcTime)&&O(this,cn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yt?1/0:5*60*1e3))}clearGcTimeout(){_(this,cn)&&(clearTimeout(_(this,cn)),O(this,cn,void 0))}},cn=new WeakMap,Yu),Ep=(Zu=class extends ha{constructor(t){super();D(this,Qe);D(this,Ln);D(this,Nn);D(this,Me);D(this,un);D(this,xe);D(this,cr);D(this,dn);O(this,dn,!1),O(this,cr,t.defaultOptions),this.setOptions(t.options),this.observers=[],O(this,un,t.client),O(this,Me,_(this,un).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,O(this,Ln,Tp(this.options)),this.state=t.state??_(this,Ln),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,xe))==null?void 0:t.promise}setOptions(t){this.options={..._(this,cr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Me).remove(this)}setData(t,n){const r=Zo(this.state.data,t,this.options);return V(this,Qe,xt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){V(this,Qe,xt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=_(this,xe))==null?void 0:r.promise;return(o=_(this,xe))==null||o.cancel(t),n?n.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ln))}isActive(){return this.observers.some(t=>He(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Rt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!oa(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,xe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,xe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Me).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,xe)&&(_(this,dn)?_(this,xe).cancel({revert:!0}):_(this,xe).cancelRetry()),this.scheduleGc()),_(this,Me).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||V(this,Qe,xt).call(this,{type:"invalidate"})}fetch(t,n){var u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,xe))return _(this,xe).continueRetry(),_(this,xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(O(this,dn,!0),r.signal)})},i=()=>{const m=ca(this.options,n),x=(()=>{const p={client:_(this,un),queryKey:this.queryKey,meta:this.meta};return o(p),p})();return O(this,dn,!1),this.options.persister?this.options.persister(m,x,this):m(x)},a=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,un),state:this.state,fetchFn:i};return o(m),m})();(u=this.options.behavior)==null||u.onFetch(a,this),O(this,Nn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&V(this,Qe,xt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=m=>{var g,x,p,v;ei(m)&&m.silent||V(this,Qe,xt).call(this,{type:"error",error:m}),ei(m)||((x=(g=_(this,Me).config).onError)==null||x.call(g,m,this),(v=(p=_(this,Me).config).onSettled)==null||v.call(p,this.state.data,m,this)),this.scheduleGc()};return O(this,xe,pa({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var g,x,p,v;if(m===void 0){console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(y){l(y);return}(x=(g=_(this,Me).config).onSuccess)==null||x.call(g,m,this),(v=(p=_(this,Me).config).onSettled)==null||v.call(p,m,this.state.error,this),this.scheduleGc()},onError:l,onFail:(m,g)=>{V(this,Qe,xt).call(this,{type:"failed",failureCount:m,error:g})},onPause:()=>{V(this,Qe,xt).call(this,{type:"pause"})},onContinue:()=>{V(this,Qe,xt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),_(this,xe).start()}},Ln=new WeakMap,Nn=new WeakMap,Me=new WeakMap,un=new WeakMap,xe=new WeakMap,cr=new WeakMap,dn=new WeakMap,Qe=new WeakSet,xt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ma(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return ei(o)&&o.revert&&_(this,Nn)?{..._(this,Nn),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Me).notify({query:this,type:"updated",action:t})})},Zu);function ma(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:da(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Tp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rp=(Xu=class extends vn{constructor(t={}){super();D(this,st);this.config=t,O(this,st,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Ko(o,n);let s=this.get(i);return s||(s=new Ep({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){_(this,st).has(t.queryHash)||(_(this,st).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,st).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,st).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,st).get(t)}getAll(){return[..._(this,st).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ia(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ia(t,r)):n}notify(t){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},st=new WeakMap,Xu),Pp=(Ju=class extends ha{constructor(t){super();D(this,lt);D(this,at);D(this,Ee);D(this,fn);this.mutationId=t.mutationId,O(this,Ee,t.mutationCache),O(this,at,[]),this.state=t.state||ga(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,at).includes(t)||(_(this,at).push(t),this.clearGcTimeout(),_(this,Ee).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){O(this,at,_(this,at).filter(n=>n!==t)),this.scheduleGc(),_(this,Ee).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,at).length||(this.state.status==="pending"?this.scheduleGc():_(this,Ee).remove(this))}continue(){var t;return((t=_(this,fn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,a,l,u,f,h,m,g,x,p,v,y,w,C,S,T,R,P,L;const n=()=>{V(this,lt,qt).call(this,{type:"continue"})};O(this,fn,pa({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,N)=>{V(this,lt,qt).call(this,{type:"failed",failureCount:j,error:N})},onPause:()=>{V(this,lt,qt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Ee).canRun(this)}));const r=this.state.status==="pending",o=!_(this,fn).canStart();try{if(r)n();else{V(this,lt,qt).call(this,{type:"pending",variables:t,isPaused:o}),await((s=(i=_(this,Ee).config).onMutate)==null?void 0:s.call(i,t,this));const N=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));N!==this.state.context&&V(this,lt,qt).call(this,{type:"pending",context:N,variables:t,isPaused:o})}const j=await _(this,fn).start();return await((f=(u=_(this,Ee).config).onSuccess)==null?void 0:f.call(u,j,t,this.state.context,this)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,j,t,this.state.context)),await((x=(g=_(this,Ee).config).onSettled)==null?void 0:x.call(g,j,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,j,null,t,this.state.context)),V(this,lt,qt).call(this,{type:"success",data:j}),j}catch(j){try{throw await((w=(y=_(this,Ee).config).onError)==null?void 0:w.call(y,j,t,this.state.context,this)),await((S=(C=this.options).onError)==null?void 0:S.call(C,j,t,this.state.context)),await((R=(T=_(this,Ee).config).onSettled)==null?void 0:R.call(T,void 0,j,this.state.variables,this.state.context,this)),await((L=(P=this.options).onSettled)==null?void 0:L.call(P,void 0,j,t,this.state.context)),j}finally{V(this,lt,qt).call(this,{type:"error",error:j})}}finally{_(this,Ee).runNext(this)}}},at=new WeakMap,Ee=new WeakMap,fn=new WeakMap,lt=new WeakSet,qt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ye.batch(()=>{_(this,at).forEach(r=>{r.onMutationUpdate(t)}),_(this,Ee).notify({mutation:this,type:"updated",action:t})})},Ju);function ga(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ap=(ed=class extends vn{constructor(t={}){super();D(this,yt);D(this,Ye);D(this,ur);this.config=t,O(this,yt,new Set),O(this,Ye,new Map),O(this,ur,0)}build(t,n,r){const o=new Pp({mutationCache:this,mutationId:++Ao(this,ur)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){_(this,yt).add(t);const n=Dr(t);if(typeof n=="string"){const r=_(this,Ye).get(n);r?r.push(t):_(this,Ye).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,yt).delete(t)){const n=Dr(t);if(typeof n=="string"){const r=_(this,Ye).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&_(this,Ye).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Dr(t);if(typeof n=="string"){const r=_(this,Ye).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Dr(t);if(typeof n=="string"){const o=(r=_(this,Ye).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ye.batch(()=>{_(this,yt).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,yt).clear(),_(this,Ye).clear()})}getAll(){return Array.from(_(this,yt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sa(n,r))}findAll(t={}){return this.getAll().filter(n=>sa(t,n))}notify(t){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ce))))}},yt=new WeakMap,Ye=new WeakMap,ur=new WeakMap,ed);function Dr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function va(e){return{onFetch:(t,n)=>{var f,h,m,g,x;const r=t.options,o=(m=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],s=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const v=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},y=ca(t.options,t.fetchOptions),w=async(C,S,T)=>{if(p)return Promise.reject();if(S==null&&C.pages.length)return Promise.resolve(C);const P=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:S,direction:T?"backward":"forward",meta:t.options.meta};return v(B),B})(),L=await y(P),{maxPages:j}=t.options,N=T?bp:yp;return{pages:N(C.pages,L,j),pageParams:N(C.pageParams,S,j)}};if(o&&i.length){const C=o==="backward",S=C?Op:ya,T={pages:i,pageParams:s},R=S(r,T);a=await w(T,R,C)}else{const C=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:ya(r,a);if(l>0&&S==null)break;a=await w(a,S),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function ya(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Op(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ip=(td=class{constructor(e={}){D(this,he);D(this,Nt);D(this,Dt);D(this,Dn);D(this,Mn);D(this,Mt);D(this,$n);D(this,Fn);O(this,he,e.queryCache||new Rp),O(this,Nt,e.mutationCache||new Ap),O(this,Dt,e.defaultOptions||{}),O(this,Dn,new Map),O(this,Mn,new Map),O(this,Mt,0)}mount(){Ao(this,Mt)._++,_(this,Mt)===1&&(O(this,$n,Xo.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,he).onFocus())})),O(this,Fn,Nr.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,he).onOnline())})))}unmount(){var e,t;Ao(this,Mt)._--,_(this,Mt)===0&&((e=_(this,$n))==null||e.call(this),O(this,$n,void 0),(t=_(this,Fn))==null||t.call(this),O(this,Fn,void 0))}isFetching(e){return _(this,he).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Nt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,he).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,he).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,he).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=_(this,he).get(r.queryHash),i=o==null?void 0:o.state.data,s=gp(t,i);if(s!==void 0)return _(this,he).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return ye.batch(()=>_(this,he).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,he).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,he);ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,he);return ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ye.batch(()=>_(this,he).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ce).catch(Ce)}invalidateQueries(e,t={}){return ye.batch(()=>(_(this,he).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ye.batch(()=>_(this,he).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ce)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ce)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,he).build(this,t);return n.isStaleByTime(Rt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ce).catch(Ce)}fetchInfiniteQuery(e){return e.behavior=va(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ce).catch(Ce)}ensureInfiniteQueryData(e){return e.behavior=va(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nr.isOnline()?_(this,Nt).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,he)}getMutationCache(){return _(this,Nt)}getDefaultOptions(){return _(this,Dt)}setDefaultOptions(e){O(this,Dt,e)}setQueryDefaults(e,t){_(this,Dn).set(Zt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Dn).values()],n={};return t.forEach(r=>{Zn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,Mn).set(Zt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Mn).values()],n={};return t.forEach(r=>{Zn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Dt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ko(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Lr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Dt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,he).clear(),_(this,Nt).clear()}},he=new WeakMap,Nt=new WeakMap,Dt=new WeakMap,Dn=new WeakMap,Mn=new WeakMap,Mt=new WeakMap,$n=new WeakMap,Fn=new WeakMap,td),jp=(nd=class extends vn{constructor(t,n){super();D(this,ne);D(this,Oe);D(this,Q);D(this,dr);D(this,Te);D(this,pn);D(this,Bn);D(this,$t);D(this,Ft);D(this,fr);D(this,Un);D(this,Wn);D(this,hn);D(this,mn);D(this,Bt);D(this,Hn,new Set);this.options=n,O(this,Oe,t),O(this,Ft,null),O(this,$t,Jo()),this.options.experimental_prefetchInRender||_(this,$t).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Q).addObserver(this),ba(_(this,Q),this.options)?V(this,ne,pr).call(this):this.updateResult(),V(this,ne,ps).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ti(_(this,Q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ti(_(this,Q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,V(this,ne,hs).call(this),V(this,ne,ms).call(this),_(this,Q).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,Q);if(this.options=_(this,Oe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof He(this.options.enabled,_(this,Q))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");V(this,ne,gs).call(this),_(this,Q).setOptions(this.options),n._defaulted&&!kr(this.options,n)&&_(this,Oe).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Q),observer:this});const o=this.hasListeners();o&&wa(_(this,Q),r,this.options,n)&&V(this,ne,pr).call(this),this.updateResult(),o&&(_(this,Q)!==r||He(this.options.enabled,_(this,Q))!==He(n.enabled,_(this,Q))||Rt(this.options.staleTime,_(this,Q))!==Rt(n.staleTime,_(this,Q)))&&V(this,ne,us).call(this);const i=V(this,ne,ds).call(this);o&&(_(this,Q)!==r||He(this.options.enabled,_(this,Q))!==He(n.enabled,_(this,Q))||i!==_(this,Bt))&&V(this,ne,fs).call(this,i)}getOptimisticResult(t){const n=_(this,Oe).getQueryCache().build(_(this,Oe),t),r=this.createResult(n,t);return Lp(this,r)&&(O(this,Te,r),O(this,Bn,this.options),O(this,pn,_(this,Q).state)),r}getCurrentResult(){return _(this,Te)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){_(this,Hn).add(t)}getCurrentQuery(){return _(this,Q)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Oe).defaultQueryOptions(t),r=_(this,Oe).getQueryCache().build(_(this,Oe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return V(this,ne,pr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Te)))}createResult(t,n){var j;const r=_(this,Q),o=this.options,i=_(this,Te),s=_(this,pn),a=_(this,Bn),u=t!==r?t.state:_(this,dr),{state:f}=t;let h={...f},m=!1,g;if(n._optimisticResults){const N=this.hasListeners(),B=!N&&ba(t,n),U=N&&wa(t,r,n,o);(B||U)&&(h={...h,...ma(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:p,status:v}=h;g=h.data;let y=!1;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let N;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(N=i.data,y=!0):N=typeof n.placeholderData=="function"?n.placeholderData((j=_(this,Wn))==null?void 0:j.state.data,_(this,Wn)):n.placeholderData,N!==void 0&&(v="success",g=Zo(i==null?void 0:i.data,N,n),m=!0)}if(n.select&&g!==void 0&&!y)if(i&&g===(s==null?void 0:s.data)&&n.select===_(this,fr))g=_(this,Un);else try{O(this,fr,n.select),g=n.select(g),g=Zo(i==null?void 0:i.data,g,n),O(this,Un,g),O(this,Ft,null)}catch(N){O(this,Ft,N)}_(this,Ft)&&(x=_(this,Ft),g=_(this,Un),p=Date.now(),v="error");const w=h.fetchStatus==="fetching",C=v==="pending",S=v==="error",T=C&&w,R=g!==void 0,L={status:v,fetchStatus:h.fetchStatus,isPending:C,isSuccess:v==="success",isError:S,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:S&&!R,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&R,isStale:ni(t,n),refetch:this.refetch,promise:_(this,$t)};if(this.options.experimental_prefetchInRender){const N=H=>{L.status==="error"?H.reject(L.error):L.data!==void 0&&H.resolve(L.data)},B=()=>{const H=O(this,$t,L.promise=Jo());N(H)},U=_(this,$t);switch(U.status){case"pending":t.queryHash===r.queryHash&&N(U);break;case"fulfilled":(L.status==="error"||L.data!==U.value)&&B();break;case"rejected":(L.status!=="error"||L.error!==U.reason)&&B();break}}return L}updateResult(){const t=_(this,Te),n=this.createResult(_(this,Q),this.options);if(O(this,pn,_(this,Q).state),O(this,Bn,this.options),_(this,pn).data!==void 0&&O(this,Wn,_(this,Q)),kr(n,t))return;O(this,Te,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!_(this,Hn).size)return!0;const s=new Set(i??_(this,Hn));return this.options.throwOnError&&s.add("error"),Object.keys(_(this,Te)).some(a=>{const l=a;return _(this,Te)[l]!==t[l]&&s.has(l)})};V(this,ne,vd).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&V(this,ne,ps).call(this)}},Oe=new WeakMap,Q=new WeakMap,dr=new WeakMap,Te=new WeakMap,pn=new WeakMap,Bn=new WeakMap,$t=new WeakMap,Ft=new WeakMap,fr=new WeakMap,Un=new WeakMap,Wn=new WeakMap,hn=new WeakMap,mn=new WeakMap,Bt=new WeakMap,Hn=new WeakMap,ne=new WeakSet,pr=function(t){V(this,ne,gs).call(this);let n=_(this,Q).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ce)),n},us=function(){V(this,ne,hs).call(this);const t=Rt(this.options.staleTime,_(this,Q));if(Yt||_(this,Te).isStale||!qo(t))return;const r=oa(_(this,Te).dataUpdatedAt,t)+1;O(this,hn,setTimeout(()=>{_(this,Te).isStale||this.updateResult()},r))},ds=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Q)):this.options.refetchInterval)??!1},fs=function(t){V(this,ne,ms).call(this),O(this,Bt,t),!(Yt||He(this.options.enabled,_(this,Q))===!1||!qo(_(this,Bt))||_(this,Bt)===0)&&O(this,mn,setInterval(()=>{(this.options.refetchIntervalInBackground||Xo.isFocused())&&V(this,ne,pr).call(this)},_(this,Bt)))},ps=function(){V(this,ne,us).call(this),V(this,ne,fs).call(this,V(this,ne,ds).call(this))},hs=function(){_(this,hn)&&(clearTimeout(_(this,hn)),O(this,hn,void 0))},ms=function(){_(this,mn)&&(clearInterval(_(this,mn)),O(this,mn,void 0))},gs=function(){const t=_(this,Oe).getQueryCache().build(_(this,Oe),this.options);if(t===_(this,Q))return;const n=_(this,Q);O(this,Q,t),O(this,dr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},vd=function(t){ye.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,Te))}),_(this,Oe).getQueryCache().notify({query:_(this,Q),type:"observerResultsUpdated"})})},nd);function kp(e,t){return He(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ba(e,t){return kp(e,t)||e.state.data!==void 0&&ti(e,t,t.refetchOnMount)}function ti(e,t,n){if(He(t.enabled,e)!==!1&&Rt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ni(e,t)}return!1}function wa(e,t,n,r){return(e!==t||He(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ni(e,n)}function ni(e,t){return He(t.enabled,e)!==!1&&e.isStaleByTime(Rt(t.staleTime,e))}function Lp(e,t){return!kr(e.getCurrentResult(),t)}var Np=(rd=class extends vn{constructor(n,r){super();D(this,wt);D(this,Ut);D(this,Wt);D(this,Ie);D(this,bt);O(this,Ut,n),this.setOptions(r),this.bindMethods(),V(this,wt,Oo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=_(this,Ut).defaultMutationOptions(n),kr(this.options,r)||_(this,Ut).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Ie),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Zt(r.mutationKey)!==Zt(this.options.mutationKey)?this.reset():((o=_(this,Ie))==null?void 0:o.state.status)==="pending"&&_(this,Ie).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Ie))==null||n.removeObserver(this)}onMutationUpdate(n){V(this,wt,Oo).call(this),V(this,wt,vs).call(this,n)}getCurrentResult(){return _(this,Wt)}reset(){var n;(n=_(this,Ie))==null||n.removeObserver(this),O(this,Ie,void 0),V(this,wt,Oo).call(this),V(this,wt,vs).call(this)}mutate(n,r){var o;return O(this,bt,r),(o=_(this,Ie))==null||o.removeObserver(this),O(this,Ie,_(this,Ut).getMutationCache().build(_(this,Ut),this.options)),_(this,Ie).addObserver(this),_(this,Ie).execute(n)}},Ut=new WeakMap,Wt=new WeakMap,Ie=new WeakMap,bt=new WeakMap,wt=new WeakSet,Oo=function(){var r;const n=((r=_(this,Ie))==null?void 0:r.state)??ga();O(this,Wt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vs=function(n){ye.batch(()=>{var r,o,i,s,a,l,u,f;if(_(this,bt)&&this.hasListeners()){const h=_(this,Wt).variables,m=_(this,Wt).context;(n==null?void 0:n.type)==="success"?((o=(r=_(this,bt)).onSuccess)==null||o.call(r,n.data,h,m),(s=(i=_(this,bt)).onSettled)==null||s.call(i,n.data,null,h,m)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,bt)).onError)==null||l.call(a,n.error,h,m),(f=(u=_(this,bt)).onSettled)==null||f.call(u,void 0,n.error,h,m))}this.listeners.forEach(h=>{h(_(this,Wt))})})},rd),_a=d.createContext(void 0),ri=e=>{const t=d.useContext(_a);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Dp=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(_a.Provider,{value:e,children:t})),xa=d.createContext(!1),Mp=()=>d.useContext(xa);xa.Provider;function $p(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Fp=d.createContext($p()),Bp=()=>d.useContext(Fp),Up=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Wp=e=>{d.useEffect(()=>{e.clearReset()},[e])},Hp=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||ua(n,[e.error,r])),Vp=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zp=(e,t)=>e.isLoading&&e.isFetching&&!t,Gp=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ca=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qp(e,t,n){var h,m,g,x,p;if(typeof e!="object"||Array.isArray(e))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Mp(),o=Bp(),i=ri(),s=i.defaultQueryOptions(e);(m=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||m.call(h,s),s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),s._optimisticResults=r?"isRestoring":"optimistic",Vp(s),Up(s,o),Wp(o);const a=!i.getQueryCache().get(s.queryHash),[l]=d.useState(()=>new t(i,s)),u=l.getOptimisticResult(s),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(v=>{const y=f?l.subscribe(ye.batchCalls(v)):Ce;return l.updateResult(),y},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(s)},[s,l]),Gp(s,u))throw Ca(s,l,o);if(Hp({result:u,errorResetBoundary:o,throwOnError:s.throwOnError,query:i.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if((x=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||x.call(g,s,u),s.experimental_prefetchInRender&&!Yt&&zp(u,r)){const v=a?Ca(s,l,o):(p=i.getQueryCache().get(s.queryHash))==null?void 0:p.promise;v==null||v.catch(Ce).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function Sa(e,t){return qp(e,jp)}function Mr(e,t){const n=ri(),[r]=d.useState(()=>new Np(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const o=d.useSyncExternalStore(d.useCallback(s=>r.subscribe(ye.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=d.useCallback((s,a)=>{r.mutate(s,a).catch(Ce)},[r]);if(o.error&&ua(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const $r={STALE_TIME:1e3*60*5,GC_TIME:1e3*60*10,RETRY_COUNT:1,RETRY_DELAY:1e3},Ea={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:$r.STALE_TIME,gcTime:$r.GC_TIME,retry:$r.RETRY_COUNT,retryDelay:$r.RETRY_DELAY,enable:!0},Fr=e=>e instanceof Error?e.message:String(e),Kp=E("useResourceActions",(e,t,n)=>{const r=ri(),{notify:o}=ra(),{createFn:i,readFn:s,readByIdFn:a,updateFn:l,deleteFn:u,partialUpdateFn:f}=n,h=()=>{r.invalidateQueries({queryKey:[e]})},m=(S,T,R,P)=>o(P!=null&&P.overrideSuccessMessage?P==null?void 0:P.overrideSuccessMessage(S,T):R,"success"),g=(S,T,R,P)=>o(P!=null&&P.overrideErrorMessage?P==null?void 0:P.overrideErrorMessage(S,T):R,"error");return{useCreate:S=>Mr({mutationFn:T=>i(T),onSuccess:T=>{h(),m(t,T,`${t} created successfully`,S)},onError:T=>{g(t,T,`Error creating ${t}: ${Fr(T)}`,S)}}),useReadQuery:S=>Sa({queryKey:[e],queryFn:s,...Ea,...S}),useReadByIdQuery:(S,T)=>Sa({queryKey:[e,S],queryFn:()=>a(S),...Ea,enabled:!!S,...T}),useUpdate:S=>Mr({mutationFn:({id:T,data:R})=>l(T,R),onSuccess:T=>{h(),m(t,T,`${t} updated successfully`,S)},onError:T=>{g(t,T,`Error updating ${t}: ${Fr(T)}`,S)}}),usePartialUpdate:S=>f&&Mr({mutationFn:({id:T,data:R})=>f(T,R),onSuccess:T=>{h(),m(t,T,`${t} updated successfully`,S)},onError:T=>{g(t,T,`Error updating ${t}: ${Fr(T)}`,S)}}),useDelete:S=>Mr({mutationFn:T=>u(T),onSuccess:()=>{h(),m(t,null,`${t} deleted successfully`,S)},onError:T=>{g(t,T,`Error deleting ${t}: ${Fr(T)}`,S)}}),invalidateQueries:h}}),L0=E("useResource",(e,t)=>Kp(e,t,{createFn:n=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r=>r.json()),deleteFn:n=>fetch(`${e}/${n}`,{method:"DELETE"}).then(r=>{if(!r.ok)throw new Error(`Error deleting: ${r.status}`)}),readByIdFn:n=>fetch(`${e}/${n}`).then(r=>r.json()),readFn:()=>fetch(e).then(n=>n.json()),updateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json()),partialUpdateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json())})),Qp={SINGLE_TENANT:"single-tenant"},Yp={COOKIE:"cookie"},oi="tenant",Ta="tenant",Ra="tenant",Zp=Qp.SINGLE_TENANT,Xp=Yp.COOKIE,Jp={mode:Zp,clientSideMode:Xp,tenantIDPProvisioningStrategy:"none"};class eh{setTenant(t,n){const r=new URL(window.location.href);r.searchParams.set(Ta,t.name),window.location.href=r.toString()}getCurrentTenantName(){const t=new URL(window.location.href);return new URLSearchParams(t.search).get(Ta)}}class th{setTenant(t,n){sessionStorage.setItem(Ra,t.name),window.location.reload()}getCurrentTenantName(){return sessionStorage.getItem(Ra)}}/*! js-cookie v3.0.5 | MIT */function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var nh={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ii(e,t){function n(o,i,s){if(!(typeof document>"u")){s=Br({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],s={},a=0;a<i.length;a++){var l=i[a].split("="),u=l.slice(1).join("=");try{var f=decodeURIComponent(l[0]);if(s[f]=e.read(u,f),o===f)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Br({},i,{expires:-1}))},withAttributes:function(o){return ii(this.converter,Br({},this.attributes,o))},withConverter:function(o){return ii(Br({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var si=ii(nh,{path:"/"});class rh{setTenant(t,n){t?si.set(oi,t.name):si.remove(oi),window.location.reload()}getCurrentTenantName(){return si.get(oi)}}class oh{extractSubdomain(t){if(t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t))return"";const n=t.split(".");if(n.length<2||n.length===2||n[0]==="www"&&n.length===3)return"";const o=(n[0]==="www"?n.slice(1):n).slice(0,-2);return o.length>0?o.join("."):""}getBaseDomain(t){const n=t.split(".");return t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t)||n.length<=2?t:n.slice(-2).join(".")}setTenant(t,n){var u;const r=(u=n.urlPatterns)==null?void 0:u.find(f=>f.patternType==="subdomain"&&f.tenantId===t.id&&f.isActive);if(!r)throw new Error(`No active subdomain pattern found for tenant '${t.name}'`);const o=new URL(window.location.href),i=r.patternValue,s=o.hostname,a=this.getBaseDomain(s),l=i?`${i}.${a}`:a;o.hostname=l,window.location.href=o.toString()}getCurrentTenantName(){const t=window.location.hostname;return this.extractSubdomain(t)||null}}const Pa={queryParams:new eh,sessionStorage:new th,cookie:new rh,subdomain:new oh},ih=e=>{const t=Pa[e.clientSideMode];if(!t)throw new Error(`Client side tenant mode '${e.clientSideMode}' is not supported ${JSON.stringify({strategies:Pa},null,2)}`);return t},sh=(e,t,n)=>{const r=t.find(i=>i.name===n);if(!r)throw Error("No tenant permission");return ih(e).setTenant(r,e),r},N0=E("useTenants",()=>{const[e,t]=vr(),{tenants:n=[],currentTenant:r,tenantConfig:o=Jp}=e,i=fe(s=>{const a=sh(o,n,s);t({...e,currentTenant:a})},[o,e]);return{tenants:n,currentTenant:r,tenantConfig:o,selectTenant:i}});function ah(e){if(!e.ok)throw console.error(e),new Error(e.statusText)}async function Ur(e,t,n,r){const o=await e(`/user-states/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,r);return ah(o),o}class Wr{static async get(t,n,r){const i=await Ur(t,n,r,{method:"GET",headers:{"Content-Type":"application/json"}});return i.status===204?null:await i.json()}static async create(t,n,r,o){const i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Ur(t,n,r,i)).json()}static async update(t,n,r,o){const i={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Ur(t,n,r,i)).json()}static async delete(t,n,r){return await Ur(t,n,r,{method:"DELETE",headers:{"Content-Type":"application/json"}}),null}}const D0=E("useUserState",e=>{const t=Ms("@bluealba/pae-nestjs-gateway-service"),n=Yd();if(!n)throw new Error("You must call the useUserState hook within a PAE application.");const[r,o]=W(null),[i,s]=W(!1),[a,l]=W(!1),[u,f]=W(null),h=(w,C)=>fe(async({newValue:S,shouldThrowError:T}={})=>{try{l(!0),f(null);const R=await w(t,n,e,S);return o(R),R?R.value:null}catch(R){if(f(R==null?void 0:R.message),console.error(`Failed to ${C} ${e}:`,R),T)throw R;return null}finally{l(!1)}},[t,n,e]),m=h(Wr.get,"fetch"),g=h(Wr.create,"create"),x=h(Wr.update,"update"),p=h(Wr.delete,"delete"),v=fe(async()=>{try{await m()}finally{s(!0)}},[m]);te(()=>{v()},[v]);const y=fe(async(w,C=!1)=>r==null?await g({newValue:w,shouldThrowError:C}):await x({newValue:w,shouldThrowError:C}),[r,g,x]);return{value:r?r.value:null,hasFetched:i,loading:a,error:u,setValue:y,createValue:g,updateValue:x,deleteValue:p}}),Aa="__PAE_EXTENSION_POINT_REACT_CONTENT_EMPTY__",M0=E("ExtendExtensionPoint",({module:e,point:t,children:n})=>(sf(e,t,n??Aa),null)),lh=E("ExtensionPoint",({name:e,children:t,...n})=>{const r=of(e);if(r===Aa)return null;if(!r)return c.jsx(c.Fragment,{children:t??null});if(ch(r)){const o=r;return c.jsx(o,{...n})}else return r}),ch=e=>typeof e=="function",$0=E("extensionPoint",(e,t)=>{const n=r=>(t=t||e.displayName||e.name||"?",c.jsx(lh,{name:t,...r,children:c.jsx(e,{...r})}));return n.displayName=`extensionPoint(${t})`,n}),Oa="single-spa:app-change";function uh(){const[e,t]=W(Ia());return te(()=>{const n=()=>{t(Ia())};return window.addEventListener(Oa,n),()=>{window.removeEventListener(Oa,n)}},[]),e}function Ia(){return gr.getAppNames().reduce((t,n)=>(gr.getAppStatus(n)?t[n]=gr.getAppStatus(n):t[n]="NOT_LOADED",t),{})}function dh(e){const n=uh()[e]??"LOAD_ERROR";return{statusName:n,isLoading:n==="LOADING_SOURCE_CODE"||n==="BOOTSTRAPPING"||n==="MOUNTING",isMounted:n==="MOUNTED",isBroken:n==="SKIP_BECAUSE_BROKEN"||n==="LOAD_ERROR"}}const ja=({appName:e})=>c.jsx("div",{children:c.jsxs("p",{children:["Loading ",e,"..."]})});ja.displayName="BaseLoading";const ka=({appName:e})=>c.jsxs("div",{children:[c.jsx("p",{children:"Something went wrong..."}),c.jsxs("p",{children:["Failed to load ",e]})]});ka.displayName="BaseError";const fh={display:"flex",flexDirection:"column",flex:1},La=q((e,t)=>c.jsx("div",{ref:t,style:fh,...e}));La.displayName="BaseContainer";const ph="pae-app:",hh=E("ModulePlaceHolder",q(({appName:e,LoadingComponent:t=ja,ErrorComponent:n=ka,ContainerComponent:r=La,...o},i)=>{const s=dh(e);return c.jsxs(r,{ref:i,...o,id:`${ph}${e}`,children:[s.isLoading&&c.jsx(t,{appName:e}),s.isBroken&&c.jsx(n,{appName:e})]})}));hh.displayName="ModulePlaceHolder";const Na=E("Authorized",({operations:e,children:t,forbiddenContent:n})=>{var o;const{hasAccess:r}=wr();if(!r(...e)){if(!n)return null;if(typeof n=="function")if((o=n==null?void 0:n.prototype)!=null&&o.isReactComponent){const i=n;return c.jsx(i,{operations:e})}else return n({operations:e});return Ue.isValidElement(n)?n:null}return t});Na.displayName="Authorized";const F0=E("PlatformEventListener",({eventName:e,listener:t})=>(af(e,t),null)),mh=()=>c.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M8.737 8.737a21.49 21.49 0 0 1 3.308-2.724m0 0c3.063-2.026 5.99-2.641 7.331-1.3 1.827 1.828.026 6.591-4.023 10.64-4.049 4.049-8.812 5.85-10.64 4.023-1.33-1.33-.736-4.218 1.249-7.253m6.083-6.11c-3.063-2.026-5.99-2.641-7.331-1.3-1.827 1.828-.026 6.591 4.023 10.64m3.308-9.34a21.497 21.497 0 0 1 3.308 2.724m2.775 3.386c1.985 3.035 2.579 5.923 1.248 7.253-1.336 1.337-4.245.732-7.295-1.275M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})}),gh=E("ApplicationIcon",({applicationName:e})=>{const t=Bd(e);if(t)if(typeof t=="function"){const n=t;return c.jsx(n,{})}else return t;return c.jsx(mh,{})});gh.displayName="ApplicationIcon";const Da=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});Da.displayName="DarkModeIcon";const Ma=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:"matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,0,0)",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});Ma.displayName="LightModeIcon";const ai={container:"container__zBqbk",expanded:"expanded__EbsIr",label:"label__cdMnm"};function $a(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=$a(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function k(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$a(e))&&(r&&(r+=" "),r+=t);return r}const vh=e=>e.toLowerCase().trim().split(" ").join("-"),yh=e=>`${vh(e)}-theme`,bh=E("useTheme",()=>{const{platformName:e="Platform"}=Os(),t=yh(e),[n,r]=W(()=>{const i=localStorage.getItem(t);return i==="light"||i==="dark"?i:"light"}),o=i=>{localStorage.setItem(t,i),r(i)};return te(()=>{document.documentElement.setAttribute("data-theme",n)},[n]),{theme:n,setTheme:o}}),Hr={spinner:"spinner__fakUN","spinner-rotation":"spinner-rotation__wUmPV",spinnerRotation:"spinner-rotation__wUmPV",button:"button__8FA9H","button--contained-primary":"button--contained-primary__stkTx",buttonContainedPrimary:"button--contained-primary__stkTx","button--outlined-primary":"button--outlined-primary__KZ1ww",buttonOutlinedPrimary:"button--outlined-primary__KZ1ww","button--text-primary":"button--text-primary__GLTfm",buttonTextPrimary:"button--text-primary__GLTfm","button--contained-danger":"button--contained-danger__L9ehT",buttonContainedDanger:"button--contained-danger__L9ehT","button--outlined-danger":"button--outlined-danger__eoYLd",buttonOutlinedDanger:"button--outlined-danger__eoYLd","button--text-danger":"button--text-danger__Sw-ha",buttonTextDanger:"button--text-danger__Sw-ha",icon:"icon__--umH"},li=E("Button",q(({variant:e="contained",colorScheme:t="primary",loading:n=!1,IconComponent:r,className:o,children:i,...s},a)=>{const l=k(Hr.button,Hr[`button--${e}-${t}`],o);return c.jsxs("button",{ref:a,className:l,...s,children:[n?c.jsx("div",{className:Hr.spinner}):r&&c.jsx(r,{className:Hr.icon}),i]})}));li.displayName="Button";const Vr={Badges:"Badges__5jpum",badges:"Badges__5jpum",Badge:"Badge__95MWM",badge:"Badge__95MWM","Badge--primary":"Badge--primary__Rx-bS",badgePrimary:"Badge--primary__Rx-bS","Badge--secondary":"Badge--secondary__d92bT",badgeSecondary:"Badge--secondary__d92bT","Badge--success":"Badge--success__Kdo98",badgeSuccess:"Badge--success__Kdo98","Badge--warning":"Badge--warning__bf-Nn",badgeWarning:"Badge--warning__bf-Nn","Badge--danger":"Badge--danger__HTj39",badgeDanger:"Badge--danger__HTj39","Badge--small":"Badge--small__y93Pj",badgeSmall:"Badge--small__y93Pj","Badge--regular":"Badge--regular__aT5AL",badgeRegular:"Badge--regular__aT5AL","Badge--large":"Badge--large__wORCH",badgeLarge:"Badge--large__wORCH"},ci={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in ci)Object.freeze(ci[e]);const Fa=Object.freeze(ci);var Ba={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function wh(e){var f,h;var t,n=[],r=1,o;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),Fa[e])n=Fa[e].slice(),o="rgb";else if(e==="transparent")r=0,o="rgb",n=[0,0,0];else if(e[0]==="#"){var i=e.slice(1),s=i.length,a=s<=4;r=1,a?(n=[parseInt(i[0]+i[0],16),parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16)],s===4&&(r=parseInt(i[3]+i[3],16)/255)):(n=[parseInt(i[0]+i[1],16),parseInt(i[2]+i[3],16),parseInt(i[4]+i[5],16)],s===8&&(r=parseInt(i[6]+i[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),o="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var l=t[1];o=l.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=n.shift()),n=n.map(function(m,g){if(m[m.length-1]==="%")return m=parseFloat(m)/100,g===3?m:o==="rgb"?m*255:o[0]==="h"||o[0]==="l"&&!g?m*100:o==="lab"?m*125:o==="lch"?g<2?m*150:m*360:o[0]==="o"&&!g?m:o==="oklab"?m*.4:o==="oklch"?g<2?m*.4:m*360:m;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(Ba[m]!==void 0)return Ba[m];if(m.endsWith("deg"))return parseFloat(m);if(m.endsWith("turn"))return parseFloat(m)*360;if(m.endsWith("grad"))return parseFloat(m)*360/400;if(m.endsWith("rad"))return parseFloat(m)*180/Math.PI}return m==="none"?0:parseFloat(m)}),r=n.length>u?n.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(m){return parseFloat(m)}),o=((h=(f=e.match(/([a-z])/ig))==null?void 0:f.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:o,values:n,alpha:r}}const _h=(e,t)=>{const{space:n,values:r}=wh(e);return n[0]==="h"?`${n}a(${r[0]}, ${r[1]}%, ${r[2]}%, ${t})`:`${n}a(${r}, ${t})`},Ua=E("Badge",q(({children:e,color:t,className:n,customColor:r,size:o="small",style:i,...s},a)=>{const l=r?{color:r,background:_h(r,.1)}:{},u=k(Vr.Badge,Vr[`Badge--${o}`],{[Vr[`Badge--${t}`]]:!!t},n);return c.jsx("span",{ref:a,className:u,style:{...i,...l},...s,children:e})}));Ua.displayName="Badge";const Wa=E("Badges",q(({children:e,className:t,...n},r)=>{const o=k(Vr.Badges,t);return c.jsx("div",{ref:r,className:o,...n,children:e})}));Wa.displayName="Badges";const xh=E("ClipboardIcon",({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...i})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...i,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]})),Ch=E("ClipboardCheckIcon",({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...i})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...i,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),c.jsx("path",{d:"m9 12 2 2 4-4"})]})),Sh={CopyToClipboardButton:"CopyToClipboardButton__2Nd2m"},fb=E("CopyToClipboardButton",({content:e})=>{const[t,n]=Eh(),{notify:r}=ra(),o=t?Ch:xh,i=fe(async()=>{await n(e)&&r("Copied to the Clipboard !","success")},[e,r]);return c.jsx(o,{className:Sh.CopyToClipboardButton,size:18,onClick:i})}),Eh=()=>{const[e,t]=W(!1);return[e,async r=>{var o;try{return await((o=navigator==null?void 0:navigator.clipboard)==null?void 0:o.writeText(r)),t(!0),setTimeout(()=>t(!1),2e3),!0}catch(i){return console.error("Failed to copy text: ",i),!1}}]},Ha={FieldGroup:"FieldGroup__Q2JCV",fieldGroup:"FieldGroup__Q2JCV","FieldGroup--horizontal":"FieldGroup--horizontal__kpfL1",fieldGroupHorizontal:"FieldGroup--horizontal__kpfL1","FieldGroup--vertical":"FieldGroup--vertical__FLo-Q",fieldGroupVertical:"FieldGroup--vertical__FLo-Q"},Th=E("FieldGroup",q(({children:e,className:t,orientation:n="vertical",...r},o)=>{const i=k(Ha.FieldGroup,Ha[`FieldGroup--${n}`],t);return c.jsx("div",{ref:o,className:i,...r,children:e})}));Th.displayName="FieldGroup";const Va={Input:"Input__uS0sb",Error:"Error__-DQpw"},ui=E("Input",q(({className:e,error:t,...n},r)=>{const o=k(Va.Input,t&&Va.Error,e);return c.jsx("input",{ref:r,className:o,...n})}));ui.displayName="Input";const Rh={Error:"Error__N4OP5"},Ph=E("InputError",q(({children:e,className:t,...n},r)=>{const o=k(Rh.Error,t);return c.jsx("span",{ref:r,className:o,...n,children:e})}));Ph.displayName="InputError";const za={Label:"Label__VYUvW",Error:"Error__Eu6DI"},Ah=E("Label",q(({children:e,className:t,error:n,...r},o)=>{const i=k(za.Label,n&&za.Error,t);return c.jsx("label",{ref:o,className:i,...r,children:e})}));Ah.displayName="Label";const di={Select:"Select__giqpe",Chevron:"Chevron__YvhBd"},Ga=q(({children:e,className:t,...n},r)=>{const o=k(di.Option,t);return c.jsx("option",{ref:r,className:o,...n,children:e})});Ga.displayName="Option";const qa=E("Select",q(({children:e,className:t,...n},r)=>{const o=k(di.Select,t);return c.jsxs("div",{className:o,children:[c.jsx("select",{ref:r,...n,children:e}),c.jsx("div",{className:di.Chevron,children:c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}));qa.displayName="Select",qa.Option=Ga;function Ka(e,[t,n]){return Math.min(n,Math.max(t,e))}function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Oh(e,t){const n=d.createContext(t),r=i=>{const{children:s,...a}=i,l=d.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=d.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Xn(e,t=[]){let n=[];function r(i,s){const a=d.createContext(s),l=n.length;n=[...n,s];const u=h=>{var y;const{scope:m,children:g,...x}=h,p=((y=m==null?void 0:m[e])==null?void 0:y[l])||a,v=d.useMemo(()=>x,Object.values(x));return c.jsx(p.Provider,{value:v,children:g})};u.displayName=i+"Provider";function f(h,m){var p;const g=((p=m==null?void 0:m[e])==null?void 0:p[l])||a,x=d.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,f]}const o=()=>{const i=n.map(s=>d.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Ih(o,...t)]}function Ih(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Qa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yn(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Qa(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Qa(e[o],null)}}}}function de(...e){return d.useCallback(yn(...e),e)}function Ya(e){const t=jh(e),n=d.forwardRef((r,o)=>{const{children:i,...s}=r,a=d.Children.toArray(i),l=a.find(Lh);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function jh(e){const t=d.forwardRef((n,r)=>{const{children:o,...i}=n;if(d.isValidElement(o)){const s=Dh(o),a=Nh(i,o.props);return o.type!==d.Fragment&&(a.ref=r?yn(r,s):s),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kh=Symbol("radix.slottable");function Lh(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kh}function Nh(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Dh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mh(e){const t=e+"CollectionProvider",[n,r]=Xn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,w=Ue.useRef(null),C=Ue.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:C,collectionRef:w,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Ya(a),u=Ue.forwardRef((p,v)=>{const{scope:y,children:w}=p,C=i(a,y),S=de(v,C.collectionRef);return c.jsx(l,{ref:S,children:w})});u.displayName=a;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=Ya(f),g=Ue.forwardRef((p,v)=>{const{scope:y,children:w,...C}=p,S=Ue.useRef(null),T=de(v,S),R=i(f,y);return Ue.useEffect(()=>(R.itemMap.set(S,{ref:S,...C}),()=>void R.itemMap.delete(S))),c.jsx(m,{[h]:"",ref:T,children:w})});g.displayName=f;function x(p){const v=i(e+"CollectionConsumer",p);return Ue.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const C=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((R,P)=>C.indexOf(R.ref.current)-C.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:g},x,r]}var $h=d.createContext(void 0);function Fh(e){const t=d.useContext($h);return e||t||"ltr"}function Bh(e){const t=Uh(e),n=d.forwardRef((r,o)=>{const{children:i,...s}=r,a=d.Children.toArray(i),l=a.find(Hh);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Uh(e){const t=d.forwardRef((n,r)=>{const{children:o,...i}=n;if(d.isValidElement(o)){const s=zh(o),a=Vh(i,o.props);return o.type!==d.Fragment&&(a.ref=r?yn(r,s):s),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wh=Symbol("radix.slottable");function Hh(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wh}function Vh(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function zh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=Gh.reduce((e,t)=>{const n=Bh(`Primitive.${t}`),r=d.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qh(e,t){e&&Gn.flushSync(()=>e.dispatchEvent(t))}function Xt(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Kh(e,t=globalThis==null?void 0:globalThis.document){const n=Xt(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qh="DismissableLayer",fi="dismissableLayer.update",Yh="dismissableLayer.pointerDownOutside",Zh="dismissableLayer.focusOutside",Za,Xa=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zr=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=d.useContext(Xa),[f,h]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),x=de(t,P=>h(P)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,T=e1(P=>{const L=P.target,j=[...u.branches].some(N=>N.contains(L));!S||j||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},m),R=t1(P=>{const L=P.target;[...u.branches].some(N=>N.contains(L))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},m);return Kh(P=>{w===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Za=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Ja(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Za)}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Ja())},[f,u]),d.useEffect(()=>{const P=()=>g({});return document.addEventListener(fi,P),()=>document.removeEventListener(fi,P)},[]),c.jsx(le.div,{...l,ref:x,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,R.onFocusCapture),onBlurCapture:X(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,T.onPointerDownCapture)})});zr.displayName=Qh;var Xh="DismissableLayerBranch",Jh=d.forwardRef((e,t)=>{const n=d.useContext(Xa),r=d.useRef(null),o=de(t,r);return d.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(le.div,{...e,ref:o})});Jh.displayName=Xh;function e1(e,t=globalThis==null?void 0:globalThis.document){const n=Xt(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){el(Yh,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function t1(e,t=globalThis==null?void 0:globalThis.document){const n=Xt(e),r=d.useRef(!1);return d.useEffect(()=>{const o=i=>{i.target&&!r.current&&el(Zh,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ja(){const e=new CustomEvent(fi);document.dispatchEvent(e)}function el(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?qh(o,i):o.dispatchEvent(i)}var pi=0;function tl(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nl()),document.body.insertAdjacentElement("beforeend",e[1]??nl()),pi++,()=>{pi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pi--}},[])}function nl(){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 hi="focusScope.autoFocusOnMount",mi="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},n1="FocusScope",gi=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=d.useState(null),u=Xt(o),f=Xt(i),h=d.useRef(null),m=de(t,p=>l(p)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let p=function(C){if(g.paused||!a)return;const S=C.target;a.contains(S)?h.current=S:Pt(h.current,{select:!0})},v=function(C){if(g.paused||!a)return;const S=C.relatedTarget;S!==null&&(a.contains(S)||Pt(h.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&Pt(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,g.paused]),d.useEffect(()=>{if(a){sl.add(g);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(hi,rl);a.addEventListener(hi,u),a.dispatchEvent(y),y.defaultPrevented||(r1(l1(ol(a)),{select:!0}),document.activeElement===p&&Pt(a))}return()=>{a.removeEventListener(hi,u),setTimeout(()=>{const y=new CustomEvent(mi,rl);a.addEventListener(mi,f),a.dispatchEvent(y),y.defaultPrevented||Pt(p??document.body,{select:!0}),a.removeEventListener(mi,f),sl.remove(g)},0)}}},[a,u,f,g]);const x=d.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[C,S]=o1(w);C&&S?!p.shiftKey&&y===S?(p.preventDefault(),n&&Pt(C,{select:!0})):p.shiftKey&&y===C&&(p.preventDefault(),n&&Pt(S,{select:!0})):y===w&&p.preventDefault()}},[n,r,g.paused]);return c.jsx(le.div,{tabIndex:-1,...s,ref:m,onKeyDown:x})});gi.displayName=n1;function r1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pt(r,{select:t}),document.activeElement!==n)return}function o1(e){const t=ol(e),n=il(t,e),r=il(t.reverse(),e);return[n,r]}function ol(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function il(e,t){for(const n of e)if(!i1(n,{upTo:t}))return n}function i1(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function s1(e){return e instanceof HTMLInputElement&&"select"in e}function Pt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&s1(e)&&t&&e.select()}}var sl=a1();function a1(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=al(e,t),e.unshift(t)},remove(t){var n;e=al(e,t),(n=e[0])==null||n.resume()}}}function al(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function l1(e){return e.filter(t=>t.tagName!=="A")}var _e=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},c1=d[" useId ".trim().toString()]||(()=>{}),u1=0;function Jt(e){const[t,n]=d.useState(c1());return _e(()=>{n(r=>r??String(u1++))},[e]),e||(t?`radix-${t}`:"")}const d1=["top","right","bottom","left"],At=Math.min,Le=Math.max,Gr=Math.round,qr=Math.floor,et=e=>({x:e,y:e}),f1={left:"right",right:"left",bottom:"top",top:"bottom"},p1={start:"end",end:"start"};function vi(e,t,n){return Le(e,At(t,n))}function ht(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function bn(e){return e.split("-")[1]}function yi(e){return e==="x"?"y":"x"}function bi(e){return e==="y"?"height":"width"}const h1=new Set(["top","bottom"]);function tt(e){return h1.has(mt(e))?"y":"x"}function wi(e){return yi(tt(e))}function m1(e,t,n){n===void 0&&(n=!1);const r=bn(e),o=wi(e),i=bi(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Kr(s)),[s,Kr(s)]}function g1(e){const t=Kr(e);return[_i(e),t,_i(t)]}function _i(e){return e.replace(/start|end/g,t=>p1[t])}const ll=["left","right"],cl=["right","left"],v1=["top","bottom"],y1=["bottom","top"];function b1(e,t,n){switch(e){case"top":case"bottom":return n?t?cl:ll:t?ll:cl;case"left":case"right":return t?v1:y1;default:return[]}}function w1(e,t,n,r){const o=bn(e);let i=b1(mt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(_i)))),i}function Kr(e){return e.replace(/left|right|bottom|top/g,t=>f1[t])}function _1(e){return{top:0,right:0,bottom:0,left:0,...e}}function ul(e){return typeof e!="number"?_1(e):{top:e,right:e,bottom:e,left:e}}function Qr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function dl(e,t,n){let{reference:r,floating:o}=e;const i=tt(t),s=wi(t),a=bi(s),l=mt(t),u=i==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(bn(t)){case"start":g[s]-=m*(n&&u?-1:1);break;case"end":g[s]+=m*(n&&u?-1:1);break}return g}async function x1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=ht(t,e),x=ul(g),v=a[m?h==="floating"?"reference":"floating":h],y=Qr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},T=Qr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:C,strategy:l}):w);return{top:(y.top-T.top+x.top)/S.y,bottom:(T.bottom-y.bottom+x.bottom)/S.y,left:(y.left-T.left+x.left)/S.x,right:(T.right-y.right+x.right)/S.x}}const C1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=dl(u,r,l),m=r,g={},x=0;for(let v=0;v<a.length;v++){var p;const{name:y,fn:w}=a[v],{x:C,y:S,data:T,reset:R}=await w({x:f,y:h,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:u,platform:{...s,detectOverflow:(p=s.detectOverflow)!=null?p:x1},elements:{reference:e,floating:t}});f=C??f,h=S??h,g={...g,[y]:{...g[y],...T}},R&&x<=50&&(x++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(u=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:f,y:h}=dl(u,m,l)),v=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:g}},S1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=ht(e,t)||{};if(u==null)return{};const h=ul(f),m={x:n,y:r},g=wi(o),x=bi(g),p=await s.getDimensions(u),v=g==="y",y=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[g]-m[g]-i.floating[x],T=m[g]-i.reference[g],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=R?R[C]:0;(!P||!await(s.isElement==null?void 0:s.isElement(R)))&&(P=a.floating[C]||i.floating[x]);const L=S/2-T/2,j=P/2-p[x]/2-1,N=At(h[y],j),B=At(h[w],j),U=N,H=P-p[x]-B,z=P/2-p[x]/2+L,se=vi(U,z,H),G=!l.arrow&&bn(o)!=null&&z!==se&&i.reference[x]/2-(z<U?N:B)-p[x]/2<0,Z=G?z<U?z-U:z-H:0;return{[g]:m[g]+Z,data:{[g]:se,centerOffset:z-se-Z,...G&&{alignmentOffset:Z}},reset:G}}}),E1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:p=!0,...v}=ht(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=mt(o),w=tt(a),C=mt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=m||(C||!p?[Kr(a)]:g1(a)),R=x!=="none";!m&&R&&T.push(...w1(a,p,x,S));const P=[a,...T],L=await l.detectOverflow(t,v),j=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&j.push(L[y]),h){const z=m1(o,s,S);j.push(L[z[0]],L[z[1]])}if(N=[...N,{placement:o,overflows:j}],!j.every(z=>z<=0)){var B,U;const z=(((B=i.flip)==null?void 0:B.index)||0)+1,se=P[z];if(se&&(!(h==="alignment"?w!==tt(se):!1)||N.every($=>tt($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:z,overflows:N},reset:{placement:se}};let G=(U=N.filter(Z=>Z.overflows[0]<=0).sort((Z,$)=>Z.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!G)switch(g){case"bestFit":{var H;const Z=(H=N.filter($=>{if(R){const ae=tt($.placement);return ae===w||ae==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ae=>ae>0).reduce((ae,we)=>ae+we,0)]).sort(($,ae)=>$[1]-ae[1])[0])==null?void 0:H[0];Z&&(G=Z);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function fl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pl(e){return d1.some(t=>e[t]>=0)}const T1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=ht(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=fl(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:pl(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=fl(s,n.floating);return{data:{escapedOffsets:a,escaped:pl(a)}}}default:return{}}}}},hl=new Set(["left","top"]);async function R1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=mt(n),a=bn(n),l=tt(n)==="y",u=hl.has(s)?-1:1,f=i&&l?-1:1,h=ht(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),l?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const P1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await R1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},A1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:w,y:C}=y;return{x:w,y:C}}},...u}=ht(e,t),f={x:n,y:r},h=await i.detectOverflow(t,u),m=tt(mt(o)),g=yi(m);let x=f[g],p=f[m];if(s){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=x+h[y],S=x-h[w];x=vi(C,x,S)}if(a){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",C=p+h[y],S=p-h[w];p=vi(C,p,S)}const v=l.fn({...t,[g]:x,[m]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:s,[m]:a}}}}}},O1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ht(e,t),f={x:n,y:r},h=tt(o),m=yi(h);let g=f[m],x=f[h];const p=ht(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const C=m==="y"?"height":"width",S=i.reference[m]-i.floating[C]+v.mainAxis,T=i.reference[m]+i.reference[C]-v.mainAxis;g<S?g=S:g>T&&(g=T)}if(u){var y,w;const C=m==="y"?"width":"height",S=hl.has(mt(o)),T=i.reference[h]-i.floating[C]+(S&&((y=s.offset)==null?void 0:y[h])||0)+(S?0:v.crossAxis),R=i.reference[h]+i.reference[C]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?v.crossAxis:0);x<T?x=T:x>R&&(x=R)}return{[m]:g,[h]:x}}}},I1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ht(e,t),f=await s.detectOverflow(t,u),h=mt(o),m=bn(o),g=tt(o)==="y",{width:x,height:p}=i.floating;let v,y;h==="top"||h==="bottom"?(v=h,y=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=h,v=m==="end"?"top":"bottom");const w=p-f.top-f.bottom,C=x-f.left-f.right,S=At(p-f[v],w),T=At(x-f[y],C),R=!t.middlewareData.shift;let P=S,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),R&&!m){const N=Le(f.left,0),B=Le(f.right,0),U=Le(f.top,0),H=Le(f.bottom,0);g?L=x-2*(N!==0||B!==0?N+B:Le(f.left,f.right)):P=p-2*(U!==0||H!==0?U+H:Le(f.top,f.bottom))}await l({...t,availableWidth:L,availableHeight:P});const j=await s.getDimensions(a.floating);return x!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function Yr(){return typeof window<"u"}function wn(e){return ml(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nt(e){var t;return(t=(ml(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ml(e){return Yr()?e instanceof Node||e instanceof Ne(e).Node:!1}function Ve(e){return Yr()?e instanceof Element||e instanceof Ne(e).Element:!1}function rt(e){return Yr()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function gl(e){return!Yr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}const j1=new Set(["inline","contents"]);function Jn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ze(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!j1.has(o)}const k1=new Set(["table","td","th"]);function L1(e){return k1.has(wn(e))}const N1=[":popover-open",":modal"];function Zr(e){return N1.some(t=>{try{return e.matches(t)}catch{return!1}})}const D1=["transform","translate","scale","rotate","perspective"],M1=["transform","translate","scale","rotate","perspective","filter"],$1=["paint","layout","strict","content"];function xi(e){const t=Ci(),n=Ve(e)?ze(e):e;return D1.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||M1.some(r=>(n.willChange||"").includes(r))||$1.some(r=>(n.contain||"").includes(r))}function F1(e){let t=Ot(e);for(;rt(t)&&!_n(t);){if(xi(t))return t;if(Zr(t))return null;t=Ot(t)}return null}function Ci(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const B1=new Set(["html","body","#document"]);function _n(e){return B1.has(wn(e))}function ze(e){return Ne(e).getComputedStyle(e)}function Xr(e){return Ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ot(e){if(wn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gl(e)&&e.host||nt(e);return gl(t)?t.host:t}function vl(e){const t=Ot(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&Jn(t)?t:vl(t)}function er(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=vl(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Si(s);return t.concat(s,s.visualViewport||[],Jn(o)?o:[],a&&n?er(a):[])}return t.concat(o,er(o,[],n))}function Si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yl(e){const t=ze(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=rt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Gr(n)!==i||Gr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ei(e){return Ve(e)?e:e.contextElement}function xn(e){const t=Ei(e);if(!rt(t))return et(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=yl(t);let s=(i?Gr(n.width):n.width)/r,a=(i?Gr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const U1=et(0);function bl(e){const t=Ne(e);return!Ci()||!t.visualViewport?U1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function W1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function en(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ei(e);let s=et(1);t&&(r?Ve(r)&&(s=xn(r)):s=xn(e));const a=W1(i,n,r)?bl(i):et(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(i){const m=Ne(i),g=r&&Ve(r)?Ne(r):r;let x=m,p=Si(x);for(;p&&r&&g!==x;){const v=xn(p),y=p.getBoundingClientRect(),w=ze(p),C=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,S=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,h*=v.y,l+=C,u+=S,x=Ne(p),p=Si(x)}}return Qr({width:f,height:h,x:l,y:u})}function Jr(e,t){const n=Xr(e).scrollLeft;return t?t.left+n:en(nt(e)).left+n}function wl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Jr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function H1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=nt(r),a=t?Zr(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=et(1);const f=et(0),h=rt(r);if((h||!h&&!i)&&((wn(r)!=="body"||Jn(s))&&(l=Xr(r)),rt(r))){const g=en(r);u=xn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=s&&!h&&!i?wl(s,l):et(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function V1(e){return Array.from(e.getClientRects())}function z1(e){const t=nt(e),n=Xr(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jr(e);const a=-n.scrollTop;return ze(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const _l=25;function G1(e,t){const n=Ne(e),r=nt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const f=Ci();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Jr(r);if(u<=0){const f=r.ownerDocument,h=f.body,m=getComputedStyle(h),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-g);x<=_l&&(i-=x)}else u<=_l&&(i+=u);return{width:i,height:s,x:a,y:l}}const q1=new Set(["absolute","fixed"]);function K1(e,t){const n=en(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=rt(e)?xn(e):et(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function xl(e,t,n){let r;if(t==="viewport")r=G1(e,n);else if(t==="document")r=z1(nt(e));else if(Ve(t))r=K1(t,n);else{const o=bl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qr(r)}function Cl(e,t){const n=Ot(e);return n===t||!Ve(n)||_n(n)?!1:ze(n).position==="fixed"||Cl(n,t)}function Q1(e,t){const n=t.get(e);if(n)return n;let r=er(e,[],!1).filter(a=>Ve(a)&&wn(a)!=="body"),o=null;const i=ze(e).position==="fixed";let s=i?Ot(e):e;for(;Ve(s)&&!_n(s);){const a=ze(s),l=xi(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&q1.has(o.position)||Jn(s)&&!l&&Cl(e,s))?r=r.filter(f=>f!==s):o=a,s=Ot(s)}return t.set(e,r),r}function Y1(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Zr(t)?[]:Q1(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const h=xl(t,f,o);return u.top=Le(h.top,u.top),u.right=At(h.right,u.right),u.bottom=At(h.bottom,u.bottom),u.left=Le(h.left,u.left),u},xl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Z1(e){const{width:t,height:n}=yl(e);return{width:t,height:n}}function X1(e,t,n){const r=rt(t),o=nt(t),i=n==="fixed",s=en(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=et(0);function u(){l.x=Jr(o)}if(r||!r&&!i)if((wn(t)!=="body"||Jn(o))&&(a=Xr(t)),r){const g=en(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&u();i&&!r&&o&&u();const f=o&&!r&&!i?wl(o,a):et(0),h=s.left+a.scrollLeft-l.x-f.x,m=s.top+a.scrollTop-l.y-f.y;return{x:h,y:m,width:s.width,height:s.height}}function Ti(e){return ze(e).position==="static"}function Sl(e,t){if(!rt(e)||ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return nt(e)===n&&(n=n.ownerDocument.body),n}function El(e,t){const n=Ne(e);if(Zr(e))return n;if(!rt(e)){let o=Ot(e);for(;o&&!_n(o);){if(Ve(o)&&!Ti(o))return o;o=Ot(o)}return n}let r=Sl(e,t);for(;r&&L1(r)&&Ti(r);)r=Sl(r,t);return r&&_n(r)&&Ti(r)&&!xi(r)?n:r||F1(e)||n}const J1=async function(e){const t=this.getOffsetParent||El,n=this.getDimensions,r=await n(e.floating);return{reference:X1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function em(e){return ze(e).direction==="rtl"}const tm={convertOffsetParentRelativeRectToViewportRelativeRect:H1,getDocumentElement:nt,getClippingRect:Y1,getOffsetParent:El,getElementRects:J1,getClientRects:V1,getDimensions:Z1,getScale:xn,isElement:Ve,isRTL:em};function Tl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nm(e,t){let n=null,r;const o=nt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:f,top:h,width:m,height:g}=u;if(a||t(),!m||!g)return;const x=qr(h),p=qr(o.clientWidth-(f+m)),v=qr(o.clientHeight-(h+g)),y=qr(f),C={rootMargin:-x+"px "+-p+"px "+-v+"px "+-y+"px",threshold:Le(0,At(1,l))||1};let S=!0;function T(R){const P=R[0].intersectionRatio;if(P!==l){if(!S)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!Tl(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,C)}n.observe(e)}return s(!0),i}function rm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ei(e),f=o||i?[...u?er(u):[],...er(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const h=u&&a?nm(u,n):null;let m=-1,g=null;s&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let x,p=l?en(e):null;l&&v();function v(){const y=en(e);p&&!Tl(p,y)&&n(),p=y,x=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h==null||h(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(x)}}const om=P1,im=A1,sm=E1,am=I1,lm=T1,Rl=S1,cm=O1,um=(e,t,n)=>{const r=new Map,o={platform:tm,...n},i={...o.platform,_c:r};return C1(e,t,{...o,platform:i})};var dm=typeof document<"u",fm=function(){},eo=dm?ys:fm;function to(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!to(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!to(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Al(e,t){const n=Pl(e);return Math.round(t*n)/n}function Ri(e){const t=d.useRef(e);return eo(()=>{t.current=e}),t}function pm(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,h]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);to(m,r)||g(r);const[x,p]=d.useState(null),[v,y]=d.useState(null),w=d.useCallback($=>{$!==R.current&&(R.current=$,p($))},[]),C=d.useCallback($=>{$!==P.current&&(P.current=$,y($))},[]),S=i||x,T=s||v,R=d.useRef(null),P=d.useRef(null),L=d.useRef(f),j=l!=null,N=Ri(l),B=Ri(o),U=Ri(u),H=d.useCallback(()=>{if(!R.current||!P.current)return;const $={placement:t,strategy:n,middleware:m};B.current&&($.platform=B.current),um(R.current,P.current,$).then(ae=>{const we={...ae,isPositioned:U.current!==!1};z.current&&!to(L.current,we)&&(L.current=we,Gn.flushSync(()=>{h(we)}))})},[m,t,n,B,U]);eo(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const z=d.useRef(!1);eo(()=>(z.current=!0,()=>{z.current=!1}),[]),eo(()=>{if(S&&(R.current=S),T&&(P.current=T),S&&T){if(N.current)return N.current(S,T,H);H()}},[S,T,H,N,j]);const se=d.useMemo(()=>({reference:R,floating:P,setReference:w,setFloating:C}),[w,C]),G=d.useMemo(()=>({reference:S,floating:T}),[S,T]),Z=d.useMemo(()=>{const $={position:n,left:0,top:0};if(!G.floating)return $;const ae=Al(G.floating,f.x),we=Al(G.floating,f.y);return a?{...$,transform:"translate("+ae+"px, "+we+"px)",...Pl(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ae,top:we}},[n,a,G.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:H,refs:se,elements:G,floatingStyles:Z}),[f,H,se,G,Z])}const hm=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Rl({element:r.current,padding:o}).fn(n):{}:r?Rl({element:r,padding:o}).fn(n):{}}}},mm=(e,t)=>({...om(e),options:[e,t]}),gm=(e,t)=>({...im(e),options:[e,t]}),vm=(e,t)=>({...cm(e),options:[e,t]}),ym=(e,t)=>({...sm(e),options:[e,t]}),bm=(e,t)=>({...am(e),options:[e,t]}),wm=(e,t)=>({...lm(e),options:[e,t]}),_m=(e,t)=>({...hm(e),options:[e,t]});var xm="Arrow",Ol=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return c.jsx(le.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ol.displayName=xm;var Cm=Ol;function Sm(e){const[t,n]=d.useState(void 0);return _e(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Pi="Popper",[Il,no]=Xn(Pi),[Em,jl]=Il(Pi),kl=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return c.jsx(Em,{scope:t,anchor:r,onAnchorChange:o,children:n})};kl.displayName=Pi;var Ll="PopperAnchor",Nl=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=jl(Ll,n),s=d.useRef(null),a=de(t,s),l=d.useRef(null);return d.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:c.jsx(le.div,{...o,ref:a})});Nl.displayName=Ll;var Ai="PopperContent",[Tm,Rm]=Il(Ai),Dl=d.forwardRef((e,t)=>{var M,re,ge,J,oe,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...p}=e,v=jl(Ai,n),[y,w]=d.useState(null),C=de(t,Re=>w(Re)),[S,T]=d.useState(null),R=Sm(S),P=(R==null?void 0:R.width)??0,L=(R==null?void 0:R.height)??0,j=r+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(u)?u:[u],U=B.length>0,H={padding:N,boundary:B.filter(Am),altBoundary:U},{refs:z,floatingStyles:se,placement:G,isPositioned:Z,middlewareData:$}=pm({strategy:"fixed",placement:j,whileElementsMounted:(...Re)=>rm(...Re,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[mm({mainAxis:o+L,alignmentAxis:s}),l&&gm({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vm():void 0,...H}),l&&ym({...H}),bm({...H,apply:({elements:Re,rects:Fe,availableWidth:ut,availableHeight:Xe})=>{const{width:Gt,height:Po}=Fe.reference,_t=Re.floating.style;_t.setProperty("--radix-popper-available-width",`${ut}px`),_t.setProperty("--radix-popper-available-height",`${Xe}px`),_t.setProperty("--radix-popper-anchor-width",`${Gt}px`),_t.setProperty("--radix-popper-anchor-height",`${Po}px`)}}),S&&_m({element:S,padding:a}),Om({arrowWidth:P,arrowHeight:L}),m&&wm({strategy:"referenceHidden",...H})]}),[ae,we]=Fl(G),$e=Xt(x);_e(()=>{Z&&($e==null||$e())},[Z,$e]);const Ht=(M=$.arrow)==null?void 0:M.x,Vt=(re=$.arrow)==null?void 0:re.y,ct=((ge=$.arrow)==null?void 0:ge.centerOffset)!==0,[zt,Ze]=d.useState();return _e(()=>{y&&Ze(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:Z?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:zt,"--radix-popper-transform-origin":[(J=$.transformOrigin)==null?void 0:J.x,(oe=$.transformOrigin)==null?void 0:oe.y].join(" "),...((ee=$.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Tm,{scope:n,placedSide:ae,onArrowChange:T,arrowX:Ht,arrowY:Vt,shouldHideArrow:ct,children:c.jsx(le.div,{"data-side":ae,"data-align":we,...p,ref:C,style:{...p.style,animation:Z?void 0:"none"}})})})});Dl.displayName=Ai;var Ml="PopperArrow",Pm={top:"bottom",right:"left",bottom:"top",left:"right"},$l=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Rm(Ml,r),s=Pm[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(Cm,{...o,ref:n,style:{...o.style,display:"block"}})})});$l.displayName=Ml;function Am(e){return e!==null}var Om=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,f]=Fl(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let x="",p="";return u==="bottom"?(x=s?h:`${m}px`,p=`${-l}px`):u==="top"?(x=s?h:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(x=`${-l}px`,p=s?h:`${g}px`):u==="left"&&(x=`${r.floating.width+l}px`,p=s?h:`${g}px`),{data:{x,y:p}}}});function Fl(e){const[t,n="center"]=e.split("-");return[t,n]}var Bl=kl,Ul=Nl,Wl=Dl,Hl=$l,Im="Portal",Oi=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=d.useState(!1);_e(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?_s.createPortal(c.jsx(le.div,{...r,ref:t}),s):null});Oi.displayName=Im;function jm(e){const t=km(e),n=d.forwardRef((r,o)=>{const{children:i,...s}=r,a=d.Children.toArray(i),l=a.find(Nm);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function km(e){const t=d.forwardRef((n,r)=>{const{children:o,...i}=n;if(d.isValidElement(o)){const s=Mm(o),a=Dm(i,o.props);return o.type!==d.Fragment&&(a.ref=r?yn(r,s):s),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lm=Symbol("radix.slottable");function Nm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lm}function Dm(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Mm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $m=d[" useInsertionEffect ".trim().toString()]||_e;function ro({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=Fm({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=d.useCallback(f=>{var h;if(a){const m=Bm(f)?f(e):f;m!==e&&((h=s.current)==null||h.call(s,m))}else i(f)},[a,e,i,s]);return[l,u]}function Fm({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),o=d.useRef(n),i=d.useRef(t);return $m(()=>{i.current=t},[t]),d.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Bm(e){return typeof e=="function"}function Um(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vl=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"}),Wm="VisuallyHidden",zl=d.forwardRef((e,t)=>c.jsx(le.span,{...e,ref:t,style:{...Vl,...e.style}}));zl.displayName=Wm;var Hm=zl,Vm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cn=new WeakMap,oo=new WeakMap,io={},Ii=0,Gl=function(e){return e&&(e.host||Gl(e.parentNode))},zm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Gl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gm=function(e,t,n,r){var o=zm(t,Array.isArray(e)?e:[e]);io[n]||(io[n]=new WeakMap);var i=io[n],s=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var f=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),x=g!==null&&g!=="false",p=(Cn.get(m)||0)+1,v=(i.get(m)||0)+1;Cn.set(m,p),i.set(m,v),s.push(m),p===1&&x&&oo.set(m,!0),v===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Ii++,function(){s.forEach(function(h){var m=Cn.get(h)-1,g=i.get(h)-1;Cn.set(h,m),i.set(h,g),m||(oo.has(h)||h.removeAttribute(r),oo.delete(h)),g||h.removeAttribute(n)}),Ii--,Ii||(Cn=new WeakMap,Cn=new WeakMap,oo=new WeakMap,io={})}},ql=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Vm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Gm(r,o,n,"aria-hidden")):function(){return null}},so="right-scroll-bar-position",ao="width-before-scroll-bar",qm="with-scroll-bars-hidden",Km="--removed-body-scroll-bar-size";function ji(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qm(e,t){var n=W(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ym=typeof window<"u"?d.useLayoutEffect:d.useEffect,Kl=new WeakMap;function Zm(e,t){var n=Qm(null,function(r){return e.forEach(function(o){return ji(o,r)})});return Ym(function(){var r=Kl.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||ji(a,null)}),i.forEach(function(a){o.has(a)||ji(a,s)})}Kl.set(n,e)},[e]),n}function Xm(e){return e}function Jm(e,t){t===void 0&&(t=Xm);var n=[],r=!1,o={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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var f=s;s=[],f.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return o}function eg(e){e===void 0&&(e={});var t=Jm(null);return t.options=Je({async:!0,ssr:!1},e),t}var Ql=function(e){var t=e.sideCar,n=Fs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Je({},n))};Ql.isSideCarExport=!0;function tg(e,t){return e.useMedium(t),Ql}var Yl=eg(),ki=function(){},lo=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ki,onWheelCapture:ki,onTouchMoveCapture:ki}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,g=e.noRelative,x=e.noIsolation,p=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,C=e.gapMode,S=Fs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,R=Zm([n,t]),P=Je(Je({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(T,{sideCar:Yl,removeScrollBar:u,shards:h,noRelative:g,noIsolation:x,inert:p,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:C}),s?d.cloneElement(d.Children.only(a),Je(Je({},P),{ref:R})):d.createElement(w,Je({},P,{className:l,ref:R}),a))});lo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lo.classNames={fullWidth:ao,zeroRight:so};var ng=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rg(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ng();return t&&e.setAttribute("nonce",t),e}function og(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ig(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rg())&&(og(t,n),ig(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ag=function(){var e=sg();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zl=function(){var e=ag(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},lg={left:0,top:0,right:0,gap:0},Li=function(e){return parseInt(e||"",10)||0},cg=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Li(n),Li(r),Li(o)]},ug=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lg;var t=cg(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])}},dg=Zl(),Sn="data-scroll-locked",fg=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
210
210
|
.`.concat(qm,` {
|
|
211
211
|
overflow: hidden `).concat(r,`;
|
|
212
212
|
padding-right: `).concat(a,"px ").concat(r,`;
|