@meridianjs/admin-dashboard 0.1.0
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/assets/index-BSEBPE1P.js +399 -0
- package/dist/assets/index-Deksw4QQ.css +1 -0
- package/dist/assets/vendor-dnd-dQurpOJF.js +5 -0
- package/dist/assets/vendor-editor-DYN2JaBa.js +148 -0
- package/dist/assets/vendor-query-BxDNdxq_.js +9 -0
- package/dist/assets/vendor-radix-DmippTD7.js +53 -0
- package/dist/assets/vendor-react-CfHM_tz4.js +59 -0
- package/dist/index.html +25 -0
- package/package.json +64 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var Se=e=>{throw TypeError(e)};var te=(e,t,s)=>t.has(e)||Se("Cannot "+s);var r=(e,t,s)=>(te(e,t,"read from private field"),s?s.call(e):t.get(e)),c=(e,t,s)=>t.has(e)?Se("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),o=(e,t,s,i)=>(te(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),y=(e,t,s)=>(te(e,t,"access private method"),s);var $t=(e,t,s,i)=>({set _(n){o(e,t,n,s)},get _(){return r(e,t,i)}});import{r as D}from"./vendor-react-CfHM_tz4.js";var Be={exports:{}},Xt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ns=D,as=Symbol.for("react.element"),os=Symbol.for("react.fragment"),us=Object.prototype.hasOwnProperty,hs=ns.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cs={key:!0,ref:!0,__self:!0,__source:!0};function ze(e,t,s){var i,n={},a=null,h=null;s!==void 0&&(a=""+s),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(h=t.ref);for(i in t)us.call(t,i)&&!cs.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)n[i]===void 0&&(n[i]=t[i]);return{$$typeof:as,type:e,key:a,ref:h,props:n,_owner:hs.current}}Xt.Fragment=os;Xt.jsx=ze;Xt.jsxs=ze;Be.exports=Xt;var ls=Be.exports,_t=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(){}},ds={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},it,pe,Ae,fs=(Ae=class{constructor(){c(this,it,ds);c(this,pe,!1)}setTimeoutProvider(e){o(this,it,e)}setTimeout(e,t){return r(this,it).setTimeout(e,t)}clearTimeout(e){r(this,it).clearTimeout(e)}setInterval(e,t){return r(this,it).setInterval(e,t)}clearInterval(e){r(this,it).clearInterval(e)}},it=new WeakMap,pe=new WeakMap,Ae),ft=new fs;function ys(e){setTimeout(e,0)}var Ot=typeof window>"u"||"Deno"in globalThis;function _(){}function ps(e,t){return typeof e=="function"?e(t):e}function ee(e){return typeof e=="number"&&e>=0&&e!==1/0}function We(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dt(e,t){return typeof e=="function"?e(t):e}function N(e,t){return typeof e=="function"?e(t):e}function Oe(e,t){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:h,stale:u}=e;if(h){if(i){if(t.queryHash!==me(h,t.options))return!1}else if(!kt(t.queryKey,h))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||n&&n!==t.state.fetchStatus||a&&!a(t))}function Pe(e,t){const{exact:s,status:i,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(Pt(t.options.mutationKey)!==Pt(a))return!1}else if(!kt(t.options.mutationKey,a))return!1}return!(i&&t.state.status!==i||n&&!n(t))}function me(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pt)(e)}function Pt(e){return JSON.stringify(e,(t,s)=>se(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function kt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>kt(e[s],t[s])):!1}var ms=Object.prototype.hasOwnProperty;function $e(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=Re(e)&&Re(t);if(!i&&!(se(e)&&se(t)))return t;const a=(i?e:Object.keys(e)).length,h=i?t:Object.keys(t),u=h.length,p=i?new Array(u):{};let m=0;for(let v=0;v<u;v++){const f=i?v:h[v],g=e[f],d=t[f];if(g===d){p[f]=g,(i?v<a:ms.call(e,f))&&m++;continue}if(g===null||d===null||typeof g!="object"||typeof d!="object"){p[f]=d;continue}const E=$e(g,d,s+1);p[f]=E,E===g&&m++}return a===u&&m===a?e:p}function Yt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Re(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function se(e){if(!Ee(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Ee(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ee(e){return Object.prototype.toString.call(e)==="[object Object]"}function vs(e){return new Promise(t=>{ft.setTimeout(t,e)})}function ie(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?$e(e,t):t}function bs(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function gs(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}var ve=Symbol();function Ve(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ve?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function be(e,t){return typeof e=="function"?e(...t):!!e}function ws(e,t,s){let i=!1,n;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??(n=t()),i||(i=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),e}var yt,rt,Rt,je,Cs=(je=class extends _t{constructor(){super();c(this,yt);c(this,rt);c(this,Rt);o(this,Rt,t=>{if(!Ot&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){r(this,rt)||this.setEventListener(r(this,Rt))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,rt))==null||t.call(this),o(this,rt,void 0))}setEventListener(t){var s;o(this,Rt,t),(s=r(this,rt))==null||s.call(this),o(this,rt,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){r(this,yt)!==t&&(o(this,yt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof r(this,yt)=="boolean"?r(this,yt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},yt=new WeakMap,rt=new WeakMap,Rt=new WeakMap,je),ge=new Cs;function re(){let e,t;const s=new Promise((n,a)=>{e=n,t=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),e(n)},s.reject=n=>{i({status:"rejected",reason:n}),t(n)},s}var Ss=ys;function Os(){let e=[],t=0,s=u=>{u()},i=u=>{u()},n=Ss;const a=u=>{t?e.push(u):n(()=>{s(u)})},h=()=>{const u=e;e=[],u.length&&n(()=>{i(()=>{u.forEach(p=>{s(p)})})})};return{batch:u=>{let p;t++;try{p=u()}finally{t--,t||h()}return p},batchCalls:u=>(...p)=>{a(()=>{u(...p)})},schedule:a,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{n=u}}}var M=Os(),Et,nt,Ft,Ue,Ps=(Ue=class extends _t{constructor(){super();c(this,Et,!0);c(this,nt);c(this,Ft);o(this,Ft,t=>{if(!Ot&&window.addEventListener){const s=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){r(this,nt)||this.setEventListener(r(this,Ft))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,nt))==null||t.call(this),o(this,nt,void 0))}setEventListener(t){var s;o(this,Ft,t),(s=r(this,nt))==null||s.call(this),o(this,nt,t(this.setOnline.bind(this)))}setOnline(t){r(this,Et)!==t&&(o(this,Et,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return r(this,Et)}},Et=new WeakMap,nt=new WeakMap,Ft=new WeakMap,Ue),Zt=new Ps;function Rs(e){return Math.min(1e3*2**e,3e4)}function Je(e){return(e??"online")==="online"?Zt.isOnline():!0}var ne=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ye(e){let t=!1,s=0,i;const n=re(),a=()=>n.status!=="pending",h=w=>{var C;if(!a()){const P=new ne(w);g(P),(C=e.onCancel)==null||C.call(e,P)}},u=()=>{t=!0},p=()=>{t=!1},m=()=>ge.isFocused()&&(e.networkMode==="always"||Zt.isOnline())&&e.canRun(),v=()=>Je(e.networkMode)&&e.canRun(),f=w=>{a()||(i==null||i(),n.resolve(w))},g=w=>{a()||(i==null||i(),n.reject(w))},d=()=>new Promise(w=>{var C;i=P=>{(a()||m())&&w(P)},(C=e.onPause)==null||C.call(e)}).then(()=>{var w;i=void 0,a()||(w=e.onContinue)==null||w.call(e)}),E=()=>{if(a())return;let w;const C=s===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(P){w=Promise.reject(P)}Promise.resolve(w).then(f).catch(P=>{var q;if(a())return;const Q=e.retry??(Ot?0:3),R=e.retryDelay??Rs,l=typeof R=="function"?R(s,P):R,I=Q===!0||typeof Q=="number"&&s<Q||typeof Q=="function"&&Q(s,P);if(t||!I){g(P);return}s++,(q=e.onFail)==null||q.call(e,s,P),vs(l).then(()=>m()?void 0:d()).then(()=>{t?g(P):E()})})};return{promise:n,status:()=>n.status,cancel:h,continue:()=>(i==null||i(),n),cancelRetry:u,continueRetry:p,canStart:v,start:()=>(v()?E():d().then(E),n)}}var pt,_e,Ze=(_e=class{constructor(){c(this,pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ee(this.gcTime)&&o(this,pt,ft.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ot?1/0:5*60*1e3))}clearGcTimeout(){r(this,pt)&&(ft.clearTimeout(r(this,pt)),o(this,pt,void 0))}},pt=new WeakMap,_e),mt,Mt,L,vt,x,Kt,bt,H,$,qe,Es=(qe=class extends Ze{constructor(t){super();c(this,H);c(this,mt);c(this,Mt);c(this,L);c(this,vt);c(this,x);c(this,Kt);c(this,bt);o(this,bt,!1),o(this,Kt,t.defaultOptions),this.setOptions(t.options),this.observers=[],o(this,vt,t.client),o(this,L,r(this,vt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,o(this,mt,Me(this.options)),this.state=t.state??r(this,mt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=r(this,x))==null?void 0:t.promise}setOptions(t){if(this.options={...r(this,Kt),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Me(this.options);s.data!==void 0&&(this.setState(Fe(s.data,s.dataUpdatedAt)),o(this,mt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&r(this,L).remove(this)}setData(t,s){const i=ie(this.state.data,t,this.options);return y(this,H,$).call(this,{data:i,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),i}setState(t,s){y(this,H,$).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var i,n;const s=(i=r(this,x))==null?void 0:i.promise;return(n=r(this,x))==null||n.cancel(t),s?s.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(r(this,mt))}isActive(){return this.observers.some(t=>N(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ve||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dt(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:!We(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,x))==null||s.continue()}onOnline(){var s;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,x))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),r(this,L).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(r(this,x)&&(r(this,bt)?r(this,x).cancel({revert:!0}):r(this,x).cancelRetry()),this.scheduleGc()),r(this,L).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||y(this,H,$).call(this,{type:"invalidate"})}async fetch(t,s){var p,m,v,f,g,d,E,w,C,P,Q,R;if(this.state.fetchStatus!=="idle"&&((p=r(this,x))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(r(this,x))return r(this,x).continueRetry(),r(this,x).promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(I=>I.options.queryFn);l&&this.setOptions(l.options)}const i=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(o(this,bt,!0),i.signal)})},a=()=>{const l=Ve(this.options,s),q=(()=>{const tt={client:r(this,vt),queryKey:this.queryKey,meta:this.meta};return n(tt),tt})();return o(this,bt,!1),this.options.persister?this.options.persister(l,q,this):l(q)},u=(()=>{const l={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:r(this,vt),state:this.state,fetchFn:a};return n(l),l})();(m=this.options.behavior)==null||m.onFetch(u,this),o(this,Mt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=u.fetchOptions)==null?void 0:v.meta))&&y(this,H,$).call(this,{type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta}),o(this,x,Ye({initialPromise:s==null?void 0:s.initialPromise,fn:u.fetchFn,onCancel:l=>{l instanceof ne&&l.revert&&this.setState({...r(this,Mt),fetchStatus:"idle"}),i.abort()},onFail:(l,I)=>{y(this,H,$).call(this,{type:"failed",failureCount:l,error:I})},onPause:()=>{y(this,H,$).call(this,{type:"pause"})},onContinue:()=>{y(this,H,$).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const l=await r(this,x).start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),(d=(g=r(this,L).config).onSuccess)==null||d.call(g,l,this),(w=(E=r(this,L).config).onSettled)==null||w.call(E,l,this.state.error,this),l}catch(l){if(l instanceof ne){if(l.silent)return r(this,x).promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw y(this,H,$).call(this,{type:"error",error:l}),(P=(C=r(this,L).config).onError)==null||P.call(C,l,this),(R=(Q=r(this,L).config).onSettled)==null||R.call(Q,this.state.data,l,this),l}finally{this.scheduleGc()}}},mt=new WeakMap,Mt=new WeakMap,L=new WeakMap,vt=new WeakMap,x=new WeakMap,Kt=new WeakMap,bt=new WeakMap,H=new WeakSet,$=function(t){const s=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Xe(i.data,this.options),fetchMeta:t.meta??null};case"success":const n={...i,...Fe(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return o(this,Mt,t.manual?n:void 0),n;case"error":const a=t.error;return{...i,error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=s(this.state),M.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),r(this,L).notify({query:this,type:"updated",action:t})})},qe);function Xe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Je(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Fe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Me(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var k,b,Lt,U,gt,Qt,V,at,Nt,It,Tt,wt,Ct,ot,xt,S,qt,ae,oe,ue,he,ce,le,de,ts,ke,Fs=(ke=class extends _t{constructor(t,s){super();c(this,S);c(this,k);c(this,b);c(this,Lt);c(this,U);c(this,gt);c(this,Qt);c(this,V);c(this,at);c(this,Nt);c(this,It);c(this,Tt);c(this,wt);c(this,Ct);c(this,ot);c(this,xt,new Set);this.options=s,o(this,k,t),o(this,at,null),o(this,V,re()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(r(this,b).addObserver(this),Qe(r(this,b),this.options)?y(this,S,qt).call(this):this.updateResult(),y(this,S,he).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fe(r(this,b),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fe(r(this,b),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,y(this,S,ce).call(this),y(this,S,le).call(this),r(this,b).removeObserver(this)}setOptions(t){const s=this.options,i=r(this,b);if(this.options=r(this,k).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof N(this.options.enabled,r(this,b))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");y(this,S,de).call(this),r(this,b).setOptions(this.options),s._defaulted&&!Yt(this.options,s)&&r(this,k).getQueryCache().notify({type:"observerOptionsUpdated",query:r(this,b),observer:this});const n=this.hasListeners();n&&Ie(r(this,b),i,this.options,s)&&y(this,S,qt).call(this),this.updateResult(),n&&(r(this,b)!==i||N(this.options.enabled,r(this,b))!==N(s.enabled,r(this,b))||dt(this.options.staleTime,r(this,b))!==dt(s.staleTime,r(this,b)))&&y(this,S,ae).call(this);const a=y(this,S,oe).call(this);n&&(r(this,b)!==i||N(this.options.enabled,r(this,b))!==N(s.enabled,r(this,b))||a!==r(this,ot))&&y(this,S,ue).call(this,a)}getOptimisticResult(t){const s=r(this,k).getQueryCache().build(r(this,k),t),i=this.createResult(s,t);return Qs(this,i)&&(o(this,U,i),o(this,Qt,this.options),o(this,gt,r(this,b).state)),i}getCurrentResult(){return r(this,U)}trackResult(t,s){return new Proxy(t,{get:(i,n)=>(this.trackProp(n),s==null||s(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&r(this,V).status==="pending"&&r(this,V).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,n))})}trackProp(t){r(this,xt).add(t)}getCurrentQuery(){return r(this,b)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=r(this,k).defaultQueryOptions(t),i=r(this,k).getQueryCache().build(r(this,k),s);return i.fetch().then(()=>this.createResult(i,s))}fetch(t){return y(this,S,qt).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),r(this,U)))}createResult(t,s){var T;const i=r(this,b),n=this.options,a=r(this,U),h=r(this,gt),u=r(this,Qt),m=t!==i?t.state:r(this,Lt),{state:v}=t;let f={...v},g=!1,d;if(s._optimisticResults){const j=this.hasListeners(),et=!j&&Qe(t,s),Bt=j&&Ie(t,i,s,n);(et||Bt)&&(f={...f,...Xe(v.data,t.options)}),s._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:E,errorUpdatedAt:w,status:C}=f;d=f.data;let P=!1;if(s.placeholderData!==void 0&&d===void 0&&C==="pending"){let j;a!=null&&a.isPlaceholderData&&s.placeholderData===(u==null?void 0:u.placeholderData)?(j=a.data,P=!0):j=typeof s.placeholderData=="function"?s.placeholderData((T=r(this,Tt))==null?void 0:T.state.data,r(this,Tt)):s.placeholderData,j!==void 0&&(C="success",d=ie(a==null?void 0:a.data,j,s),g=!0)}if(s.select&&d!==void 0&&!P)if(a&&d===(h==null?void 0:h.data)&&s.select===r(this,Nt))d=r(this,It);else try{o(this,Nt,s.select),d=s.select(d),d=ie(a==null?void 0:a.data,d,s),o(this,It,d),o(this,at,null)}catch(j){o(this,at,j)}r(this,at)&&(E=r(this,at),d=r(this,It),w=Date.now(),C="error");const Q=f.fetchStatus==="fetching",R=C==="pending",l=C==="error",I=R&&Q,q=d!==void 0,O={status:C,fetchStatus:f.fetchStatus,isPending:R,isSuccess:C==="success",isError:l,isInitialLoading:I,isLoading:I,data:d,dataUpdatedAt:f.dataUpdatedAt,error:E,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>m.dataUpdateCount||f.errorUpdateCount>m.errorUpdateCount,isFetching:Q,isRefetching:Q&&!R,isLoadingError:l&&!q,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:l&&q,isStale:we(t,s),refetch:this.refetch,promise:r(this,V),isEnabled:N(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=O.data!==void 0,et=O.status==="error"&&!j,Bt=Wt=>{et?Wt.reject(O.error):j&&Wt.resolve(O.data)},Ce=()=>{const Wt=o(this,V,O.promise=re());Bt(Wt)},zt=r(this,V);switch(zt.status){case"pending":t.queryHash===i.queryHash&&Bt(zt);break;case"fulfilled":(et||O.data!==zt.value)&&Ce();break;case"rejected":(!et||O.error!==zt.reason)&&Ce();break}}return O}updateResult(){const t=r(this,U),s=this.createResult(r(this,b),this.options);if(o(this,gt,r(this,b).state),o(this,Qt,this.options),r(this,gt).data!==void 0&&o(this,Tt,r(this,b)),Yt(s,t))return;o(this,U,s);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!r(this,xt).size)return!0;const h=new Set(a??r(this,xt));return this.options.throwOnError&&h.add("error"),Object.keys(r(this,U)).some(u=>{const p=u;return r(this,U)[p]!==t[p]&&h.has(p)})};y(this,S,ts).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&y(this,S,he).call(this)}},k=new WeakMap,b=new WeakMap,Lt=new WeakMap,U=new WeakMap,gt=new WeakMap,Qt=new WeakMap,V=new WeakMap,at=new WeakMap,Nt=new WeakMap,It=new WeakMap,Tt=new WeakMap,wt=new WeakMap,Ct=new WeakMap,ot=new WeakMap,xt=new WeakMap,S=new WeakSet,qt=function(t){y(this,S,de).call(this);let s=r(this,b).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(_)),s},ae=function(){y(this,S,ce).call(this);const t=dt(this.options.staleTime,r(this,b));if(Ot||r(this,U).isStale||!ee(t))return;const i=We(r(this,U).dataUpdatedAt,t)+1;o(this,wt,ft.setTimeout(()=>{r(this,U).isStale||this.updateResult()},i))},oe=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(r(this,b)):this.options.refetchInterval)??!1},ue=function(t){y(this,S,le).call(this),o(this,ot,t),!(Ot||N(this.options.enabled,r(this,b))===!1||!ee(r(this,ot))||r(this,ot)===0)&&o(this,Ct,ft.setInterval(()=>{(this.options.refetchIntervalInBackground||ge.isFocused())&&y(this,S,qt).call(this)},r(this,ot)))},he=function(){y(this,S,ae).call(this),y(this,S,ue).call(this,y(this,S,oe).call(this))},ce=function(){r(this,wt)&&(ft.clearTimeout(r(this,wt)),o(this,wt,void 0))},le=function(){r(this,Ct)&&(ft.clearInterval(r(this,Ct)),o(this,Ct,void 0))},de=function(){const t=r(this,k).getQueryCache().build(r(this,k),this.options);if(t===r(this,b))return;const s=r(this,b);o(this,b,t),o(this,Lt,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},ts=function(t){M.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(r(this,U))}),r(this,k).getQueryCache().notify({query:r(this,b),type:"observerResultsUpdated"})})},ke);function Ms(e,t){return N(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qe(e,t){return Ms(e,t)||e.state.data!==void 0&&fe(e,t,t.refetchOnMount)}function fe(e,t,s){if(N(t.enabled,e)!==!1&&dt(t.staleTime,e)!=="static"){const i=typeof s=="function"?s(e):s;return i==="always"||i!==!1&&we(e,t)}return!1}function Ie(e,t,s,i){return(e!==t||N(i.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&we(e,s)}function we(e,t){return N(t.enabled,e)!==!1&&e.isStaleByTime(dt(t.staleTime,e))}function Qs(e,t){return!Yt(e.getCurrentResult(),t)}function Te(e){return{onFetch:(t,s)=>{var v,f,g,d,E;const i=t.options,n=(g=(f=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,a=((d=t.state.data)==null?void 0:d.pages)||[],h=((E=t.state.data)==null?void 0:E.pageParams)||[];let u={pages:[],pageParams:[]},p=0;const m=async()=>{let w=!1;const C=R=>{ws(R,()=>t.signal,()=>w=!0)},P=Ve(t.options,t.fetchOptions),Q=async(R,l,I)=>{if(w)return Promise.reject();if(l==null&&R.pages.length)return Promise.resolve(R);const tt=(()=>{const et={client:t.client,queryKey:t.queryKey,pageParam:l,direction:I?"backward":"forward",meta:t.options.meta};return C(et),et})(),O=await P(tt),{maxPages:T}=t.options,j=I?gs:bs;return{pages:j(R.pages,O,T),pageParams:j(R.pageParams,l,T)}};if(n&&a.length){const R=n==="backward",l=R?Is:xe,I={pages:a,pageParams:h},q=l(i,I);u=await Q(I,q,R)}else{const R=e??a.length;do{const l=p===0?h[0]??i.initialPageParam:xe(i,u);if(p>0&&l==null)break;u=await Q(u,l),p++}while(p<R)}return u};t.options.persister?t.fetchFn=()=>{var w,C;return(C=(w=t.options).persister)==null?void 0:C.call(w,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=m}}}function xe(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function Is(e,{pages:t,pageParams:s}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,s[0],s):void 0}var Ht,B,A,St,z,st,Ke,Ts=(Ke=class extends Ze{constructor(t){super();c(this,z);c(this,Ht);c(this,B);c(this,A);c(this,St);o(this,Ht,t.client),this.mutationId=t.mutationId,o(this,A,t.mutationCache),o(this,B,[]),this.state=t.state||es(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){r(this,B).includes(t)||(r(this,B).push(t),this.clearGcTimeout(),r(this,A).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){o(this,B,r(this,B).filter(s=>s!==t)),this.scheduleGc(),r(this,A).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){r(this,B).length||(this.state.status==="pending"?this.scheduleGc():r(this,A).remove(this))}continue(){var t;return((t=r(this,St))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var h,u,p,m,v,f,g,d,E,w,C,P,Q,R,l,I,q,tt;const s=()=>{y(this,z,st).call(this,{type:"continue"})},i={client:r(this,Ht),meta:this.options.meta,mutationKey:this.options.mutationKey};o(this,St,Ye({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(O,T)=>{y(this,z,st).call(this,{type:"failed",failureCount:O,error:T})},onPause:()=>{y(this,z,st).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>r(this,A).canRun(this)}));const n=this.state.status==="pending",a=!r(this,St).canStart();try{if(n)s();else{y(this,z,st).call(this,{type:"pending",variables:t,isPaused:a}),r(this,A).config.onMutate&&await r(this,A).config.onMutate(t,this,i);const T=await((u=(h=this.options).onMutate)==null?void 0:u.call(h,t,i));T!==this.state.context&&y(this,z,st).call(this,{type:"pending",context:T,variables:t,isPaused:a})}const O=await r(this,St).start();return await((m=(p=r(this,A).config).onSuccess)==null?void 0:m.call(p,O,t,this.state.context,this,i)),await((f=(v=this.options).onSuccess)==null?void 0:f.call(v,O,t,this.state.context,i)),await((d=(g=r(this,A).config).onSettled)==null?void 0:d.call(g,O,null,this.state.variables,this.state.context,this,i)),await((w=(E=this.options).onSettled)==null?void 0:w.call(E,O,null,t,this.state.context,i)),y(this,z,st).call(this,{type:"success",data:O}),O}catch(O){try{await((P=(C=r(this,A).config).onError)==null?void 0:P.call(C,O,t,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((R=(Q=this.options).onError)==null?void 0:R.call(Q,O,t,this.state.context,i))}catch(T){Promise.reject(T)}try{await((I=(l=r(this,A).config).onSettled)==null?void 0:I.call(l,void 0,O,this.state.variables,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((tt=(q=this.options).onSettled)==null?void 0:tt.call(q,void 0,O,t,this.state.context,i))}catch(T){Promise.reject(T)}throw y(this,z,st).call(this,{type:"error",error:O}),O}finally{r(this,A).runNext(this)}}},Ht=new WeakMap,B=new WeakMap,A=new WeakMap,St=new WeakMap,z=new WeakSet,st=function(t){const s=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),M.batch(()=>{r(this,B).forEach(i=>{i.onMutationUpdate(t)}),r(this,A).notify({mutation:this,type:"updated",action:t})})},Ke);function es(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var J,G,Gt,Le,xs=(Le=class extends _t{constructor(t={}){super();c(this,J);c(this,G);c(this,Gt);this.config=t,o(this,J,new Set),o(this,G,new Map),o(this,Gt,0)}build(t,s,i){const n=new Ts({client:t,mutationCache:this,mutationId:++$t(this,Gt)._,options:t.defaultMutationOptions(s),state:i});return this.add(n),n}add(t){r(this,J).add(t);const s=Vt(t);if(typeof s=="string"){const i=r(this,G).get(s);i?i.push(t):r(this,G).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(r(this,J).delete(t)){const s=Vt(t);if(typeof s=="string"){const i=r(this,G).get(s);if(i)if(i.length>1){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}else i[0]===t&&r(this,G).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=Vt(t);if(typeof s=="string"){const i=r(this,G).get(s),n=i==null?void 0:i.find(a=>a.state.status==="pending");return!n||n===t}else return!0}runNext(t){var i;const s=Vt(t);if(typeof s=="string"){const n=(i=r(this,G).get(s))==null?void 0:i.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){M.batch(()=>{r(this,J).forEach(t=>{this.notify({type:"removed",mutation:t})}),r(this,J).clear(),r(this,G).clear()})}getAll(){return Array.from(r(this,J))}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Pe(s,i))}findAll(t={}){return this.getAll().filter(s=>Pe(t,s))}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return M.batch(()=>Promise.all(t.map(s=>s.continue().catch(_))))}},J=new WeakMap,G=new WeakMap,Gt=new WeakMap,Le);function Vt(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Y,ut,K,Z,X,Jt,ye,Ne,Ds=(Ne=class extends _t{constructor(t,s){super();c(this,X);c(this,Y);c(this,ut);c(this,K);c(this,Z);o(this,Y,t),this.setOptions(s),this.bindMethods(),y(this,X,Jt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const s=this.options;this.options=r(this,Y).defaultMutationOptions(t),Yt(this.options,s)||r(this,Y).getMutationCache().notify({type:"observerOptionsUpdated",mutation:r(this,K),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Pt(s.mutationKey)!==Pt(this.options.mutationKey)?this.reset():((i=r(this,K))==null?void 0:i.state.status)==="pending"&&r(this,K).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=r(this,K))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,X,Jt).call(this),y(this,X,ye).call(this,t)}getCurrentResult(){return r(this,ut)}reset(){var t;(t=r(this,K))==null||t.removeObserver(this),o(this,K,void 0),y(this,X,Jt).call(this),y(this,X,ye).call(this)}mutate(t,s){var i;return o(this,Z,s),(i=r(this,K))==null||i.removeObserver(this),o(this,K,r(this,Y).getMutationCache().build(r(this,Y),this.options)),r(this,K).addObserver(this),r(this,K).execute(t)}},Y=new WeakMap,ut=new WeakMap,K=new WeakMap,Z=new WeakMap,X=new WeakSet,Jt=function(){var s;const t=((s=r(this,K))==null?void 0:s.state)??es();o(this,ut,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},ye=function(t){M.batch(()=>{var s,i,n,a,h,u,p,m;if(r(this,Z)&&this.hasListeners()){const v=r(this,ut).variables,f=r(this,ut).context,g={client:r(this,Y),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=(s=r(this,Z)).onSuccess)==null||i.call(s,t.data,v,f,g)}catch(d){Promise.reject(d)}try{(a=(n=r(this,Z)).onSettled)==null||a.call(n,t.data,null,v,f,g)}catch(d){Promise.reject(d)}}else if((t==null?void 0:t.type)==="error"){try{(u=(h=r(this,Z)).onError)==null||u.call(h,t.error,v,f,g)}catch(d){Promise.reject(d)}try{(m=(p=r(this,Z)).onSettled)==null||m.call(p,void 0,t.error,v,f,g)}catch(d){Promise.reject(d)}}}this.listeners.forEach(v=>{v(r(this,ut))})})},Ne),W,He,As=(He=class extends _t{constructor(t={}){super();c(this,W);this.config=t,o(this,W,new Map)}build(t,s,i){const n=s.queryKey,a=s.queryHash??me(n,s);let h=this.get(a);return h||(h=new Es({client:t,queryKey:n,queryHash:a,options:t.defaultQueryOptions(s),state:i,defaultOptions:t.getQueryDefaults(n)}),this.add(h)),h}add(t){r(this,W).has(t.queryHash)||(r(this,W).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=r(this,W).get(t.queryHash);s&&(t.destroy(),s===t&&r(this,W).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){M.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return r(this,W).get(t)}getAll(){return[...r(this,W).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Oe(s,i))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(i=>Oe(t,i)):s}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){M.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},W=new WeakMap,He),F,ht,ct,Dt,At,lt,jt,Ut,Ge,$s=(Ge=class{constructor(e={}){c(this,F);c(this,ht);c(this,ct);c(this,Dt);c(this,At);c(this,lt);c(this,jt);c(this,Ut);o(this,F,e.queryCache||new As),o(this,ht,e.mutationCache||new xs),o(this,ct,e.defaultOptions||{}),o(this,Dt,new Map),o(this,At,new Map),o(this,lt,0)}mount(){$t(this,lt)._++,r(this,lt)===1&&(o(this,jt,ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,F).onFocus())})),o(this,Ut,Zt.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,F).onOnline())})))}unmount(){var e,t;$t(this,lt)._--,r(this,lt)===0&&((e=r(this,jt))==null||e.call(this),o(this,jt,void 0),(t=r(this,Ut))==null||t.call(this),o(this,Ut,void 0))}isFetching(e){return r(this,F).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return r(this,ht).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,F).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=r(this,F).build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(dt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return r(this,F).findAll(e).map(({queryKey:t,state:s})=>{const i=s.data;return[t,i]})}setQueryData(e,t,s){const i=this.defaultQueryOptions({queryKey:e}),n=r(this,F).get(i.queryHash),a=n==null?void 0:n.state.data,h=ps(t,a);if(h!==void 0)return r(this,F).build(this,i).setData(h,{...s,manual:!0})}setQueriesData(e,t,s){return M.batch(()=>r(this,F).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,F).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=r(this,F);M.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=r(this,F);return M.batch(()=>(s.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},i=M.batch(()=>r(this,F).findAll(e).map(n=>n.cancel(s)));return Promise.all(i).then(_).catch(_)}invalidateQueries(e,t={}){return M.batch(()=>(r(this,F).findAll(e).forEach(s=>{s.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 s={...t,cancelRefetch:t.cancelRefetch??!0},i=M.batch(()=>r(this,F).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(_)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(_)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=r(this,F).build(this,t);return s.isStaleByTime(dt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_).catch(_)}fetchInfiniteQuery(e){return e.behavior=Te(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_).catch(_)}ensureInfiniteQueryData(e){return e.behavior=Te(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Zt.isOnline()?r(this,ht).resumePausedMutations():Promise.resolve()}getQueryCache(){return r(this,F)}getMutationCache(){return r(this,ht)}getDefaultOptions(){return r(this,ct)}setDefaultOptions(e){o(this,ct,e)}setQueryDefaults(e,t){r(this,Dt).set(Pt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...r(this,Dt).values()],s={};return t.forEach(i=>{kt(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){r(this,At).set(Pt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...r(this,At).values()],s={};return t.forEach(i=>{kt(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...r(this,ct).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=me(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===ve&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...r(this,ct).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){r(this,F).clear(),r(this,ht).clear()}},F=new WeakMap,ht=new WeakMap,ct=new WeakMap,Dt=new WeakMap,At=new WeakMap,lt=new WeakMap,jt=new WeakMap,Ut=new WeakMap,Ge),ss=D.createContext(void 0),is=e=>{const t=D.useContext(ss);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Vs=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ls.jsx(ss.Provider,{value:e,children:t})),rs=D.createContext(!1),js=()=>D.useContext(rs);rs.Provider;function Us(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var _s=D.createContext(Us()),qs=()=>D.useContext(_s),ks=(e,t,s)=>{const i=s!=null&&s.state.error&&typeof e.throwOnError=="function"?be(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},Ks=e=>{D.useEffect(()=>{e.clearReset()},[e])},Ls=({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(n&&e.data===void 0||be(s,[e.error,i])),Ns=e=>{if(e.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...n)=>s(i(...n)):s(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Hs=(e,t)=>e.isLoading&&e.isFetching&&!t,Gs=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,De=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Bs(e,t,s){var g,d,E,w;const i=js(),n=qs(),a=is(),h=a.defaultQueryOptions(e);(d=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||d.call(g,h);const u=a.getQueryCache().get(h.queryHash);h._optimisticResults=i?"isRestoring":"optimistic",Ns(h),ks(h,n,u),Ks(n);const p=!a.getQueryCache().get(h.queryHash),[m]=D.useState(()=>new t(a,h)),v=m.getOptimisticResult(h),f=!i&&e.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(C=>{const P=f?m.subscribe(M.batchCalls(C)):_;return m.updateResult(),P},[m,f]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),D.useEffect(()=>{m.setOptions(h)},[h,m]),Gs(h,v))throw De(h,m,n);if(Ls({result:v,errorResetBoundary:n,throwOnError:h.throwOnError,query:u,suspense:h.suspense}))throw v.error;if((w=(E=a.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||w.call(E,h,v),h.experimental_prefetchInRender&&!Ot&&Hs(v,i)){const C=p?De(h,m,n):u==null?void 0:u.promise;C==null||C.catch(_).finally(()=>{m.updateResult()})}return h.notifyOnChangeProps?v:m.trackResult(v)}function Js(e,t){return Bs(e,Fs)}function Ys(e,t){const s=is(),[i]=D.useState(()=>new Ds(s,e));D.useEffect(()=>{i.setOptions(e)},[i,e]);const n=D.useSyncExternalStore(D.useCallback(h=>i.subscribe(M.batchCalls(h)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=D.useCallback((h,u)=>{i.mutate(h,u).catch(_)},[i]);if(n.error&&be(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}export{$s as Q,Ys as a,Js as b,Vs as c,ls as j,is as u};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import{r as s,a as at,R as Wn,b as Qs,c as Ne}from"./vendor-react-CfHM_tz4.js";import{j as m}from"./vendor-query-BxDNdxq_.js";function P(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 pr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function X(...e){return t=>{let n=!1;const r=e.map(o=>{const i=pr(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():pr(e[o],null)}}}}function $(...e){return s.useCallback(X(...e),e)}function Js(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,ec(o,...t)]}function ec(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function tc(e){const t=nc(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(oc);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function nc(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=sc(o),c=ic(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rc=Symbol("radix.slottable");function oc(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rc}function ic(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function sc(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 cc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Br=cc.reduce((e,t)=>{const n=tc(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ac(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function Z(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function lc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e);s.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 uc="DismissableLayer",Pn="dismissableLayer.update",fc="dismissableLayer.pointerDownOutside",dc="dismissableLayer.focusOutside",mr,Hr=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...l}=e,u=s.useContext(Hr),[d,f]=s.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=s.useState({}),g=$(t,b=>f(b)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(y),w=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=w>=x,E=vc(b=>{const A=b.target,T=[...u.branches].some(O=>O.contains(A));!C||T||(o==null||o(b),a==null||a(b),b.defaultPrevented||c==null||c())},p),R=hc(b=>{const A=b.target;[...u.branches].some(O=>O.contains(A))||(i==null||i(b),a==null||a(b),b.defaultPrevented||c==null||c())},p);return lc(b=>{w===u.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&c&&(b.preventDefault(),c()))},p),s.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mr=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),vr(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=mr)}},[d,p,n,u]),s.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),vr())},[d,u]),s.useEffect(()=>{const b=()=>h({});return document.addEventListener(Pn,b),()=>document.removeEventListener(Pn,b)},[]),m.jsx(Br.div,{...l,ref:g,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:P(e.onFocusCapture,R.onFocusCapture),onBlurCapture:P(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:P(e.onPointerDownCapture,E.onPointerDownCapture)})});Xe.displayName=uc;var pc="DismissableLayerBranch",mc=s.forwardRef((e,t)=>{const n=s.useContext(Hr),r=s.useRef(null),o=$(t,r);return s.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(Br.div,{...e,ref:o})});mc.displayName=pc;function vc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e),r=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let l=function(){Ur(fc,n,u,{discrete:!0})};const u={originalEvent:c};c.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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function hc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e),r=s.useRef(!1);return s.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ur(dc,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 vr(){const e=new CustomEvent(Pn);document.dispatchEvent(e)}function Ur(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?ac(o,i):o.dispatchEvent(i)}var Y=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},gc=Wn[" useId ".trim().toString()]||(()=>{}),yc=0;function le(e){const[t,n]=s.useState(gc());return Y(()=>{n(r=>r??String(yc++))},[e]),t?`radix-${t}`:""}const xc=["top","right","bottom","left"],Pe=Math.min,ne=Math.max,It=Math.round,bt=Math.floor,he=e=>({x:e,y:e}),wc={left:"right",right:"left",bottom:"top",top:"bottom"},Sc={start:"end",end:"start"};function Rn(e,t,n){return ne(e,Pe(t,n))}function Ce(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Vn(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}const Cc=new Set(["top","bottom"]);function ve(e){return Cc.has(be(e))?"y":"x"}function Hn(e){return Vn(ve(e))}function bc(e,t,n){n===void 0&&(n=!1);const r=Ze(e),o=Hn(e),i=Bn(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Mt(a)),[a,Mt(a)]}function Ec(e){const t=Mt(e);return[_n(e),t,_n(t)]}function _n(e){return e.replace(/start|end/g,t=>Sc[t])}const hr=["left","right"],gr=["right","left"],Pc=["top","bottom"],Rc=["bottom","top"];function _c(e,t,n){switch(e){case"top":case"bottom":return n?t?gr:hr:t?hr:gr;case"left":case"right":return t?Pc:Rc;default:return[]}}function Ac(e,t,n,r){const o=Ze(e);let i=_c(be(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(_n)))),i}function Mt(e){return e.replace(/left|right|bottom|top/g,t=>wc[t])}function Tc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kr(e){return typeof e!="number"?Tc(e):{top:e,right:e,bottom:e,left:e}}function Dt(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 yr(e,t,n){let{reference:r,floating:o}=e;const i=ve(t),a=Hn(t),c=Bn(a),l=be(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ze(t)){case"start":h[a]-=p*(n&&u?-1:1);break;case"end":h[a]+=p*(n&&u?-1:1);break}return h}async function Oc(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Ce(t,e),g=Kr(h),y=c[p?f==="floating"?"reference":"floating":f],x=Dt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),w=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:S,strategy:l}):w);return{top:(x.top-E.top+g.top)/C.y,bottom:(E.bottom-x.bottom+g.bottom)/C.y,left:(x.left-E.left+g.left)/C.x,right:(E.right-x.right+g.right)/C.x}}const Nc=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=yr(u,r,l),p=r,h={},g=0;for(let y=0;y<c.length;y++){var v;const{name:x,fn:w}=c[y],{x:S,y:C,data:E,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:{...a,detectOverflow:(v=a.detectOverflow)!=null?v:Oc},elements:{reference:e,floating:t}});d=S??d,f=C??f,h={...h,[x]:{...h[x],...E}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(u=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:d,y:f}=yr(u,p,l)),y=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}},Ic=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:d=0}=Ce(e,t)||{};if(u==null)return{};const f=Kr(d),p={x:n,y:r},h=Hn(o),g=Bn(h),v=await a.getDimensions(u),y=h==="y",x=y?"top":"left",w=y?"bottom":"right",S=y?"clientHeight":"clientWidth",C=i.reference[g]+i.reference[h]-p[h]-i.floating[g],E=p[h]-i.reference[h],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let b=R?R[S]:0;(!b||!await(a.isElement==null?void 0:a.isElement(R)))&&(b=c.floating[S]||i.floating[g]);const A=C/2-E/2,T=b/2-v[g]/2-1,O=Pe(f[x],T),D=Pe(f[w],T),L=O,F=b-v[g]-D,j=b/2-v[g]/2+A,U=Rn(L,j,F),M=!l.arrow&&Ze(o)!=null&&j!==U&&i.reference[g]/2-(j<L?O:D)-v[g]/2<0,k=M?j<L?j-L:j-F:0;return{[h]:p[h]+k,data:{[h]:U,centerOffset:j-U-k,...M&&{alignmentOffset:k}},reset:M}}}),Mc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...y}=Ce(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=be(o),w=ve(c),S=be(c)===c,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(S||!v?[Mt(c)]:Ec(c)),R=g!=="none";!p&&R&&E.push(...Ac(c,v,g,C));const b=[c,...E],A=await l.detectOverflow(t,y),T=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(A[x]),f){const j=bc(o,a,C);T.push(A[j[0]],A[j[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(j=>j<=0)){var D,L;const j=(((D=i.flip)==null?void 0:D.index)||0)+1,U=b[j];if(U&&(!(f==="alignment"?w!==ve(U):!1)||O.every(N=>ve(N.placement)===w?N.overflows[0]>0:!0)))return{data:{index:j,overflows:O},reset:{placement:U}};let M=(L=O.filter(k=>k.overflows[0]<=0).sort((k,N)=>k.overflows[1]-N.overflows[1])[0])==null?void 0:L.placement;if(!M)switch(h){case"bestFit":{var F;const k=(F=O.filter(N=>{if(R){const _=ve(N.placement);return _===w||_==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(_=>_>0).reduce((_,K)=>_+K,0)]).sort((N,_)=>N[1]-_[1])[0])==null?void 0:F[0];k&&(M=k);break}case"initialPlacement":M=c;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function xr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wr(e){return xc.some(t=>e[t]>=0)}const Dc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Ce(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=xr(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:wr(c)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),c=xr(a,n.floating);return{data:{escapedOffsets:c,escaped:wr(c)}}}default:return{}}}}},Gr=new Set(["left","top"]);async function $c(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=be(n),c=Ze(n),l=ve(n)==="y",u=Gr.has(a)?-1:1,d=i&&l?-1:1,f=Ce(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const jc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:c}=t,l=await $c(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Lc=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:a=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:w,y:S}=x;return{x:w,y:S}}},...u}=Ce(e,t),d={x:n,y:r},f=await i.detectOverflow(t,u),p=ve(be(o)),h=Vn(p);let g=d[h],v=d[p];if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",S=g+f[x],C=g-f[w];g=Rn(S,g,C)}if(c){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",S=v+f[x],C=v-f[w];v=Rn(S,v,C)}const y=l.fn({...t,[h]:g,[p]:v});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:a,[p]:c}}}}}},Fc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=Ce(e,t),d={x:n,y:r},f=ve(o),p=Vn(f);let h=d[p],g=d[f];const v=Ce(c,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const S=p==="y"?"height":"width",C=i.reference[p]-i.floating[S]+y.mainAxis,E=i.reference[p]+i.reference[S]-y.mainAxis;h<C?h=C:h>E&&(h=E)}if(u){var x,w;const S=p==="y"?"width":"height",C=Gr.has(be(o)),E=i.reference[f]-i.floating[S]+(C&&((x=a.offset)==null?void 0:x[f])||0)+(C?0:y.crossAxis),R=i.reference[f]+i.reference[S]+(C?0:((w=a.offset)==null?void 0:w[f])||0)-(C?y.crossAxis:0);g<E?g=E:g>R&&(g=R)}return{[p]:h,[f]:g}}}},kc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:c}=t,{apply:l=()=>{},...u}=Ce(e,t),d=await a.detectOverflow(t,u),f=be(o),p=Ze(o),h=ve(o)==="y",{width:g,height:v}=i.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=p===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(x=f,y=p==="end"?"top":"bottom");const w=v-d.top-d.bottom,S=g-d.left-d.right,C=Pe(v-d[y],w),E=Pe(g-d[x],S),R=!t.middlewareData.shift;let b=C,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(b=w),R&&!p){const O=ne(d.left,0),D=ne(d.right,0),L=ne(d.top,0),F=ne(d.bottom,0);h?A=g-2*(O!==0||D!==0?O+D:ne(d.left,d.right)):b=v-2*(L!==0||F!==0?L+F:ne(d.top,d.bottom))}await l({...t,availableWidth:A,availableHeight:b});const T=await a.getDimensions(c.floating);return g!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Ht(){return typeof window<"u"}function qe(e){return zr(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ye(e){var t;return(t=(zr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zr(e){return Ht()?e instanceof Node||e instanceof re(e).Node:!1}function ue(e){return Ht()?e instanceof Element||e instanceof re(e).Element:!1}function ge(e){return Ht()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Sr(e){return!Ht()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}const Wc=new Set(["inline","contents"]);function lt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Wc.has(o)}const Vc=new Set(["table","td","th"]);function Bc(e){return Vc.has(qe(e))}const Hc=[":popover-open",":modal"];function Ut(e){return Hc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Uc=["transform","translate","scale","rotate","perspective"],Kc=["transform","translate","scale","rotate","perspective","filter"],Gc=["paint","layout","strict","content"];function Un(e){const t=Kn(),n=ue(e)?fe(e):e;return Uc.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)||Kc.some(r=>(n.willChange||"").includes(r))||Gc.some(r=>(n.contain||"").includes(r))}function zc(e){let t=Re(e);for(;ge(t)&&!Ue(t);){if(Un(t))return t;if(Ut(t))return null;t=Re(t)}return null}function Kn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yc=new Set(["html","body","#document"]);function Ue(e){return Yc.has(qe(e))}function fe(e){return re(e).getComputedStyle(e)}function Kt(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(qe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sr(e)&&e.host||ye(e);return Sr(t)?t.host:t}function Yr(e){const t=Re(e);return Ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&<(t)?t:Yr(t)}function ot(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Yr(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=re(o);if(i){const c=An(a);return t.concat(a,a.visualViewport||[],lt(o)?o:[],c&&n?ot(c):[])}return t.concat(o,ot(o,[],n))}function An(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xr(e){const t=fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ge(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=It(n)!==i||It(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function Gn(e){return ue(e)?e:e.contextElement}function Be(e){const t=Gn(e);if(!ge(t))return he(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xr(t);let a=(i?It(n.width):n.width)/r,c=(i?It(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Xc=he(0);function Zr(e){const t=re(e);return!Kn()||!t.visualViewport?Xc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==re(e)?!1:t}function Ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Gn(e);let a=he(1);t&&(r?ue(r)&&(a=Be(r)):a=Be(e));const c=Zc(i,n,r)?Zr(i):he(0);let l=(o.left+c.x)/a.x,u=(o.top+c.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const p=re(i),h=r&&ue(r)?re(r):r;let g=p,v=An(g);for(;v&&r&&h!==g;){const y=Be(v),x=v.getBoundingClientRect(),w=fe(v),S=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*y.x,C=x.top+(v.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,f*=y.y,l+=S,u+=C,g=re(v),v=An(g)}}return Dt({width:d,height:f,x:l,y:u})}function Gt(e,t){const n=Kt(e).scrollLeft;return t?t.left+n:Ie(ye(e)).left+n}function qr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Gt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function qc(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=ye(r),c=t?Ut(t.floating):!1;if(r===a||c&&i)return n;let l={scrollLeft:0,scrollTop:0},u=he(1);const d=he(0),f=ge(r);if((f||!f&&!i)&&((qe(r)!=="body"||lt(a))&&(l=Kt(r)),ge(r))){const h=Ie(r);u=Be(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=a&&!f&&!i?qr(a,l):he(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function Qc(e){return Array.from(e.getClientRects())}function Jc(e){const t=ye(e),n=Kt(e),r=e.ownerDocument.body,o=ne(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ne(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Gt(e);const c=-n.scrollTop;return fe(r).direction==="rtl"&&(a+=ne(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:c}}const Cr=25;function ea(e,t){const n=re(e),r=ye(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,l=0;if(o){i=o.width,a=o.height;const d=Kn();(!d||d&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const u=Gt(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=Cr&&(i-=g)}else u<=Cr&&(i+=u);return{width:i,height:a,x:c,y:l}}const ta=new Set(["absolute","fixed"]);function na(e,t){const n=Ie(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ge(e)?Be(e):he(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:a,height:c,x:l,y:u}}function br(e,t,n){let r;if(t==="viewport")r=ea(e,n);else if(t==="document")r=Jc(ye(e));else if(ue(t))r=na(t,n);else{const o=Zr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dt(r)}function Qr(e,t){const n=Re(e);return n===t||!ue(n)||Ue(n)?!1:fe(n).position==="fixed"||Qr(n,t)}function ra(e,t){const n=t.get(e);if(n)return n;let r=ot(e,[],!1).filter(c=>ue(c)&&qe(c)!=="body"),o=null;const i=fe(e).position==="fixed";let a=i?Re(e):e;for(;ue(a)&&!Ue(a);){const c=fe(a),l=Un(a);!l&&c.position==="fixed"&&(o=null),(i?!l&&!o:!l&&c.position==="static"&&!!o&&ta.has(o.position)||lt(a)&&!l&&Qr(e,a))?r=r.filter(d=>d!==a):o=c,a=Re(a)}return t.set(e,r),r}function oa(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Ut(t)?[]:ra(t,this._c):[].concat(n),r],c=a[0],l=a.reduce((u,d)=>{const f=br(t,d,o);return u.top=ne(f.top,u.top),u.right=Pe(f.right,u.right),u.bottom=Pe(f.bottom,u.bottom),u.left=ne(f.left,u.left),u},br(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ia(e){const{width:t,height:n}=Xr(e);return{width:t,height:n}}function sa(e,t,n){const r=ge(t),o=ye(t),i=n==="fixed",a=Ie(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=he(0);function u(){l.x=Gt(o)}if(r||!r&&!i)if((qe(t)!=="body"||lt(o))&&(c=Kt(t)),r){const h=Ie(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const d=o&&!r&&!i?qr(o,c):he(0),f=a.left+c.scrollLeft-l.x-d.x,p=a.top+c.scrollTop-l.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function mn(e){return fe(e).position==="static"}function Er(e,t){if(!ge(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ye(e)===n&&(n=n.ownerDocument.body),n}function Jr(e,t){const n=re(e);if(Ut(e))return n;if(!ge(e)){let o=Re(e);for(;o&&!Ue(o);){if(ue(o)&&!mn(o))return o;o=Re(o)}return n}let r=Er(e,t);for(;r&&Bc(r)&&mn(r);)r=Er(r,t);return r&&Ue(r)&&mn(r)&&!Un(r)?n:r||zc(e)||n}const ca=async function(e){const t=this.getOffsetParent||Jr,n=this.getDimensions,r=await n(e.floating);return{reference:sa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function aa(e){return fe(e).direction==="rtl"}const la={convertOffsetParentRelativeRectToViewportRelativeRect:qc,getDocumentElement:ye,getClippingRect:oa,getOffsetParent:Jr,getElementRects:ca,getClientRects:Qc,getDimensions:ia,getScale:Be,isElement:ue,isRTL:aa};function eo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ua(e,t){let n=null,r;const o=ye(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(c||t(),!p||!h)return;const g=bt(f),v=bt(o.clientWidth-(d+p)),y=bt(o.clientHeight-(f+h)),x=bt(d),S={rootMargin:-g+"px "+-v+"px "+-y+"px "+-x+"px",threshold:ne(0,Pe(1,l))||1};let C=!0;function E(R){const b=R[0].intersectionRatio;if(b!==l){if(!C)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},1e3)}b===1&&!eo(u,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(E,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return a(!0),i}function fa(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Gn(e),d=o||i?[...u?ot(u):[],...ot(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=u&&c?ua(u,n):null;let p=-1,h=null;a&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,v=l?Ie(e):null;l&&y();function y(){const x=Ie(e);v&&!eo(v,x)&&n(),v=x,g=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const da=jc,pa=Lc,ma=Mc,va=kc,ha=Dc,Pr=Ic,ga=Fc,ya=(e,t,n)=>{const r=new Map,o={platform:la,...n},i={...o.platform,_c:r};return Nc(e,t,{...o,platform:i})};var xa=typeof document<"u",wa=function(){},Tt=xa?s.useLayoutEffect:wa;function $t(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(!$t(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)&&!$t(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function to(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rr(e,t){const n=to(e);return Math.round(t*n)/n}function vn(e){const t=s.useRef(e);return Tt(()=>{t.current=e}),t}function Sa(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=s.useState(r);$t(p,r)||h(r);const[g,v]=s.useState(null),[y,x]=s.useState(null),w=s.useCallback(N=>{N!==R.current&&(R.current=N,v(N))},[]),S=s.useCallback(N=>{N!==b.current&&(b.current=N,x(N))},[]),C=i||g,E=a||y,R=s.useRef(null),b=s.useRef(null),A=s.useRef(d),T=l!=null,O=vn(l),D=vn(o),L=vn(u),F=s.useCallback(()=>{if(!R.current||!b.current)return;const N={placement:t,strategy:n,middleware:p};D.current&&(N.platform=D.current),ya(R.current,b.current,N).then(_=>{const K={..._,isPositioned:L.current!==!1};j.current&&!$t(A.current,K)&&(A.current=K,at.flushSync(()=>{f(K)}))})},[p,t,n,D,L]);Tt(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[u]);const j=s.useRef(!1);Tt(()=>(j.current=!0,()=>{j.current=!1}),[]),Tt(()=>{if(C&&(R.current=C),E&&(b.current=E),C&&E){if(O.current)return O.current(C,E,F);F()}},[C,E,F,O,T]);const U=s.useMemo(()=>({reference:R,floating:b,setReference:w,setFloating:S}),[w,S]),M=s.useMemo(()=>({reference:C,floating:E}),[C,E]),k=s.useMemo(()=>{const N={position:n,left:0,top:0};if(!M.floating)return N;const _=Rr(M.floating,d.x),K=Rr(M.floating,d.y);return c?{...N,transform:"translate("+_+"px, "+K+"px)",...to(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:K}},[n,c,M.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:F,refs:U,elements:M,floatingStyles:k}),[d,F,U,M,k])}const Ca=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?Pr({element:r.current,padding:o}).fn(n):{}:r?Pr({element:r,padding:o}).fn(n):{}}}},ba=(e,t)=>({...da(e),options:[e,t]}),Ea=(e,t)=>({...pa(e),options:[e,t]}),Pa=(e,t)=>({...ga(e),options:[e,t]}),Ra=(e,t)=>({...ma(e),options:[e,t]}),_a=(e,t)=>({...va(e),options:[e,t]}),Aa=(e,t)=>({...ha(e),options:[e,t]}),Ta=(e,t)=>({...Ca(e),options:[e,t]});function Oa(e){const t=Na(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Ma);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Na(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=$a(o),c=Da(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ia=Symbol("radix.slottable");function Ma(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ia}function Da(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function $a(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 ja=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],La=ja.reduce((e,t)=>{const n=Oa(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Fa="Arrow",no=s.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m.jsx(La.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});no.displayName=Fa;var ka=no;function Wa(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Va(o,...t)]}function Va(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ba(e){const t=Ha(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Ka);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ha(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=za(o),c=Ga(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ua=Symbol("radix.slottable");function Ka(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ua}function Ga(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function za(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 Ya=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ro=Ya.reduce((e,t)=>{const n=Ba(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xa(e){const[t,n]=s.useState(void 0);return Y(()=>{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 a,c;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zn="Popper",[oo,_e]=Wa(zn),[Za,io]=oo(zn),so=e=>{const{__scopePopper:t,children:n}=e,[r,o]=s.useState(null);return m.jsx(Za,{scope:t,anchor:r,onAnchorChange:o,children:n})};so.displayName=zn;var co="PopperAnchor",ao=s.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=io(co,n),a=s.useRef(null),c=$(t,a),l=s.useRef(null);return s.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||a.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:m.jsx(ro.div,{...o,ref:c})});ao.displayName=co;var Yn="PopperContent",[qa,Qa]=oo(Yn),lo=s.forwardRef((e,t)=>{var I,V,G,W,B,H;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,y=io(Yn,n),[x,w]=s.useState(null),S=$(t,te=>w(te)),[C,E]=s.useState(null),R=Xa(C),b=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,T=r+(i!=="center"?"-"+i:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],L=D.length>0,F={padding:O,boundary:D.filter(el),altBoundary:L},{refs:j,floatingStyles:U,placement:M,isPositioned:k,middlewareData:N}=Sa({strategy:"fixed",placement:T,whileElementsMounted:(...te)=>fa(...te,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[ba({mainAxis:o+A,alignmentAxis:a}),l&&Ea({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Pa():void 0,...F}),l&&Ra({...F}),_a({...F,apply:({elements:te,rects:pe,availableWidth:Je,availableHeight:et})=>{const{width:tt,height:qs}=pe.reference,Ct=te.floating.style;Ct.setProperty("--radix-popper-available-width",`${Je}px`),Ct.setProperty("--radix-popper-available-height",`${et}px`),Ct.setProperty("--radix-popper-anchor-width",`${tt}px`),Ct.setProperty("--radix-popper-anchor-height",`${qs}px`)}}),C&&Ta({element:C,padding:c}),tl({arrowWidth:b,arrowHeight:A}),p&&Aa({strategy:"referenceHidden",...F})]}),[_,K]=po(M),z=Z(g);Y(()=>{k&&(z==null||z())},[k,z]);const J=(I=N.arrow)==null?void 0:I.x,we=(V=N.arrow)==null?void 0:V.y,ie=((G=N.arrow)==null?void 0:G.centerOffset)!==0,[Se,ee]=s.useState();return Y(()=>{x&&ee(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:k?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(W=N.transformOrigin)==null?void 0:W.x,(B=N.transformOrigin)==null?void 0:B.y].join(" "),...((H=N.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(qa,{scope:n,placedSide:_,onArrowChange:E,arrowX:J,arrowY:we,shouldHideArrow:ie,children:m.jsx(ro.div,{"data-side":_,"data-align":K,...v,ref:S,style:{...v.style,animation:k?void 0:"none"}})})})});lo.displayName=Yn;var uo="PopperArrow",Ja={top:"bottom",right:"left",bottom:"top",left:"right"},fo=s.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Qa(uo,r),a=Ja[i.placedSide];return m.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:m.jsx(ka,{...o,ref:n,style:{...o.style,display:"block"}})})});fo.displayName=uo;function el(e){return e!==null}var tl=e=>({name:"transformOrigin",options:e,fn(t){var y,x,w;const{placement:n,rects:r,middlewareData:o}=t,a=((y=o.arrow)==null?void 0:y.centerOffset)!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=po(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((x=o.arrow)==null?void 0:x.x)??0)+c/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",v="";return u==="bottom"?(g=a?f:`${p}px`,v=`${-l}px`):u==="top"?(g=a?f:`${p}px`,v=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,v=a?f:`${h}px`):u==="left"&&(g=`${r.floating.width+l}px`,v=a?f:`${h}px`),{data:{x:g,y:v}}}});function po(e){const[t,n="center"]=e.split("-");return[t,n]}var zt=so,ut=ao,Yt=lo,Xt=fo;function nl(e){const t=rl(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(il);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function rl(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=cl(o),c=sl(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ol=Symbol("radix.slottable");function il(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ol}function sl(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function cl(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 al=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ll=al.reduce((e,t)=>{const n=nl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ul="Portal",ft=s.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,i]=s.useState(!1);Y(()=>i(!0),[]);const a=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Qs.createPortal(m.jsx(ll.div,{...r,ref:t}),a):null});ft.displayName=ul;function fl(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=dl(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=$(r.ref,pl(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:i}):null};q.displayName="Presence";function dl(e){const[t,n]=s.useState(),r=s.useRef(null),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[c,l]=fl(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const u=Et(r.current);i.current=c==="mounted"?u:"none"},[c]),Y(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,h=Et(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Y(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const v=Et(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(i.current=Et(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Et(e){return(e==null?void 0:e.animationName)||"none"}function pl(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 ml(e){const t=vl(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(gl);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function vl(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=xl(o),c=yl(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mo=Symbol("radix.slottable");function hl(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=mo,t}function gl(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mo}function yl(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function xl(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 wl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sl=wl.reduce((e,t)=>{const n=ml(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Cl=Wn[" useInsertionEffect ".trim().toString()]||Y;function Me({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=bl({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:o;{const d=s.useRef(e!==void 0);s.useEffect(()=>{const f=d.current;f!==c&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=c},[c,r])}const u=s.useCallback(d=>{var f;if(c){const p=El(d)?d(e):d;p!==e&&((f=a.current)==null||f.call(a,p))}else i(d)},[c,e,i,a]);return[l,u]}function bl({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),o=s.useRef(n),i=s.useRef(t);return Cl(()=>{i.current=t},[t]),s.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function El(e){return typeof e=="function"}function Pl(e){const t=Rl(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Al);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Rl(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Ol(o),c=Tl(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _l=Symbol("radix.slottable");function Al(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_l}function Tl(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ol(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 Nl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Il=Nl.reduce((e,t)=>{const n=Pl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vo=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"}),Ml="VisuallyHidden",ho=s.forwardRef((e,t)=>m.jsx(Il.span,{...e,ref:t,style:{...vo,...e.style}}));ho.displayName=Ml;var Dl=ho,[Zt]=Js("Tooltip",[_e]),qt=_e(),go="TooltipProvider",$l=700,Tn="tooltip.open",[jl,Xn]=Zt(go),yo=e=>{const{__scopeTooltip:t,delayDuration:n=$l,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=s.useRef(!0),c=s.useRef(!1),l=s.useRef(0);return s.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(jl,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(u=>{c.current=u},[]),disableHoverableContent:o,children:i})};yo.displayName=go;var it="Tooltip",[Ll,Qt]=Zt(it),xo=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:c}=e,l=Xn(it,e.__scopeTooltip),u=qt(t),[d,f]=s.useState(null),p=le(),h=s.useRef(0),g=a??l.disableHoverableContent,v=c??l.delayDuration,y=s.useRef(!1),[x,w]=Me({prop:r,defaultProp:o??!1,onChange:b=>{b?(l.onOpen(),document.dispatchEvent(new CustomEvent(Tn))):l.onClose(),i==null||i(b)},caller:it}),S=s.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),C=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,w(!0)},[w]),E=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),R=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0),h.current=0},v)},[v,w]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),m.jsx(zt,{...u,children:m.jsx(Ll,{scope:t,contentId:p,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:s.useCallback(()=>{l.isOpenDelayedRef.current?R():C()},[l.isOpenDelayedRef,R,C]),onTriggerLeave:s.useCallback(()=>{g?E():(window.clearTimeout(h.current),h.current=0)},[E,g]),onOpen:C,onClose:E,disableHoverableContent:g,children:n})})};xo.displayName=it;var On="TooltipTrigger",wo=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Qt(On,n),i=Xn(On,n),a=qt(n),c=s.useRef(null),l=$(t,c,o.onTriggerChange),u=s.useRef(!1),d=s.useRef(!1),f=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.jsx(ut,{asChild:!0,...a,children:m.jsx(Sl.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:P(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:P(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:P(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:P(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:P(e.onBlur,o.onClose),onClick:P(e.onClick,o.onClose)})})});wo.displayName=On;var Fl="TooltipPortal",[uv,kl]=Zt(Fl,{forceMount:void 0}),Ke="TooltipContent",So=s.forwardRef((e,t)=>{const n=kl(Ke,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Qt(Ke,e.__scopeTooltip);return m.jsx(q,{present:r||a.open,children:a.disableHoverableContent?m.jsx(Co,{side:o,...i,ref:t}):m.jsx(Wl,{side:o,...i,ref:t})})}),Wl=s.forwardRef((e,t)=>{const n=Qt(Ke,e.__scopeTooltip),r=Xn(Ke,e.__scopeTooltip),o=s.useRef(null),i=$(t,o),[a,c]=s.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=s.useCallback(()=>{c(null),f(!1)},[f]),h=s.useCallback((g,v)=>{const y=g.currentTarget,x={x:g.clientX,y:g.clientY},w=Kl(x,y.getBoundingClientRect()),S=Gl(x,w),C=zl(v.getBoundingClientRect()),E=Xl([...S,...C]);c(E),f(!0)},[f]);return s.useEffect(()=>()=>p(),[p]),s.useEffect(()=>{if(l&&d){const g=y=>h(y,d),v=y=>h(y,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",v)}}},[l,d,h,p]),s.useEffect(()=>{if(a){const g=v=>{const y=v.target,x={x:v.clientX,y:v.clientY},w=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),S=!Yl(x,a);w?p():S&&(p(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,a,u,p]),m.jsx(Co,{...e,ref:i})}),[Vl,Bl]=Zt(it,{isInside:!1}),Hl=hl("TooltipContent"),Co=s.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...c}=e,l=Qt(Ke,n),u=qt(n),{onClose:d}=l;return s.useEffect(()=>(document.addEventListener(Tn,d),()=>document.removeEventListener(Tn,d)),[d]),s.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:m.jsxs(Yt,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(Hl,{children:r}),m.jsx(Vl,{scope:n,isInside:!0,children:m.jsx(Dl,{id:l.contentId,role:"tooltip",children:o||r})})]})})});So.displayName=Ke;var bo="TooltipArrow",Ul=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qt(n);return Bl(bo,n).isInside?null:m.jsx(Xt,{...o,...r,ref:t})});Ul.displayName=bo;function Kl(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Gl(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function zl(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Yl(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],l=t[a],u=c.x,d=c.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function Xl(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Zl(t)}function Zl(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var fv=yo,dv=xo,pv=wo,mv=So,ql=Symbol.for("react.lazy"),jt=Wn[" use ".trim().toString()];function Ql(e){return typeof e=="object"&&e!==null&&"then"in e}function Eo(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ql&&"_payload"in e&&Ql(e._payload)}function Po(e){const t=Jl(e),n=s.forwardRef((r,o)=>{let{children:i,...a}=r;Eo(i)&&typeof jt=="function"&&(i=jt(i._payload));const c=s.Children.toArray(i),l=c.find(tu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var vv=Po("Slot");function Jl(e){const t=s.forwardRef((n,r)=>{let{children:o,...i}=n;if(Eo(o)&&typeof jt=="function"&&(o=jt(o._payload)),s.isValidElement(o)){const a=ru(o),c=nu(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eu=Symbol("radix.slottable");function tu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eu}function nu(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ru(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 ou=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dt=ou.reduce((e,t)=>{const n=Po(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),iu="Separator",_r="horizontal",su=["horizontal","vertical"],Ro=s.forwardRef((e,t)=>{const{decorative:n,orientation:r=_r,...o}=e,i=cu(r)?r:_r,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.jsx(dt.div,{"data-orientation":i,...c,...o,ref:t})});Ro.displayName=iu;function cu(e){return su.includes(e)}var hv=Ro;function au(e,t){const n=s.createContext(t),r=i=>{const{children:a,...c}=i,l=s.useMemo(()=>c,Object.values(c));return m.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=s.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function lu(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,uu(o,...t)]}function uu(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function fu(e){const t=du(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(mu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function du(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=hu(o),c=vu(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pu=Symbol("radix.slottable");function mu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pu}function vu(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function hu(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 gu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yu=gu.reduce((e,t)=>{const n=fu(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),hn="focusScope.autoFocusOnMount",gn="focusScope.autoFocusOnUnmount",Ar={bubbles:!1,cancelable:!0},xu="FocusScope",pt=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[c,l]=s.useState(null),u=Z(o),d=Z(i),f=s.useRef(null),p=$(t,v=>l(v)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let v=function(S){if(h.paused||!c)return;const C=S.target;c.contains(C)?f.current=C:Ee(f.current,{select:!0})},y=function(S){if(h.paused||!c)return;const C=S.relatedTarget;C!==null&&(c.contains(C)||Ee(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Ee(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const w=new MutationObserver(x);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),w.disconnect()}}},[r,c,h.paused]),s.useEffect(()=>{if(c){Or.add(h);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(hn,Ar);c.addEventListener(hn,u),c.dispatchEvent(x),x.defaultPrevented||(wu(Pu(_o(c)),{select:!0}),document.activeElement===v&&Ee(c))}return()=>{c.removeEventListener(hn,u),setTimeout(()=>{const x=new CustomEvent(gn,Ar);c.addEventListener(gn,d),c.dispatchEvent(x),x.defaultPrevented||Ee(v??document.body,{select:!0}),c.removeEventListener(gn,d),Or.remove(h)},0)}}},[c,u,d,h]);const g=s.useCallback(v=>{if(!n&&!r||h.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(y&&x){const w=v.currentTarget,[S,C]=Su(w);S&&C?!v.shiftKey&&x===C?(v.preventDefault(),n&&Ee(S,{select:!0})):v.shiftKey&&x===S&&(v.preventDefault(),n&&Ee(C,{select:!0})):x===w&&v.preventDefault()}},[n,r,h.paused]);return m.jsx(yu.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});pt.displayName=xu;function wu(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ee(r,{select:t}),document.activeElement!==n)return}function Su(e){const t=_o(e),n=Tr(t,e),r=Tr(t.reverse(),e);return[n,r]}function _o(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 Tr(e,t){for(const n of e)if(!Cu(n,{upTo:t}))return n}function Cu(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 bu(e){return e instanceof HTMLInputElement&&"select"in e}function Ee(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bu(e)&&t&&e.select()}}var Or=Eu();function Eu(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Nr(e,t),e.unshift(t)},remove(t){var n;e=Nr(e,t),(n=e[0])==null||n.resume()}}}function Nr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pu(e){return e.filter(t=>t.tagName!=="A")}function Ao(e){const t=Ru(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Au);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ru(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Ou(o),c=Tu(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _u=Symbol("radix.slottable");function Au(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_u}function Tu(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ou(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 Nu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mt=Nu.reduce((e,t)=>{const n=Ao(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=0;function Jt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ir()),document.body.insertAdjacentElement("beforeend",e[1]??Ir()),yn++,()=>{yn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yn--}},[])}function Ir(){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 me=function(){return me=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},me.apply(this,arguments)};function To(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Iu(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ot="right-scroll-bar-position",Nt="width-before-scroll-bar",Mu="with-scroll-bars-hidden",Du="--removed-body-scroll-bar-size";function xn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $u(e,t){var n=s.useState(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 ju=typeof window<"u"?s.useLayoutEffect:s.useEffect,Mr=new WeakMap;function Lu(e,t){var n=$u(null,function(r){return e.forEach(function(o){return xn(o,r)})});return ju(function(){var r=Mr.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(c){i.has(c)||xn(c,null)}),i.forEach(function(c){o.has(c)||xn(c,a)})}Mr.set(n,e)},[e]),n}function Fu(e){return e}function ku(e,t){t===void 0&&(t=Fu);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 a=t(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var l=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function Wu(e){e===void 0&&(e={});var t=ku(null);return t.options=me({async:!0,ssr:!1},e),t}var Oo=function(e){var t=e.sideCar,n=To(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 s.createElement(r,me({},n))};Oo.isSideCarExport=!0;function Vu(e,t){return e.useMedium(t),Oo}var No=Wu(),wn=function(){},en=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:wn,onWheelCapture:wn,onTouchMoveCapture:wn}),o=r[0],i=r[1],a=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,C=To(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,R=Lu([n,t]),b=me(me({},C),o);return s.createElement(s.Fragment,null,d&&s.createElement(E,{sideCar:No,removeScrollBar:u,shards:f,noRelative:h,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:S}),a?s.cloneElement(s.Children.only(c),me(me({},b),{ref:R})):s.createElement(w,me({},b,{className:l,ref:R}),c))});en.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};en.classNames={fullWidth:Nt,zeroRight:Ot};var Bu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Hu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Bu();return t&&e.setAttribute("nonce",t),e}function Uu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ku(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Hu())&&(Uu(t,n),Ku(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zu=function(){var e=Gu();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Io=function(){var e=zu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Yu={left:0,top:0,right:0,gap:0},Sn=function(e){return parseInt(e||"",10)||0},Xu=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[Sn(n),Sn(r),Sn(o)]},Zu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Yu;var t=Xu(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])}},qu=Io(),He="data-scroll-locked",Qu=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
+
.`.concat(Mu,` {
|
|
3
|
+
overflow: hidden `).concat(r,`;
|
|
4
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
5
|
+
}
|
|
6
|
+
body[`).concat(He,`] {
|
|
7
|
+
overflow: hidden `).concat(r,`;
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
10
|
+
padding-left: `.concat(o,`px;
|
|
11
|
+
padding-top: `).concat(i,`px;
|
|
12
|
+
padding-right: `).concat(a,`px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
16
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.`).concat(Ot,` {
|
|
20
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.`).concat(Nt,` {
|
|
24
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(Ot," .").concat(Ot,` {
|
|
28
|
+
right: 0 `).concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(Nt," .").concat(Nt,` {
|
|
32
|
+
margin-right: 0 `).concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[`).concat(He,`] {
|
|
36
|
+
`).concat(Du,": ").concat(c,`px;
|
|
37
|
+
}
|
|
38
|
+
`)},Dr=function(){var e=parseInt(document.body.getAttribute(He)||"0",10);return isFinite(e)?e:0},Ju=function(){s.useEffect(function(){return document.body.setAttribute(He,(Dr()+1).toString()),function(){var e=Dr()-1;e<=0?document.body.removeAttribute(He):document.body.setAttribute(He,e.toString())}},[])},ef=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Ju();var i=s.useMemo(function(){return Zu(o)},[o]);return s.createElement(qu,{styles:Qu(i,!t,o,n?"":"!important")})},Nn=!1;if(typeof window<"u")try{var Pt=Object.defineProperty({},"passive",{get:function(){return Nn=!0,!0}});window.addEventListener("test",Pt,Pt),window.removeEventListener("test",Pt,Pt)}catch{Nn=!1}var ke=Nn?{passive:!1}:!1,tf=function(e){return e.tagName==="TEXTAREA"},Mo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tf(e)&&n[t]==="visible")},nf=function(e){return Mo(e,"overflowY")},rf=function(e){return Mo(e,"overflowX")},$r=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Do(e,r);if(o){var i=$o(e,r),a=i[1],c=i[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},of=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sf=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Do=function(e,t){return e==="v"?nf(t):rf(t)},$o=function(e,t){return e==="v"?of(t):sf(t)},cf=function(e,t){return e==="h"&&t==="rtl"?-1:1},af=function(e,t,n,r,o){var i=cf(e,window.getComputedStyle(t).direction),a=i*r,c=n.target,l=t.contains(c),u=!1,d=a>0,f=0,p=0;do{if(!c)break;var h=$o(e,c),g=h[0],v=h[1],y=h[2],x=v-y-i*g;(g||x)&&Do(e,c)&&(f+=x,p+=g);var w=c.parentNode;c=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(d&&Math.abs(f)<1||!d&&Math.abs(p)<1)&&(u=!0),u},Rt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jr=function(e){return[e.deltaX,e.deltaY]},Lr=function(e){return e&&"current"in e?e.current:e},lf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},uf=function(e){return`
|
|
39
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
+
`)},ff=0,We=[];function df(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),o=s.useState(ff++)[0],i=s.useState(Io)[0],a=s.useRef(e);s.useEffect(function(){a.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=Iu([e.lockRef.current],(e.shards||[]).map(Lr),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var x=Rt(v),w=n.current,S="deltaX"in v?v.deltaX:w[0]-x[0],C="deltaY"in v?v.deltaY:w[1]-x[1],E,R=v.target,b=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&b==="h"&&R.type==="range")return!1;var A=window.getSelection(),T=A&&A.anchorNode,O=T?T===R||T.contains(R):!1;if(O)return!1;var D=$r(b,R);if(!D)return!0;if(D?E=b:(E=b==="v"?"h":"v",D=$r(b,R)),!D)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var L=r.current||E;return af(L,y,v,L==="h"?S:C)},[]),l=s.useCallback(function(v){var y=v;if(!(!We.length||We[We.length-1]!==i)){var x="deltaY"in y?jr(y):Rt(y),w=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&lf(E.delta,x)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var S=(a.current.shards||[]).map(Lr).filter(Boolean).filter(function(E){return E.contains(y.target)}),C=S.length>0?c(y,S[0]):!a.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),u=s.useCallback(function(v,y,x,w){var S={name:v,delta:y,target:x,should:w,shadowParent:pf(x)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),d=s.useCallback(function(v){n.current=Rt(v),r.current=void 0},[]),f=s.useCallback(function(v){u(v.type,jr(v),v.target,c(v,e.lockRef.current))},[]),p=s.useCallback(function(v){u(v.type,Rt(v),v.target,c(v,e.lockRef.current))},[]);s.useEffect(function(){return We.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ke),document.addEventListener("touchmove",l,ke),document.addEventListener("touchstart",d,ke),function(){We=We.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,ke),document.removeEventListener("touchmove",l,ke),document.removeEventListener("touchstart",d,ke)}},[]);var h=e.removeScrollBar,g=e.inert;return s.createElement(s.Fragment,null,g?s.createElement(i,{styles:uf(o)}):null,h?s.createElement(ef,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mf=Vu(No,df);var vt=s.forwardRef(function(e,t){return s.createElement(en,me({},e,{ref:t,sideCar:mf}))});vt.classNames=en.classNames;var vf=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ve=new WeakMap,_t=new WeakMap,At={},Cn=0,jo=function(e){return e&&(e.host||jo(e.parentNode))},hf=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jo(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})},gf=function(e,t,n,r){var o=hf(t,Array.isArray(e)?e:[e]);At[n]||(At[n]=new WeakMap);var i=At[n],a=[],c=new Set,l=new Set(o),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(c.has(p))d(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",v=(Ve.get(p)||0)+1,y=(i.get(p)||0)+1;Ve.set(p,v),i.set(p,y),a.push(p),v===1&&g&&_t.set(p,!0),y===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(t),c.clear(),Cn++,function(){a.forEach(function(f){var p=Ve.get(f)-1,h=i.get(f)-1;Ve.set(f,p),i.set(f,h),p||(_t.has(f)||f.removeAttribute(r),_t.delete(f)),h||f.removeAttribute(n)}),Cn--,Cn||(Ve=new WeakMap,Ve=new WeakMap,_t=new WeakMap,At={})}},tn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=vf(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),gf(r,o,n,"aria-hidden")):function(){return null}},nn="Dialog",[Lo]=lu(nn),[yf,de]=Lo(nn),Fo=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,c=s.useRef(null),l=s.useRef(null),[u,d]=Me({prop:r,defaultProp:o??!1,onChange:i,caller:nn});return m.jsx(yf,{scope:t,triggerRef:c,contentRef:l,contentId:le(),titleId:le(),descriptionId:le(),open:u,onOpenChange:d,onOpenToggle:s.useCallback(()=>d(f=>!f),[d]),modal:a,children:n})};Fo.displayName=nn;var ko="DialogTrigger",xf=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=de(ko,n),i=$(t,o.triggerRef);return m.jsx(mt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Qn(o.open),...r,ref:i,onClick:P(e.onClick,o.onOpenToggle)})});xf.displayName=ko;var Zn="DialogPortal",[wf,Wo]=Lo(Zn,{forceMount:void 0}),Vo=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=de(Zn,t);return m.jsx(wf,{scope:t,forceMount:n,children:s.Children.map(r,a=>m.jsx(q,{present:n||i.open,children:m.jsx(ft,{asChild:!0,container:o,children:a})}))})};Vo.displayName=Zn;var Lt="DialogOverlay",Bo=s.forwardRef((e,t)=>{const n=Wo(Lt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=de(Lt,e.__scopeDialog);return i.modal?m.jsx(q,{present:r||i.open,children:m.jsx(Cf,{...o,ref:t})}):null});Bo.displayName=Lt;var Sf=Ao("DialogOverlay.RemoveScroll"),Cf=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=de(Lt,n);return m.jsx(vt,{as:Sf,allowPinchZoom:!0,shards:[o.contentRef],children:m.jsx(mt.div,{"data-state":Qn(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),De="DialogContent",Ho=s.forwardRef((e,t)=>{const n=Wo(De,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=de(De,e.__scopeDialog);return m.jsx(q,{present:r||i.open,children:i.modal?m.jsx(bf,{...o,ref:t}):m.jsx(Ef,{...o,ref:t})})});Ho.displayName=De;var bf=s.forwardRef((e,t)=>{const n=de(De,e.__scopeDialog),r=s.useRef(null),o=$(t,n.contentRef,r);return s.useEffect(()=>{const i=r.current;if(i)return tn(i)},[]),m.jsx(Uo,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:P(e.onFocusOutside,i=>i.preventDefault())})}),Ef=s.forwardRef((e,t)=>{const n=de(De,e.__scopeDialog),r=s.useRef(!1),o=s.useRef(!1);return m.jsx(Uo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Uo=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,c=de(De,n),l=s.useRef(null),u=$(t,l);return Jt(),m.jsxs(m.Fragment,{children:[m.jsx(pt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(Xe,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Qn(c.open),...a,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(Pf,{titleId:c.titleId}),m.jsx(_f,{contentRef:l,descriptionId:c.descriptionId})]})]})}),qn="DialogTitle",Ko=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=de(qn,n);return m.jsx(mt.h2,{id:o.titleId,...r,ref:t})});Ko.displayName=qn;var Go="DialogDescription",zo=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=de(Go,n);return m.jsx(mt.p,{id:o.descriptionId,...r,ref:t})});zo.displayName=Go;var Yo="DialogClose",Xo=s.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=de(Yo,n);return m.jsx(mt.button,{type:"button",...r,ref:t,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});Xo.displayName=Yo;function Qn(e){return e?"open":"closed"}var Zo="DialogTitleWarning",[gv,qo]=au(Zo,{contentName:De,titleName:qn,docsSlug:"dialog"}),Pf=({titleId:e})=>{const t=qo(Zo),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
+
|
|
43
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
+
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Rf="DialogDescriptionWarning",_f=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qo(Rf).contentName}}.`;return s.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},yv=Fo,xv=Vo,wv=Bo,Sv=Ho,Cv=Ko,bv=zo,Ev=Xo;function Af(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Tf(o,...t)]}function Tf(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Of(e){const t=Nf(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Mf);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Nf(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=$f(o),c=Df(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var If=Symbol("radix.slottable");function Mf(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===If}function Df(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function $f(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 jf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lf=jf.reduce((e,t)=>{const n=Of(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ff(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,kf(o,...t)]}function kf(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Fr(e){const t=Wf(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Bf);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Wf(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Uf(o),c=Hf(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vf=Symbol("radix.slottable");function Bf(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vf}function Hf(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Uf(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 Jn(e){const t=e+"CollectionProvider",[n,r]=Ff(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:y,children:x}=v,w=Ne.useRef(null),S=Ne.useRef(new Map).current;return m.jsx(o,{scope:y,itemMap:S,collectionRef:w,children:x})};a.displayName=t;const c=e+"CollectionSlot",l=Fr(c),u=Ne.forwardRef((v,y)=>{const{scope:x,children:w}=v,S=i(c,x),C=$(y,S.collectionRef);return m.jsx(l,{ref:C,children:w})});u.displayName=c;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Fr(d),h=Ne.forwardRef((v,y)=>{const{scope:x,children:w,...S}=v,C=Ne.useRef(null),E=$(y,C),R=i(d,x);return Ne.useEffect(()=>(R.itemMap.set(C,{ref:C,...S}),()=>void R.itemMap.delete(C))),m.jsx(p,{[f]:"",ref:E,children:w})});h.displayName=d;function g(v){const y=i(e+"CollectionConsumer",v);return Ne.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const S=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((R,b)=>S.indexOf(R.ref.current)-S.indexOf(b.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},g,r]}function Kf(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Gf(o,...t)]}function Gf(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var zf=s.createContext(void 0);function rn(e){const t=s.useContext(zf);return e||t||"ltr"}function Qo(e){const t=Yf(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Zf);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Yf(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Qf(o),c=qf(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xf=Symbol("radix.slottable");function Zf(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xf}function qf(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Qf(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 Jf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=Jf.reduce((e,t)=>{const n=Qo(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ed(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function td(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,nd(o,...t)]}function nd(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function rd(e){const t=od(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(sd);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function od(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=ad(o),c=cd(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var id=Symbol("radix.slottable");function sd(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===id}function cd(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ad(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 ld=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jo=ld.reduce((e,t)=>{const n=rd(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),bn="rovingFocusGroup.onEntryFocus",ud={bubbles:!1,cancelable:!0},gt="RovingFocusGroup",[In,ei,fd]=Jn(gt),[dd,ti]=td(gt,[fd]),[pd,md]=dd(gt),ni=s.forwardRef((e,t)=>m.jsx(In.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(In.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(vd,{...e,ref:t})})}));ni.displayName=gt;var vd=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=s.useRef(null),h=$(t,p),g=rn(i),[v,y]=Me({prop:a,defaultProp:c??null,onChange:l,caller:gt}),[x,w]=s.useState(!1),S=Z(u),C=ei(n),E=s.useRef(!1),[R,b]=s.useState(0);return s.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(bn,S),()=>A.removeEventListener(bn,S)},[S]),m.jsx(pd,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:s.useCallback(A=>y(A),[y]),onItemShiftTab:s.useCallback(()=>w(!0),[]),onFocusableItemAdd:s.useCallback(()=>b(A=>A+1),[]),onFocusableItemRemove:s.useCallback(()=>b(A=>A-1),[]),children:m.jsx(Jo.div,{tabIndex:x||R===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:P(e.onMouseDown,()=>{E.current=!0}),onFocus:P(e.onFocus,A=>{const T=!E.current;if(A.target===A.currentTarget&&T&&!x){const O=new CustomEvent(bn,ud);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const D=C().filter(M=>M.focusable),L=D.find(M=>M.active),F=D.find(M=>M.id===v),U=[L,F,...D].filter(Boolean).map(M=>M.ref.current);ii(U,d)}}E.current=!1}),onBlur:P(e.onBlur,()=>w(!1))})})}),ri="RovingFocusGroupItem",oi=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...c}=e,l=le(),u=i||l,d=md(ri,n),f=d.currentTabStopId===u,p=ei(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=d;return s.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),m.jsx(In.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:m.jsx(Jo.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:P(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:P(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:P(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=yd(y,d.orientation,d.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=p().filter(C=>C.focusable).map(C=>C.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const C=S.indexOf(y.currentTarget);S=d.loop?xd(S,C+1):S.slice(C+1)}setTimeout(()=>ii(S))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:v!=null}):a})})});oi.displayName=ri;var hd={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gd(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yd(e,t,n){const r=gd(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return hd[r]}function ii(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var wd=ni,Sd=oi,Mn=["Enter"," "],Cd=["ArrowDown","PageUp","Home"],si=["ArrowUp","PageDown","End"],bd=[...Cd,...si],Ed={ltr:[...Mn,"ArrowRight"],rtl:[...Mn,"ArrowLeft"]},Pd={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yt="Menu",[st,Rd,_d]=Jn(yt),[Le,ci]=Kf(yt,[_d,_e,ti]),on=_e(),ai=ti(),[Ad,Fe]=Le(yt),[Td,xt]=Le(yt),li=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,c=on(t),[l,u]=s.useState(null),d=s.useRef(!1),f=Z(i),p=rn(o);return s.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),m.jsx(zt,{...c,children:m.jsx(Ad,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:m.jsx(Td,{scope:t,onClose:s.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:a,children:r})})})};li.displayName=yt;var Od="MenuAnchor",er=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=on(n);return m.jsx(ut,{...o,...r,ref:t})});er.displayName=Od;var tr="MenuPortal",[Nd,ui]=Le(tr,{forceMount:void 0}),fi=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Fe(tr,t);return m.jsx(Nd,{scope:t,forceMount:n,children:m.jsx(q,{present:n||i.open,children:m.jsx(ft,{asChild:!0,container:o,children:r})})})};fi.displayName=tr;var se="MenuContent",[Id,nr]=Le(se),di=s.forwardRef((e,t)=>{const n=ui(se,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Fe(se,e.__scopeMenu),a=xt(se,e.__scopeMenu);return m.jsx(st.Provider,{scope:e.__scopeMenu,children:m.jsx(q,{present:r||i.open,children:m.jsx(st.Slot,{scope:e.__scopeMenu,children:a.modal?m.jsx(Md,{...o,ref:t}):m.jsx(Dd,{...o,ref:t})})})})}),Md=s.forwardRef((e,t)=>{const n=Fe(se,e.__scopeMenu),r=s.useRef(null),o=$(t,r);return s.useEffect(()=>{const i=r.current;if(i)return tn(i)},[]),m.jsx(rr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:P(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Dd=s.forwardRef((e,t)=>{const n=Fe(se,e.__scopeMenu);return m.jsx(rr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$d=Qo("MenuContent.ScrollLock"),rr=s.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...v}=e,y=Fe(se,n),x=xt(se,n),w=on(n),S=ai(n),C=Rd(n),[E,R]=s.useState(null),b=s.useRef(null),A=$(t,b,y.onContentChange),T=s.useRef(0),O=s.useRef(""),D=s.useRef(0),L=s.useRef(null),F=s.useRef("right"),j=s.useRef(0),U=g?vt:s.Fragment,M=g?{as:$d,allowPinchZoom:!0}:void 0,k=_=>{var I,V;const K=O.current+_,z=C().filter(G=>!G.disabled),J=document.activeElement,we=(I=z.find(G=>G.ref.current===J))==null?void 0:I.textValue,ie=z.map(G=>G.textValue),Se=zd(ie,K,we),ee=(V=z.find(G=>G.textValue===Se))==null?void 0:V.ref.current;(function G(W){O.current=W,window.clearTimeout(T.current),W!==""&&(T.current=window.setTimeout(()=>G(""),1e3))})(K),ee&&setTimeout(()=>ee.focus())};s.useEffect(()=>()=>window.clearTimeout(T.current),[]),Jt();const N=s.useCallback(_=>{var z,J;return F.current===((z=L.current)==null?void 0:z.side)&&Xd(_,(J=L.current)==null?void 0:J.area)},[]);return m.jsx(Id,{scope:n,searchRef:O,onItemEnter:s.useCallback(_=>{N(_)&&_.preventDefault()},[N]),onItemLeave:s.useCallback(_=>{var K;N(_)||((K=b.current)==null||K.focus(),R(null))},[N]),onTriggerLeave:s.useCallback(_=>{N(_)&&_.preventDefault()},[N]),pointerGraceTimerRef:D,onPointerGraceIntentChange:s.useCallback(_=>{L.current=_},[]),children:m.jsx(U,{...M,children:m.jsx(pt,{asChild:!0,trapped:o,onMountAutoFocus:P(i,_=>{var K;_.preventDefault(),(K=b.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,children:m.jsx(wd,{asChild:!0,...S,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:R,onEntryFocus:P(l,_=>{x.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(Yt,{role:"menu","aria-orientation":"vertical","data-state":Ai(y.open),"data-radix-menu-content":"",dir:x.dir,...w,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:P(v.onKeyDown,_=>{const z=_.target.closest("[data-radix-menu-content]")===_.currentTarget,J=_.ctrlKey||_.altKey||_.metaKey,we=_.key.length===1;z&&(_.key==="Tab"&&_.preventDefault(),!J&&we&&k(_.key));const ie=b.current;if(_.target!==ie||!bd.includes(_.key))return;_.preventDefault();const ee=C().filter(I=>!I.disabled).map(I=>I.ref.current);si.includes(_.key)&&ee.reverse(),Kd(ee)}),onBlur:P(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(T.current),O.current="")}),onPointerMove:P(e.onPointerMove,ct(_=>{const K=_.target,z=j.current!==_.clientX;if(_.currentTarget.contains(K)&&z){const J=_.clientX>j.current?"right":"left";F.current=J,j.current=_.clientX}}))})})})})})})});di.displayName=se;var jd="MenuGroup",or=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(ht.div,{role:"group",...r,ref:t})});or.displayName=jd;var Ld="MenuLabel",pi=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(ht.div,{...r,ref:t})});pi.displayName=Ld;var Ft="MenuItem",kr="menu.itemSelect",sn=s.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=s.useRef(null),a=xt(Ft,e.__scopeMenu),c=nr(Ft,e.__scopeMenu),l=$(t,i),u=s.useRef(!1),d=()=>{const f=i.current;if(!n&&f){const p=new CustomEvent(kr,{bubbles:!0,cancelable:!0});f.addEventListener(kr,h=>r==null?void 0:r(h),{once:!0}),ed(f,p),p.defaultPrevented?u.current=!1:a.onClose()}};return m.jsx(mi,{...o,ref:l,disabled:n,onClick:P(e.onClick,d),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),u.current=!0},onPointerUp:P(e.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:P(e.onKeyDown,f=>{const p=c.searchRef.current!=="";n||p&&f.key===" "||Mn.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});sn.displayName=Ft;var mi=s.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=nr(Ft,n),c=ai(n),l=s.useRef(null),u=$(t,l),[d,f]=s.useState(!1),[p,h]=s.useState("");return s.useEffect(()=>{const g=l.current;g&&h((g.textContent??"").trim())},[i.children]),m.jsx(st.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:m.jsx(Sd,{asChild:!0,...c,focusable:!r,children:m.jsx(ht.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:P(e.onPointerMove,ct(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:P(e.onPointerLeave,ct(g=>a.onItemLeave(g))),onFocus:P(e.onFocus,()=>f(!0)),onBlur:P(e.onBlur,()=>f(!1))})})})}),Fd="MenuCheckboxItem",vi=s.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.jsx(wi,{scope:e.__scopeMenu,checked:n,children:m.jsx(sn,{role:"menuitemcheckbox","aria-checked":kt(n)?"mixed":n,...o,ref:t,"data-state":sr(n),onSelect:P(o.onSelect,()=>r==null?void 0:r(kt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});vi.displayName=Fd;var hi="MenuRadioGroup",[kd,Wd]=Le(hi,{value:void 0,onValueChange:()=>{}}),gi=s.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Z(r);return m.jsx(kd,{scope:e.__scopeMenu,value:n,onValueChange:i,children:m.jsx(or,{...o,ref:t})})});gi.displayName=hi;var yi="MenuRadioItem",xi=s.forwardRef((e,t)=>{const{value:n,...r}=e,o=Wd(yi,e.__scopeMenu),i=n===o.value;return m.jsx(wi,{scope:e.__scopeMenu,checked:i,children:m.jsx(sn,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":sr(i),onSelect:P(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});xi.displayName=yi;var ir="MenuItemIndicator",[wi,Vd]=Le(ir,{checked:!1}),Si=s.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Vd(ir,n);return m.jsx(q,{present:r||kt(i.checked)||i.checked===!0,children:m.jsx(ht.span,{...o,ref:t,"data-state":sr(i.checked)})})});Si.displayName=ir;var Bd="MenuSeparator",Ci=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(ht.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Ci.displayName=Bd;var Hd="MenuArrow",bi=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=on(n);return m.jsx(Xt,{...o,...r,ref:t})});bi.displayName=Hd;var Ud="MenuSub",[Pv,Ei]=Le(Ud),nt="MenuSubTrigger",Pi=s.forwardRef((e,t)=>{const n=Fe(nt,e.__scopeMenu),r=xt(nt,e.__scopeMenu),o=Ei(nt,e.__scopeMenu),i=nr(nt,e.__scopeMenu),a=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=s.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return s.useEffect(()=>d,[d]),s.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),l(null)}},[c,l]),m.jsx(er,{asChild:!0,...u,children:m.jsx(mi,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ai(n.open),...e,ref:X(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:P(e.onPointerMove,ct(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:P(e.onPointerLeave,ct(f=>{var h,g;d();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const v=(g=n.content)==null?void 0:g.dataset.side,y=v==="right",x=y?-5:5,w=p[y?"left":"right"],S=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:w,y:p.top},{x:S,y:p.top},{x:S,y:p.bottom},{x:w,y:p.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:P(e.onKeyDown,f=>{var h;const p=i.searchRef.current!=="";e.disabled||p&&f.key===" "||Ed[r.dir].includes(f.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),f.preventDefault())})})})});Pi.displayName=nt;var Ri="MenuSubContent",_i=s.forwardRef((e,t)=>{const n=ui(se,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Fe(se,e.__scopeMenu),a=xt(se,e.__scopeMenu),c=Ei(Ri,e.__scopeMenu),l=s.useRef(null),u=$(t,l);return m.jsx(st.Provider,{scope:e.__scopeMenu,children:m.jsx(q,{present:r||i.open,children:m.jsx(st.Slot,{scope:e.__scopeMenu,children:m.jsx(rr,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;a.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:P(e.onFocusOutside,d=>{d.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:P(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:P(e.onKeyDown,d=>{var h;const f=d.currentTarget.contains(d.target),p=Pd[a.dir].includes(d.key);f&&p&&(i.onOpenChange(!1),(h=c.trigger)==null||h.focus(),d.preventDefault())})})})})})});_i.displayName=Ri;function Ai(e){return e?"open":"closed"}function kt(e){return e==="indeterminate"}function sr(e){return kt(e)?"indeterminate":e?"checked":"unchecked"}function Kd(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Gd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zd(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Gd(e,Math.max(i,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Yd(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],l=t[a],u=c.x,d=c.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function Xd(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Yd(n,t)}function ct(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Zd=li,qd=er,Qd=fi,Jd=di,ep=or,tp=pi,np=sn,rp=vi,op=gi,ip=xi,sp=Si,cp=Ci,ap=bi,lp=Pi,up=_i,cn="DropdownMenu",[fp]=Af(cn,[ci]),Q=ci(),[dp,Ti]=fp(cn),Oi=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:c=!0}=e,l=Q(t),u=s.useRef(null),[d,f]=Me({prop:o,defaultProp:i??!1,onChange:a,caller:cn});return m.jsx(dp,{scope:t,triggerId:le(),triggerRef:u,contentId:le(),open:d,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(p=>!p),[f]),modal:c,children:m.jsx(Zd,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};Oi.displayName=cn;var Ni="DropdownMenuTrigger",Ii=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Ti(Ni,n),a=Q(n);return m.jsx(qd,{asChild:!0,...a,children:m.jsx(Lf.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:X(t,i.triggerRef),onPointerDown:P(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:P(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Ii.displayName=Ni;var pp="DropdownMenuPortal",Mi=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Q(t);return m.jsx(Qd,{...r,...n})};Mi.displayName=pp;var Di="DropdownMenuContent",$i=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ti(Di,n),i=Q(n),a=s.useRef(!1);return m.jsx(Jd,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:P(e.onCloseAutoFocus,c=>{var l;a.current||(l=o.triggerRef.current)==null||l.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:P(e.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$i.displayName=Di;var mp="DropdownMenuGroup",vp=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(ep,{...o,...r,ref:t})});vp.displayName=mp;var hp="DropdownMenuLabel",ji=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(tp,{...o,...r,ref:t})});ji.displayName=hp;var gp="DropdownMenuItem",Li=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(np,{...o,...r,ref:t})});Li.displayName=gp;var yp="DropdownMenuCheckboxItem",Fi=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(rp,{...o,...r,ref:t})});Fi.displayName=yp;var xp="DropdownMenuRadioGroup",wp=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(op,{...o,...r,ref:t})});wp.displayName=xp;var Sp="DropdownMenuRadioItem",ki=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(ip,{...o,...r,ref:t})});ki.displayName=Sp;var Cp="DropdownMenuItemIndicator",Wi=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(sp,{...o,...r,ref:t})});Wi.displayName=Cp;var bp="DropdownMenuSeparator",Vi=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(cp,{...o,...r,ref:t})});Vi.displayName=bp;var Ep="DropdownMenuArrow",Pp=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(ap,{...o,...r,ref:t})});Pp.displayName=Ep;var Rp="DropdownMenuSubTrigger",Bi=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(lp,{...o,...r,ref:t})});Bi.displayName=Rp;var _p="DropdownMenuSubContent",Hi=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Q(n);return m.jsx(up,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Hi.displayName=_p;var Rv=Oi,_v=Ii,Av=Mi,Tv=$i,Ov=ji,Nv=Li,Iv=Fi,Mv=ki,Dv=Wi,$v=Vi,jv=Bi,Lv=Hi;function Ap(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a);c.displayName=i+"Context";const l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Tp(o,...t)]}function Tp(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Ui={exports:{}},Ki={};/**
|
|
46
|
+
* @license React
|
|
47
|
+
* use-sync-external-store-shim.production.js
|
|
48
|
+
*
|
|
49
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the MIT license found in the
|
|
52
|
+
* LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/var Ge=s;function Op(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Np=typeof Object.is=="function"?Object.is:Op,Ip=Ge.useState,Mp=Ge.useEffect,Dp=Ge.useLayoutEffect,$p=Ge.useDebugValue;function jp(e,t){var n=t(),r=Ip({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Dp(function(){o.value=n,o.getSnapshot=t,En(o)&&i({inst:o})},[e,n,t]),Mp(function(){return En(o)&&i({inst:o}),e(function(){En(o)&&i({inst:o})})},[e]),$p(n),n}function En(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Np(e,n)}catch{return!0}}function Lp(e,t){return t()}var Fp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lp:jp;Ki.useSyncExternalStore=Ge.useSyncExternalStore!==void 0?Ge.useSyncExternalStore:Fp;Ui.exports=Ki;var kp=Ui.exports;function Wp(){return kp.useSyncExternalStore(Vp,()=>!0,()=>!1)}function Vp(){return()=>{}}var cr="Avatar",[Bp]=Ap(cr),[Hp,Gi]=Bp(cr),zi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=s.useState("idle");return m.jsx(Hp,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:m.jsx(dt.span,{...r,ref:t})})});zi.displayName=cr;var Yi="AvatarImage",Xi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=Gi(Yi,n),c=Up(r,i),l=Z(u=>{o(u),a.onImageLoadingStatusChange(u)});return Y(()=>{c!=="idle"&&l(c)},[c,l]),c==="loaded"?m.jsx(dt.img,{...i,ref:t,src:r}):null});Xi.displayName=Yi;var Zi="AvatarFallback",qi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=Gi(Zi,n),[a,c]=s.useState(r===void 0);return s.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?m.jsx(dt.span,{...o,ref:t}):null});qi.displayName=Zi;function Wr(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Up(e,{referrerPolicy:t,crossOrigin:n}){const r=Wp(),o=s.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[a,c]=s.useState(()=>Wr(i,e));return Y(()=>{c(Wr(i,e))},[i,e]),Y(()=>{const l=f=>()=>{c(f)};if(!i)return;const u=l("loaded"),d=l("error");return i.addEventListener("load",u),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,n,t]),a}var Fv=zi,kv=Xi,Wv=qi,Kp="Label",Qi=s.forwardRef((e,t)=>m.jsx(dt.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Qi.displayName=Kp;var Vv=Qi;function Dn(e,[t,n]){return Math.min(n,Math.max(t,e))}function Gp(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,zp(o,...t)]}function zp(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ji(e){const t=Yp(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Zp);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Yp(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Qp(o),c=qp(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xp=Symbol("radix.slottable");function Zp(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xp}function qp(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Qp(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 Jp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=Jp.reduce((e,t)=>{const n=Ji(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function em(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var tm=[" ","Enter","ArrowUp","ArrowDown"],nm=[" ","Enter"],$e="Select",[an,ln,rm]=Jn($e),[Qe]=Gp($e,[rm,_e]),un=_e(),[om,Ae]=Qe($e),[im,sm]=Qe($e),es=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:g}=e,v=un(t),[y,x]=s.useState(null),[w,S]=s.useState(null),[C,E]=s.useState(!1),R=rn(u),[b,A]=Me({prop:r,defaultProp:o??!1,onChange:i,caller:$e}),[T,O]=Me({prop:a,defaultProp:c,onChange:l,caller:$e}),D=s.useRef(null),L=y?g||!!y.closest("form"):!0,[F,j]=s.useState(new Set),U=Array.from(F).map(M=>M.props.value).join(";");return m.jsx(zt,{...v,children:m.jsxs(om,{required:h,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:le(),value:T,onValueChange:O,open:b,onOpenChange:A,dir:R,triggerPointerDownPosRef:D,disabled:p,children:[m.jsx(an.Provider,{scope:t,children:m.jsx(im,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(M=>{j(k=>new Set(k).add(M))},[]),onNativeOptionRemove:s.useCallback(M=>{j(k=>{const N=new Set(k);return N.delete(M),N})},[]),children:n})}),L?m.jsxs(Es,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:T,onChange:M=>O(M.target.value),disabled:p,form:g,children:[T===void 0?m.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};es.displayName=$e;var ts="SelectTrigger",ns=s.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=un(n),a=Ae(ts,n),c=a.disabled||r,l=$(t,a.onTriggerChange),u=ln(n),d=s.useRef("touch"),[f,p,h]=Rs(v=>{const y=u().filter(S=>!S.disabled),x=y.find(S=>S.value===a.value),w=_s(y,v,x);w!==void 0&&a.onValueChange(w.value)}),g=v=>{c||(a.onOpenChange(!0),h()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return m.jsx(ut,{asChild:!0,...i,children:m.jsx(oe.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Ps(a.value)?"":void 0,...o,ref:l,onClick:P(o.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&g(v)}),onPointerDown:P(o.onPointerDown,v=>{d.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(g(v),v.preventDefault())}),onKeyDown:P(o.onKeyDown,v=>{const y=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(y&&v.key===" ")&&tm.includes(v.key)&&(g(),v.preventDefault())})})})});ns.displayName=ts;var rs="SelectValue",os=s.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...c}=e,l=Ae(rs,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=$(t,l.onValueNodeChange);return Y(()=>{u(d)},[u,d]),m.jsx(oe.span,{...c,ref:f,style:{pointerEvents:"none"},children:Ps(l.value)?m.jsx(m.Fragment,{children:a}):i})});os.displayName=rs;var cm="SelectIcon",is=s.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});is.displayName=cm;var am="SelectPortal",ss=e=>m.jsx(ft,{asChild:!0,...e});ss.displayName=am;var je="SelectContent",cs=s.forwardRef((e,t)=>{const n=Ae(je,e.__scopeSelect),[r,o]=s.useState();if(Y(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?at.createPortal(m.jsx(as,{scope:e.__scopeSelect,children:m.jsx(an.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),i):null}return m.jsx(ls,{...e,ref:t})});cs.displayName=je;var ae=10,[as,Te]=Qe(je),lm="SelectContentImpl",um=Ji("SelectContent.RemoveScroll"),ls=s.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y,...x}=e,w=Ae(je,n),[S,C]=s.useState(null),[E,R]=s.useState(null),b=$(t,I=>C(I)),[A,T]=s.useState(null),[O,D]=s.useState(null),L=ln(n),[F,j]=s.useState(!1),U=s.useRef(!1);s.useEffect(()=>{if(S)return tn(S)},[S]),Jt();const M=s.useCallback(I=>{const[V,...G]=L().map(H=>H.ref.current),[W]=G.slice(-1),B=document.activeElement;for(const H of I)if(H===B||(H==null||H.scrollIntoView({block:"nearest"}),H===V&&E&&(E.scrollTop=0),H===W&&E&&(E.scrollTop=E.scrollHeight),H==null||H.focus(),document.activeElement!==B))return},[L,E]),k=s.useCallback(()=>M([A,S]),[M,A,S]);s.useEffect(()=>{F&&k()},[F,k]);const{onOpenChange:N,triggerPointerDownPosRef:_}=w;s.useEffect(()=>{if(S){let I={x:0,y:0};const V=W=>{var B,H;I={x:Math.abs(Math.round(W.pageX)-(((B=_.current)==null?void 0:B.x)??0)),y:Math.abs(Math.round(W.pageY)-(((H=_.current)==null?void 0:H.y)??0))}},G=W=>{I.x<=10&&I.y<=10?W.preventDefault():S.contains(W.target)||N(!1),document.removeEventListener("pointermove",V),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",G,{capture:!0})}}},[S,N,_]),s.useEffect(()=>{const I=()=>N(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[N]);const[K,z]=Rs(I=>{const V=L().filter(B=>!B.disabled),G=V.find(B=>B.ref.current===document.activeElement),W=_s(V,I,G);W&&setTimeout(()=>W.ref.current.focus())}),J=s.useCallback((I,V,G)=>{const W=!U.current&&!G;(w.value!==void 0&&w.value===V||W)&&(T(I),W&&(U.current=!0))},[w.value]),we=s.useCallback(()=>S==null?void 0:S.focus(),[S]),ie=s.useCallback((I,V,G)=>{const W=!U.current&&!G;(w.value!==void 0&&w.value===V||W)&&D(I)},[w.value]),Se=r==="popper"?$n:us,ee=Se===$n?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return m.jsx(as,{scope:n,content:S,viewport:E,onViewportChange:R,itemRefCallback:J,selectedItem:A,onItemLeave:we,itemTextRefCallback:ie,focusSelectedItem:k,selectedItemText:O,position:r,isPositioned:F,searchRef:K,children:m.jsx(vt,{as:um,allowPinchZoom:!0,children:m.jsx(pt,{asChild:!0,trapped:w.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:P(o,I=>{var V;(V=w.trigger)==null||V.focus({preventScroll:!0}),I.preventDefault()}),children:m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m.jsx(Se,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:I=>I.preventDefault(),...x,...ee,onPlaced:()=>j(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:P(x.onKeyDown,I=>{const V=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!V&&I.key.length===1&&z(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let W=L().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(I.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const B=I.target,H=W.indexOf(B);W=W.slice(H+1)}setTimeout(()=>M(W)),I.preventDefault()}})})})})})})});ls.displayName=lm;var fm="SelectItemAlignedPosition",us=s.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ae(je,n),a=Te(je,n),[c,l]=s.useState(null),[u,d]=s.useState(null),f=$(t,b=>d(b)),p=ln(n),h=s.useRef(!1),g=s.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:x,focusSelectedItem:w}=a,S=s.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&v&&y&&x){const b=i.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),O=x.getBoundingClientRect();if(i.dir!=="rtl"){const B=O.left-A.left,H=T.left-B,te=b.left-H,pe=b.width+te,Je=Math.max(pe,A.width),et=window.innerWidth-ae,tt=Dn(H,[ae,Math.max(ae,et-Je)]);c.style.minWidth=pe+"px",c.style.left=tt+"px"}else{const B=A.right-O.right,H=window.innerWidth-T.right-B,te=window.innerWidth-b.right-H,pe=b.width+te,Je=Math.max(pe,A.width),et=window.innerWidth-ae,tt=Dn(H,[ae,Math.max(ae,et-Je)]);c.style.minWidth=pe+"px",c.style.right=tt+"px"}const D=p(),L=window.innerHeight-ae*2,F=v.scrollHeight,j=window.getComputedStyle(u),U=parseInt(j.borderTopWidth,10),M=parseInt(j.paddingTop,10),k=parseInt(j.borderBottomWidth,10),N=parseInt(j.paddingBottom,10),_=U+M+F+N+k,K=Math.min(y.offsetHeight*5,_),z=window.getComputedStyle(v),J=parseInt(z.paddingTop,10),we=parseInt(z.paddingBottom,10),ie=b.top+b.height/2-ae,Se=L-ie,ee=y.offsetHeight/2,I=y.offsetTop+ee,V=U+M+I,G=_-V;if(V<=ie){const B=D.length>0&&y===D[D.length-1].ref.current;c.style.bottom="0px";const H=u.clientHeight-v.offsetTop-v.offsetHeight,te=Math.max(Se,ee+(B?we:0)+H+k),pe=V+te;c.style.height=pe+"px"}else{const B=D.length>0&&y===D[0].ref.current;c.style.top="0px";const te=Math.max(ie,U+v.offsetTop+(B?J:0)+ee)+G;c.style.height=te+"px",v.scrollTop=V-ie+v.offsetTop}c.style.margin=`${ae}px 0`,c.style.minHeight=K+"px",c.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,c,u,v,y,x,i.dir,r]);Y(()=>S(),[S]);const[C,E]=s.useState();Y(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const R=s.useCallback(b=>{b&&g.current===!0&&(S(),w==null||w(),g.current=!1)},[S,w]);return m.jsx(pm,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:m.jsx(oe.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});us.displayName=fm;var dm="SelectPopperPosition",$n=s.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ae,...i}=e,a=un(n);return m.jsx(Yt,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});$n.displayName=dm;var[pm,ar]=Qe(je,{}),jn="SelectViewport",fs=s.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Te(jn,n),a=ar(jn,n),c=$(t,i.onViewportChange),l=s.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(an.Slot,{scope:n,children:m.jsx(oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:P(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const g=window.innerHeight-ae*2,v=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),x=Math.max(v,y);if(x<g){const w=x+h,S=Math.min(g,w),C=w-S;f.style.height=S+"px",f.style.bottom==="0px"&&(d.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});fs.displayName=jn;var ds="SelectGroup",[mm,vm]=Qe(ds),hm=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=le();return m.jsx(mm,{scope:n,id:o,children:m.jsx(oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});hm.displayName=ds;var ps="SelectLabel",ms=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=vm(ps,n);return m.jsx(oe.div,{id:o.id,...r,ref:t})});ms.displayName=ps;var Wt="SelectItem",[gm,vs]=Qe(Wt),hs=s.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,c=Ae(Wt,n),l=Te(Wt,n),u=c.value===r,[d,f]=s.useState(i??""),[p,h]=s.useState(!1),g=$(t,w=>{var S;return(S=l.itemRefCallback)==null?void 0:S.call(l,w,r,o)}),v=le(),y=s.useRef("touch"),x=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(gm,{scope:n,value:r,disabled:o,textId:v,isSelected:u,onItemTextChange:s.useCallback(w=>{f(S=>S||((w==null?void 0:w.textContent)??"").trim())},[]),children:m.jsx(an.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:m.jsx(oe.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:P(a.onFocus,()=>h(!0)),onBlur:P(a.onBlur,()=>h(!1)),onClick:P(a.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:P(a.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:P(a.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:P(a.onPointerMove,w=>{var S;y.current=w.pointerType,o?(S=l.onItemLeave)==null||S.call(l):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(a.onPointerLeave,w=>{var S;w.currentTarget===document.activeElement&&((S=l.onItemLeave)==null||S.call(l))}),onKeyDown:P(a.onKeyDown,w=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&w.key===" "||(nm.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});hs.displayName=Wt;var rt="SelectItemText",gs=s.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=Ae(rt,n),c=Te(rt,n),l=vs(rt,n),u=sm(rt,n),[d,f]=s.useState(null),p=$(t,x=>f(x),l.onItemTextChange,x=>{var w;return(w=c.itemTextRefCallback)==null?void 0:w.call(c,x,l.value,l.disabled)}),h=d==null?void 0:d.textContent,g=s.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=u;return Y(()=>(v(g),()=>y(g)),[v,y,g]),m.jsxs(m.Fragment,{children:[m.jsx(oe.span,{id:l.textId,...i,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?at.createPortal(i.children,a.valueNode):null]})});gs.displayName=rt;var ys="SelectItemIndicator",xs=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return vs(ys,n).isSelected?m.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});xs.displayName=ys;var Ln="SelectScrollUpButton",ws=s.forwardRef((e,t)=>{const n=Te(Ln,e.__scopeSelect),r=ar(Ln,e.__scopeSelect),[o,i]=s.useState(!1),a=$(t,r.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?m.jsx(Cs,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});ws.displayName=Ln;var Fn="SelectScrollDownButton",Ss=s.forwardRef((e,t)=>{const n=Te(Fn,e.__scopeSelect),r=ar(Fn,e.__scopeSelect),[o,i]=s.useState(!1),a=$(t,r.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;i(d)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?m.jsx(Cs,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Ss.displayName=Fn;var Cs=s.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Te("SelectScrollButton",n),a=s.useRef(null),c=ln(n),l=s.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return s.useEffect(()=>()=>l(),[l]),Y(()=>{var d;const u=c().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),m.jsx(oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:P(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:P(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:P(o.onPointerLeave,()=>{l()})})}),ym="SelectSeparator",bs=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});bs.displayName=ym;var kn="SelectArrow",xm=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=un(n),i=Ae(kn,n),a=Te(kn,n);return i.open&&a.position==="popper"?m.jsx(Xt,{...o,...r,ref:t}):null});xm.displayName=kn;var wm="SelectBubbleInput",Es=s.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=s.useRef(null),i=$(r,o),a=em(t);return s.useEffect(()=>{const c=o.current;if(!c)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const f=new Event("change",{bubbles:!0});d.call(c,t),c.dispatchEvent(f)}},[a,t]),m.jsx(oe.select,{...n,style:{...vo,...n.style},ref:i,defaultValue:t})});Es.displayName=wm;function Ps(e){return e===""||e===void 0}function Rs(e){const t=Z(e),n=s.useRef(""),r=s.useRef(0),o=s.useCallback(a=>{const c=n.current+a;t(c),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(c)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function _s(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Sm(e,Math.max(i,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Sm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Bv=es,Hv=ns,Uv=os,Kv=is,Gv=ss,zv=cs,Yv=fs,Xv=ms,Zv=hs,qv=gs,Qv=xs,Jv=ws,eh=Ss,th=bs;function Cm(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,bm(o,...t)]}function bm(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function As(e){const t=Em(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Rm);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Em(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Am(o),c=_m(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pm=Symbol("radix.slottable");function Rm(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pm}function _m(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Am(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 Tm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ts=Tm.reduce((e,t)=>{const n=As(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fn="Popover",[Os]=Cm(fn,[_e]),wt=_e(),[Om,Oe]=Os(fn),Ns=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,c=wt(t),l=s.useRef(null),[u,d]=s.useState(!1),[f,p]=Me({prop:r,defaultProp:o??!1,onChange:i,caller:fn});return m.jsx(zt,{...c,children:m.jsx(Om,{scope:t,contentId:le(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>d(!0),[]),onCustomAnchorRemove:s.useCallback(()=>d(!1),[]),modal:a,children:n})})};Ns.displayName=fn;var Is="PopoverAnchor",Nm=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(Is,n),i=wt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=o;return s.useEffect(()=>(a(),()=>c()),[a,c]),m.jsx(ut,{...i,...r,ref:t})});Nm.displayName=Is;var Ms="PopoverTrigger",Ds=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(Ms,n),i=wt(n),a=$(t,o.triggerRef),c=m.jsx(Ts.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ks(o.open),...r,ref:a,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:m.jsx(ut,{asChild:!0,...i,children:c})});Ds.displayName=Ms;var lr="PopoverPortal",[Im,Mm]=Os(lr,{forceMount:void 0}),$s=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Oe(lr,t);return m.jsx(Im,{scope:t,forceMount:n,children:m.jsx(q,{present:n||i.open,children:m.jsx(ft,{asChild:!0,container:o,children:r})})})};$s.displayName=lr;var ze="PopoverContent",js=s.forwardRef((e,t)=>{const n=Mm(ze,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Oe(ze,e.__scopePopover);return m.jsx(q,{present:r||i.open,children:i.modal?m.jsx($m,{...o,ref:t}):m.jsx(jm,{...o,ref:t})})});js.displayName=ze;var Dm=As("PopoverContent.RemoveScroll"),$m=s.forwardRef((e,t)=>{const n=Oe(ze,e.__scopePopover),r=s.useRef(null),o=$(t,r),i=s.useRef(!1);return s.useEffect(()=>{const a=r.current;if(a)return tn(a)},[]),m.jsx(vt,{as:Dm,allowPinchZoom:!0,children:m.jsx(Ls,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),jm=s.forwardRef((e,t)=>{const n=Oe(ze,e.__scopePopover),r=s.useRef(!1),o=s.useRef(!1);return m.jsx(Ls,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Ls=s.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=Oe(ze,n),h=wt(n);return Jt(),m.jsx(pt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:m.jsx(Yt,{"data-state":ks(p.open),role:"dialog",id:p.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Fs="PopoverClose",Lm=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(Fs,n);return m.jsx(Ts.button,{type:"button",...r,ref:t,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});Lm.displayName=Fs;var Fm="PopoverArrow",km=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(n);return m.jsx(Xt,{...o,...r,ref:t})});km.displayName=Fm;function ks(e){return e?"open":"closed"}var nh=Ns,rh=Ds,oh=$s,ih=js;function Wm(e){const t=Vm(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Hm);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vm(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Km(o),c=Um(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bm=Symbol("radix.slottable");function Hm(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bm}function Um(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Km(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 Gm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],St=Gm.reduce((e,t)=>{const n=Wm(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zm(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Ym(o,...t)]}function Ym(...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 a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Xm(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var ur="ScrollArea",[Ws]=zm(ur),[Zm,ce]=Ws(ur),Vs=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[c,l]=s.useState(null),[u,d]=s.useState(null),[f,p]=s.useState(null),[h,g]=s.useState(null),[v,y]=s.useState(null),[x,w]=s.useState(0),[S,C]=s.useState(0),[E,R]=s.useState(!1),[b,A]=s.useState(!1),T=$(t,D=>l(D)),O=rn(o);return m.jsx(Zm,{scope:n,type:r,dir:O,scrollHideDelay:i,scrollArea:c,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:R,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:b,onScrollbarYEnabledChange:A,onCornerWidthChange:w,onCornerHeightChange:C,children:m.jsx(St.div,{dir:O,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});Vs.displayName=ur;var Bs="ScrollAreaViewport",Hs=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=ce(Bs,n),c=s.useRef(null),l=$(t,c,a.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),m.jsx(St.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Hs.displayName=Bs;var xe="ScrollAreaScrollbar",qm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,c=e.orientation==="horizontal";return s.useEffect(()=>(c?i(!0):a(!0),()=>{c?i(!1):a(!1)}),[c,i,a]),o.type==="hover"?m.jsx(Qm,{...r,ref:t,forceMount:n}):o.type==="scroll"?m.jsx(Jm,{...r,ref:t,forceMount:n}):o.type==="auto"?m.jsx(Us,{...r,ref:t,forceMount:n}):o.type==="always"?m.jsx(fr,{...r,ref:t}):null});qm.displayName=xe;var Qm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),[i,a]=s.useState(!1);return s.useEffect(()=>{const c=o.scrollArea;let l=0;if(c){const u=()=>{window.clearTimeout(l),a(!0)},d=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(q,{present:n||i,children:m.jsx(Us,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Jm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),i=e.orientation==="horizontal",a=pn(()=>l("SCROLL_END"),100),[c,l]=Xm("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,o.scrollHideDelay,l]),s.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const h=u[d];f!==h&&(l("SCROLL"),a()),f=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,l,a]),m.jsx(q,{present:n||c!=="hidden",children:m.jsx(fr,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:P(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:P(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Us=s.forwardRef((e,t)=>{const n=ce(xe,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=s.useState(!1),c=e.orientation==="horizontal",l=pn(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?u:d)}},10);return Ye(n.viewport,l),Ye(n.content,l),m.jsx(q,{present:r||i,children:m.jsx(fr,{"data-state":i?"visible":"hidden",...o,ref:t})})}),fr=s.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ce(xe,e.__scopeScrollArea),i=s.useRef(null),a=s.useRef(0),[c,l]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Ys(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function f(p,h){return sv(p,a.current,c,h)}return n==="horizontal"?m.jsx(ev,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=Vr(p,c,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?m.jsx(tv,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=Vr(p,c);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),ev=s.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ce(xe,e.__scopeScrollArea),[a,c]=s.useState(),l=s.useRef(null),u=$(t,l,i.onScrollbarXChange);return s.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(Gs,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dn(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Zs(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Bt(a.paddingLeft),paddingEnd:Bt(a.paddingRight)}})}})}),tv=s.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ce(xe,e.__scopeScrollArea),[a,c]=s.useState(),l=s.useRef(null),u=$(t,l,i.onScrollbarYChange);return s.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(Gs,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dn(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Zs(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Bt(a.paddingTop),paddingEnd:Bt(a.paddingBottom)}})}})}),[nv,Ks]=Ws(xe),Gs=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,h=ce(xe,n),[g,v]=s.useState(null),y=$(t,T=>v(T)),x=s.useRef(null),w=s.useRef(""),S=h.viewport,C=r.content-r.viewport,E=Z(d),R=Z(l),b=pn(f,10);function A(T){if(x.current){const O=T.clientX-x.current.left,D=T.clientY-x.current.top;u({x:O,y:D})}}return s.useEffect(()=>{const T=O=>{const D=O.target;(g==null?void 0:g.contains(D))&&E(O,C)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[S,g,C,E]),s.useEffect(R,[r,R]),Ye(g,b),Ye(h.content,b),m.jsx(nv,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:Z(i),onThumbPointerUp:Z(a),onThumbPositionChange:R,onThumbPointerDown:Z(c),children:m.jsx(St.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:P(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),x.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),A(T))}),onPointerMove:P(e.onPointerMove,A),onPointerUp:P(e.onPointerUp,T=>{const O=T.target;O.hasPointerCapture(T.pointerId)&&O.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),Vt="ScrollAreaThumb",rv=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ks(Vt,e.__scopeScrollArea);return m.jsx(q,{present:n||o.hasThumb,children:m.jsx(ov,{ref:t,...r})})}),ov=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ce(Vt,n),a=Ks(Vt,n),{onThumbPositionChange:c}=a,l=$(t,f=>a.onThumbChange(f)),u=s.useRef(void 0),d=pn(()=>{u.current&&(u.current(),u.current=void 0)},100);return s.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(d(),!u.current){const h=cv(f,c);u.current=h,c()}};return c(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,d,c]),m.jsx(St.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:P(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),g=f.clientX-h.left,v=f.clientY-h.top;a.onThumbPointerDown({x:g,y:v})}),onPointerUp:P(e.onPointerUp,a.onThumbPointerUp)})});rv.displayName=Vt;var dr="ScrollAreaCorner",zs=s.forwardRef((e,t)=>{const n=ce(dr,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(iv,{...e,ref:t}):null});zs.displayName=dr;var iv=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ce(dr,n),[i,a]=s.useState(0),[c,l]=s.useState(0),u=!!(i&&c);return Ye(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),Ye(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),u?m.jsx(St.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bt(e){return e?parseInt(e,10):0}function Ys(e,t){const n=e/t;return isNaN(n)?0:n}function dn(e){const t=Ys(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function sv(e,t,n,r="ltr"){const o=dn(n),i=o/2,a=t||i,c=o-a,l=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return Xs([l,u],f)(e)}function Vr(e,t,n="ltr"){const r=dn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,c=i-r,l=n==="ltr"?[0,a]:[a*-1,0],u=Dn(e,l);return Xs([0,a],[0,c])(u)}function Xs(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Zs(e,t){return e>0&&e<t}var cv=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,c=n.top!==i.top;(a||c)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function pn(e,t){const n=Z(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ye(e,t){const n=Z(t);Y(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var sh=Vs,ch=Hs,ah=zs;export{qm as $,Gv as A,zv as B,mv as C,bv as D,Xv as E,Wv as F,Zv as G,Qv as H,Nv as I,qv as J,th as K,Ov as L,Bv as M,Uv as N,wv as O,fv as P,oh as Q,dv as R,vv as S,pv as T,ih as U,Yv as V,nh as W,rh as X,sh as Y,ch as Z,ah as _,hv as a,rv as a0,xv as b,Sv as c,Ev as d,Cv as e,yv as f,jv as g,Lv as h,Av as i,Tv as j,Iv as k,Dv as l,Mv as m,$v as n,Rv as o,_v as p,Fv as q,kv as r,kp as s,dt as t,le as u,Vv as v,Hv as w,Kv as x,Jv as y,eh as z};
|