var qpe=Object.defineProperty;var cq=e=>{throw TypeError(e)};var Gpe=(e,t,n)=>t in e?qpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Be=(e,t,n)=>Gpe(e,typeof t!="symbol"?t+"":t,n),d3=(e,t,n)=>t.has(e)||cq("Cannot "+n);var P=(e,t,n)=>(d3(e,t,"read from private field"),n?n.call(e):t.get(e)),G=(e,t,n)=>t.has(e)?cq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(d3(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),K=(e,t,n)=>(d3(e,t,"access private method"),n);var Ui=(e,t,n,r)=>({set _(s){V(e,t,s,n)},get _(){return P(e,t,r)}});function AX(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kpe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var RX={exports:{}},Uk={},PX={exports:{}},ln={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var AA=Symbol.for("react.element"),Ype=Symbol.for("react.portal"),Xpe=Symbol.for("react.fragment"),Qpe=Symbol.for("react.strict_mode"),Zpe=Symbol.for("react.profiler"),Jpe=Symbol.for("react.provider"),eme=Symbol.for("react.context"),tme=Symbol.for("react.forward_ref"),nme=Symbol.for("react.suspense"),rme=Symbol.for("react.memo"),sme=Symbol.for("react.lazy"),uq=Symbol.iterator;function ime(e){return e===null||typeof e!="object"?null:(e=uq&&e[uq]||e["@@iterator"],typeof e=="function"?e:null)}var NX={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TX=Object.assign,kX={};function Ex(e,t,n){this.props=e,this.context=t,this.refs=kX,this.updater=n||NX}Ex.prototype.isReactComponent={};Ex.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ex.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function DX(){}DX.prototype=Ex.prototype;function EV(e,t,n){this.props=e,this.context=t,this.refs=kX,this.updater=n||NX}var AV=EV.prototype=new DX;AV.constructor=EV;TX(AV,Ex.prototype);AV.isPureReactComponent=!0;var dq=Array.isArray,OX=Object.prototype.hasOwnProperty,RV={current:null},MX={key:!0,ref:!0,__self:!0,__source:!0};function IX(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)OX.call(t,r)&&!MX.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,J=H[re];if(0>>1;res(be,he))xes(ve,be)?(H[re]=ve,H[xe]=he,re=xe):(H[re]=be,H[ae]=he,re=ae);else if(xes(ve,he))H[re]=ve,H[xe]=he,re=xe;else break e}}return se}function s(H,se){var he=H.sortIndex-se.sortIndex;return he!==0?he:H.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],d=[],h=1,u=null,f=3,g=!1,v=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(H){for(var se=n(d);se!==null;){if(se.callback===null)r(d);else if(se.startTime<=H)r(d),se.sortIndex=se.expirationTime,t(c,se);else break;se=n(d)}}function E(H){if(m=!1,w(H),!v)if(n(c)!==null)v=!0,Z(R);else{var se=n(d);se!==null&&Y(E,se.startTime-H)}}function R(H,se){v=!1,m&&(m=!1,y(A),A=-1),g=!0;var he=f;try{for(w(se),u=n(c);u!==null&&(!(u.expirationTime>se)||H&&!I());){var re=u.callback;if(typeof re=="function"){u.callback=null,f=u.priorityLevel;var J=re(u.expirationTime<=se);se=e.unstable_now(),typeof J=="function"?u.callback=J:u===n(c)&&r(c),w(se)}else r(c);u=n(c)}if(u!==null)var te=!0;else{var ae=n(d);ae!==null&&Y(E,ae.startTime-se),te=!1}return te}finally{u=null,f=he,g=!1}}var T=!1,N=null,A=-1,D=5,O=-1;function I(){return!(e.unstable_now()-OH||125re?(H.sortIndex=he,t(d,H),n(c)===null&&H===n(d)&&(m?(y(A),A=-1):m=!0,Y(E,he-re))):(H.sortIndex=J,t(c,H),v||g||(v=!0,Z(R))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var se=f;return function(){var he=f;f=se;try{return H.apply(this,arguments)}finally{f=he}}}})(zX);FX.exports=zX;var gme=FX.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var vme=C,Qa=gme;function Ve(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pz=Object.prototype.hasOwnProperty,yme=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hq={},pq={};function bme(e){return Pz.call(pq,e)?!0:Pz.call(hq,e)?!1:yme.test(e)?pq[e]=!0:(hq[e]=!0,!1)}function xme(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _me(e,t,n,r){if(t===null||typeof t>"u"||xme(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mo(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Fi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fi[e]=new Mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fi[t]=new Mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fi[e]=new Mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fi[e]=new Mo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fi[e]=new Mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fi[e]=new Mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fi[e]=new Mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fi[e]=new Mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fi[e]=new Mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var NV=/[\-:]([a-z])/g;function TV(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(NV,TV);Fi[t]=new Mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(NV,TV);Fi[t]=new Mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(NV,TV);Fi[t]=new Mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Fi.xlinkHref=new Mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function kV(e,t,n,r){var s=Fi.hasOwnProperty(t)?Fi[t]:null;(s!==null?s.type!==0:r||!(2a||s[o]!==i[a]){var c=` `+s[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{p3=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?r1(e):""}function wme(e){switch(e.tag){case 5:return r1(e.type);case 16:return r1("Lazy");case 13:return r1("Suspense");case 19:return r1("SuspenseList");case 0:case 2:case 15:return e=m3(e.type,!1),e;case 11:return e=m3(e.type.render,!1),e;case 1:return e=m3(e.type,!0),e;default:return""}}function Dz(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ib:return"Fragment";case sb:return"Portal";case Nz:return"Profiler";case DV:return"StrictMode";case Tz:return"Suspense";case kz:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case VX:return(e.displayName||"Context")+".Consumer";case UX:return(e._context.displayName||"Context")+".Provider";case OV:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case MV:return t=e.displayName||null,t!==null?t:Dz(e.type)||"Memo";case lh:t=e._payload,e=e._init;try{return Dz(e(t))}catch{}}return null}function Sme(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dz(t);case 8:return t===DV?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fp(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function WX(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cme(e){var t=WX(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function OR(e){e._valueTracker||(e._valueTracker=Cme(e))}function qX(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=WX(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function BN(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Oz(e,t){var n=t.checked;return is({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gq(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fp(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function GX(e,t){t=t.checked,t!=null&&kV(e,"checked",t,!1)}function Mz(e,t){GX(e,t);var n=fp(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Iz(e,t.type,n):t.hasOwnProperty("defaultValue")&&Iz(e,t.type,fp(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vq(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Iz(e,t,n){(t!=="number"||BN(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var s1=Array.isArray;function xb(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=MR.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function eC(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var T1={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Eme=["Webkit","ms","Moz","O"];Object.keys(T1).forEach(function(e){Eme.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),T1[t]=T1[e]})});function QX(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||T1.hasOwnProperty(e)&&T1[e]?(""+t).trim():t+"px"}function ZX(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=QX(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Ame=is({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $z(e,t){if(t){if(Ame[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ve(62))}}function Fz(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zz=null;function IV(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bz=null,_b=null,wb=null;function xq(e){if(e=NA(e)){if(typeof Bz!="function")throw Error(Ve(280));var t=e.stateNode;t&&(t=Gk(t),Bz(e.stateNode,e.type,t))}}function JX(e){_b?wb?wb.push(e):wb=[e]:_b=e}function eQ(){if(_b){var e=_b,t=wb;if(wb=_b=null,xq(e),t)for(e=0;e>>=0,e===0?32:31-(jme(e)/$me|0)|0}var IR=64,LR=4194304;function i1(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function WN(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=i1(a):(i&=o,i!==0&&(r=i1(i)))}else o=n&~s,o!==0?r=i1(o):i!==0&&(r=i1(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function RA(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bc(t),e[t]=n}function Ume(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=D1),Nq=" ",Tq=!1;function xQ(e,t){switch(e){case"keyup":return gge.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _Q(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ob=!1;function yge(e,t){switch(e){case"compositionend":return _Q(t);case"keypress":return t.which!==32?null:(Tq=!0,Nq);case"textInput":return e=t.data,e===Nq&&Tq?null:e;default:return null}}function bge(e,t){if(ob)return e==="compositionend"||!VV&&xQ(e,t)?(e=yQ(),zP=zV=Xh=null,ob=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mq(n)}}function EQ(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?EQ(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function AQ(){for(var e=window,t=BN();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=BN(e.document)}return t}function HV(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Pge(e){var t=AQ(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&EQ(n.ownerDocument.documentElement,n)){if(r!==null&&HV(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Iq(n,i);var o=Iq(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ab=null,Gz=null,M1=null,Kz=!1;function Lq(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kz||ab==null||ab!==BN(r)||(r=ab,"selectionStart"in r&&HV(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),M1&&oC(M1,r)||(M1=r,r=KN(Gz,"onSelect"),0ub||(e.current=eB[ub],eB[ub]=null,ub--)}function Ar(e,t){ub++,eB[ub]=e.current,e.current=t}var hp={},so=Ap(hp),ta=Ap(!1),kv=hp;function Z0(e,t){var n=e.type.contextTypes;if(!n)return hp;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function na(e){return e=e.childContextTypes,e!=null}function XN(){Ur(ta),Ur(so)}function Vq(e,t,n){if(so.current!==hp)throw Error(Ve(168));Ar(so,t),Ar(ta,n)}function IQ(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(Ve(108,Sme(e)||"Unknown",s));return is({},n,r)}function QN(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hp,kv=so.current,Ar(so,e),Ar(ta,ta.current),!0}function Hq(e,t,n){var r=e.stateNode;if(!r)throw Error(Ve(169));n?(e=IQ(e,t,kv),r.__reactInternalMemoizedMergedChildContext=e,Ur(ta),Ur(so),Ar(so,e)):Ur(ta),Ar(ta,n)}var Vd=null,Kk=!1,N3=!1;function LQ(e){Vd===null?Vd=[e]:Vd.push(e)}function zge(e){Kk=!0,LQ(e)}function Rp(){if(!N3&&Vd!==null){N3=!0;var e=0,t=rr;try{var n=Vd;for(rr=1;e>=o,s-=o,xf=1<<32-bc(t)+s|n<A?(D=N,N=null):D=N.sibling;var O=f(y,N,w[A],E);if(O===null){N===null&&(N=D);break}e&&N&&O.alternate===null&&t(y,N),b=i(O,b,A),T===null?R=O:T.sibling=O,T=O,N=D}if(A===w.length)return n(y,N),Gr&&Jm(y,A),R;if(N===null){for(;AA?(D=N,N=null):D=N.sibling;var I=f(y,N,O.value,E);if(I===null){N===null&&(N=D);break}e&&N&&I.alternate===null&&t(y,N),b=i(I,b,A),T===null?R=I:T.sibling=I,T=I,N=D}if(O.done)return n(y,N),Gr&&Jm(y,A),R;if(N===null){for(;!O.done;A++,O=w.next())O=u(y,O.value,E),O!==null&&(b=i(O,b,A),T===null?R=O:T.sibling=O,T=O);return Gr&&Jm(y,A),R}for(N=r(y,N);!O.done;A++,O=w.next())O=g(N,y,A,O.value,E),O!==null&&(e&&O.alternate!==null&&N.delete(O.key===null?A:O.key),b=i(O,b,A),T===null?R=O:T.sibling=O,T=O);return e&&N.forEach(function($){return t(y,$)}),Gr&&Jm(y,A),R}function x(y,b,w,E){if(typeof w=="object"&&w!==null&&w.type===ib&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case DR:e:{for(var R=w.key,T=b;T!==null;){if(T.key===R){if(R=w.type,R===ib){if(T.tag===7){n(y,T.sibling),b=s(T,w.props.children),b.return=y,y=b;break e}}else if(T.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===lh&&Gq(R)===T.type){n(y,T.sibling),b=s(T,w.props),b.ref=TS(y,T,w),b.return=y,y=b;break e}n(y,T);break}else t(y,T);T=T.sibling}w.type===ib?(b=Sv(w.props.children,y.mode,E,w.key),b.return=y,y=b):(E=KP(w.type,w.key,w.props,null,y.mode,E),E.ref=TS(y,b,w),E.return=y,y=E)}return o(y);case sb:e:{for(T=w.key;b!==null;){if(b.key===T)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=s(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=j3(w,y.mode,E),b.return=y,y=b}return o(y);case lh:return T=w._init,x(y,b,T(w._payload),E)}if(s1(w))return v(y,b,w,E);if(ES(w))return m(y,b,w,E);VR(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,w),b.return=y,y=b):(n(y,b),b=L3(w,y.mode,E),b.return=y,y=b),o(y)):n(y,b)}return x}var ex=zQ(!0),BQ=zQ(!1),eT=Ap(null),tT=null,hb=null,KV=null;function YV(){KV=hb=tT=null}function XV(e){var t=eT.current;Ur(eT),e._currentValue=t}function rB(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Cb(e,t){tT=e,KV=hb=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xo=!0),e.firstContext=null)}function Sl(e){var t=e._currentValue;if(KV!==e)if(e={context:e,memoizedValue:t,next:null},hb===null){if(tT===null)throw Error(Ve(308));hb=e,tT.dependencies={lanes:0,firstContext:e}}else hb=hb.next=e;return t}var ug=null;function QV(e){ug===null?ug=[e]:ug.push(e)}function UQ(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,QV(t)):(n.next=s.next,s.next=n),t.interleaved=n,Mf(e,r)}function Mf(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ch=!1;function ZV(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function VQ(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Sf(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sp(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Rn&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Mf(e,n)}return s=r.interleaved,s===null?(t.next=t,QV(r)):(t.next=s.next,s.next=t),r.interleaved=t,Mf(e,n)}function UP(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jV(e,n)}}function Kq(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function nT(e,t,n,r){var s=e.updateQueue;ch=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=d:a.next=d,h.lastBaseUpdate=c))}if(i!==null){var u=s.baseState;o=0,h=d=c=null,a=i;do{var f=a.lane,g=a.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,m=a;switch(f=t,g=n,m.tag){case 1:if(v=m.payload,typeof v=="function"){u=v.call(g,u,f);break e}u=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,f=typeof v=="function"?v.call(g,u,f):v,f==null)break e;u=is({},u,f);break e;case 2:ch=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else g={eventTime:g,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(d=h=g,c=u):h=h.next=g,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(h===null&&(c=u),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Mv|=o,e.lanes=o,e.memoizedState=u}}function Yq(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=k3.transition;k3.transition={};try{e(!1),t()}finally{rr=n,k3.transition=r}}function oZ(){return Cl().memoizedState}function Hge(e,t,n){var r=op(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},aZ(e))lZ(t,n);else if(n=UQ(e,t,n,r),n!==null){var s=To();xc(n,e,r,s),cZ(n,t,r)}}function Wge(e,t,n){var r=op(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(aZ(e))lZ(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Sc(a,o)){var c=t.interleaved;c===null?(s.next=s,QV(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=UQ(e,t,s,r),n!==null&&(s=To(),xc(n,e,r,s),cZ(n,t,r))}}function aZ(e){var t=e.alternate;return e===ss||t!==null&&t===ss}function lZ(e,t){I1=sT=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cZ(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jV(e,n)}}var iT={readContext:Sl,useCallback:Vi,useContext:Vi,useEffect:Vi,useImperativeHandle:Vi,useInsertionEffect:Vi,useLayoutEffect:Vi,useMemo:Vi,useReducer:Vi,useRef:Vi,useState:Vi,useDebugValue:Vi,useDeferredValue:Vi,useTransition:Vi,useMutableSource:Vi,useSyncExternalStore:Vi,useId:Vi,unstable_isNewReconciler:!1},qge={readContext:Sl,useCallback:function(e,t){return Vc().memoizedState=[e,t===void 0?null:t],e},useContext:Sl,useEffect:Qq,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,HP(4194308,4,tZ.bind(null,t,e),n)},useLayoutEffect:function(e,t){return HP(4194308,4,e,t)},useInsertionEffect:function(e,t){return HP(4,2,e,t)},useMemo:function(e,t){var n=Vc();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vc();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Hge.bind(null,ss,e),[r.memoizedState,e]},useRef:function(e){var t=Vc();return e={current:e},t.memoizedState=e},useState:Xq,useDebugValue:oH,useDeferredValue:function(e){return Vc().memoizedState=e},useTransition:function(){var e=Xq(!1),t=e[0];return e=Vge.bind(null,e[1]),Vc().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ss,s=Vc();if(Gr){if(n===void 0)throw Error(Ve(407));n=n()}else{if(n=t(),fi===null)throw Error(Ve(349));Ov&30||GQ(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Qq(YQ.bind(null,r,i,e),[e]),r.flags|=2048,pC(9,KQ.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vc(),t=fi.identifierPrefix;if(Gr){var n=_f,r=xf;n=(r&~(1<<32-bc(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fC++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[hu]=t,e[cC]=r,bZ(e,t,!1,!1),t.stateNode=e;e:{switch(o=Fz(n,r),n){case"dialog":Fr("cancel",e),Fr("close",e),s=r;break;case"iframe":case"object":case"embed":Fr("load",e),s=r;break;case"video":case"audio":for(s=0;srx&&(t.flags|=128,r=!0,kS(i,!1),t.lanes=4194304)}else{if(!r)if(e=rT(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kS(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Gr)return Hi(t),null}else 2*_s()-i.renderingStartTime>rx&&n!==1073741824&&(t.flags|=128,r=!0,kS(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=_s(),t.sibling=null,n=rs.current,Ar(rs,r?n&1|2:n&1),t):(Hi(t),null);case 22:case 23:return fH(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?za&1073741824&&(Hi(t),t.subtreeFlags&6&&(t.flags|=8192)):Hi(t),null;case 24:return null;case 25:return null}throw Error(Ve(156,t.tag))}function eve(e,t){switch(qV(t),t.tag){case 1:return na(t.type)&&XN(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tx(),Ur(ta),Ur(so),tH(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return eH(t),null;case 13:if(Ur(rs),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ve(340));J0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ur(rs),null;case 4:return tx(),null;case 10:return XV(t.type._context),null;case 22:case 23:return fH(),null;case 24:return null;default:return null}}var WR=!1,eo=!1,tve=typeof WeakSet=="function"?WeakSet:Set,ct=null;function pb(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ds(e,t,r)}else n.current=null}function fB(e,t,n){try{n()}catch(r){ds(e,t,r)}}var lG=!1;function nve(e,t){if(Yz=qN,e=AQ(),HV(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,d=0,h=0,u=e,f=null;t:for(;;){for(var g;u!==n||s!==0&&u.nodeType!==3||(a=o+s),u!==i||r!==0&&u.nodeType!==3||(c=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(g=u.firstChild)!==null;)f=u,u=g;for(;;){if(u===e)break t;if(f===n&&++d===s&&(a=o),f===i&&++h===r&&(c=o),(g=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=g}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xz={focusedElem:e,selectionRange:n},qN=!1,ct=t;ct!==null;)if(t=ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ct=e;else for(;ct!==null;){t=ct;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,x=v.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Kl(t.type,m),x);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ve(163))}}catch(E){ds(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,ct=e;break}ct=t.return}return v=lG,lG=!1,v}function L1(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&fB(t,n,i)}s=s.next}while(s!==r)}}function Qk(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hB(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wZ(e){var t=e.alternate;t!==null&&(e.alternate=null,wZ(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hu],delete t[cC],delete t[Jz],delete t[$ge],delete t[Fge])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function SZ(e){return e.tag===5||e.tag===3||e.tag===4}function cG(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SZ(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pB(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=YN));else if(r!==4&&(e=e.child,e!==null))for(pB(e,t,n),e=e.sibling;e!==null;)pB(e,t,n),e=e.sibling}function mB(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(mB(e,t,n),e=e.sibling;e!==null;)mB(e,t,n),e=e.sibling}var ki=null,dc=!1;function Yf(e,t,n){for(n=n.child;n!==null;)CZ(e,t,n),n=n.sibling}function CZ(e,t,n){if(_u&&typeof _u.onCommitFiberUnmount=="function")try{_u.onCommitFiberUnmount(Vk,n)}catch{}switch(n.tag){case 5:eo||pb(n,t);case 6:var r=ki,s=dc;ki=null,Yf(e,t,n),ki=r,dc=s,ki!==null&&(dc?(e=ki,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ki.removeChild(n.stateNode));break;case 18:ki!==null&&(dc?(e=ki,n=n.stateNode,e.nodeType===8?P3(e.parentNode,n):e.nodeType===1&&P3(e,n),sC(e)):P3(ki,n.stateNode));break;case 4:r=ki,s=dc,ki=n.stateNode.containerInfo,dc=!0,Yf(e,t,n),ki=r,dc=s;break;case 0:case 11:case 14:case 15:if(!eo&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&fB(n,t,o),s=s.next}while(s!==r)}Yf(e,t,n);break;case 1:if(!eo&&(pb(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ds(n,t,a)}Yf(e,t,n);break;case 21:Yf(e,t,n);break;case 22:n.mode&1?(eo=(r=eo)||n.memoizedState!==null,Yf(e,t,n),eo=r):Yf(e,t,n);break;default:Yf(e,t,n)}}function uG(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tve),t.forEach(function(r){var s=dve.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ql(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=_s()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sve(r/1960))-r,10e?16:e,Qh===null)var r=!1;else{if(e=Qh,Qh=null,lT=0,Rn&6)throw Error(Ve(331));var s=Rn;for(Rn|=4,ct=e.current;ct!==null;){var i=ct,o=i.child;if(ct.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c_s()-uH?wv(e,0):cH|=n),ra(e,t)}function DZ(e,t){t===0&&(e.mode&1?(t=LR,LR<<=1,!(LR&130023424)&&(LR=4194304)):t=1);var n=To();e=Mf(e,t),e!==null&&(RA(e,t,n),ra(e,n))}function uve(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),DZ(e,n)}function dve(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ve(314))}r!==null&&r.delete(t),DZ(e,n)}var OZ;OZ=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ta.current)Xo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xo=!1,Zge(e,t,n);Xo=!!(e.flags&131072)}else Xo=!1,Gr&&t.flags&1048576&&jQ(t,JN,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;WP(e,t),e=t.pendingProps;var s=Z0(t,so.current);Cb(t,n),s=rH(null,t,r,e,s,n);var i=sH();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,na(r)?(i=!0,QN(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ZV(t),s.updater=Xk,t.stateNode=s,s._reactInternals=t,iB(t,r,e,n),t=lB(null,t,r,!0,i,n)):(t.tag=0,Gr&&i&&WV(t),So(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(WP(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=hve(r),e=Kl(r,e),s){case 0:t=aB(null,t,r,e,n);break e;case 1:t=iG(null,t,r,e,n);break e;case 11:t=rG(null,t,r,e,n);break e;case 14:t=sG(null,t,r,Kl(r.type,e),n);break e}throw Error(Ve(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),aB(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),iG(e,t,r,s,n);case 3:e:{if(gZ(t),e===null)throw Error(Ve(387));r=t.pendingProps,i=t.memoizedState,s=i.element,VQ(e,t),nT(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=nx(Error(Ve(423)),t),t=oG(e,t,r,n,s);break e}else if(r!==s){s=nx(Error(Ve(424)),t),t=oG(e,t,r,n,s);break e}else for(qa=rp(t.stateNode.containerInfo.firstChild),Ga=t,Gr=!0,hc=null,n=BQ(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(J0(),r===s){t=If(e,t,n);break e}So(e,t,r,n)}t=t.child}return t;case 5:return HQ(t),e===null&&nB(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Qz(r,s)?o=null:i!==null&&Qz(r,i)&&(t.flags|=32),mZ(e,t),So(e,t,o,n),t.child;case 6:return e===null&&nB(t),null;case 13:return vZ(e,t,n);case 4:return JV(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ex(t,null,r,n):So(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),rG(e,t,r,s,n);case 7:return So(e,t,t.pendingProps,n),t.child;case 8:return So(e,t,t.pendingProps.children,n),t.child;case 12:return So(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,Ar(eT,r._currentValue),r._currentValue=o,i!==null)if(Sc(i.value,o)){if(i.children===s.children&&!ta.current){t=If(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Sf(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?c.next=c:(c.next=h.next,h.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),rB(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(Ve(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),rB(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}So(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Cb(t,n),s=Sl(s),r=r(s),t.flags|=1,So(e,t,r,n),t.child;case 14:return r=t.type,s=Kl(r,t.pendingProps),s=Kl(r.type,s),sG(e,t,r,s,n);case 15:return hZ(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),WP(e,t),t.tag=1,na(r)?(e=!0,QN(t)):e=!1,Cb(t,n),uZ(t,r,s),iB(t,r,s,n),lB(null,t,r,!0,e,n);case 19:return yZ(e,t,n);case 22:return pZ(e,t,n)}throw Error(Ve(156,t.tag))};function MZ(e,t){return aQ(e,t)}function fve(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bl(e,t,n,r){return new fve(e,t,n,r)}function pH(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hve(e){if(typeof e=="function")return pH(e)?1:0;if(e!=null){if(e=e.$$typeof,e===OV)return 11;if(e===MV)return 14}return 2}function ap(e,t){var n=e.alternate;return n===null?(n=bl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function KP(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")pH(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ib:return Sv(n.children,s,i,t);case DV:o=8,s|=8;break;case Nz:return e=bl(12,n,t,s|2),e.elementType=Nz,e.lanes=i,e;case Tz:return e=bl(13,n,t,s),e.elementType=Tz,e.lanes=i,e;case kz:return e=bl(19,n,t,s),e.elementType=kz,e.lanes=i,e;case HX:return Jk(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case UX:o=10;break e;case VX:o=9;break e;case OV:o=11;break e;case MV:o=14;break e;case lh:o=16,r=null;break e}throw Error(Ve(130,e==null?e:typeof e,""))}return t=bl(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Sv(e,t,n,r){return e=bl(7,e,r,t),e.lanes=n,e}function Jk(e,t,n,r){return e=bl(22,e,r,t),e.elementType=HX,e.lanes=n,e.stateNode={isHidden:!1},e}function L3(e,t,n){return e=bl(6,e,null,t),e.lanes=n,e}function j3(e,t,n){return t=bl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pve(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v3(0),this.expirationTimes=v3(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v3(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function mH(e,t,n,r,s,i,o,a,c){return e=new pve(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=bl(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ZV(i),e}function mve(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($Z)}catch(e){console.error(e)}}$Z(),$X.exports=el;var Li=$X.exports;const kA=Al(Li),xve=AX({__proto__:null,default:kA},[Li]);var yG=Li;Rz.createRoot=yG.createRoot,Rz.hydrateRoot=yG.hydrateRoot;const FZ=C.createContext({}),_ve=({children:e,authActions:t})=>{const n=i=>{var o;try{return Promise.resolve((o=t.login)==null?void 0:o.call(t,i))}catch(a){return console.error(a),Promise.reject(a)}},r=i=>{var o;try{return Promise.resolve((o=t.logout)==null?void 0:o.call(t,i))}catch(a){return console.error(a),Promise.reject(a)}},s=async()=>{var i;try{return Promise.resolve((i=t.check)==null?void 0:i.call(t))}catch(o){return console.error(o),Promise.reject(o)}};return _.jsx(FZ.Provider,{value:{...t,login:n,logout:r,check:s},children:e})},sD=()=>{const e=C.useContext(FZ);if(e===null)throw new Error("useAuth must be used within a AuthProvider");return e};var Px=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(){}},Lv=typeof window>"u"||"Deno"in globalThis;function cl(){}function wve(e,t){return typeof e=="function"?e(t):e}function xB(e){return typeof e=="number"&&e>=0&&e!==1/0}function zZ(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ab(e,t){return typeof e=="function"?e(t):e}function pc(e,t){return typeof e=="function"?e(t):e}function bG(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==bH(o,t.options))return!1}else if(!gC(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function xG(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(jv(t.options.mutationKey)!==jv(i))return!1}else if(!gC(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function bH(e,t){return((t==null?void 0:t.queryKeyHashFn)||jv)(e)}function jv(e){return JSON.stringify(e,(t,n)=>_B(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function gC(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>gC(e[n],t[n])):!1}function BZ(e,t){if(e===t)return e;const n=_G(e)&&_G(t);if(n||_B(e)&&_B(t)){const r=n?e:Object.keys(e),s=r.length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{};let c=0;for(let d=0;d{setTimeout(t,e)})}function wB(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BZ(e,t):t}function UZ(e){return e}function Cve(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Eve(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xH=Symbol();function VZ(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xH?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var bg,xh,Vb,pX,Ave=(pX=class extends Px{constructor(){super();G(this,bg);G(this,xh);G(this,Vb);V(this,Vb,t=>{if(!Lv&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,xh)||this.setEventListener(P(this,Vb))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,xh))==null||t.call(this),V(this,xh,void 0))}setEventListener(t){var n;V(this,Vb,t),(n=P(this,xh))==null||n.call(this),V(this,xh,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,bg)!==t&&(V(this,bg,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,bg)=="boolean"?P(this,bg):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},bg=new WeakMap,xh=new WeakMap,Vb=new WeakMap,pX),_H=new Ave,Hb,_h,Wb,mX,Rve=(mX=class extends Px{constructor(){super();G(this,Hb,!0);G(this,_h);G(this,Wb);V(this,Wb,t=>{if(!Lv&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,_h)||this.setEventListener(P(this,Wb))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,_h))==null||t.call(this),V(this,_h,void 0))}setEventListener(t){var n;V(this,Wb,t),(n=P(this,_h))==null||n.call(this),V(this,_h,t(this.setOnline.bind(this)))}setOnline(t){P(this,Hb)!==t&&(V(this,Hb,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,Hb)}},Hb=new WeakMap,_h=new WeakMap,Wb=new WeakMap,mX),fT=new Rve;function SB(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function Pve(e){return Math.min(1e3*2**e,3e4)}function HZ(e){return(e??"online")==="online"?fT.isOnline():!0}var WZ=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $3(e){return e instanceof WZ}function qZ(e){let t=!1,n=0,r=!1,s;const i=SB(),o=m=>{var x;r||(f(new WZ(m)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},c=()=>{t=!1},d=()=>_H.isFocused()&&(e.networkMode==="always"||fT.isOnline())&&e.canRun(),h=()=>HZ(e.networkMode)&&e.canRun(),u=m=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,m),s==null||s(),i.resolve(m))},f=m=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,m),s==null||s(),i.reject(m))},g=()=>new Promise(m=>{var x;s=y=>{(r||d())&&m(y)},(x=e.onPause)==null||x.call(e)}).then(()=>{var m;s=void 0,r||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(r)return;let m;const x=n===0?e.initialPromise:void 0;try{m=x??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(u).catch(y=>{var T;if(r)return;const b=e.retry??(Lv?0:3),w=e.retryDelay??Pve,E=typeof w=="function"?w(n,y):w,R=b===!0||typeof b=="number"&&nd()?void 0:g()).then(()=>{t?f(y):v()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:c,canStart:h,start:()=>(h()?v():g().then(v),i)}}var Nve=e=>setTimeout(e,0);function Tve(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=Nve;const i=a=>{t?e.push(a):s(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var ti=Tve(),xg,gX,GZ=(gX=class{constructor(){G(this,xg)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xB(this.gcTime)&&V(this,xg,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lv?1/0:5*60*1e3))}clearGcTimeout(){P(this,xg)&&(clearTimeout(P(this,xg)),V(this,xg,void 0))}},xg=new WeakMap,gX),qb,Gb,sl,_g,Xi,HC,wg,Xl,Id,vX,kve=(vX=class extends GZ{constructor(t){super();G(this,Xl);G(this,qb);G(this,Gb);G(this,sl);G(this,_g);G(this,Xi);G(this,HC);G(this,wg);V(this,wg,!1),V(this,HC,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,_g,t.client),V(this,sl,P(this,_g).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,qb,Dve(this.options)),this.state=t.state??P(this,qb),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,Xi))==null?void 0:t.promise}setOptions(t){this.options={...P(this,HC),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,sl).remove(this)}setData(t,n){const r=wB(this.state.data,t,this.options);return K(this,Xl,Id).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){K(this,Xl,Id).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=P(this,Xi))==null?void 0:r.promise;return(s=P(this,Xi))==null||s.cancel(t),n?n.then(cl).catch(cl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,qb))}isActive(){return this.observers.some(t=>pc(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xH||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!zZ(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Xi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Xi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,sl).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,Xi)&&(P(this,wg)?P(this,Xi).cancel({revert:!0}):P(this,Xi).cancelRetry()),this.scheduleGc()),P(this,sl).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||K(this,Xl,Id).call(this,{type:"invalidate"})}fetch(t,n){var c,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,Xi))return P(this,Xi).continueRetry(),P(this,Xi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(f=>f.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,s=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(V(this,wg,!0),r.signal)})},i=()=>{const u=VZ(this.options,n),f={client:P(this,_g),queryKey:this.queryKey,meta:this.meta};return s(f),V(this,wg,!1),this.options.persister?this.options.persister(u,f,this):u(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,_g),state:this.state,fetchFn:i};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),V(this,Gb,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&K(this,Xl,Id).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const a=u=>{var f,g,v,m;$3(u)&&u.silent||K(this,Xl,Id).call(this,{type:"error",error:u}),$3(u)||((g=(f=P(this,sl).config).onError)==null||g.call(f,u,this),(m=(v=P(this,sl).config).onSettled)==null||m.call(v,this.state.data,u,this)),this.scheduleGc()};return V(this,Xi,qZ({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var f,g,v,m;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(x){a(x);return}(g=(f=P(this,sl).config).onSuccess)==null||g.call(f,u,this),(m=(v=P(this,sl).config).onSettled)==null||m.call(v,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,f)=>{K(this,Xl,Id).call(this,{type:"failed",failureCount:u,error:f})},onPause:()=>{K(this,Xl,Id).call(this,{type:"pause"})},onContinue:()=>{K(this,Xl,Id).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),P(this,Xi).start()}},qb=new WeakMap,Gb=new WeakMap,sl=new WeakMap,_g=new WeakMap,Xi=new WeakMap,HC=new WeakMap,wg=new WeakMap,Xl=new WeakSet,Id=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...KZ(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return $3(s)&&s.revert&&P(this,Gb)?{...P(this,Gb),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ti.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,sl).notify({query:this,type:"updated",action:t})})},vX);function KZ(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HZ(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Dve(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Wc,yX,Ove=(yX=class extends Px{constructor(t={}){super();G(this,Wc);this.config=t,V(this,Wc,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??bH(s,n);let o=this.get(i);return o||(o=new kve({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){P(this,Wc).has(t.queryHash)||(P(this,Wc).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,Wc).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,Wc).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ti.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,Wc).get(t)}getAll(){return[...P(this,Wc).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bG(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>bG(t,r)):n}notify(t){ti.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ti.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ti.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Wc=new WeakMap,yX),qc,yo,Sg,Gc,eh,bX,Mve=(bX=class extends GZ{constructor(t){super();G(this,Gc);G(this,qc);G(this,yo);G(this,Sg);this.mutationId=t.mutationId,V(this,yo,t.mutationCache),V(this,qc,[]),this.state=t.state||YZ(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,qc).includes(t)||(P(this,qc).push(t),this.clearGcTimeout(),P(this,yo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,qc,P(this,qc).filter(n=>n!==t)),this.scheduleGc(),P(this,yo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,qc).length||(this.state.status==="pending"?this.scheduleGc():P(this,yo).remove(this))}continue(){var t;return((t=P(this,Sg))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,o,a,c,d,h,u,f,g,v,m,x,y,b,w,E,R,T,N;V(this,Sg,qZ({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,D)=>{K(this,Gc,eh).call(this,{type:"failed",failureCount:A,error:D})},onPause:()=>{K(this,Gc,eh).call(this,{type:"pause"})},onContinue:()=>{K(this,Gc,eh).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,yo).canRun(this)}));const n=this.state.status==="pending",r=!P(this,Sg).canStart();try{if(!n){K(this,Gc,eh).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(s=P(this,yo).config).onMutate)==null?void 0:i.call(s,t,this));const D=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));D!==this.state.context&&K(this,Gc,eh).call(this,{type:"pending",context:D,variables:t,isPaused:r})}const A=await P(this,Sg).start();return await((d=(c=P(this,yo).config).onSuccess)==null?void 0:d.call(c,A,t,this.state.context,this)),await((u=(h=this.options).onSuccess)==null?void 0:u.call(h,A,t,this.state.context)),await((g=(f=P(this,yo).config).onSettled)==null?void 0:g.call(f,A,null,this.state.variables,this.state.context,this)),await((m=(v=this.options).onSettled)==null?void 0:m.call(v,A,null,t,this.state.context)),K(this,Gc,eh).call(this,{type:"success",data:A}),A}catch(A){try{throw await((y=(x=P(this,yo).config).onError)==null?void 0:y.call(x,A,t,this.state.context,this)),await((w=(b=this.options).onError)==null?void 0:w.call(b,A,t,this.state.context)),await((R=(E=P(this,yo).config).onSettled)==null?void 0:R.call(E,void 0,A,this.state.variables,this.state.context,this)),await((N=(T=this.options).onSettled)==null?void 0:N.call(T,void 0,A,t,this.state.context)),A}finally{K(this,Gc,eh).call(this,{type:"error",error:A})}}finally{P(this,yo).runNext(this)}}},qc=new WeakMap,yo=new WeakMap,Sg=new WeakMap,Gc=new WeakSet,eh=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ti.batch(()=>{P(this,qc).forEach(r=>{r.onMutationUpdate(t)}),P(this,yo).notify({mutation:this,type:"updated",action:t})})},bX);function YZ(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wd,Ql,WC,xX,Ive=(xX=class extends Px{constructor(t={}){super();G(this,Wd);G(this,Ql);G(this,WC);this.config=t,V(this,Wd,new Set),V(this,Ql,new Map),V(this,WC,0)}build(t,n,r){const s=new Mve({mutationCache:this,mutationId:++Ui(this,WC)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){P(this,Wd).add(t);const n=KR(t);if(typeof n=="string"){const r=P(this,Ql).get(n);r?r.push(t):P(this,Ql).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,Wd).delete(t)){const n=KR(t);if(typeof n=="string"){const r=P(this,Ql).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&P(this,Ql).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=KR(t);if(typeof n=="string"){const r=P(this,Ql).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=KR(t);if(typeof n=="string"){const s=(r=P(this,Ql).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ti.batch(()=>{P(this,Wd).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,Wd).clear(),P(this,Ql).clear()})}getAll(){return Array.from(P(this,Wd))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>xG(n,r))}findAll(t={}){return this.getAll().filter(n=>xG(t,n))}notify(t){ti.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ti.batch(()=>Promise.all(t.map(n=>n.continue().catch(cl))))}},Wd=new WeakMap,Ql=new WeakMap,WC=new WeakMap,xX);function KR(e){var t;return(t=e.options.scope)==null?void 0:t.id}function SG(e){return{onFetch:(t,n)=>{var h,u,f,g,v;const r=t.options,s=(f=(u=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:u.fetchMore)==null?void 0:f.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const d=async()=>{let m=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=VZ(t.options,t.fetchOptions),b=async(w,E,R)=>{if(m)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const T={client:t.client,queryKey:t.queryKey,pageParam:E,direction:R?"backward":"forward",meta:t.options.meta};x(T);const N=await y(T),{maxPages:A}=t.options,D=R?Eve:Cve;return{pages:D(w.pages,N,A),pageParams:D(w.pageParams,E,A)}};if(s&&i.length){const w=s==="backward",E=w?Lve:CG,R={pages:i,pageParams:o},T=E(r,R);a=await b(R,T,w)}else{const w=e??i.length;do{const E=c===0?o[0]??r.initialPageParam:CG(r,a);if(c>0&&E==null)break;a=await b(a,E),c++}while(c{var m,x;return(x=(m=t.options).persister)==null?void 0:x.call(m,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function CG(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Lve(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var cs,wh,Sh,Kb,Yb,Ch,Xb,Qb,_X,jve=(_X=class{constructor(e={}){G(this,cs);G(this,wh);G(this,Sh);G(this,Kb);G(this,Yb);G(this,Ch);G(this,Xb);G(this,Qb);V(this,cs,e.queryCache||new Ove),V(this,wh,e.mutationCache||new Ive),V(this,Sh,e.defaultOptions||{}),V(this,Kb,new Map),V(this,Yb,new Map),V(this,Ch,0)}mount(){Ui(this,Ch)._++,P(this,Ch)===1&&(V(this,Xb,_H.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,cs).onFocus())})),V(this,Qb,fT.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,cs).onOnline())})))}unmount(){var e,t;Ui(this,Ch)._--,P(this,Ch)===0&&((e=P(this,Xb))==null||e.call(this),V(this,Xb,void 0),(t=P(this,Qb))==null||t.call(this),V(this,Qb,void 0))}isFetching(e){return P(this,cs).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,wh).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,cs).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,cs).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ab(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,cs).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=P(this,cs).get(r.queryHash),i=s==null?void 0:s.state.data,o=wve(t,i);if(o!==void 0)return P(this,cs).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ti.batch(()=>P(this,cs).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,cs).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,cs);ti.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,cs);return ti.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ti.batch(()=>P(this,cs).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(cl).catch(cl)}invalidateQueries(e,t={}){return ti.batch(()=>(P(this,cs).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ti.batch(()=>P(this,cs).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(cl)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(cl)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,cs).build(this,t);return n.isStaleByTime(Ab(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cl).catch(cl)}fetchInfiniteQuery(e){return e.behavior=SG(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cl).catch(cl)}ensureInfiniteQueryData(e){return e.behavior=SG(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fT.isOnline()?P(this,wh).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,cs)}getMutationCache(){return P(this,wh)}getDefaultOptions(){return P(this,Sh)}setDefaultOptions(e){V(this,Sh,e)}setQueryDefaults(e,t){P(this,Kb).set(jv(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Kb).values()],n={};return t.forEach(r=>{gC(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Yb).set(jv(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Yb).values()],n={};return t.forEach(r=>{gC(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Sh).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bH(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===xH&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Sh).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,cs).clear(),P(this,wh).clear()}},cs=new WeakMap,wh=new WeakMap,Sh=new WeakMap,Kb=new WeakMap,Yb=new WeakMap,Ch=new WeakMap,Xb=new WeakMap,Qb=new WeakMap,_X),Bo,vn,qC,bo,Cg,Zb,Eh,Kc,GC,Jb,e0,Eg,Ag,Ah,t0,qn,a1,CB,EB,AB,RB,PB,NB,TB,XZ,wX,$ve=(wX=class extends Px{constructor(t,n){super();G(this,qn);G(this,Bo);G(this,vn);G(this,qC);G(this,bo);G(this,Cg);G(this,Zb);G(this,Eh);G(this,Kc);G(this,GC);G(this,Jb);G(this,e0);G(this,Eg);G(this,Ag);G(this,Ah);G(this,t0,new Set);this.options=n,V(this,Bo,t),V(this,Kc,null),V(this,Eh,SB()),this.options.experimental_prefetchInRender||P(this,Eh).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,vn).addObserver(this),EG(P(this,vn),this.options)?K(this,qn,a1).call(this):this.updateResult(),K(this,qn,RB).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kB(P(this,vn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kB(P(this,vn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,K(this,qn,PB).call(this),K(this,qn,NB).call(this),P(this,vn).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,vn);if(this.options=P(this,Bo).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pc(this.options.enabled,P(this,vn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");K(this,qn,TB).call(this),P(this,vn).setOptions(this.options),n._defaulted&&!dT(this.options,n)&&P(this,Bo).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,vn),observer:this});const s=this.hasListeners();s&&AG(P(this,vn),r,this.options,n)&&K(this,qn,a1).call(this),this.updateResult(),s&&(P(this,vn)!==r||pc(this.options.enabled,P(this,vn))!==pc(n.enabled,P(this,vn))||Ab(this.options.staleTime,P(this,vn))!==Ab(n.staleTime,P(this,vn)))&&K(this,qn,CB).call(this);const i=K(this,qn,EB).call(this);s&&(P(this,vn)!==r||pc(this.options.enabled,P(this,vn))!==pc(n.enabled,P(this,vn))||i!==P(this,Ah))&&K(this,qn,AB).call(this,i)}getOptimisticResult(t){const n=P(this,Bo).getQueryCache().build(P(this,Bo),t),r=this.createResult(n,t);return zve(this,r)&&(V(this,bo,r),V(this,Zb,this.options),V(this,Cg,P(this,vn).state)),r}getCurrentResult(){return P(this,bo)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){P(this,t0).add(t)}getCurrentQuery(){return P(this,vn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Bo).defaultQueryOptions(t),r=P(this,Bo).getQueryCache().build(P(this,Bo),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return K(this,qn,a1).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,bo)))}createResult(t,n){var A;const r=P(this,vn),s=this.options,i=P(this,bo),o=P(this,Cg),a=P(this,Zb),d=t!==r?t.state:P(this,qC),{state:h}=t;let u={...h},f=!1,g;if(n._optimisticResults){const D=this.hasListeners(),O=!D&&EG(t,n),I=D&&AG(t,r,n,s);(O||I)&&(u={...u,...KZ(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:x}=u;if(n.select&&u.data!==void 0)if(i&&u.data===(o==null?void 0:o.data)&&n.select===P(this,GC))g=P(this,Jb);else try{V(this,GC,n.select),g=n.select(u.data),g=wB(i==null?void 0:i.data,g,n),V(this,Jb,g),V(this,Kc,null)}catch(D){V(this,Kc,D)}else g=u.data;if(n.placeholderData!==void 0&&g===void 0&&x==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((A=P(this,e0))==null?void 0:A.state.data,P(this,e0)):n.placeholderData,n.select&&D!==void 0)try{D=n.select(D),V(this,Kc,null)}catch(O){V(this,Kc,O)}D!==void 0&&(x="success",g=wB(i==null?void 0:i.data,D,n),f=!0)}P(this,Kc)&&(v=P(this,Kc),g=P(this,Jb),m=Date.now(),x="error");const y=u.fetchStatus==="fetching",b=x==="pending",w=x==="error",E=b&&y,R=g!==void 0,N={status:x,fetchStatus:u.fetchStatus,isPending:b,isSuccess:x==="success",isError:w,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:u.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>d.dataUpdateCount||u.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:w&&!R,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&R,isStale:wH(t,n),refetch:this.refetch,promise:P(this,Eh)};if(this.options.experimental_prefetchInRender){const D=$=>{N.status==="error"?$.reject(N.error):N.data!==void 0&&$.resolve(N.data)},O=()=>{const $=V(this,Eh,N.promise=SB());D($)},I=P(this,Eh);switch(I.status){case"pending":t.queryHash===r.queryHash&&D(I);break;case"fulfilled":(N.status==="error"||N.data!==I.value)&&O();break;case"rejected":(N.status!=="error"||N.error!==I.reason)&&O();break}}return N}updateResult(){const t=P(this,bo),n=this.createResult(P(this,vn),this.options);if(V(this,Cg,P(this,vn).state),V(this,Zb,this.options),P(this,Cg).data!==void 0&&V(this,e0,P(this,vn)),dT(n,t))return;V(this,bo,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!P(this,t0).size)return!0;const o=new Set(i??P(this,t0));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,bo)).some(a=>{const c=a;return P(this,bo)[c]!==t[c]&&o.has(c)})};K(this,qn,XZ).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&K(this,qn,RB).call(this)}},Bo=new WeakMap,vn=new WeakMap,qC=new WeakMap,bo=new WeakMap,Cg=new WeakMap,Zb=new WeakMap,Eh=new WeakMap,Kc=new WeakMap,GC=new WeakMap,Jb=new WeakMap,e0=new WeakMap,Eg=new WeakMap,Ag=new WeakMap,Ah=new WeakMap,t0=new WeakMap,qn=new WeakSet,a1=function(t){K(this,qn,TB).call(this);let n=P(this,vn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(cl)),n},CB=function(){K(this,qn,PB).call(this);const t=Ab(this.options.staleTime,P(this,vn));if(Lv||P(this,bo).isStale||!xB(t))return;const r=zZ(P(this,bo).dataUpdatedAt,t)+1;V(this,Eg,setTimeout(()=>{P(this,bo).isStale||this.updateResult()},r))},EB=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,vn)):this.options.refetchInterval)??!1},AB=function(t){K(this,qn,NB).call(this),V(this,Ah,t),!(Lv||pc(this.options.enabled,P(this,vn))===!1||!xB(P(this,Ah))||P(this,Ah)===0)&&V(this,Ag,setInterval(()=>{(this.options.refetchIntervalInBackground||_H.isFocused())&&K(this,qn,a1).call(this)},P(this,Ah)))},RB=function(){K(this,qn,CB).call(this),K(this,qn,AB).call(this,K(this,qn,EB).call(this))},PB=function(){P(this,Eg)&&(clearTimeout(P(this,Eg)),V(this,Eg,void 0))},NB=function(){P(this,Ag)&&(clearInterval(P(this,Ag)),V(this,Ag,void 0))},TB=function(){const t=P(this,Bo).getQueryCache().build(P(this,Bo),this.options);if(t===P(this,vn))return;const n=P(this,vn);V(this,vn,t),V(this,qC,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},XZ=function(t){ti.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,bo))}),P(this,Bo).getQueryCache().notify({query:P(this,vn),type:"observerResultsUpdated"})})},wX);function Fve(e,t){return pc(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function EG(e,t){return Fve(e,t)||e.state.data!==void 0&&kB(e,t,t.refetchOnMount)}function kB(e,t,n){if(pc(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&wH(e,t)}return!1}function AG(e,t,n,r){return(e!==t||pc(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&wH(e,n)}function wH(e,t){return pc(t.enabled,e)!==!1&&e.isStaleByTime(Ab(t.staleTime,e))}function zve(e,t){return!dT(e.getCurrentResult(),t)}var Rh,Ph,Uo,qd,Nf,YP,DB,SX,Bve=(SX=class extends Px{constructor(n,r){super();G(this,Nf);G(this,Rh);G(this,Ph);G(this,Uo);G(this,qd);V(this,Rh,n),this.setOptions(r),this.bindMethods(),K(this,Nf,YP).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=P(this,Rh).defaultMutationOptions(n),dT(this.options,r)||P(this,Rh).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Uo),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&jv(r.mutationKey)!==jv(this.options.mutationKey)?this.reset():((s=P(this,Uo))==null?void 0:s.state.status)==="pending"&&P(this,Uo).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Uo))==null||n.removeObserver(this)}onMutationUpdate(n){K(this,Nf,YP).call(this),K(this,Nf,DB).call(this,n)}getCurrentResult(){return P(this,Ph)}reset(){var n;(n=P(this,Uo))==null||n.removeObserver(this),V(this,Uo,void 0),K(this,Nf,YP).call(this),K(this,Nf,DB).call(this)}mutate(n,r){var s;return V(this,qd,r),(s=P(this,Uo))==null||s.removeObserver(this),V(this,Uo,P(this,Rh).getMutationCache().build(P(this,Rh),this.options)),P(this,Uo).addObserver(this),P(this,Uo).execute(n)}},Rh=new WeakMap,Ph=new WeakMap,Uo=new WeakMap,qd=new WeakMap,Nf=new WeakSet,YP=function(){var r;const n=((r=P(this,Uo))==null?void 0:r.state)??YZ();V(this,Ph,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},DB=function(n){ti.batch(()=>{var r,s,i,o,a,c,d,h;if(P(this,qd)&&this.hasListeners()){const u=P(this,Ph).variables,f=P(this,Ph).context;(n==null?void 0:n.type)==="success"?((s=(r=P(this,qd)).onSuccess)==null||s.call(r,n.data,u,f),(o=(i=P(this,qd)).onSettled)==null||o.call(i,n.data,null,u,f)):(n==null?void 0:n.type)==="error"&&((c=(a=P(this,qd)).onError)==null||c.call(a,n.error,u,f),(h=(d=P(this,qd)).onSettled)==null||h.call(d,void 0,n.error,u,f))}this.listeners.forEach(u=>{u(P(this,Ph))})})},SX),QZ=C.createContext(void 0),pu=e=>{const t=C.useContext(QZ);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Uve=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(QZ.Provider,{value:e,children:t})),ZZ=C.createContext(!1),Vve=()=>C.useContext(ZZ);ZZ.Provider;function Hve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wve=C.createContext(Hve()),qve=()=>C.useContext(Wve);function JZ(e,t){return typeof e=="function"?e(...t):!!e}function OB(){}var Gve=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Kve=e=>{C.useEffect(()=>{e.clearReset()},[e])},Yve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||JZ(n,[e.error,r])),Xve=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Qve=(e,t)=>e.isLoading&&e.isFetching&&!t,Zve=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,RG=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Jve(e,t,n){var u,f,g,v,m;const r=pu(),s=Vve(),i=qve(),o=r.defaultQueryOptions(e);(f=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||f.call(u,o),o._optimisticResults=s?"isRestoring":"optimistic",Xve(o),Gve(o,i),Kve(i);const a=!r.getQueryCache().get(o.queryHash),[c]=C.useState(()=>new t(r,o)),d=c.getOptimisticResult(o),h=!s&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(x=>{const y=h?c.subscribe(ti.batchCalls(x)):OB;return c.updateResult(),y},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setOptions(o)},[o,c]),Zve(o,d))throw RG(o,c,i);if(Yve({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;if((v=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||v.call(g,o,d),o.experimental_prefetchInRender&&!Lv&&Qve(d,s)){const x=a?RG(o,c,i):(m=r.getQueryCache().get(o.queryHash))==null?void 0:m.promise;x==null||x.catch(OB).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function iD(e,t){return Jve(e,$ve)}function mu(e,t){const n=pu(),[r]=C.useState(()=>new Bve(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const s=C.useSyncExternalStore(C.useCallback(o=>r.subscribe(ti.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=C.useCallback((o,a)=>{r.mutate(o,a).catch(OB)},[r]);if(s.error&&JZ(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class El{constructor(t=[]){Be(this,"segments",[]);this.segments=t}key(){return this.segments}get(){return this.segments}}class Pp extends El{params(t){return new El([...this.segments,t])}}class eye extends El{id(t){return new Pp([...this.segments,t?String(t):void 0])}}class tye extends El{ids(...t){return new Pp([...this.segments,...t.length?[t.map(n=>String(n))]:[]])}}class nye extends El{action(t){if(["one","report"].includes(t))return new eye([...this.segments,t]);if(t==="many")return new tye([...this.segments,t]);if(["list","infinite"].includes(t))return new Pp([...this.segments,t]);throw new Error("Invalid action type")}}class rye extends El{resource(t){return new nye([...this.segments,t])}mutation(t){return new Pp([...t==="custom"?this.segments:[this.segments[0]],t])}}class sye extends El{action(t){return new Pp([...this.segments,t])}}class iye extends El{action(t){return new Pp([...this.segments,t])}}class oye extends El{resource(t){return new iye([...this.segments,t])}}class aye extends El{action(t){return new Pp([...this.segments,t])}}class lye extends El{resource(t){return new aye([...this.segments,t])}action(t){return new Pp([...this.segments,t])}}class cye extends El{data(t){return new rye(["data",t||"default"])}auth(){return new sye(["auth"])}access(){return new oye(["access"])}audit(){return new lye(["audit"])}}const uye=()=>new cye([]),Lf=()=>uye,SH=e=>{const t=Lf(),{getProfile:n}=sD();return iD({queryKey:t().auth().action("profile").get(),queryFn:n,...e})},dye=e=>{const t=Lf(),{check:n}=sD();return iD({queryKey:t().auth().action("check").get(),queryFn:n,retry:!1,...e})},fye=e=>{const t=Lf(),{login:n}=sD();return mu({mutationKey:t().auth().action("login").get(),mutationFn:n,...e})};function hye(e,t){const n=C.createContext(t);function r(i){const{children:o,...a}=i,c=C.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:c,children:o})}function s(i){const o=C.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function _r(e,t=[]){let n=[];function r(i,o){const a=C.createContext(o),c=n.length;n=[...n,o];function d(u){const{scope:f,children:g,...v}=u,m=(f==null?void 0:f[e][c])||a,x=C.useMemo(()=>v,Object.values(v));return _.jsx(m.Provider,{value:x,children:g})}function h(u,f){const g=(f==null?void 0:f[e][c])||a,v=C.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,h]}const s=()=>{const i=n.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,pye(s,...t)]}function pye(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function mye(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function DA(...e){return t=>e.forEach(n=>mye(n,t))}function _t(...e){return C.useCallback(DA(...e),e)}var Cc=C.forwardRef((e,t)=>{const{children:n,...r}=e,s=C.Children.toArray(n),i=s.find(gye);if(i){const o=i.props.children,a=s.map(c=>c===i?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return _.jsx(MB,{...r,ref:t,children:C.isValidElement(o)?C.cloneElement(o,void 0,a):null})}return _.jsx(MB,{...r,ref:t,children:n})});Cc.displayName="Slot";var MB=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const s=yye(n);return C.cloneElement(n,{...vye(r,n.props),ref:t?DA(t,s):s})}return C.Children.count(n)>1?C.Children.only(null):null});MB.displayName="SlotClone";var CH=({children:e})=>_.jsx(_.Fragment,{children:e});function gye(e){return C.isValidElement(e)&&e.type===CH}function vye(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function yye(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Uf(e){const t=e+"CollectionProvider",[n,r]=_r(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:v,children:m}=g,x=fe.useRef(null),y=fe.useRef(new Map).current;return _.jsx(s,{scope:v,itemMap:y,collectionRef:x,children:m})};o.displayName=t;const a=e+"CollectionSlot",c=fe.forwardRef((g,v)=>{const{scope:m,children:x}=g,y=i(a,m),b=_t(v,y.collectionRef);return _.jsx(Cc,{ref:b,children:x})});c.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",u=fe.forwardRef((g,v)=>{const{scope:m,children:x,...y}=g,b=fe.useRef(null),w=_t(v,b),E=i(d,m);return fe.useEffect(()=>(E.itemMap.set(b,{ref:b,...y}),()=>void E.itemMap.delete(b))),_.jsx(Cc,{[h]:"",ref:w,children:x})});u.displayName=d;function f(g){const v=i(e+"CollectionConsumer",g);return fe.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((E,R)=>y.indexOf(E.ref.current)-y.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:c,ItemSlot:u},f,r]}function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function bn(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function os({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=bye({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=bn(n),c=C.useCallback(d=>{if(i){const u=typeof d=="function"?d(e):d;u!==e&&a(u)}else s(d)},[i,e,s,a]);return[o,c]}function bye({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,s=C.useRef(r),i=bn(t);return C.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var xye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],He=xye.reduce((e,t)=>{const n=C.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?Cc:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vC(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}var Rr=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function _ye(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Vr=e=>{const{present:t,children:n}=e,r=wye(t),s=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=_t(r.ref,Sye(s));return typeof n=="function"||r.isPresent?C.cloneElement(s,{ref:i}):null};Vr.displayName="Presence";function wye(e){const[t,n]=C.useState(),r=C.useRef({}),s=C.useRef(e),i=C.useRef("none"),o=e?"mounted":"unmounted",[a,c]=_ye(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const d=YR(r.current);i.current=a==="mounted"?d:"none"},[a]),Rr(()=>{const d=r.current,h=s.current;if(h!==e){const f=i.current,g=YR(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Rr(()=>{if(t){const d=u=>{const g=YR(r.current).includes(u.animationName);u.target===t&&g&&Li.flushSync(()=>c("ANIMATION_END"))},h=u=>{u.target===t&&(i.current=YR(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function YR(e){return(e==null?void 0:e.animationName)||"none"}function Sye(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Cye=Tv.useId||(()=>{}),Eye=0;function si(e){const[t,n]=C.useState(Cye());return Rr(()=>{n(r=>r??String(Eye++))},[e]),t?`radix-${t}`:""}var EH="Collapsible",[Aye,eJ]=_r(EH),[Rye,AH]=Aye(EH),tJ=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=e,[c=!1,d]=os({prop:r,defaultProp:s,onChange:o});return _.jsx(Rye,{scope:n,disabled:i,contentId:si(),open:c,onOpenToggle:C.useCallback(()=>d(h=>!h),[d]),children:_.jsx(He.div,{"data-state":PH(c),"data-disabled":i?"":void 0,...a,ref:t})})});tJ.displayName=EH;var nJ="CollapsibleTrigger",rJ=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=AH(nJ,n);return _.jsx(He.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":PH(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ae(e.onClick,s.onOpenToggle)})});rJ.displayName=nJ;var RH="CollapsibleContent",sJ=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=AH(RH,e.__scopeCollapsible);return _.jsx(Vr,{present:n||s.open,children:({present:i})=>_.jsx(Pye,{...r,ref:t,present:i})})});sJ.displayName=RH;var Pye=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,o=AH(RH,n),[a,c]=C.useState(r),d=C.useRef(null),h=_t(t,d),u=C.useRef(0),f=u.current,g=C.useRef(0),v=g.current,m=o.open||a,x=C.useRef(m),y=C.useRef();return C.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Rr(()=>{const b=d.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();u.current=w.height,g.current=w.width,x.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),c(r)}},[o.open,r]),_.jsx(He.div,{"data-state":PH(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...i,ref:h,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:m&&s})});function PH(e){return e?"open":"closed"}var Nye=tJ,Tye=rJ,kye=sJ,Dye=C.createContext(void 0);function kc(e){const t=C.useContext(Dye);return e||t||"ltr"}var Vf="Accordion",Oye=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[NH,Mye,Iye]=Uf(Vf),[oD,n7e]=_r(Vf,[Iye,eJ]),TH=eJ(),Lye=fe.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return _.jsx(NH.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?_.jsx(zye,{...i,ref:t}):_.jsx(Fye,{...s,ref:t})})});Lye.displayName=Vf;var[iJ,jye]=oD(Vf),[oJ,$ye]=oD(Vf,{collapsible:!1}),Fye=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=e,[a,c]=os({prop:n,defaultProp:r,onChange:s});return _.jsx(iJ,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:c,onItemClose:fe.useCallback(()=>i&&c(""),[i,c]),children:_.jsx(oJ,{scope:e.__scopeAccordion,collapsible:i,children:_.jsx(aJ,{...o,ref:t})})})}),zye=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o=[],a]=os({prop:n,defaultProp:r,onChange:s}),c=fe.useCallback(h=>a((u=[])=>[...u,h]),[a]),d=fe.useCallback(h=>a((u=[])=>u.filter(f=>f!==h)),[a]);return _.jsx(iJ,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:_.jsx(oJ,{scope:e.__scopeAccordion,collapsible:!0,children:_.jsx(aJ,{...i,ref:t})})})}),[Bye,aD]=oD(Vf),aJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=e,a=fe.useRef(null),c=_t(a,t),d=Mye(n),u=kc(s)==="ltr",f=Ae(e.onKeyDown,g=>{var A;if(!Oye.includes(g.key))return;const v=g.target,m=d().filter(D=>{var O;return!((O=D.ref.current)!=null&&O.disabled)}),x=m.findIndex(D=>D.ref.current===v),y=m.length;if(x===-1)return;g.preventDefault();let b=x;const w=0,E=y-1,R=()=>{b=x+1,b>E&&(b=w)},T=()=>{b=x-1,b{const{__scopeAccordion:n,value:r,...s}=e,i=aD(hT,n),o=jye(hT,n),a=TH(n),c=si(),d=r&&o.value.includes(r)||!1,h=i.disabled||e.disabled;return _.jsx(Uye,{scope:n,open:d,disabled:h,triggerId:c,children:_.jsx(Nye,{"data-orientation":i.orientation,"data-state":pJ(d),...a,...s,ref:t,disabled:h,open:d,onOpenChange:u=>{u?o.onItemOpen(r):o.onItemClose(r)}})})});lJ.displayName=hT;var cJ="AccordionHeader",uJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=aD(Vf,n),i=kH(cJ,n);return _.jsx(He.h3,{"data-orientation":s.orientation,"data-state":pJ(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});uJ.displayName=cJ;var IB="AccordionTrigger",dJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=aD(Vf,n),i=kH(IB,n),o=$ye(IB,n),a=TH(n);return _.jsx(NH.ItemSlot,{scope:n,children:_.jsx(Tye,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:t})})});dJ.displayName=IB;var fJ="AccordionContent",hJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=aD(Vf,n),i=kH(fJ,n),o=TH(n);return _.jsx(kye,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});hJ.displayName=fJ;function pJ(e){return e?"open":"closed"}var Vye=lJ,Hye=uJ,mJ=dJ,gJ=hJ;/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wye=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vJ=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var qye={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gye=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>C.createElement("svg",{ref:c,...qye,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vJ("lucide",s),...a},[...o.map(([d,h])=>C.createElement(d,h)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wt=(e,t)=>{const n=C.forwardRef(({className:r,...s},i)=>C.createElement(Gye,{ref:i,iconNode:t,className:vJ(`lucide-${Wye(e)}`,r),...s}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yJ=Wt("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kye=Wt("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PG=Wt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NG=Wt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yye=Wt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OA=Wt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nx=Wt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lD=Wt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tx=Wt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bJ=Wt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xye=Wt("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qye=Wt("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xJ=Wt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _J=Wt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zye=Wt("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jye=Wt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ebe=Wt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cD=Wt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tbe=Wt("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DH=Wt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wJ=Wt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nbe=Wt("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SJ=Wt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rbe=Wt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sbe=Wt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CJ=Wt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ibe=Wt("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const obe=Wt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const abe=Wt("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lbe=Wt("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cbe=Wt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ube=Wt("Package2",[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OH=Wt("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MH=Wt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EJ=Wt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dbe=Wt("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IH=Wt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fbe=Wt("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hbe=Wt("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pbe=Wt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AJ=Wt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RJ=Wt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sx=Wt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function PJ(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const t=vbe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(LH);return a[0]===""&&a.length!==1&&a.shift(),NJ(a,t)||gbe(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},NJ=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?NJ(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(LH);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},TG=/^\[(.+)\]$/,gbe=e=>{if(TG.test(e)){const t=TG.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},vbe=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return bbe(Object.entries(e.classGroups),n).forEach(([i,o])=>{LB(o,r,i,t)}),r},LB=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:kG(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(ybe(s)){LB(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{LB(o,kG(t,i),n,r)})})},kG=(e,t)=>{let n=e;return t.split(LH).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ybe=e=>e.isThemeGetter,bbe=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,xbe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},TJ="!",_be=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const c=[];let d=0,h=0,u;for(let x=0;xh?u-h:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:o}):o},wbe=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Sbe=e=>({cache:xbe(e.cacheSize),parseClassName:_be(e),...mbe(e)}),Cbe=/\s+/,Ebe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(Cbe);let a="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:h,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:g}=n(d);let v=!!g,m=r(v?f.substring(0,g):f);if(!m){if(!v){a=d+(a.length>0?" "+a:a);continue}if(m=r(f),!m){a=d+(a.length>0?" "+a:a);continue}v=!1}const x=wbe(h).join(":"),y=u?x+TJ:x,b=y+m;if(i.includes(b))continue;i.push(b);const w=s(m,v);for(let E=0;E0?" "+a:a)}return a};function Abe(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;ru(h),e());return n=Sbe(d),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const d=r(c);if(d)return d;const h=Ebe(c,n);return s(c,h),h}return function(){return i(Abe.apply(null,arguments))}}const jr=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},DJ=/^\[(?:([a-z-]+):)?(.+)\]$/i,Pbe=/^\d+\/\d+$/,Nbe=new Set(["px","full","screen"]),Tbe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kbe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Dbe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Obe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mbe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nd=e=>Rb(e)||Nbe.has(e)||Pbe.test(e),Xf=e=>kx(e,"length",Ube),Rb=e=>!!e&&!Number.isNaN(Number(e)),F3=e=>kx(e,"number",Rb),OS=e=>!!e&&Number.isInteger(Number(e)),Ibe=e=>e.endsWith("%")&&Rb(e.slice(0,-1)),Kt=e=>DJ.test(e),Qf=e=>Tbe.test(e),Lbe=new Set(["length","size","percentage"]),jbe=e=>kx(e,Lbe,OJ),$be=e=>kx(e,"position",OJ),Fbe=new Set(["image","url"]),zbe=e=>kx(e,Fbe,Hbe),Bbe=e=>kx(e,"",Vbe),MS=()=>!0,kx=(e,t,n)=>{const r=DJ.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ube=e=>kbe.test(e)&&!Dbe.test(e),OJ=()=>!1,Vbe=e=>Obe.test(e),Hbe=e=>Mbe.test(e),Wbe=()=>{const e=jr("colors"),t=jr("spacing"),n=jr("blur"),r=jr("brightness"),s=jr("borderColor"),i=jr("borderRadius"),o=jr("borderSpacing"),a=jr("borderWidth"),c=jr("contrast"),d=jr("grayscale"),h=jr("hueRotate"),u=jr("invert"),f=jr("gap"),g=jr("gradientColorStops"),v=jr("gradientColorStopPositions"),m=jr("inset"),x=jr("margin"),y=jr("opacity"),b=jr("padding"),w=jr("saturate"),E=jr("scale"),R=jr("sepia"),T=jr("skew"),N=jr("space"),A=jr("translate"),D=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Kt,t],$=()=>[Kt,t],F=()=>["",Nd,Xf],B=()=>["auto",Rb,Kt],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",Kt],he=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Rb,Kt];return{cacheSize:500,separator:":",theme:{colors:[MS],spacing:[Nd,Xf],blur:["none","",Qf,Kt],brightness:re(),borderColor:[e],borderRadius:["none","","full",Qf,Kt],borderSpacing:$(),borderWidth:F(),contrast:re(),grayscale:se(),hueRotate:re(),invert:se(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Ibe,Xf],inset:I(),margin:I(),opacity:re(),padding:$(),saturate:re(),scale:re(),sepia:se(),skew:re(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Kt]}],container:["container"],columns:[{columns:[Qf]}],"break-after":[{"break-after":he()}],"break-before":[{"break-before":he()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),Kt]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",OS,Kt]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Kt]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",OS,Kt]}],"grid-cols":[{"grid-cols":[MS]}],"col-start-end":[{col:["auto",{span:["full",OS,Kt]},Kt]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[MS]}],"row-start-end":[{row:["auto",{span:[OS,Kt]},Kt]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Kt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Kt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Kt,t]}],"min-w":[{"min-w":[Kt,t,"min","max","fit"]}],"max-w":[{"max-w":[Kt,t,"none","full","min","max","fit","prose",{screen:[Qf]},Qf]}],h:[{h:[Kt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Kt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Kt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Kt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qf,Xf]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",F3]}],"font-family":[{font:[MS]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Kt]}],"line-clamp":[{"line-clamp":["none",Rb,F3]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Nd,Kt]}],"list-image":[{"list-image":["none",Kt]}],"list-style-type":[{list:["none","disc","decimal",Kt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Nd,Xf]}],"underline-offset":[{"underline-offset":["auto",Nd,Kt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Kt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Kt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),$be]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jbe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zbe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:Z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[Nd,Kt]}],"outline-w":[{outline:[Nd,Xf]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Nd,Xf]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qf,Bbe]}],"shadow-color":[{shadow:[MS]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Qf,Kt]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Kt]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",Kt]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",Kt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[OS,Kt]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Kt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Kt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Kt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Nd,Xf,F3]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},qbe=Rbe(Wbe);function ge(...e){return qbe(oy(e))}const Gbe=C.forwardRef(({className:e,...t},n)=>_.jsx(Vye,{ref:n,className:ge("border-b",e),...t}));Gbe.displayName="AccordionItem";const Kbe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsx(Hye,{className:"flex",children:_.jsxs(mJ,{ref:r,className:ge("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,_.jsx(Nx,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Kbe.displayName=mJ.displayName;const Ybe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsx(gJ,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:ge("pb-4 pt-0",e),children:t})}));Ybe.displayName=gJ.displayName;const DG=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,OG=oy,Io=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return OG(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const h=n==null?void 0:n[d],u=i==null?void 0:i[d];if(h===null)return null;const f=DG(h)||DG(u);return s[d][f]}),a=n&&Object.entries(n).reduce((d,h)=>{let[u,f]=h;return f===void 0||(d[u]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:u,className:f,...g}=h;return Object.entries(g).every(v=>{let[m,x]=v;return Array.isArray(x)?x.includes({...i,...a}[m]):{...i,...a}[m]===x})?[...d,u,f]:d},[]);return OG(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Xbe=Io("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),jH=C.forwardRef(({className:e,variant:t,...n},r)=>_.jsx("div",{ref:r,role:"alert",className:ge(Xbe({variant:t}),e),...n}));jH.displayName="Alert";const $H=C.forwardRef(({className:e,...t},n)=>_.jsx("h5",{ref:n,className:ge("mb-1 font-medium leading-none tracking-tight",e),...t}));$H.displayName="AlertTitle";const FH=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("text-sm [&_p]:leading-relaxed",e),...t}));FH.displayName="AlertDescription";function MJ(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e);C.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qbe="DismissableLayer",jB="dismissableLayer.update",Zbe="dismissableLayer.pointerDownOutside",Jbe="dismissableLayer.focusOutside",MG,IJ=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hf=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,d=C.useContext(IJ),[h,u]=C.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),v=_t(t,N=>u(N)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=h?m.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,R=t0e(N=>{const A=N.target,D=[...d.branches].some(O=>O.contains(A));!E||D||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},f),T=n0e(N=>{const A=N.target;[...d.branches].some(O=>O.contains(A))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},f);return MJ(N=>{b===d.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},f),C.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(MG=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),IG(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=MG)}},[h,f,n,d]),C.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),IG())},[h,d]),C.useEffect(()=>{const N=()=>g({});return document.addEventListener(jB,N),()=>document.removeEventListener(jB,N)},[]),_.jsx(He.div,{...c,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,R.onPointerDownCapture)})});Hf.displayName=Qbe;var e0e="DismissableLayerBranch",LJ=C.forwardRef((e,t)=>{const n=C.useContext(IJ),r=C.useRef(null),s=_t(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(He.div,{...e,ref:s})});LJ.displayName=e0e;function t0e(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){jJ(Zbe,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function n0e(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!r.current&&jJ(Jbe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function IG(){const e=new CustomEvent(jB);document.dispatchEvent(e)}function jJ(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?vC(s,i):s.dispatchEvent(i)}var r0e=Hf,s0e=LJ,z3="focusScope.autoFocusOnMount",B3="focusScope.autoFocusOnUnmount",LG={bubbles:!1,cancelable:!0},i0e="FocusScope",MA=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=C.useState(null),d=bn(s),h=bn(i),u=C.useRef(null),f=_t(t,m=>c(m)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const E=w.target;a.contains(E)?u.current=E:th(u.current,{select:!0})},x=function(w){if(g.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||th(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&th(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,g.paused]),C.useEffect(()=>{if(a){$G.add(g);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(z3,LG);a.addEventListener(z3,d),a.dispatchEvent(y),y.defaultPrevented||(o0e(d0e($J(a)),{select:!0}),document.activeElement===m&&th(a))}return()=>{a.removeEventListener(z3,d),setTimeout(()=>{const y=new CustomEvent(B3,LG);a.addEventListener(B3,h),a.dispatchEvent(y),y.defaultPrevented||th(m??document.body,{select:!0}),a.removeEventListener(B3,h),$G.remove(g)},0)}}},[a,d,h,g]);const v=C.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[w,E]=a0e(b);w&&E?!m.shiftKey&&y===E?(m.preventDefault(),n&&th(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&th(E,{select:!0})):y===b&&m.preventDefault()}},[n,r,g.paused]);return _.jsx(He.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});MA.displayName=i0e;function o0e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(th(r,{select:t}),document.activeElement!==n)return}function a0e(e){const t=$J(e),n=jG(t,e),r=jG(t.reverse(),e);return[n,r]}function $J(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function jG(e,t){for(const n of e)if(!l0e(n,{upTo:t}))return n}function l0e(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 c0e(e){return e instanceof HTMLInputElement&&"select"in e}function th(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&c0e(e)&&t&&e.select()}}var $G=u0e();function u0e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=FG(e,t),e.unshift(t)},remove(t){var n;e=FG(e,t),(n=e[0])==null||n.resume()}}}function FG(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function d0e(e){return e.filter(t=>t.tagName!=="A")}var f0e="Portal",Dx=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=C.useState(!1);Rr(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?kA.createPortal(_.jsx(He.div,{...r,ref:t}),o):null});Dx.displayName=f0e;var U3=0;function uD(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zG()),document.body.insertAdjacentElement("beforeend",e[1]??zG()),U3++,()=>{U3===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),U3--}},[])}function zG(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var fs=function(){return fs=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return E0e;var t=A0e(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])}},P0e=hD(),Tb="data-scroll-locked",N0e=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(h0e,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } body[`).concat(Tb,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(s,`px; padding-top: `).concat(i,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Pb,` { right: `).concat(a,"px ").concat(r,`; } .`).concat(Nb,` { margin-right: `).concat(a,"px ").concat(r,`; } .`).concat(Pb," .").concat(Pb,` { right: 0 `).concat(r,`; } .`).concat(Nb," .").concat(Nb,` { margin-right: 0 `).concat(r,`; } body[`).concat(Tb,`] { `).concat(p0e,": ").concat(a,`px; } `)},UG=function(){var e=parseInt(document.body.getAttribute(Tb)||"0",10);return isFinite(e)?e:0},T0e=function(){C.useEffect(function(){return document.body.setAttribute(Tb,(UG()+1).toString()),function(){var e=UG()-1;e<=0?document.body.removeAttribute(Tb):document.body.setAttribute(Tb,e.toString())}},[])},HH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;T0e();var i=C.useMemo(function(){return R0e(s)},[s]);return C.createElement(P0e,{styles:N0e(i,!t,s,n?"":"!important")})},$B=!1;if(typeof window<"u")try{var XR=Object.defineProperty({},"passive",{get:function(){return $B=!0,!0}});window.addEventListener("test",XR,XR),window.removeEventListener("test",XR,XR)}catch{$B=!1}var Ny=$B?{passive:!1}:!1,k0e=function(e){return e.tagName==="TEXTAREA"},BJ=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!k0e(e)&&n[t]==="visible")},D0e=function(e){return BJ(e,"overflowY")},O0e=function(e){return BJ(e,"overflowX")},VG=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=UJ(e,r);if(s){var i=VJ(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},M0e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},I0e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},UJ=function(e,t){return e==="v"?D0e(t):O0e(t)},VJ=function(e,t){return e==="v"?M0e(t):I0e(t)},L0e=function(e,t){return e==="h"&&t==="rtl"?-1:1},j0e=function(e,t,n,r,s){var i=L0e(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),d=!1,h=o>0,u=0,f=0;do{var g=VJ(e,a),v=g[0],m=g[1],x=g[2],y=m-x-i*v;(v||y)&&UJ(e,a)&&(u+=y,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(h&&Math.abs(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},QR=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HG=function(e){return[e.deltaX,e.deltaY]},WG=function(e){return e&&"current"in e?e.current:e},$0e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},F0e=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},z0e=0,Ty=[];function B0e(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),s=C.useState(z0e++)[0],i=C.useState(hD)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zH([e.lockRef.current],(e.shards||[]).map(WG),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var y=QR(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-y[0],E="deltaY"in m?m.deltaY:b[1]-y[1],R,T=m.target,N=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in m&&N==="h"&&T.type==="range")return!1;var A=VG(N,T);if(!A)return!0;if(A?R=N:(R=N==="v"?"h":"v",A=VG(N,T)),!A)return!1;if(!r.current&&"changedTouches"in m&&(w||E)&&(r.current=R),!R)return!0;var D=r.current||R;return j0e(D,x,m,D==="h"?w:E)},[]),c=C.useCallback(function(m){var x=m;if(!(!Ty.length||Ty[Ty.length-1]!==i)){var y="deltaY"in x?HG(x):QR(x),b=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&$0e(R.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(WG).filter(Boolean).filter(function(R){return R.contains(x.target)}),E=w.length>0?a(x,w[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),d=C.useCallback(function(m,x,y,b){var w={name:m,delta:x,target:y,should:b,shadowParent:U0e(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),h=C.useCallback(function(m){n.current=QR(m),r.current=void 0},[]),u=C.useCallback(function(m){d(m.type,HG(m),m.target,a(m,e.lockRef.current))},[]),f=C.useCallback(function(m){d(m.type,QR(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return Ty.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ny),document.addEventListener("touchmove",c,Ny),document.addEventListener("touchstart",h,Ny),function(){Ty=Ty.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Ny),document.removeEventListener("touchmove",c,Ny),document.removeEventListener("touchstart",h,Ny)}},[]);var g=e.removeScrollBar,v=e.inert;return C.createElement(C.Fragment,null,v?C.createElement(i,{styles:F0e(s)}):null,g?C.createElement(HH,{gapMode:e.gapMode}):null)}function U0e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const V0e=VH(zJ,B0e);var IA=C.forwardRef(function(e,t){return C.createElement(fD,fs({},e,{ref:t,sideCar:V0e}))});IA.classNames=fD.classNames;var H0e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ky=new WeakMap,ZR=new WeakMap,JR={},q3=0,HJ=function(e){return e&&(e.host||HJ(e.parentNode))},W0e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=HJ(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})},q0e=function(e,t,n,r){var s=W0e(t,Array.isArray(e)?e:[e]);JR[n]||(JR[n]=new WeakMap);var i=JR[n],o=[],a=new Set,c=new Set(s),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};s.forEach(d);var h=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(f){if(a.has(f))h(f);else try{var g=f.getAttribute(r),v=g!==null&&g!=="false",m=(ky.get(f)||0)+1,x=(i.get(f)||0)+1;ky.set(f,m),i.set(f,x),o.push(f),m===1&&v&&ZR.set(f,!0),x===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return h(t),a.clear(),q3++,function(){o.forEach(function(u){var f=ky.get(u)-1,g=i.get(u)-1;ky.set(u,f),i.set(u,g),f||(ZR.has(u)||u.removeAttribute(r),ZR.delete(u)),g||u.removeAttribute(n)}),q3--,q3||(ky=new WeakMap,ky=new WeakMap,ZR=new WeakMap,JR={})}},Ox=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=H0e(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),q0e(r,s,n,"aria-hidden")):function(){return null}},WH="Dialog",[WJ,qJ]=_r(WH),[G0e,Dc]=WJ(WH),GJ=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=C.useRef(null),c=C.useRef(null),[d=!1,h]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(G0e,{scope:t,triggerRef:a,contentRef:c,contentId:si(),titleId:si(),descriptionId:si(),open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};GJ.displayName=WH;var KJ="DialogTrigger",YJ=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(KJ,n),i=_t(t,s.triggerRef);return _.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":YH(s.open),...r,ref:i,onClick:Ae(e.onClick,s.onOpenToggle)})});YJ.displayName=KJ;var qH="DialogPortal",[K0e,XJ]=WJ(qH,{forceMount:void 0}),QJ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Dc(qH,t);return _.jsx(K0e,{scope:t,forceMount:n,children:C.Children.map(r,o=>_.jsx(Vr,{present:n||i.open,children:_.jsx(Dx,{asChild:!0,container:s,children:o})}))})};QJ.displayName=qH;var pT="DialogOverlay",ZJ=C.forwardRef((e,t)=>{const n=XJ(pT,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Dc(pT,e.__scopeDialog);return i.modal?_.jsx(Vr,{present:r||i.open,children:_.jsx(Y0e,{...s,ref:t})}):null});ZJ.displayName=pT;var Y0e=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(pT,n);return _.jsx(IA,{as:Cc,allowPinchZoom:!0,shards:[s.contentRef],children:_.jsx(He.div,{"data-state":YH(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$v="DialogContent",JJ=C.forwardRef((e,t)=>{const n=XJ($v,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Dc($v,e.__scopeDialog);return _.jsx(Vr,{present:r||i.open,children:i.modal?_.jsx(X0e,{...s,ref:t}):_.jsx(Q0e,{...s,ref:t})})});JJ.displayName=$v;var X0e=C.forwardRef((e,t)=>{const n=Dc($v,e.__scopeDialog),r=C.useRef(null),s=_t(t,n.contentRef,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(eee,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault())})}),Q0e=C.forwardRef((e,t)=>{const n=Dc($v,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(eee,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),eee=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=Dc($v,n),c=C.useRef(null),d=_t(t,c);return uD(),_.jsxs(_.Fragment,{children:[_.jsx(MA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(Hf,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":YH(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(J0e,{titleId:a.titleId}),_.jsx(txe,{contentRef:c,descriptionId:a.descriptionId})]})]})}),GH="DialogTitle",tee=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(GH,n);return _.jsx(He.h2,{id:s.titleId,...r,ref:t})});tee.displayName=GH;var nee="DialogDescription",KH=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(nee,n);return _.jsx(He.p,{id:s.descriptionId,...r,ref:t})});KH.displayName=nee;var ree="DialogClose",see=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(ree,n);return _.jsx(He.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});see.displayName=ree;function YH(e){return e?"open":"closed"}var iee="DialogTitleWarning",[Z0e,oee]=hye(iee,{contentName:$v,titleName:GH,docsSlug:"dialog"}),J0e=({titleId:e})=>{const t=oee(iee),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},exe="DialogDescriptionWarning",txe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${oee(exe).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},XH=GJ,QH=YJ,ZH=QJ,LA=ZJ,jA=JJ,$A=tee,FA=KH,zA=see,aee="AlertDialog",[nxe,r7e]=_r(aee,[qJ]),Wf=qJ(),lee=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wf(t);return _.jsx(XH,{...r,...n,modal:!0})};lee.displayName=aee;var rxe="AlertDialogTrigger",cee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(QH,{...s,...r,ref:t})});cee.displayName=rxe;var sxe="AlertDialogPortal",uee=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wf(t);return _.jsx(ZH,{...r,...n})};uee.displayName=sxe;var ixe="AlertDialogOverlay",dee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(LA,{...s,...r,ref:t})});dee.displayName=ixe;var kb="AlertDialogContent",[oxe,axe]=nxe(kb),fee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Wf(n),o=C.useRef(null),a=_t(t,o),c=C.useRef(null);return _.jsx(Z0e,{contentName:kb,titleName:hee,docsSlug:"alert-dialog",children:_.jsx(oxe,{scope:n,cancelRef:c,children:_.jsxs(jA,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:Ae(s.onOpenAutoFocus,d=>{var h;d.preventDefault(),(h=c.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[_.jsx(CH,{children:r}),_.jsx(cxe,{contentRef:o})]})})})});fee.displayName=kb;var hee="AlertDialogTitle",pee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx($A,{...s,...r,ref:t})});pee.displayName=hee;var mee="AlertDialogDescription",gee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(FA,{...s,...r,ref:t})});gee.displayName=mee;var lxe="AlertDialogAction",vee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(zA,{...s,...r,ref:t})});vee.displayName=lxe;var yee="AlertDialogCancel",bee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=axe(yee,n),i=Wf(n),o=_t(t,s);return _.jsx(zA,{...i,...r,ref:o})});bee.displayName=yee;var cxe=({contentRef:e})=>{const t=`\`${kb}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${kb}\` by passing a \`${mee}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${kb}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},uxe=lee,dxe=cee,fxe=uee,xee=dee,_ee=fee,wee=vee,See=bee,Cee=pee,Eee=gee;const yC=Io("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),at=C.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?Cc:"button";return _.jsx(o,{className:ge(yC({variant:t,size:n,className:e})),ref:i,...s})});at.displayName="Button";const JH=uxe,hxe=dxe,pxe=fxe,Aee=C.forwardRef(({className:e,...t},n)=>_.jsx(xee,{className:ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Aee.displayName=xee.displayName;const pD=C.forwardRef(({className:e,...t},n)=>_.jsxs(pxe,{children:[_.jsx(Aee,{}),_.jsx(_ee,{ref:n,className:ge("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));pD.displayName=_ee.displayName;const mD=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col space-y-2 text-center sm:text-left",e),...t});mD.displayName="AlertDialogHeader";const gD=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});gD.displayName="AlertDialogFooter";const vD=C.forwardRef(({className:e,...t},n)=>_.jsx(Cee,{ref:n,className:ge("text-lg font-semibold",e),...t}));vD.displayName=Cee.displayName;const yD=C.forwardRef(({className:e,...t},n)=>_.jsx(Eee,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));yD.displayName=Eee.displayName;const bD=C.forwardRef(({className:e,...t},n)=>_.jsx(wee,{ref:n,className:ge(yC(),e),...t}));bD.displayName=wee.displayName;const xD=C.forwardRef(({className:e,...t},n)=>_.jsx(See,{ref:n,className:ge(yC({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));xD.displayName=See.displayName;const mxe=({textAreaRef:e,triggerAutoSize:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=C.useState(!0);C.useEffect(()=>{if(e){s&&(e.style.minHeight=`${r+2}px`,n>r&&(e.style.maxHeight=`${n}px`),i(!1)),e.style.height=`${r+2}px`;const a=e.scrollHeight;a>n?e.style.height=`${n}px`:e.style.height=`${a+2}px`}},[e,t,s,n,r])},Ree=C.forwardRef(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,className:n,onChange:r,value:s,...i},o)=>{const a=C.useRef(null),[c,d]=C.useState("");return mxe({textAreaRef:a.current,triggerAutoSize:c,maxHeight:e,minHeight:t}),C.useImperativeHandle(o,()=>({textArea:a.current,focus:()=>{var h;return(h=a.current)==null?void 0:h.focus()},maxHeight:e,minHeight:t})),C.useEffect(()=>{(s||i!=null&&i.defaultValue)&&d(s)},[s||(i==null?void 0:i.defaultValue)]),_.jsx("textarea",{...i,value:s,ref:a,className:ge("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),onChange:h=>{d(h.target.value),r==null||r(h)}})});Ree.displayName="AutosizeTextarea";var e6="Avatar",[gxe,s7e]=_r(e6),[vxe,Pee]=gxe(e6),Nee=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,i]=C.useState("idle");return _.jsx(vxe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:_.jsx(He.span,{...r,ref:t})})});Nee.displayName=e6;var Tee="AvatarImage",kee=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=e,o=Pee(Tee,n),a=yxe(r),c=bn(d=>{s(d),o.onImageLoadingStatusChange(d)});return Rr(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?_.jsx(He.img,{...i,ref:t,src:r}):null});kee.displayName=Tee;var Dee="AvatarFallback",Oee=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,i=Pee(Dee,n),[o,a]=C.useState(r===void 0);return C.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?_.jsx(He.span,{...s,ref:t}):null});Oee.displayName=Dee;function yxe(e){const[t,n]=C.useState("idle");return Rr(()=>{if(!e){n("error");return}let r=!0;const s=new window.Image,i=o=>()=>{r&&n(o)};return n("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=e,()=>{r=!1}},[e]),t}var Mee=Nee,Iee=kee,Lee=Oee;const bxe=C.forwardRef(({className:e,...t},n)=>_.jsx(Mee,{ref:n,className:ge("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));bxe.displayName=Mee.displayName;const xxe=C.forwardRef(({className:e,...t},n)=>_.jsx(Iee,{ref:n,className:ge("aspect-square h-full w-full",e),...t}));xxe.displayName=Iee.displayName;const _xe=C.forwardRef(({className:e,...t},n)=>_.jsx(Lee,{ref:n,className:ge("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));_xe.displayName=Lee.displayName;const wxe=Io("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function _D({className:e,variant:t,...n}){return _.jsx("div",{className:ge(wxe({variant:t}),e),...n})}const Sxe=C.forwardRef(({...e},t)=>_.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Sxe.displayName="Breadcrumb";const Cxe=C.forwardRef(({className:e,...t},n)=>_.jsx("ol",{ref:n,className:ge("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Cxe.displayName="BreadcrumbList";const Exe=C.forwardRef(({className:e,...t},n)=>_.jsx("li",{ref:n,className:ge("inline-flex items-center gap-1.5",e),...t}));Exe.displayName="BreadcrumbItem";const Axe=C.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?Cc:"a";return _.jsx(s,{ref:r,className:ge("transition-colors hover:text-foreground",t),...n})});Axe.displayName="BreadcrumbLink";const Rxe=C.forwardRef(({className:e,...t},n)=>_.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ge("font-normal text-foreground",e),...t}));Rxe.displayName="BreadcrumbPage";function Pn(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Za(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Co(e,t){const n=Pn(e);return isNaN(t)?Za(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Ec(e,t){const n=Pn(e);if(isNaN(t))return Za(e,NaN);if(!t)return n;const r=n.getDate(),s=Za(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const t6=6048e5,Pxe=864e5;let Nxe={};function BA(){return Nxe}function Ru(e,t){var a,c,d,h;const n=BA(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,s=Pn(e),i=s.getDay(),o=(i=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function ix(e){const t=Pn(e);return t.setHours(0,0,0,0),t}function mT(e){const t=Pn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function gu(e,t){const n=ix(e),r=ix(t),s=+n-mT(n),i=+r-mT(r);return Math.round((s-i)/Pxe)}function Txe(e){const t=jee(e),n=Za(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Fv(n)}function FB(e,t){const n=t*7;return Co(e,n)}function kxe(e,t){return Ec(e,t*12)}function Dxe(e){let t;return e.forEach(function(n){const r=Pn(n);(t===void 0||t{const r=Pn(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Qo(e,t){const n=ix(e),r=ix(t);return+n==+r}function n6(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Mxe(e){if(!n6(e)&&typeof e!="number")return!1;const t=Pn(e);return!isNaN(Number(t))}function bC(e,t){const n=Pn(e),r=Pn(t),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function Ixe(e,t,n){const r=Ru(e,n),s=Ru(t,n),i=+r-mT(r),o=+s-mT(s);return Math.round((i-o)/t6)}function r6(e){const t=Pn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function sa(e){const t=Pn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function $ee(e){const t=Pn(e),n=Za(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function s6(e,t){var a,c,d,h;const n=BA(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,s=Pn(e),i=s.getDay(),o=(i{let r;const s=Lxe[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function G3(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const $xe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Fxe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zxe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bxe={date:G3({formats:$xe,defaultWidth:"full"}),time:G3({formats:Fxe,defaultWidth:"full"}),dateTime:G3({formats:zxe,defaultWidth:"full"})},Uxe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vxe=(e,t,n,r)=>Uxe[e];function IS(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const Hxe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wxe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qxe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Gxe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Kxe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Yxe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xxe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Qxe={ordinalNumber:Xxe,era:IS({values:Hxe,defaultWidth:"wide"}),quarter:IS({values:Wxe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:IS({values:qxe,defaultWidth:"wide"}),day:IS({values:Gxe,defaultWidth:"wide"}),dayPeriod:IS({values:Kxe,defaultWidth:"wide",formattingValues:Yxe,defaultFormattingWidth:"wide"})};function LS(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?Jxe(a,u=>u.test(o)):Zxe(a,u=>u.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(o.length);return{value:d,rest:h}}}function Zxe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Jxe(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const t_e=/^(\d+)(th|st|nd|rd)?/i,n_e=/\d+/i,r_e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},s_e={any:[/^b/i,/^(a|c)/i]},i_e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},o_e={any:[/1/i,/2/i,/3/i,/4/i]},a_e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},l_e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},c_e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},u_e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},d_e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},f_e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},h_e={ordinalNumber:e_e({matchPattern:t_e,parsePattern:n_e,valueCallback:e=>parseInt(e,10)}),era:LS({matchPatterns:r_e,defaultMatchWidth:"wide",parsePatterns:s_e,defaultParseWidth:"any"}),quarter:LS({matchPatterns:i_e,defaultMatchWidth:"wide",parsePatterns:o_e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:LS({matchPatterns:a_e,defaultMatchWidth:"wide",parsePatterns:l_e,defaultParseWidth:"any"}),day:LS({matchPatterns:c_e,defaultMatchWidth:"wide",parsePatterns:u_e,defaultParseWidth:"any"}),dayPeriod:LS({matchPatterns:d_e,defaultMatchWidth:"any",parsePatterns:f_e,defaultParseWidth:"any"})},zee={code:"en-US",formatDistance:jxe,formatLong:Bxe,formatRelative:Vxe,localize:Qxe,match:h_e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function p_e(e){const t=Pn(e);return gu(t,$ee(t))+1}function Bee(e){const t=Pn(e),n=+Fv(t)-+Txe(t);return Math.round(n/t6)+1}function Uee(e,t){var h,u,f,g;const n=Pn(e),r=n.getFullYear(),s=BA(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=Za(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=Ru(o,t),c=Za(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Ru(c,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function m_e(e,t){var a,c,d,h;const n=BA(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,s=Uee(e,t),i=Za(e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Ru(i,t)}function Vee(e,t){const n=Pn(e),r=+Ru(n,t)-+m_e(n,t);return Math.round(r/t6)+1}function Jn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Zf={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Jn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Jn(n+1,2)},d(e,t){return Jn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Jn(e.getHours()%12||12,t.length)},H(e,t){return Jn(e.getHours(),t.length)},m(e,t){return Jn(e.getMinutes(),t.length)},s(e,t){return Jn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Jn(s,t.length)}},Dy={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qG={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Zf.y(e,t)},Y:function(e,t,n,r){const s=Uee(e,r),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return Jn(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Jn(i,t.length)},R:function(e,t){const n=jee(e);return Jn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Jn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Jn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Jn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Zf.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Jn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=Vee(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Jn(s,t.length)},I:function(e,t,n){const r=Bee(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Jn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Zf.d(e,t)},D:function(e,t,n){const r=p_e(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Jn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Jn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Jn(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return Jn(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Dy.noon:r===0?s=Dy.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Dy.evening:r>=12?s=Dy.afternoon:r>=4?s=Dy.morning:s=Dy.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Zf.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zf.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zf.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zf.s(e,t)},S:function(e,t){return Zf.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return KG(r);case"XXXX":case"XX":return tg(r);case"XXXXX":case"XXX":default:return tg(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return KG(r);case"xxxx":case"xx":return tg(r);case"xxxxx":case"xxx":default:return tg(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+GG(r,":");case"OOOO":default:return"GMT"+tg(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+GG(r,":");case"zzzz":default:return"GMT"+tg(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Jn(r,t.length)},T:function(e,t,n){const r=e.getTime();return Jn(r,t.length)}};function GG(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+t+Jn(i,2)}function KG(e,t){return e%60===0?(e>0?"-":"+")+Jn(Math.abs(e)/60,2):tg(e,t)}function tg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Jn(Math.trunc(r/60),2),i=Jn(r%60,2);return n+s+t+i}const YG=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Hee=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},g_e=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return YG(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",YG(r,t)).replace("{{time}}",Hee(s,t))},v_e={p:Hee,P:g_e},y_e=/^D+$/,b_e=/^Y+$/,x_e=["D","DD","YY","YYYY"];function __e(e){return y_e.test(e)}function w_e(e){return b_e.test(e)}function S_e(e,t,n){const r=C_e(e,t,n);if(console.warn(r),x_e.includes(e))throw new RangeError(r)}function C_e(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const E_e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,R_e=/^'([^]*?)'?$/,P_e=/''/g,N_e=/[a-zA-Z]/;function ay(e,t,n){var h,u,f,g,v,m,x,y;const r=BA(),s=(n==null?void 0:n.locale)??r.locale??zee,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((m=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((y=(x=r.locale)==null?void 0:x.options)==null?void 0:y.weekStartsOn)??0,a=Pn(e);if(!Mxe(a))throw new RangeError("Invalid time value");let c=t.match(A_e).map(b=>{const w=b[0];if(w==="p"||w==="P"){const E=v_e[w];return E(b,s.formatLong)}return b}).join("").match(E_e).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:T_e(b)};if(qG[w])return{isToken:!0,value:b};if(w.match(N_e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&w_e(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&__e(w))&&S_e(w,t,String(e));const E=qG[w[0]];return E(a,w,s.localize,d)}).join("")}function T_e(e){const t=e.match(R_e);return t?t[1].replace(P_e,"'"):e}function k_e(e){const t=Pn(e),n=t.getFullYear(),r=t.getMonth(),s=Za(e,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function D_e(e){return Math.trunc(+Pn(e)/1e3)}function O_e(e){const t=Pn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function M_e(e,t){return Ixe(O_e(e),sa(e),t)+1}function zB(e,t){const n=Pn(e),r=Pn(t);return n.getTime()>r.getTime()}function Wee(e,t){const n=Pn(e),r=Pn(t);return+n<+r}function i6(e,t){const n=Pn(e),r=Pn(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function I_e(e,t){const n=Pn(e),r=Pn(t);return n.getFullYear()===r.getFullYear()}function K3(e,t){return Co(e,-t)}function Y3(e,t){const n=Pn(e),r=n.getFullYear(),s=n.getDate(),i=Za(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const o=k_e(i);return n.setMonth(t,Math.min(s,o)),n}function XG(e,t){const n=Pn(e);return isNaN(+n)?Za(e,NaN):(n.setFullYear(t),n)}var Mt=function(){return Mt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r1&&(c||!d),u=t>1&&(d||!c),f=function(){r&&i(r)},g=function(){s&&i(s)};return _.jsx(pwe,{displayMonth:e.displayMonth,hideNext:h,hidePrevious:u,nextMonth:s,previousMonth:r,onPreviousClick:f,onNextClick:g})}function mwe(e){var t,n=Pr(),r=n.classNames,s=n.disableNavigation,i=n.styles,o=n.captionLayout,a=n.components,c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:Kee,d;return s?d=_.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?d=_.jsx(QG,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?d=_.jsxs(_.Fragment,{children:[_.jsx(QG,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),_.jsx(ZG,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=_.jsxs(_.Fragment,{children:[_.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_.jsx(ZG,{displayMonth:e.displayMonth,id:e.id})]}),_.jsx("div",{className:r.caption,style:i.caption,children:d})}function gwe(e){var t=Pr(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?_.jsx("tfoot",{className:s,style:r.tfoot,children:_.jsx("tr",{children:_.jsx("td",{colSpan:8,children:n})})}):_.jsx(_.Fragment,{})}function vwe(e,t,n){for(var r=n?Fv(new Date):Ru(new Date,{locale:e,weekStartsOn:t}),s=[],i=0;i<7;i++){var o=Co(r,i);s.push(o)}return s}function ywe(){var e=Pr(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,i=e.weekStartsOn,o=e.ISOWeek,a=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=vwe(s,i,o);return _.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&_.jsx("td",{style:n.head_cell,className:t.head_cell}),d.map(function(h,u){return _.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(h,{locale:s}),children:a(h,{locale:s})},u)})]})}function bwe(){var e,t=Pr(),n=t.classNames,r=t.styles,s=t.components,i=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:ywe;return _.jsx("thead",{style:r.head,className:n.head,children:_.jsx(i,{})})}function xwe(e){var t=Pr(),n=t.locale,r=t.formatters.formatDay;return _.jsx(_.Fragment,{children:r(e.date,{locale:n})})}var o6=C.createContext(void 0);function _we(e){if(!UA(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return _.jsx(o6.Provider,{value:t,children:e.children})}return _.jsx(wwe,{initialProps:e.initialProps,children:e.children})}function wwe(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,i=t.max,o=function(d,h,u){var f,g;(f=t.onDayClick)===null||f===void 0||f.call(t,d,h,u);var v=!!(h.selected&&s&&(r==null?void 0:r.length)===s);if(!v){var m=!!(!h.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var x=r?qee([],r):[];if(h.selected){var y=x.findIndex(function(b){return Qo(d,b)});x.splice(y,1)}else x.push(d);(g=t.onSelect)===null||g===void 0||g.call(t,x,d,h,u)}}},a={disabled:[]};r&&a.disabled.push(function(d){var h=i&&r.length>i-1,u=r.some(function(f){return Qo(f,d)});return!!(h&&!u)});var c={selected:r,onDayClick:o,modifiers:a};return _.jsx(o6.Provider,{value:c,children:n})}function a6(){var e=C.useContext(o6);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Swe(e,t){var n=t||{},r=n.from,s=n.to;return r&&s?Qo(s,e)&&Qo(r,e)?void 0:Qo(s,e)?{from:s,to:void 0}:Qo(r,e)?void 0:zB(r,e)?{from:e,to:s}:{from:r,to:e}:s?zB(e,s)?{from:s,to:e}:{from:e,to:s}:r?Wee(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var l6=C.createContext(void 0);function Cwe(e){if(!VA(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return _.jsx(l6.Provider,{value:t,children:e.children})}return _.jsx(Ewe,{initialProps:e.initialProps,children:e.children})}function Ewe(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},i=s.from,o=s.to,a=t.min,c=t.max,d=function(g,v,m){var x,y;(x=t.onDayClick)===null||x===void 0||x.call(t,g,v,m);var b=Swe(g,r);(y=t.onSelect)===null||y===void 0||y.call(t,b,g,v,m)},h={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(h.range_start=[i],o?(h.range_end=[o],Qo(i,o)||(h.range_middle=[{after:i,before:o}])):h.range_end=[i]):o&&(h.range_start=[o],h.range_end=[o]),a&&(i&&!o&&h.disabled.push({after:K3(i,a-1),before:Co(i,a-1)}),i&&o&&h.disabled.push({after:i,before:Co(i,a-1)}),!i&&o&&h.disabled.push({after:K3(o,a-1),before:Co(o,a-1)})),c){if(i&&!o&&(h.disabled.push({before:Co(i,-c+1)}),h.disabled.push({after:Co(i,c-1)})),i&&o){var u=gu(o,i)+1,f=c-u;h.disabled.push({before:K3(i,f)}),h.disabled.push({after:Co(o,f)})}!i&&o&&(h.disabled.push({before:Co(o,-c+1)}),h.disabled.push({after:Co(o,c-1)}))}return _.jsx(l6.Provider,{value:{selected:r,onDayClick:d,modifiers:h},children:n})}function c6(){var e=C.useContext(l6);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function XP(e){return Array.isArray(e)?qee([],e):e!==void 0?[e]:[]}function Awe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=XP(s)}),t}var Ac;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ac||(Ac={}));var Rwe=Ac.Selected,Td=Ac.Disabled,Pwe=Ac.Hidden,Nwe=Ac.Today,X3=Ac.RangeEnd,Q3=Ac.RangeMiddle,Z3=Ac.RangeStart,Twe=Ac.Outside;function kwe(e,t,n){var r,s=(r={},r[Rwe]=XP(e.selected),r[Td]=XP(e.disabled),r[Pwe]=XP(e.hidden),r[Nwe]=[e.today],r[X3]=[],r[Q3]=[],r[Z3]=[],r[Twe]=[],r);return e.fromDate&&s[Td].push({before:e.fromDate}),e.toDate&&s[Td].push({after:e.toDate}),UA(e)?s[Td]=s[Td].concat(t.modifiers[Td]):VA(e)&&(s[Td]=s[Td].concat(n.modifiers[Td]),s[Z3]=n.modifiers[Z3],s[Q3]=n.modifiers[Q3],s[X3]=n.modifiers[X3]),s}var Qee=C.createContext(void 0);function Dwe(e){var t=Pr(),n=a6(),r=c6(),s=kwe(t,n,r),i=Awe(t.modifiers),o=Mt(Mt({},s),i);return _.jsx(Qee.Provider,{value:o,children:e.children})}function Zee(){var e=C.useContext(Qee);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Owe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Mwe(e){return!!(e&&typeof e=="object"&&"from"in e)}function Iwe(e){return!!(e&&typeof e=="object"&&"after"in e)}function Lwe(e){return!!(e&&typeof e=="object"&&"before"in e)}function jwe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function $we(e,t){var n,r=t.from,s=t.to;if(r&&s){var i=gu(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var o=gu(e,r)>=0&&gu(s,e)>=0;return o}return s?Qo(s,e):r?Qo(r,e):!1}function Fwe(e){return n6(e)}function zwe(e){return Array.isArray(e)&&e.every(n6)}function Bwe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Fwe(n))return Qo(e,n);if(zwe(n))return n.includes(e);if(Mwe(n))return $we(e,n);if(jwe(n))return n.dayOfWeek.includes(e.getDay());if(Owe(n)){var r=gu(n.before,e),s=gu(n.after,e),i=r>0,o=s<0,a=zB(n.before,n.after);return a?o&&i:i||o}return Iwe(n)?gu(e,n.after)>0:Lwe(n)?gu(n.before,e)>0:typeof n=="function"?n(e):!1})}function u6(e,t,n){var r=Object.keys(t).reduce(function(i,o){var a=t[o];return Bwe(e,a)&&i.push(o),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!i6(e,n)&&(s.outside=!0),s}function Uwe(e,t){for(var n=sa(e[0]),r=r6(e[e.length-1]),s,i,o=n;o<=r;){var a=u6(o,t),c=!a.disabled&&!a.hidden;if(!c){o=Co(o,1);continue}if(a.selected)return o;a.today&&!i&&(i=o),s||(s=o),o=Co(o,1)}return i||s}var Vwe=365;function Jee(e,t){var n=t.moveBy,r=t.direction,s=t.context,i=t.modifiers,o=t.retry,a=o===void 0?{count:0,lastFocused:e}:o,c=s.weekStartsOn,d=s.fromDate,h=s.toDate,u=s.locale,f={day:Co,week:FB,month:Ec,year:kxe,startOfWeek:function(x){return s.ISOWeek?Fv(x):Ru(x,{locale:u,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?Fee(x):s6(x,{locale:u,weekStartsOn:c})}},g=f[n](e,r==="after"?1:-1);r==="before"&&d?g=Dxe([d,g]):r==="after"&&h&&(g=Oxe([h,g]));var v=!0;if(i){var m=u6(g,i);v=!m.disabled&&!m.hidden}return v?g:a.count>Vwe?a.lastFocused:Jee(g,{moveBy:n,direction:r,context:s,modifiers:i,retry:Mt(Mt({},a),{count:a.count+1})})}var ete=C.createContext(void 0);function Hwe(e){var t=HA(),n=Zee(),r=C.useState(),s=r[0],i=r[1],o=C.useState(),a=o[0],c=o[1],d=Uwe(t.displayMonths,n),h=s??(a&&t.isDateDisplayed(a))?a:d,u=function(){c(s),i(void 0)},f=function(x){i(x)},g=Pr(),v=function(x,y){if(s){var b=Jee(s,{moveBy:x,direction:y,context:g,modifiers:n});Qo(s,b)||(t.goToDate(b,s),f(b))}},m={focusedDay:s,focusTarget:h,blur:u,focus:f,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return _.jsx(ete.Provider,{value:m,children:e.children})}function d6(){var e=C.useContext(ete);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Wwe(e,t){var n=Zee(),r=u6(e,n,t);return r}var f6=C.createContext(void 0);function qwe(e){if(!wD(e.initialProps)){var t={selected:void 0};return _.jsx(f6.Provider,{value:t,children:e.children})}return _.jsx(Gwe,{initialProps:e.initialProps,children:e.children})}function Gwe(e){var t=e.initialProps,n=e.children,r=function(i,o,a){var c,d,h;if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,a),o.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,i,o,a);return}(h=t.onSelect)===null||h===void 0||h.call(t,i,i,o,a)},s={selected:t.selected,onDayClick:r};return _.jsx(f6.Provider,{value:s,children:n})}function tte(){var e=C.useContext(f6);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Kwe(e,t){var n=Pr(),r=tte(),s=a6(),i=c6(),o=d6(),a=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,h=o.focusWeekBefore,u=o.blur,f=o.focus,g=o.focusMonthBefore,v=o.focusMonthAfter,m=o.focusYearBefore,x=o.focusYearAfter,y=o.focusStartOfWeek,b=o.focusEndOfWeek,w=function(Y){var H,se,he,re;wD(n)?(H=r.onDayClick)===null||H===void 0||H.call(r,e,t,Y):UA(n)?(se=s.onDayClick)===null||se===void 0||se.call(s,e,t,Y):VA(n)?(he=i.onDayClick)===null||he===void 0||he.call(i,e,t,Y):(re=n.onDayClick)===null||re===void 0||re.call(n,e,t,Y)},E=function(Y){var H;f(e),(H=n.onDayFocus)===null||H===void 0||H.call(n,e,t,Y)},R=function(Y){var H;u(),(H=n.onDayBlur)===null||H===void 0||H.call(n,e,t,Y)},T=function(Y){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,e,t,Y)},N=function(Y){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,e,t,Y)},A=function(Y){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,e,t,Y)},D=function(Y){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,e,t,Y)},O=function(Y){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,e,t,Y)},I=function(Y){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,e,t,Y)},$=function(Y){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,e,t,Y)},F=function(Y){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,e,t,Y)},B=function(Y){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,e,t,Y)},W=function(Y){var H;switch(Y.key){case"ArrowLeft":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?a():c();break;case"ArrowRight":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?c():a();break;case"ArrowDown":Y.preventDefault(),Y.stopPropagation(),d();break;case"ArrowUp":Y.preventDefault(),Y.stopPropagation(),h();break;case"PageUp":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?m():g();break;case"PageDown":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?x():v();break;case"Home":Y.preventDefault(),Y.stopPropagation(),y();break;case"End":Y.preventDefault(),Y.stopPropagation(),b();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,e,t,Y)},Z={onClick:w,onFocus:E,onBlur:R,onKeyDown:W,onKeyUp:B,onMouseEnter:T,onMouseLeave:N,onPointerEnter:A,onPointerLeave:D,onTouchCancel:O,onTouchEnd:I,onTouchMove:$,onTouchStart:F};return Z}function Ywe(){var e=Pr(),t=tte(),n=a6(),r=c6(),s=wD(e)?t.selected:UA(e)?n.selected:VA(e)?r.selected:void 0;return s}function Xwe(e){return Object.values(Ac).includes(e)}function Qwe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(Xwe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Zwe(e,t){var n=Mt({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=Mt(Mt({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function Jwe(e,t,n){var r,s,i,o=Pr(),a=d6(),c=Wwe(e,t),d=Kwe(e,c),h=Ywe(),u=!!(o.onDayClick||o.mode!=="default");C.useEffect(function(){var T;c.outside||a.focusedDay&&u&&Qo(a.focusedDay,e)&&((T=n.current)===null||T===void 0||T.focus())},[a.focusedDay,e,n,u,c.outside]);var f=Qwe(o,c).join(" "),g=Zwe(o,c),v=!!(c.outside&&!o.showOutsideDays||c.hidden),m=(i=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:xwe,x=_.jsx(m,{date:e,displayMonth:t,activeModifiers:c}),y={style:g,className:f,children:x,role:"gridcell"},b=a.focusTarget&&Qo(a.focusTarget,e)&&!c.outside,w=a.focusedDay&&Qo(a.focusedDay,e),E=Mt(Mt(Mt({},y),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||b?0:-1,r)),d),R={isButton:u,isHidden:v,activeModifiers:c,selectedDays:h,buttonProps:E,divProps:y};return R}function eSe(e){var t=C.useRef(null),n=Jwe(e.date,e.displayMonth,t);return n.isHidden?_.jsx("div",{role:"gridcell"}):n.isButton?_.jsx(gT,Mt({name:"day",ref:t},n.buttonProps)):_.jsx("div",Mt({},n.divProps))}function tSe(e){var t=e.number,n=e.dates,r=Pr(),s=r.onWeekNumberClick,i=r.styles,o=r.classNames,a=r.locale,c=r.labels.labelWeekNumber,d=r.formatters.formatWeekNumber,h=d(Number(t),{locale:a});if(!s)return _.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:h});var u=c(Number(t),{locale:a}),f=function(g){s(t,n,g)};return _.jsx(gT,{name:"week-number","aria-label":u,className:o.weeknumber,style:i.weeknumber,onClick:f,children:h})}function nSe(e){var t,n,r=Pr(),s=r.styles,i=r.classNames,o=r.showWeekNumber,a=r.components,c=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:eSe,d=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:tSe,h;return o&&(h=_.jsx("td",{className:i.cell,style:s.cell,children:_.jsx(d,{number:e.weekNumber,dates:e.dates})})),_.jsxs("tr",{className:i.row,style:s.row,children:[h,e.dates.map(function(u){return _.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:_.jsx(c,{displayMonth:e.displayMonth,date:u})},D_e(u))})]})}function JG(e,t,n){for(var r=n!=null&&n.ISOWeek?Fee(t):s6(t,n),s=n!=null&&n.ISOWeek?Fv(e):Ru(e,n),i=gu(r,s),o=[],a=0;a<=i;a++)o.push(Co(s,a));var c=o.reduce(function(d,h){var u=n!=null&&n.ISOWeek?Bee(h):Vee(h,n),f=d.find(function(g){return g.weekNumber===u});return f?(f.dates.push(h),d):(d.push({weekNumber:u,dates:[h]}),d)},[]);return c}function rSe(e,t){var n=JG(sa(e),r6(e),t);if(t!=null&&t.useFixedWeeks){var r=M_e(e,t);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],o=FB(i,6-r),a=JG(FB(i,1),o,t);n.push.apply(n,a)}}return n}function sSe(e){var t,n,r,s=Pr(),i=s.locale,o=s.classNames,a=s.styles,c=s.hideHead,d=s.fixedWeeks,h=s.components,u=s.weekStartsOn,f=s.firstWeekContainsDate,g=s.ISOWeek,v=rSe(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:g,locale:i,weekStartsOn:u,firstWeekContainsDate:f}),m=(t=h==null?void 0:h.Head)!==null&&t!==void 0?t:bwe,x=(n=h==null?void 0:h.Row)!==null&&n!==void 0?n:nSe,y=(r=h==null?void 0:h.Footer)!==null&&r!==void 0?r:gwe;return _.jsxs("table",{id:e.id,className:o.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&_.jsx(m,{}),_.jsx("tbody",{className:o.tbody,style:a.tbody,children:v.map(function(b){return _.jsx(x,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),_.jsx(y,{displayMonth:e.displayMonth})]})}function iSe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var oSe=iSe()?C.useLayoutEffect:C.useEffect,J3=!1,aSe=0;function e9(){return"react-day-picker-".concat(++aSe)}function lSe(e){var t,n=e??(J3?e9():null),r=C.useState(n),s=r[0],i=r[1];return oSe(function(){s===null&&i(e9())},[]),C.useEffect(function(){J3===!1&&(J3=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function cSe(e){var t,n,r=Pr(),s=r.dir,i=r.classNames,o=r.styles,a=r.components,c=HA().displayMonths,d=lSe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),h=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,u=[i.month],f=o.month,g=e.displayIndex===0,v=e.displayIndex===c.length-1,m=!g&&!v;s==="rtl"&&(t=[g,v],v=t[0],g=t[1]),g&&(u.push(i.caption_start),f=Mt(Mt({},f),o.caption_start)),v&&(u.push(i.caption_end),f=Mt(Mt({},f),o.caption_end)),m&&(u.push(i.caption_between),f=Mt(Mt({},f),o.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:mwe;return _.jsxs("div",{className:u.join(" "),style:f,children:[_.jsx(x,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_.jsx(sSe,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function uSe(e){var t=Pr(),n=t.classNames,r=t.styles;return _.jsx("div",{className:n.months,style:r.months,children:e.children})}function dSe(e){var t,n,r=e.initialProps,s=Pr(),i=d6(),o=HA(),a=C.useState(!1),c=a[0],d=a[1];C.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),d(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var h=[s.classNames.root,s.className];s.numberOfMonths>1&&h.push(s.classNames.multiple_months),s.showWeekNumber&&h.push(s.classNames.with_weeknumber);var u=Mt(Mt({},s.styles.root),s.style),f=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,m){var x;return Mt(Mt({},v),(x={},x[m]=r[m],x))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:uSe;return _.jsx("div",Mt({className:h.join(" "),style:u,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:_.jsx(g,{children:o.displayMonths.map(function(v,m){return _.jsx(cSe,{displayIndex:m,displayMonth:v},m)})})}))}function fSe(e){var t=e.children,n=L_e(e,["children"]);return _.jsx(twe,{initialProps:n,children:_.jsx(dwe,{children:_.jsx(qwe,{initialProps:n,children:_.jsx(_we,{initialProps:n,children:_.jsx(Cwe,{initialProps:n,children:_.jsx(Dwe,{children:_.jsx(Hwe,{children:t})})})})})})})}function hSe(e){return _.jsx(fSe,Mt({},e,{children:_.jsx(dSe,{initialProps:e})}))}function nte({className:e,classNames:t,showOutsideDays:n=!0,...r}){return _.jsx(hSe,{showOutsideDays:n,className:ge("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ge(yC({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ge(yC({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>_.jsx(lD,{className:"w-4 h-4"}),IconRight:()=>_.jsx(Tx,{className:"w-4 h-4"})},...r})}nte.displayName="Calendar";const bs=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("rounded-md border bg-card text-card-foreground shadow",e),...t}));bs.displayName="Card";const Go=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("flex flex-col space-y-1.5 p-6",e),...t}));Go.displayName="CardHeader";const ui=C.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:ge("font-semibold leading-none tracking-tight",e),...t}));ui.displayName="CardTitle";const Di=C.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));Di.displayName="CardDescription";const xs=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("p-6 pt-0",e),...t}));xs.displayName="CardContent";const fl=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("flex items-center p-6 pt-0",e),...t}));fl.displayName="CardFooter";var pSe=Array.isArray,SD=pSe,mSe=typeof xr=="object"&&xr&&xr.Object===Object&&xr,gSe=mSe,vSe=gSe,ySe=typeof self=="object"&&self&&self.Object===Object&&self,bSe=vSe||ySe||Function("return this")(),CD=bSe,xSe=CD,_Se=xSe.Symbol,h6=_Se,t9=h6,rte=Object.prototype,wSe=rte.hasOwnProperty,SSe=rte.toString,jS=t9?t9.toStringTag:void 0;function CSe(e){var t=wSe.call(e,jS),n=e[jS];try{e[jS]=void 0;var r=!0}catch{}var s=SSe.call(e);return r&&(t?e[jS]=n:delete e[jS]),s}var ESe=CSe,ASe=Object.prototype,RSe=ASe.toString;function PSe(e){return RSe.call(e)}var NSe=PSe,n9=h6,TSe=ESe,kSe=NSe,DSe="[object Null]",OSe="[object Undefined]",r9=n9?n9.toStringTag:void 0;function MSe(e){return e==null?e===void 0?OSe:DSe:r9&&r9 in Object(e)?TSe(e):kSe(e)}var p6=MSe;function ISe(e){return e!=null&&typeof e=="object"}var ste=ISe,LSe=p6,jSe=ste,$Se="[object Symbol]";function FSe(e){return typeof e=="symbol"||jSe(e)&&LSe(e)==$Se}var ED=FSe,zSe=SD,BSe=ED,USe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VSe=/^\w*$/;function HSe(e,t){if(zSe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||BSe(e)?!0:VSe.test(e)||!USe.test(e)||t!=null&&e in Object(t)}var WSe=HSe;function qSe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Mx=qSe;const GSe=Al(Mx);var KSe=p6,YSe=Mx,XSe="[object AsyncFunction]",QSe="[object Function]",ZSe="[object GeneratorFunction]",JSe="[object Proxy]";function e1e(e){if(!YSe(e))return!1;var t=KSe(e);return t==QSe||t==ZSe||t==XSe||t==JSe}var t1e=e1e,n1e=CD,r1e=n1e["__core-js_shared__"],s1e=r1e,e4=s1e,s9=function(){var e=/[^.]+$/.exec(e4&&e4.keys&&e4.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function i1e(e){return!!s9&&s9 in e}var o1e=i1e,a1e=Function.prototype,l1e=a1e.toString;function c1e(e){if(e!=null){try{return l1e.call(e)}catch{}try{return e+""}catch{}}return""}var u1e=c1e,d1e=t1e,f1e=o1e,h1e=Mx,p1e=u1e,m1e=/[\\^$.*+?()[\]{}|]/g,g1e=/^\[object .+?Constructor\]$/,v1e=Function.prototype,y1e=Object.prototype,b1e=v1e.toString,x1e=y1e.hasOwnProperty,_1e=RegExp("^"+b1e.call(x1e).replace(m1e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function w1e(e){if(!h1e(e)||f1e(e))return!1;var t=d1e(e)?_1e:g1e;return t.test(p1e(e))}var S1e=w1e;function C1e(e,t){return e==null?void 0:e[t]}var E1e=C1e,A1e=S1e,R1e=E1e;function P1e(e,t){var n=R1e(e,t);return A1e(n)?n:void 0}var ite=P1e,N1e=ite,T1e=N1e(Object,"create"),AD=T1e,i9=AD;function k1e(){this.__data__=i9?i9(null):{},this.size=0}var D1e=k1e;function O1e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var M1e=O1e,I1e=AD,L1e="__lodash_hash_undefined__",j1e=Object.prototype,$1e=j1e.hasOwnProperty;function F1e(e){var t=this.__data__;if(I1e){var n=t[e];return n===L1e?void 0:n}return $1e.call(t,e)?t[e]:void 0}var z1e=F1e,B1e=AD,U1e=Object.prototype,V1e=U1e.hasOwnProperty;function H1e(e){var t=this.__data__;return B1e?t[e]!==void 0:V1e.call(t,e)}var W1e=H1e,q1e=AD,G1e="__lodash_hash_undefined__";function K1e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q1e&&t===void 0?G1e:t,this}var Y1e=K1e,X1e=D1e,Q1e=M1e,Z1e=z1e,J1e=W1e,eCe=Y1e;function Ix(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}var yCe=vCe,bCe=RD;function xCe(e,t){var n=this.__data__,r=bCe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var _Ce=xCe,wCe=rCe,SCe=fCe,CCe=mCe,ECe=yCe,ACe=_Ce;function Lx(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t2?r-2:0),i=2;i=t||N<0||u&&A>=i}function y(){var T=n4();if(x(T))return b(T);a=setTimeout(y,m(T))}function b(T){return a=void 0,f&&r?g(T):(r=s=void 0,o)}function w(){a!==void 0&&clearTimeout(a),d=0,r=c=s=a=void 0}function E(){return a===void 0?o:b(n4())}function R(){var T=n4(),N=x(T);if(r=arguments,s=this,c=T,N){if(a===void 0)return v(c);if(u)return clearTimeout(a),a=setTimeout(y,t),g(c)}return a===void 0&&(a=setTimeout(y,t)),o}return R.cancel=w,R.flush=E,R}var bAe=yAe,xAe=bAe,_Ae=Mx,wAe="Expected a function";function SAe(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new TypeError(wAe);return _Ae(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),xAe(e,t,{leading:r,maxWait:t,trailing:s})}var CAe=SAe;const EAe=Al(CAe);function xC(e){"@babel/helpers - typeof";return xC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xC(e)}function h9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function tP(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(F=EAe(F,m,{trailing:!0,leading:!1}));var B=new ResizeObserver(F),W=R.current.getBoundingClientRect(),Z=W.width,Y=W.height;return I(Z,Y),B.observe(R.current),function(){B.disconnect()}},[I,m]);var $=C.useMemo(function(){var F=D.containerWidth,B=D.containerHeight;if(F<0||B<0)return null;t4(eP(o)||eP(c),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,c),t4(!n||n>0,"The aspect(%s) must be greater than zero.",n);var W=eP(o)?F:o,Z=eP(c)?B:c;n&&n>0&&(W?Z=W/n:Z&&(W=Z*n),f&&Z>f&&(Z=f)),t4(W>0||Z>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,W,Z,o,c,h,u,n);var Y=!Array.isArray(g)&&YEe(g.type).endsWith("Chart");return fe.Children.map(g,function(H){return fe.isValidElement(H)?C.cloneElement(H,tP({width:W,height:Z},Y?{style:tP({height:"100%",width:"100%",maxHeight:Z,maxWidth:W},H.props.style)}:{})):H})},[n,g,c,f,u,h,D,o]);return fe.createElement("div",{id:x?"".concat(x):void 0,className:oy("recharts-responsive-container",y),style:tP(tP({},E),{},{width:o,height:c,minWidth:h,minHeight:u,maxHeight:f}),ref:R},$)}),IAe="Invariant failed";function yr(e,t){if(!e)throw new Error(IAe)}function UB(){return UB=Object.assign?Object.assign.bind():function(e){for(var t=1;t");return e}const jAe=C.forwardRef(({id:e,className:t,children:n,config:r,...s},i)=>{const o=C.useId(),a=`chart-${e||o.replace(/:/g,"")}`;return _.jsx(cte.Provider,{value:{config:r},children:_.jsxs("div",{"data-chart":a,ref:i,className:ge("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...s,children:[_.jsx($Ae,{id:a,config:r}),_.jsx(MAe,{children:n})]})})});jAe.displayName="Chart";const $Ae=({id:e,config:t})=>{const n=Object.entries(t).filter(([r,s])=>s.theme||s.color);return n.length?_.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(LAe).map(([r,s])=>` ${s} [data-chart=${e}] { ${n.map(([i,o])=>{var c;const a=((c=o.theme)==null?void 0:c[r])||o.color;return a?` --color-${i}: ${a};`:null}).join(` `)} } `).join(` `)}}):null},FAe=C.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:o,labelFormatter:a,labelClassName:c,formatter:d,color:h,nameKey:u,labelKey:f},g)=>{const{config:v}=ute(),m=C.useMemo(()=>{var R;if(s||!(t!=null&&t.length))return null;const[y]=t,b=`${f||y.dataKey||y.name||"value"}`,w=VB(v,y,b),E=!f&&typeof o=="string"?((R=v[o])==null?void 0:R.label)||o:w==null?void 0:w.label;return a?_.jsx("div",{className:ge("font-medium",c),children:a(E,t)}):E?_.jsx("div",{className:ge("font-medium",c),children:E}):null},[o,a,t,s,c,v,f]);if(!e||!(t!=null&&t.length))return null;const x=t.length===1&&r!=="dot";return _.jsxs("div",{ref:g,className:ge("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[x?null:m,_.jsx("div",{className:"grid gap-1.5",children:t.map((y,b)=>{const w=`${u||y.name||y.dataKey||"value"}`,E=VB(v,y,w),R=h||y.payload.fill||y.color;return _.jsx("div",{className:ge("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:d&&(y==null?void 0:y.value)!==void 0&&y.name?d(y.value,y.name,y,b,y.payload):_.jsxs(_.Fragment,{children:[E!=null&&E.icon?_.jsx(E.icon,{}):!i&&_.jsx("div",{className:ge("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":x&&r==="dashed"}),style:{"--color-bg":R,"--color-border":R}}),_.jsxs("div",{className:ge("flex flex-1 justify-between leading-none",x?"items-end":"items-center"),children:[_.jsxs("div",{className:"grid gap-1.5",children:[x?m:null,_.jsx("span",{className:"text-muted-foreground",children:(E==null?void 0:E.label)||y.name})]}),y.value&&_.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:y.value.toLocaleString()})]})]})},y.dataKey)})})]})});FAe.displayName="ChartTooltip";const zAe=C.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:o}=ute();return n!=null&&n.length?_.jsx("div",{ref:i,className:ge("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.map(a=>{const c=`${s||a.dataKey||"value"}`,d=VB(o,a,c);return _.jsxs("div",{className:ge("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d!=null&&d.icon&&!t?_.jsx(d.icon,{}):_.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:a.color}}),d==null?void 0:d.label]},a.value)})}):null});zAe.displayName="ChartLegend";function VB(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let s=n;return n in t&&typeof t[n]=="string"?s=t[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in e?e[s]:e[n]}function $x(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function WA(e){const[t,n]=C.useState(void 0);return Rr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,a=d.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var y6="Checkbox",[BAe,i7e]=_r(y6),[UAe,VAe]=BAe(y6),dte=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:d,...h}=e,[u,f]=C.useState(null),g=_t(t,w=>f(w)),v=C.useRef(!1),m=u?!!u.closest("form"):!0,[x=!1,y]=os({prop:s,defaultProp:i,onChange:d}),b=C.useRef(x);return C.useEffect(()=>{const w=u==null?void 0:u.form;if(w){const E=()=>y(b.current);return w.addEventListener("reset",E),()=>w.removeEventListener("reset",E)}},[u,y]),_.jsxs(UAe,{scope:n,state:x,disabled:a,children:[_.jsx(He.button,{type:"button",role:"checkbox","aria-checked":Cv(x)?"mixed":x,"aria-required":o,"data-state":pte(x),"data-disabled":a?"":void 0,disabled:a,value:c,...h,ref:g,onKeyDown:Ae(e.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:Ae(e.onClick,w=>{y(E=>Cv(E)?!0:!E),m&&(v.current=w.isPropagationStopped(),v.current||w.stopPropagation())})}),m&&_.jsx(HAe,{control:u,bubbles:!v.current,name:r,value:c,checked:x,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});dte.displayName=y6;var fte="CheckboxIndicator",hte=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=VAe(fte,n);return _.jsx(Vr,{present:r||Cv(i.state)||i.state===!0,children:_.jsx(He.span,{"data-state":pte(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});hte.displayName=fte;var HAe=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,i=C.useRef(null),o=$x(n),a=WA(t);return C.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&u){const f=new Event("click",{bubbles:r});c.indeterminate=Cv(n),u.call(c,Cv(n)?!1:n),c.dispatchEvent(f)}},[o,n,r]),_.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Cv(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Cv(e){return e==="indeterminate"}function pte(e){return Cv(e)?"indeterminate":e?"checked":"unchecked"}var mte=dte,WAe=hte;const _C=C.forwardRef(({className:e,...t},n)=>_.jsx(mte,{ref:n,className:ge("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:_.jsx(WAe,{className:ge("flex items-center justify-center text-current"),children:_.jsx(OA,{className:"h-4 w-4"})})}));_C.displayName=mte.displayName;var m9=1,qAe=.9,GAe=.8,KAe=.17,r4=.1,s4=.999,YAe=.9999,XAe=.99,QAe=/[\\\/_+.#"@\[\(\{&]/,ZAe=/[\\\/_+.#"@\[\(\{&]/g,JAe=/[\s-]/,gte=/[\s-]/g;function HB(e,t,n,r,s,i,o){if(i===t.length)return s===e.length?m9:XAe;var a=`${s},${i}`;if(o[a]!==void 0)return o[a];for(var c=r.charAt(i),d=n.indexOf(c,s),h=0,u,f,g,v;d>=0;)u=HB(e,t,n,r,d+1,i+1,o),u>h&&(d===s?u*=m9:QAe.test(e.charAt(d-1))?(u*=GAe,g=e.slice(s,d-1).match(ZAe),g&&s>0&&(u*=Math.pow(s4,g.length))):JAe.test(e.charAt(d-1))?(u*=qAe,v=e.slice(s,d-1).match(gte),v&&s>0&&(u*=Math.pow(s4,v.length))):(u*=KAe,s>0&&(u*=Math.pow(s4,d-s))),e.charAt(d)!==t.charAt(i)&&(u*=YAe)),(uu&&(u=f*r4)),u>h&&(h=u),d=n.indexOf(c,d+1);return o[a]=h,h}function g9(e){return e.toLowerCase().replace(gte," ")}function eRe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,HB(e,t,g9(e),g9(t),0,0,{})}function lp(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function v9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zv(...e){return t=>{let n=!1;const r=e.map(s=>{const i=v9(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:o,...a}=i,c=C.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=C.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function nRe(e,t=[]){let n=[];function r(i,o){const a=C.createContext(o),c=n.length;n=[...n,o];const d=u=>{var y;const{scope:f,children:g,...v}=u,m=((y=f==null?void 0:f[e])==null?void 0:y[c])||a,x=C.useMemo(()=>v,Object.values(v));return _.jsx(m.Provider,{value:x,children:g})};d.displayName=i+"Provider";function h(u,f){var m;const g=((m=f==null?void 0:f[e])==null?void 0:m[c])||a,v=C.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,rRe(s,...t)]}function rRe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}const vT=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},sRe=Tv.useId||(()=>{});let iRe=0;function Cf(e){const[t,n]=C.useState(sRe());return vT(()=>{n(r=>r??String(iRe++))},[e]),t?`radix-${t}`:""}function Bv(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function oRe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=aRe({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=Bv(n),c=C.useCallback(d=>{if(i){const u=typeof d=="function"?d(e):d;u!==e&&a(u)}else s(d)},[i,e,s,a]);return[o,c]}function aRe({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,s=C.useRef(r),i=Bv(t);return C.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var b6=C.forwardRef((e,t)=>{const{children:n,...r}=e,s=C.Children.toArray(n),i=s.find(cRe);if(i){const o=i.props.children,a=s.map(c=>c===i?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return _.jsx(WB,{...r,ref:t,children:C.isValidElement(o)?C.cloneElement(o,void 0,a):null})}return _.jsx(WB,{...r,ref:t,children:n})});b6.displayName="Slot";var WB=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const s=dRe(n),i=uRe(r,n.props);return n.type!==C.Fragment&&(i.ref=t?zv(t,s):s),C.cloneElement(n,i)}return C.Children.count(n)>1?C.Children.only(null):null});WB.displayName="SlotClone";var lRe=({children:e})=>_.jsx(_.Fragment,{children:e});function cRe(e){return C.isValidElement(e)&&e.type===lRe}function uRe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function dRe(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fRe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zi=fRe.reduce((e,t)=>{const n=C.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?b6:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function hRe(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}function pRe(e,t=globalThis==null?void 0:globalThis.document){const n=Bv(e);C.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}var mRe="DismissableLayer",qB="dismissableLayer.update",gRe="dismissableLayer.pointerDownOutside",vRe="dismissableLayer.focusOutside",y9,vte=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yte=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,d=C.useContext(vte),[h,u]=C.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),v=ly(t,N=>u(N)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=h?m.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,R=xRe(N=>{const A=N.target,D=[...d.branches].some(O=>O.contains(A));!E||D||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},f),T=_Re(N=>{const A=N.target;[...d.branches].some(O=>O.contains(A))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},f);return pRe(N=>{b===d.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},f),C.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(y9=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),b9(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=y9)}},[h,f,n,d]),C.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),b9())},[h,d]),C.useEffect(()=>{const N=()=>g({});return document.addEventListener(qB,N),()=>document.removeEventListener(qB,N)},[]),_.jsx(zi.div,{...c,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:lp(e.onFocusCapture,T.onFocusCapture),onBlurCapture:lp(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:lp(e.onPointerDownCapture,R.onPointerDownCapture)})});yte.displayName=mRe;var yRe="DismissableLayerBranch",bRe=C.forwardRef((e,t)=>{const n=C.useContext(vte),r=C.useRef(null),s=ly(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(zi.div,{...e,ref:s})});bRe.displayName=yRe;function xRe(e,t=globalThis==null?void 0:globalThis.document){const n=Bv(e),r=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){bte(gRe,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _Re(e,t=globalThis==null?void 0:globalThis.document){const n=Bv(e),r=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!r.current&&bte(vRe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function b9(){const e=new CustomEvent(qB);document.dispatchEvent(e)}function bte(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?hRe(s,i):s.dispatchEvent(i)}var i4="focusScope.autoFocusOnMount",o4="focusScope.autoFocusOnUnmount",x9={bubbles:!1,cancelable:!0},wRe="FocusScope",xte=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=C.useState(null),d=Bv(s),h=Bv(i),u=C.useRef(null),f=ly(t,m=>c(m)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const E=w.target;a.contains(E)?u.current=E:nh(u.current,{select:!0})},x=function(w){if(g.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||nh(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&nh(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,g.paused]),C.useEffect(()=>{if(a){w9.add(g);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(i4,x9);a.addEventListener(i4,d),a.dispatchEvent(y),y.defaultPrevented||(SRe(PRe(_te(a)),{select:!0}),document.activeElement===m&&nh(a))}return()=>{a.removeEventListener(i4,d),setTimeout(()=>{const y=new CustomEvent(o4,x9);a.addEventListener(o4,h),a.dispatchEvent(y),y.defaultPrevented||nh(m??document.body,{select:!0}),a.removeEventListener(o4,h),w9.remove(g)},0)}}},[a,d,h,g]);const v=C.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[w,E]=CRe(b);w&&E?!m.shiftKey&&y===E?(m.preventDefault(),n&&nh(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&nh(E,{select:!0})):y===b&&m.preventDefault()}},[n,r,g.paused]);return _.jsx(zi.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});xte.displayName=wRe;function SRe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nh(r,{select:t}),document.activeElement!==n)return}function CRe(e){const t=_te(e),n=_9(t,e),r=_9(t.reverse(),e);return[n,r]}function _te(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _9(e,t){for(const n of e)if(!ERe(n,{upTo:t}))return n}function ERe(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 ARe(e){return e instanceof HTMLInputElement&&"select"in e}function nh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ARe(e)&&t&&e.select()}}var w9=RRe();function RRe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=S9(e,t),e.unshift(t)},remove(t){var n;e=S9(e,t),(n=e[0])==null||n.resume()}}}function S9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function PRe(e){return e.filter(t=>t.tagName!=="A")}var NRe="Portal",wte=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=C.useState(!1);vT(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?kA.createPortal(_.jsx(zi.div,{...r,ref:t}),o):null});wte.displayName=NRe;function TRe(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var FD=e=>{const{present:t,children:n}=e,r=kRe(t),s=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=ly(r.ref,DRe(s));return typeof n=="function"||r.isPresent?C.cloneElement(s,{ref:i}):null};FD.displayName="Presence";function kRe(e){const[t,n]=C.useState(),r=C.useRef({}),s=C.useRef(e),i=C.useRef("none"),o=e?"mounted":"unmounted",[a,c]=TRe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const d=nP(r.current);i.current=a==="mounted"?d:"none"},[a]),vT(()=>{const d=r.current,h=s.current;if(h!==e){const f=i.current,g=nP(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),vT(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,u=g=>{const m=nP(r.current).includes(g.animationName);if(g.target===t&&m&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=g=>{g.target===t&&(i.current=nP(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function nP(e){return(e==null?void 0:e.animationName)||"none"}function DRe(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var a4=0;function ORe(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??C9()),document.body.insertAdjacentElement("beforeend",e[1]??C9()),a4++,()=>{a4===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),a4--}},[])}function C9(){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 Ste=UH(),l4=function(){},zD=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:l4,onWheelCapture:l4,onTouchMoveCapture:l4}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,u=e.shards,f=e.sideCar,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,w=dD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,R=BH([n,t]),T=fs(fs({},w),s);return C.createElement(C.Fragment,null,h&&C.createElement(E,{sideCar:Ste,removeScrollBar:d,shards:u,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),o?C.cloneElement(C.Children.only(a),fs(fs({},T),{ref:R})):C.createElement(y,fs({},T,{className:c,ref:R}),a))});zD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zD.classNames={fullWidth:Nb,zeroRight:Pb};var GB=!1;if(typeof window<"u")try{var rP=Object.defineProperty({},"passive",{get:function(){return GB=!0,!0}});window.addEventListener("test",rP,rP),window.removeEventListener("test",rP,rP)}catch{GB=!1}var Oy=GB?{passive:!1}:!1,MRe=function(e){return e.tagName==="TEXTAREA"},Cte=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!MRe(e)&&n[t]==="visible")},IRe=function(e){return Cte(e,"overflowY")},LRe=function(e){return Cte(e,"overflowX")},E9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Ete(e,r);if(s){var i=Ate(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jRe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$Re=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ete=function(e,t){return e==="v"?IRe(t):LRe(t)},Ate=function(e,t){return e==="v"?jRe(t):$Re(t)},FRe=function(e,t){return e==="h"&&t==="rtl"?-1:1},zRe=function(e,t,n,r,s){var i=FRe(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),d=!1,h=o>0,u=0,f=0;do{var g=Ate(e,a),v=g[0],m=g[1],x=g[2],y=m-x-i*v;(v||y)&&Ete(e,a)&&(u+=y,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(h&&Math.abs(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},sP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A9=function(e){return[e.deltaX,e.deltaY]},R9=function(e){return e&&"current"in e?e.current:e},BRe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},URe=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},VRe=0,My=[];function HRe(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),s=C.useState(VRe++)[0],i=C.useState(hD)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zH([e.lockRef.current],(e.shards||[]).map(R9),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=sP(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-y[0],E="deltaY"in m?m.deltaY:b[1]-y[1],R,T=m.target,N=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in m&&N==="h"&&T.type==="range")return!1;var A=E9(N,T);if(!A)return!0;if(A?R=N:(R=N==="v"?"h":"v",A=E9(N,T)),!A)return!1;if(!r.current&&"changedTouches"in m&&(w||E)&&(r.current=R),!R)return!0;var D=r.current||R;return zRe(D,x,m,D==="h"?w:E)},[]),c=C.useCallback(function(m){var x=m;if(!(!My.length||My[My.length-1]!==i)){var y="deltaY"in x?A9(x):sP(x),b=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&BRe(R.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(R9).filter(Boolean).filter(function(R){return R.contains(x.target)}),E=w.length>0?a(x,w[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),d=C.useCallback(function(m,x,y,b){var w={name:m,delta:x,target:y,should:b,shadowParent:WRe(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),h=C.useCallback(function(m){n.current=sP(m),r.current=void 0},[]),u=C.useCallback(function(m){d(m.type,A9(m),m.target,a(m,e.lockRef.current))},[]),f=C.useCallback(function(m){d(m.type,sP(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return My.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Oy),document.addEventListener("touchmove",c,Oy),document.addEventListener("touchstart",h,Oy),function(){My=My.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Oy),document.removeEventListener("touchmove",c,Oy),document.removeEventListener("touchstart",h,Oy)}},[]);var g=e.removeScrollBar,v=e.inert;return C.createElement(C.Fragment,null,v?C.createElement(i,{styles:URe(s)}):null,g?C.createElement(HH,{gapMode:e.gapMode}):null)}function WRe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qRe=VH(Ste,HRe);var Rte=C.forwardRef(function(e,t){return C.createElement(zD,fs({},e,{ref:t,sideCar:qRe}))});Rte.classNames=zD.classNames;var x6="Dialog",[Pte,o7e]=nRe(x6),[GRe,Oc]=Pte(x6),Nte=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=C.useRef(null),c=C.useRef(null),[d=!1,h]=oRe({prop:r,defaultProp:s,onChange:i});return _.jsx(GRe,{scope:t,triggerRef:a,contentRef:c,contentId:Cf(),titleId:Cf(),descriptionId:Cf(),open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};Nte.displayName=x6;var Tte="DialogTrigger",KRe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(Tte,n),i=ly(t,s.triggerRef);return _.jsx(zi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":S6(s.open),...r,ref:i,onClick:lp(e.onClick,s.onOpenToggle)})});KRe.displayName=Tte;var _6="DialogPortal",[YRe,kte]=Pte(_6,{forceMount:void 0}),Dte=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Oc(_6,t);return _.jsx(YRe,{scope:t,forceMount:n,children:C.Children.map(r,o=>_.jsx(FD,{present:n||i.open,children:_.jsx(wte,{asChild:!0,container:s,children:o})}))})};Dte.displayName=_6;var yT="DialogOverlay",Ote=C.forwardRef((e,t)=>{const n=kte(yT,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Oc(yT,e.__scopeDialog);return i.modal?_.jsx(FD,{present:r||i.open,children:_.jsx(XRe,{...s,ref:t})}):null});Ote.displayName=yT;var XRe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(yT,n);return _.jsx(Rte,{as:b6,allowPinchZoom:!0,shards:[s.contentRef],children:_.jsx(zi.div,{"data-state":S6(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Uv="DialogContent",Mte=C.forwardRef((e,t)=>{const n=kte(Uv,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Oc(Uv,e.__scopeDialog);return _.jsx(FD,{present:r||i.open,children:i.modal?_.jsx(QRe,{...s,ref:t}):_.jsx(ZRe,{...s,ref:t})})});Mte.displayName=Uv;var QRe=C.forwardRef((e,t)=>{const n=Oc(Uv,e.__scopeDialog),r=C.useRef(null),s=ly(t,n.contentRef,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(Ite,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:lp(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:lp(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:lp(e.onFocusOutside,i=>i.preventDefault())})}),ZRe=C.forwardRef((e,t)=>{const n=Oc(Uv,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(Ite,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Ite=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=Oc(Uv,n),c=C.useRef(null),d=ly(t,c);return ORe(),_.jsxs(_.Fragment,{children:[_.jsx(xte,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(yte,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":S6(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(nPe,{titleId:a.titleId}),_.jsx(sPe,{contentRef:c,descriptionId:a.descriptionId})]})]})}),w6="DialogTitle",JRe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(w6,n);return _.jsx(zi.h2,{id:s.titleId,...r,ref:t})});JRe.displayName=w6;var Lte="DialogDescription",ePe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(Lte,n);return _.jsx(zi.p,{id:s.descriptionId,...r,ref:t})});ePe.displayName=Lte;var jte="DialogClose",tPe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(jte,n);return _.jsx(zi.button,{type:"button",...r,ref:t,onClick:lp(e.onClick,()=>s.onOpenChange(!1))})});tPe.displayName=jte;function S6(e){return e?"open":"closed"}var $te="DialogTitleWarning",[a7e,Fte]=tRe($te,{contentName:Uv,titleName:w6,docsSlug:"dialog"}),nPe=({titleId:e})=>{const t=Fte($te),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},rPe="DialogDescriptionWarning",sPe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fte(rPe).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},iPe=Nte,oPe=Dte,aPe=Ote,lPe=Mte,$S='[cmdk-group=""]',c4='[cmdk-group-items=""]',cPe='[cmdk-group-heading=""]',zte='[cmdk-item=""]',P9=`${zte}:not([aria-disabled="true"])`,KB="cmdk-item-select",Ky="data-value",uPe=(e,t,n)=>eRe(e,t,n),Bte=C.createContext(void 0),qA=()=>C.useContext(Bte),Ute=C.createContext(void 0),C6=()=>C.useContext(Ute),Vte=C.createContext(void 0),Hte=C.forwardRef((e,t)=>{let n=Yy(()=>{var J,te;return{search:"",value:(te=(J=e.value)!=null?J:e.defaultValue)!=null?te:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Yy(()=>new Set),s=Yy(()=>new Map),i=Yy(()=>new Map),o=Yy(()=>new Set),a=Wte(e),{label:c,children:d,value:h,onValueChange:u,filter:f,shouldFilter:g,loop:v,disablePointerSelection:m=!1,vimBindings:x=!0,...y}=e,b=Cf(),w=Cf(),E=Cf(),R=C.useRef(null),T=_Pe();Vv(()=>{if(h!==void 0){let J=h.trim();n.current.value=J,N.emit()}},[h]),Vv(()=>{T(6,F)},[]);let N=C.useMemo(()=>({subscribe:J=>(o.current.add(J),()=>o.current.delete(J)),snapshot:()=>n.current,setState:(J,te,ae)=>{var be,xe,ve,Pe;if(!Object.is(n.current[J],te)){if(n.current[J]=te,J==="search")$(),O(),T(1,I);else if(J==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Oe=document.getElementById(E);Oe?Oe.focus():(be=document.getElementById(b))==null||be.focus()}if(T(7,()=>{var Oe;n.current.selectedItemId=(Oe=B())==null?void 0:Oe.id,N.emit()}),ae||T(5,F),((xe=a.current)==null?void 0:xe.value)!==void 0){let Oe=te??"";(Pe=(ve=a.current).onValueChange)==null||Pe.call(ve,Oe);return}}N.emit()}},emit:()=>{o.current.forEach(J=>J())}}),[]),A=C.useMemo(()=>({value:(J,te,ae)=>{var be;te!==((be=i.current.get(J))==null?void 0:be.value)&&(i.current.set(J,{value:te,keywords:ae}),n.current.filtered.items.set(J,D(te,ae)),T(2,()=>{O(),N.emit()}))},item:(J,te)=>(r.current.add(J),te&&(s.current.has(te)?s.current.get(te).add(J):s.current.set(te,new Set([J]))),T(3,()=>{$(),O(),n.current.value||I(),N.emit()}),()=>{i.current.delete(J),r.current.delete(J),n.current.filtered.items.delete(J);let ae=B();T(4,()=>{$(),(ae==null?void 0:ae.getAttribute("id"))===J&&I(),N.emit()})}),group:J=>(s.current.has(J)||s.current.set(J,new Set),()=>{i.current.delete(J),s.current.delete(J)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:E,labelId:w,listInnerRef:R}),[]);function D(J,te){var ae,be;let xe=(be=(ae=a.current)==null?void 0:ae.filter)!=null?be:uPe;return J?xe(J,n.current.search,te):0}function O(){if(!n.current.search||a.current.shouldFilter===!1)return;let J=n.current.filtered.items,te=[];n.current.filtered.groups.forEach(be=>{let xe=s.current.get(be),ve=0;xe.forEach(Pe=>{let Oe=J.get(Pe);ve=Math.max(Oe,ve)}),te.push([be,ve])});let ae=R.current;W().sort((be,xe)=>{var ve,Pe;let Oe=be.getAttribute("id"),ke=xe.getAttribute("id");return((ve=J.get(ke))!=null?ve:0)-((Pe=J.get(Oe))!=null?Pe:0)}).forEach(be=>{let xe=be.closest(c4);xe?xe.appendChild(be.parentElement===xe?be:be.closest(`${c4} > *`)):ae.appendChild(be.parentElement===ae?be:be.closest(`${c4} > *`))}),te.sort((be,xe)=>xe[1]-be[1]).forEach(be=>{var xe;let ve=(xe=R.current)==null?void 0:xe.querySelector(`${$S}[${Ky}="${encodeURIComponent(be[0])}"]`);ve==null||ve.parentElement.appendChild(ve)})}function I(){let J=W().find(ae=>ae.getAttribute("aria-disabled")!=="true"),te=J==null?void 0:J.getAttribute(Ky);N.setState("value",te||void 0)}function $(){var J,te,ae,be;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let xe=0;for(let ve of r.current){let Pe=(te=(J=i.current.get(ve))==null?void 0:J.value)!=null?te:"",Oe=(be=(ae=i.current.get(ve))==null?void 0:ae.keywords)!=null?be:[],ke=D(Pe,Oe);n.current.filtered.items.set(ve,ke),ke>0&&xe++}for(let[ve,Pe]of s.current)for(let Oe of Pe)if(n.current.filtered.items.get(Oe)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=xe}function F(){var J,te,ae;let be=B();be&&(((J=be.parentElement)==null?void 0:J.firstChild)===be&&((ae=(te=be.closest($S))==null?void 0:te.querySelector(cPe))==null||ae.scrollIntoView({block:"nearest"})),be.scrollIntoView({block:"nearest"}))}function B(){var J;return(J=R.current)==null?void 0:J.querySelector(`${zte}[aria-selected="true"]`)}function W(){var J;return Array.from(((J=R.current)==null?void 0:J.querySelectorAll(P9))||[])}function Z(J){let te=W()[J];te&&N.setState("value",te.getAttribute(Ky))}function Y(J){var te;let ae=B(),be=W(),xe=be.findIndex(Pe=>Pe===ae),ve=be[xe+J];(te=a.current)!=null&&te.loop&&(ve=xe+J<0?be[be.length-1]:xe+J===be.length?be[0]:be[xe+J]),ve&&N.setState("value",ve.getAttribute(Ky))}function H(J){let te=B(),ae=te==null?void 0:te.closest($S),be;for(;ae&&!be;)ae=J>0?bPe(ae,$S):xPe(ae,$S),be=ae==null?void 0:ae.querySelector(P9);be?N.setState("value",be.getAttribute(Ky)):Y(J)}let se=()=>Z(W().length-1),he=J=>{J.preventDefault(),J.metaKey?se():J.altKey?H(1):Y(1)},re=J=>{J.preventDefault(),J.metaKey?Z(0):J.altKey?H(-1):Y(-1)};return C.createElement(zi.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:J=>{var te;(te=y.onKeyDown)==null||te.call(y,J);let ae=J.nativeEvent.isComposing||J.keyCode===229;if(!(J.defaultPrevented||ae))switch(J.key){case"n":case"j":{x&&J.ctrlKey&&he(J);break}case"ArrowDown":{he(J);break}case"p":case"k":{x&&J.ctrlKey&&re(J);break}case"ArrowUp":{re(J);break}case"Home":{J.preventDefault(),Z(0);break}case"End":{J.preventDefault(),se();break}case"Enter":{J.preventDefault();let be=B();if(be){let xe=new Event(KB);be.dispatchEvent(xe)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:SPe},c),BD(e,J=>C.createElement(Ute.Provider,{value:N},C.createElement(Bte.Provider,{value:A},J))))}),dPe=C.forwardRef((e,t)=>{var n,r;let s=Cf(),i=C.useRef(null),o=C.useContext(Vte),a=qA(),c=Wte(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Vv(()=>{if(!d)return a.item(s,o==null?void 0:o.id)},[d]);let h=qte(s,i,[e.value,e.children,i],e.keywords),u=C6(),f=pp(T=>T.value&&T.value===h.current),g=pp(T=>d||a.filter()===!1?!0:T.search?T.filtered.items.get(s)>0:!0);C.useEffect(()=>{let T=i.current;if(!(!T||e.disabled))return T.addEventListener(KB,v),()=>T.removeEventListener(KB,v)},[g,e.onSelect,e.disabled]);function v(){var T,N;m(),(N=(T=c.current).onSelect)==null||N.call(T,h.current)}function m(){u.setState("value",h.current,!0)}if(!g)return null;let{disabled:x,value:y,onSelect:b,forceMount:w,keywords:E,...R}=e;return C.createElement(zi.div,{ref:zv(i,t),...R,id:s,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!f,"data-disabled":!!x,"data-selected":!!f,onPointerMove:x||a.getDisablePointerSelection()?void 0:m,onClick:x?void 0:v},e.children)}),fPe=C.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,o=Cf(),a=C.useRef(null),c=C.useRef(null),d=Cf(),h=qA(),u=pp(g=>s||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Vv(()=>h.group(o),[]),qte(o,a,[e.value,e.heading,c]);let f=C.useMemo(()=>({id:o,forceMount:s}),[s]);return C.createElement(zi.div,{ref:zv(a,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&C.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),BD(e,g=>C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},C.createElement(Vte.Provider,{value:f},g))))}),hPe=C.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=C.useRef(null),i=pp(o=>!o.search);return!n&&!i?null:C.createElement(zi.div,{ref:zv(s,t),...r,"cmdk-separator":"",role:"separator"})}),pPe=C.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=C6(),o=pp(d=>d.search),a=pp(d=>d.selectedItemId),c=qA();return C.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),C.createElement(zi.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:s?e.value:o,onChange:d=>{s||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),mPe=C.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=C.useRef(null),o=C.useRef(null),a=pp(d=>d.selectedItemId),c=qA();return C.useEffect(()=>{if(o.current&&i.current){let d=o.current,h=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let g=d.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return f.observe(d),()=>{cancelAnimationFrame(u),f.unobserve(d)}}},[]),C.createElement(zi.div,{ref:zv(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},BD(e,d=>C.createElement("div",{ref:zv(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),gPe=C.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...a}=e;return C.createElement(iPe,{open:n,onOpenChange:r},C.createElement(oPe,{container:o},C.createElement(aPe,{"cmdk-overlay":"",className:s}),C.createElement(lPe,{"aria-label":e.label,"cmdk-dialog":"",className:i},C.createElement(Hte,{ref:t,...a}))))}),vPe=C.forwardRef((e,t)=>pp(n=>n.filtered.count===0)?C.createElement(zi.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),yPe=C.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return C.createElement(zi.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},BD(e,o=>C.createElement("div",{"aria-hidden":!0},o)))}),la=Object.assign(Hte,{List:mPe,Item:dPe,Input:pPe,Group:fPe,Separator:hPe,Dialog:gPe,Empty:vPe,Loading:yPe});function bPe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function xPe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Wte(e){let t=C.useRef(e);return Vv(()=>{t.current=e}),t}var Vv=typeof window>"u"?C.useEffect:C.useLayoutEffect;function Yy(e){let t=C.useRef();return t.current===void 0&&(t.current=e()),t}function pp(e){let t=C6(),n=()=>e(t.snapshot());return C.useSyncExternalStore(t.subscribe,n,n)}function qte(e,t,n,r=[]){let s=C.useRef(),i=qA();return Vv(()=>{var o;let a=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(e,a,c),(o=t.current)==null||o.setAttribute(Ky,a),s.current=a}),s}var _Pe=()=>{let[e,t]=C.useState(),n=Yy(()=>new Map);return Vv(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function wPe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function BD({asChild:e,children:t},n){return e&&C.isValidElement(t)?C.cloneElement(wPe(t),{ref:t.ref},n(t.props.children)):n(t)}var SPe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Fx=XH,E6=QH,CPe=ZH,bT=zA,Gte=C.forwardRef(({className:e,...t},n)=>_.jsx(LA,{ref:n,className:ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Gte.displayName=LA.displayName;const cy=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(CPe,{children:[_.jsx(Gte,{}),_.jsxs(jA,{ref:r,className:ge("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,_.jsxs(zA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx(sx,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cy.displayName=jA.displayName;const uy=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});uy.displayName="DialogHeader";const dy=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});dy.displayName="DialogFooter";const fy=C.forwardRef(({className:e,...t},n)=>_.jsx($A,{ref:n,className:ge("text-lg font-semibold leading-none tracking-tight",e),...t}));fy.displayName=$A.displayName;const GA=C.forwardRef(({className:e,...t},n)=>_.jsx(FA,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));GA.displayName=FA.displayName;const EPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la,{ref:n,className:ge("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));EPe.displayName=la.displayName;const APe=C.forwardRef(({className:e,...t},n)=>_.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[_.jsx(IH,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),_.jsx(la.Input,{ref:n,className:ge("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));APe.displayName=la.Input.displayName;const RPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.List,{ref:n,className:ge("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));RPe.displayName=la.List.displayName;const PPe=C.forwardRef((e,t)=>_.jsx(la.Empty,{ref:t,className:"py-6 text-sm text-center",...e}));PPe.displayName=la.Empty.displayName;const NPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.Group,{ref:n,className:ge("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));NPe.displayName=la.Group.displayName;const TPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.Separator,{ref:n,className:ge("-mx-1 h-px bg-border",e),...t}));TPe.displayName=la.Separator.displayName;const kPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.Item,{ref:n,className:ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));kPe.displayName=la.Item.displayName;const DPe=["top","right","bottom","left"],vu=Math.min,Ha=Math.max,xT=Math.round,iP=Math.floor,mp=e=>({x:e,y:e}),OPe={left:"right",right:"left",bottom:"top",top:"bottom"},MPe={start:"end",end:"start"};function YB(e,t,n){return Ha(e,vu(t,n))}function jf(e,t){return typeof e=="function"?e(t):e}function $f(e){return e.split("-")[0]}function zx(e){return e.split("-")[1]}function A6(e){return e==="x"?"y":"x"}function R6(e){return e==="y"?"height":"width"}function gp(e){return["top","bottom"].includes($f(e))?"y":"x"}function P6(e){return A6(gp(e))}function IPe(e,t,n){n===void 0&&(n=!1);const r=zx(e),s=P6(e),i=R6(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=_T(o)),[o,_T(o)]}function LPe(e){const t=_T(e);return[XB(e),t,XB(t)]}function XB(e){return e.replace(/start|end/g,t=>MPe[t])}function jPe(e,t,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?i:o;default:return[]}}function $Pe(e,t,n,r){const s=zx(e);let i=jPe($f(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(XB)))),i}function _T(e){return e.replace(/left|right|bottom|top/g,t=>OPe[t])}function FPe(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kte(e){return typeof e!="number"?FPe(e):{top:e,right:e,bottom:e,left:e}}function wT(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function N9(e,t,n){let{reference:r,floating:s}=e;const i=gp(t),o=P6(t),a=R6(o),c=$f(t),d=i==="y",h=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let g;switch(c){case"top":g={x:h,y:r.y-s.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-s.width,y:u};break;default:g={x:r.x,y:r.y}}switch(zx(t)){case"start":g[o]-=f*(n&&d?-1:1);break;case"end":g[o]+=f*(n&&d?-1:1);break}return g}const zPe=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:u}=N9(d,r,c),f=r,g={},v=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=t,{element:d,padding:h=0}=jf(e,t)||{};if(d==null)return{};const u=Kte(h),f={x:n,y:r},g=P6(s),v=R6(g),m=await o.getDimensions(d),x=g==="y",y=x?"top":"left",b=x?"bottom":"right",w=x?"clientHeight":"clientWidth",E=i.reference[v]+i.reference[g]-f[g]-i.floating[v],R=f[g]-i.reference[g],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let N=T?T[w]:0;(!N||!await(o.isElement==null?void 0:o.isElement(T)))&&(N=a.floating[w]||i.floating[v]);const A=E/2-R/2,D=N/2-m[v]/2-1,O=vu(u[y],D),I=vu(u[b],D),$=O,F=N-m[v]-I,B=N/2-m[v]/2+A,W=YB($,B,F),Z=!c.arrow&&zx(s)!=null&&B!==W&&i.reference[v]/2-(B<$?O:I)-m[v]/2<0,Y=Z?B<$?B-$:B-F:0;return{[g]:f[g]+Y,data:{[g]:W,centerOffset:B-W-Y,...Z&&{alignmentOffset:Y}},reset:Z}}}),UPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...x}=jf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=$f(s),b=gp(a),w=$f(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=f||(w||!m?[_T(a)]:LPe(a)),T=v!=="none";!f&&T&&R.push(...$Pe(a,m,v,E));const N=[a,...R],A=await wC(t,x),D=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&D.push(A[y]),u){const B=IPe(s,o,E);D.push(A[B[0]],A[B[1]])}if(O=[...O,{placement:s,overflows:D}],!D.every(B=>B<=0)){var I,$;const B=(((I=i.flip)==null?void 0:I.index)||0)+1,W=N[B];if(W)return{data:{index:B,overflows:O},reset:{placement:W}};let Z=($=O.filter(Y=>Y.overflows[0]<=0).sort((Y,H)=>Y.overflows[1]-H.overflows[1])[0])==null?void 0:$.placement;if(!Z)switch(g){case"bestFit":{var F;const Y=(F=O.filter(H=>{if(T){const se=gp(H.placement);return se===b||se==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(se=>se>0).reduce((se,he)=>se+he,0)]).sort((H,se)=>H[1]-se[1])[0])==null?void 0:F[0];Y&&(Z=Y);break}case"initialPlacement":Z=a;break}if(s!==Z)return{reset:{placement:Z}}}return{}}}};function T9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function k9(e){return DPe.some(t=>e[t]>=0)}const VPe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=jf(e,t);switch(r){case"referenceHidden":{const i=await wC(t,{...s,elementContext:"reference"}),o=T9(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:k9(o)}}}case"escaped":{const i=await wC(t,{...s,altBoundary:!0}),o=T9(i,n.floating);return{data:{escapedOffsets:o,escaped:k9(o)}}}default:return{}}}}};async function HPe(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=$f(n),a=zx(n),c=gp(n)==="y",d=["left","top"].includes(o)?-1:1,h=i&&c?-1:1,u=jf(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),c?{x:g*h,y:f*d}:{x:f*d,y:g*h}}const WPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=t,c=await HPe(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},qPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...c}=jf(e,t),d={x:n,y:r},h=await wC(t,c),u=gp($f(s)),f=A6(u);let g=d[f],v=d[u];if(i){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=g+h[x],w=g-h[y];g=YB(b,g,w)}if(o){const x=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+h[x],w=v-h[y];v=YB(b,v,w)}const m=a.fn({...t,[f]:g,[u]:v});return{...m,data:{x:m.x-n,y:m.y-r}}}}},GPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:a=0,mainAxis:c=!0,crossAxis:d=!0}=jf(e,t),h={x:n,y:r},u=gp(s),f=A6(u);let g=h[f],v=h[u];const m=jf(a,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=f==="y"?"height":"width",E=i.reference[f]-i.floating[w]+x.mainAxis,R=i.reference[f]+i.reference[w]-x.mainAxis;gR&&(g=R)}if(d){var y,b;const w=f==="y"?"width":"height",E=["top","left"].includes($f(s)),R=i.reference[u]-i.floating[w]+(E&&((y=o.offset)==null?void 0:y[u])||0)+(E?0:x.crossAxis),T=i.reference[u]+i.reference[w]+(E?0:((b=o.offset)==null?void 0:b[u])||0)-(E?x.crossAxis:0);vT&&(v=T)}return{[f]:g,[u]:v}}}},KPe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:o=()=>{},...a}=jf(e,t),c=await wC(t,a),d=$f(n),h=zx(n),u=gp(n)==="y",{width:f,height:g}=r.floating;let v,m;d==="top"||d==="bottom"?(v=d,m=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(m=d,v=h==="end"?"top":"bottom");const x=g-c.top-c.bottom,y=f-c.left-c.right,b=vu(g-c[v],x),w=vu(f-c[m],y),E=!t.middlewareData.shift;let R=b,T=w;if(u?T=h||E?vu(w,y):y:R=h||E?vu(b,x):x,E&&!h){const A=Ha(c.left,0),D=Ha(c.right,0),O=Ha(c.top,0),I=Ha(c.bottom,0);u?T=f-2*(A!==0||D!==0?A+D:Ha(c.left,c.right)):R=g-2*(O!==0||I!==0?O+I:Ha(c.top,c.bottom))}await o({...t,availableWidth:T,availableHeight:R});const N=await s.getDimensions(i.floating);return f!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function Bx(e){return Yte(e)?(e.nodeName||"").toLowerCase():"#document"}function Ka(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qf(e){var t;return(t=(Yte(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yte(e){return e instanceof Node||e instanceof Ka(e).Node}function Pu(e){return e instanceof Element||e instanceof Ka(e).Element}function Nu(e){return e instanceof HTMLElement||e instanceof Ka(e).HTMLElement}function D9(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ka(e).ShadowRoot}function KA(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Rc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function YPe(e){return["table","td","th"].includes(Bx(e))}function UD(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function N6(e){const t=T6(),n=Rc(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function XPe(e){let t=vp(e);for(;Nu(t)&&!ox(t);){if(UD(t))return null;if(N6(t))return t;t=vp(t)}return null}function T6(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ox(e){return["html","body","#document"].includes(Bx(e))}function Rc(e){return Ka(e).getComputedStyle(e)}function VD(e){return Pu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vp(e){if(Bx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||D9(e)&&e.host||qf(e);return D9(t)?t.host:t}function Xte(e){const t=vp(e);return ox(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nu(t)&&KA(t)?t:Xte(t)}function SC(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Xte(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=Ka(s);return i?t.concat(o,o.visualViewport||[],KA(s)?s:[],o.frameElement&&n?SC(o.frameElement):[]):t.concat(s,SC(s,[],n))}function Qte(e){const t=Rc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Nu(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,a=xT(n)!==i||xT(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function k6(e){return Pu(e)?e:e.contextElement}function Db(e){const t=k6(e);if(!Nu(t))return mp(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=Qte(t);let o=(i?xT(n.width):n.width)/r,a=(i?xT(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const QPe=mp(0);function Zte(e){const t=Ka(e);return!T6()||!t.visualViewport?QPe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZPe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ka(e)?!1:t}function Hv(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=k6(e);let o=mp(1);t&&(r?Pu(r)&&(o=Db(r)):o=Db(e));const a=ZPe(i,n,r)?Zte(i):mp(0);let c=(s.left+a.x)/o.x,d=(s.top+a.y)/o.y,h=s.width/o.x,u=s.height/o.y;if(i){const f=Ka(i),g=r&&Pu(r)?Ka(r):r;let v=f,m=v.frameElement;for(;m&&r&&g!==v;){const x=Db(m),y=m.getBoundingClientRect(),b=Rc(m),w=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,E=y.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,d*=x.y,h*=x.x,u*=x.y,c+=w,d+=E,v=Ka(m),m=v.frameElement}}return wT({width:h,height:u,x:c,y:d})}function JPe(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=qf(r),a=t?UD(t.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},d=mp(1);const h=mp(0),u=Nu(r);if((u||!u&&!i)&&((Bx(r)!=="body"||KA(o))&&(c=VD(r)),Nu(r))){const f=Hv(r);d=Db(r),h.x=f.x+r.clientLeft,h.y=f.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x,y:n.y*d.y-c.scrollTop*d.y+h.y}}function eNe(e){return Array.from(e.getClientRects())}function Jte(e){return Hv(qf(e)).left+VD(e).scrollLeft}function tNe(e){const t=qf(e),n=VD(e),r=e.ownerDocument.body,s=Ha(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ha(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Jte(e);const a=-n.scrollTop;return Rc(r).direction==="rtl"&&(o+=Ha(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function nNe(e,t){const n=Ka(e),r=qf(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const d=T6();(!d||d&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}function rNe(e,t){const n=Hv(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Nu(e)?Db(e):mp(1),o=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:o,height:a,x:c,y:d}}function O9(e,t,n){let r;if(t==="viewport")r=nNe(e,n);else if(t==="document")r=tNe(qf(e));else if(Pu(t))r=rNe(t,n);else{const s=Zte(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return wT(r)}function ene(e,t){const n=vp(e);return n===t||!Pu(n)||ox(n)?!1:Rc(n).position==="fixed"||ene(n,t)}function sNe(e,t){const n=t.get(e);if(n)return n;let r=SC(e,[],!1).filter(a=>Pu(a)&&Bx(a)!=="body"),s=null;const i=Rc(e).position==="fixed";let o=i?vp(e):e;for(;Pu(o)&&!ox(o);){const a=Rc(o),c=N6(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||KA(o)&&!c&&ene(e,o))?r=r.filter(h=>h!==o):s=a,o=vp(o)}return t.set(e,r),r}function iNe(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?UD(t)?[]:sNe(t,this._c):[].concat(n),r],a=o[0],c=o.reduce((d,h)=>{const u=O9(t,h,s);return d.top=Ha(u.top,d.top),d.right=vu(u.right,d.right),d.bottom=vu(u.bottom,d.bottom),d.left=Ha(u.left,d.left),d},O9(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function oNe(e){const{width:t,height:n}=Qte(e);return{width:t,height:n}}function aNe(e,t,n){const r=Nu(t),s=qf(t),i=n==="fixed",o=Hv(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=mp(0);if(r||!r&&!i)if((Bx(t)!=="body"||KA(s))&&(a=VD(t)),r){const u=Hv(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else s&&(c.x=Jte(s));const d=o.left+a.scrollLeft-c.x,h=o.top+a.scrollTop-c.y;return{x:d,y:h,width:o.width,height:o.height}}function u4(e){return Rc(e).position==="static"}function M9(e,t){return!Nu(e)||Rc(e).position==="fixed"?null:t?t(e):e.offsetParent}function tne(e,t){const n=Ka(e);if(UD(e))return n;if(!Nu(e)){let s=vp(e);for(;s&&!ox(s);){if(Pu(s)&&!u4(s))return s;s=vp(s)}return n}let r=M9(e,t);for(;r&&YPe(r)&&u4(r);)r=M9(r,t);return r&&ox(r)&&u4(r)&&!N6(r)?n:r||XPe(e)||n}const lNe=async function(e){const t=this.getOffsetParent||tne,n=this.getDimensions,r=await n(e.floating);return{reference:aNe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cNe(e){return Rc(e).direction==="rtl"}const uNe={convertOffsetParentRelativeRectToViewportRelativeRect:JPe,getDocumentElement:qf,getClippingRect:iNe,getOffsetParent:tne,getElementRects:lNe,getClientRects:eNe,getDimensions:oNe,getScale:Db,isElement:Pu,isRTL:cNe};function dNe(e,t){let n=null,r;const s=qf(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:d,top:h,width:u,height:f}=e.getBoundingClientRect();if(a||t(),!u||!f)return;const g=iP(h),v=iP(s.clientWidth-(d+u)),m=iP(s.clientHeight-(h+f)),x=iP(d),b={rootMargin:-g+"px "+-v+"px "+-m+"px "+-x+"px",threshold:Ha(0,vu(1,c))||1};let w=!0;function E(R){const T=R[0].intersectionRatio;if(T!==c){if(!w)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(E,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return o(!0),i}function fNe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=k6(e),h=s||i?[...d?SC(d):[],...SC(t)]:[];h.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const u=d&&a?dNe(d,n):null;let f=-1,g=null;o&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),d&&!c&&g.observe(d),g.observe(t));let v,m=c?Hv(e):null;c&&x();function x(){const y=Hv(e);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&n(),m=y,v=requestAnimationFrame(x)}return n(),()=>{var y;h.forEach(b=>{s&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u==null||u(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const hNe=WPe,pNe=qPe,mNe=UPe,gNe=KPe,vNe=VPe,I9=BPe,yNe=GPe,bNe=(e,t,n)=>{const r=new Map,s={platform:uNe,...n},i={...s.platform,_c:r};return zPe(e,t,{...s,platform:i})};var QP=typeof document<"u"?C.useLayoutEffect:C.useEffect;function ST(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,s;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(!ST(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!ST(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function nne(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function L9(e,t){const n=nne(e);return Math.round(t*n)/n}function j9(e){const t=C.useRef(e);return QP(()=>{t.current=e}),t}function xNe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:d}=e,[h,u]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=C.useState(r);ST(f,r)||g(r);const[v,m]=C.useState(null),[x,y]=C.useState(null),b=C.useCallback(Y=>{Y!==T.current&&(T.current=Y,m(Y))},[]),w=C.useCallback(Y=>{Y!==N.current&&(N.current=Y,y(Y))},[]),E=i||v,R=o||x,T=C.useRef(null),N=C.useRef(null),A=C.useRef(h),D=c!=null,O=j9(c),I=j9(s),$=C.useCallback(()=>{if(!T.current||!N.current)return;const Y={placement:t,strategy:n,middleware:f};I.current&&(Y.platform=I.current),bNe(T.current,N.current,Y).then(H=>{const se={...H,isPositioned:!0};F.current&&!ST(A.current,se)&&(A.current=se,Li.flushSync(()=>{u(se)}))})},[f,t,n,I]);QP(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u(Y=>({...Y,isPositioned:!1})))},[d]);const F=C.useRef(!1);QP(()=>(F.current=!0,()=>{F.current=!1}),[]),QP(()=>{if(E&&(T.current=E),R&&(N.current=R),E&&R){if(O.current)return O.current(E,R,$);$()}},[E,R,$,O,D]);const B=C.useMemo(()=>({reference:T,floating:N,setReference:b,setFloating:w}),[b,w]),W=C.useMemo(()=>({reference:E,floating:R}),[E,R]),Z=C.useMemo(()=>{const Y={position:n,left:0,top:0};if(!W.floating)return Y;const H=L9(W.floating,h.x),se=L9(W.floating,h.y);return a?{...Y,transform:"translate("+H+"px, "+se+"px)",...nne(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:se}},[n,a,W.floating,h.x,h.y]);return C.useMemo(()=>({...h,update:$,refs:B,elements:W,floatingStyles:Z}),[h,$,B,W,Z])}const _Ne=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?I9({element:r.current,padding:s}).fn(n):{}:r?I9({element:r,padding:s}).fn(n):{}}}},wNe=(e,t)=>({...hNe(e),options:[e,t]}),SNe=(e,t)=>({...pNe(e),options:[e,t]}),CNe=(e,t)=>({...yNe(e),options:[e,t]}),ENe=(e,t)=>({...mNe(e),options:[e,t]}),ANe=(e,t)=>({...gNe(e),options:[e,t]}),RNe=(e,t)=>({...vNe(e),options:[e,t]}),PNe=(e,t)=>({..._Ne(e),options:[e,t]});var NNe="Arrow",rne=C.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return _.jsx(He.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:_.jsx("polygon",{points:"0,0 30,0 15,10"})})});rne.displayName=NNe;var TNe=rne,D6="Popper",[sne,Iu]=_r(D6),[kNe,ine]=sne(D6),one=e=>{const{__scopePopper:t,children:n}=e,[r,s]=C.useState(null);return _.jsx(kNe,{scope:t,anchor:r,onAnchorChange:s,children:n})};one.displayName=D6;var ane="PopperAnchor",lne=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=ine(ane,n),o=C.useRef(null),a=_t(t,o);return C.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:_.jsx(He.div,{...s,ref:a})});lne.displayName=ane;var O6="PopperContent",[DNe,ONe]=sne(O6),cne=C.forwardRef((e,t)=>{var ve,Pe,Oe,ke,ze,$e;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:v,...m}=e,x=ine(O6,n),[y,b]=C.useState(null),w=_t(t,Te=>b(Te)),[E,R]=C.useState(null),T=WA(E),N=(T==null?void 0:T.width)??0,A=(T==null?void 0:T.height)??0,D=r+(i!=="center"?"-"+i:""),O=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},I=Array.isArray(d)?d:[d],$=I.length>0,F={padding:O,boundary:I.filter(INe),altBoundary:$},{refs:B,floatingStyles:W,placement:Z,isPositioned:Y,middlewareData:H}=xNe({strategy:"fixed",placement:D,whileElementsMounted:(...Te)=>fNe(...Te,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[wNe({mainAxis:s+A,alignmentAxis:o}),c&&SNe({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?CNe():void 0,...F}),c&&ENe({...F}),ANe({...F,apply:({elements:Te,rects:Ue,availableWidth:wt,availableHeight:ut})=>{const{width:St,height:Nn}=Ue.reference,cn=Te.floating.style;cn.setProperty("--radix-popper-available-width",`${wt}px`),cn.setProperty("--radix-popper-available-height",`${ut}px`),cn.setProperty("--radix-popper-anchor-width",`${St}px`),cn.setProperty("--radix-popper-anchor-height",`${Nn}px`)}}),E&&PNe({element:E,padding:a}),LNe({arrowWidth:N,arrowHeight:A}),f&&RNe({strategy:"referenceHidden",...F})]}),[se,he]=fne(Z),re=bn(v);Rr(()=>{Y&&(re==null||re())},[Y,re]);const J=(ve=H.arrow)==null?void 0:ve.x,te=(Pe=H.arrow)==null?void 0:Pe.y,ae=((Oe=H.arrow)==null?void 0:Oe.centerOffset)!==0,[be,xe]=C.useState();return Rr(()=>{y&&xe(window.getComputedStyle(y).zIndex)},[y]),_.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:Y?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(ke=H.transformOrigin)==null?void 0:ke.x,(ze=H.transformOrigin)==null?void 0:ze.y].join(" "),...(($e=H.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:_.jsx(DNe,{scope:n,placedSide:se,onArrowChange:R,arrowX:J,arrowY:te,shouldHideArrow:ae,children:_.jsx(He.div,{"data-side":se,"data-align":he,...m,ref:w,style:{...m.style,animation:Y?void 0:"none"}})})})});cne.displayName=O6;var une="PopperArrow",MNe={top:"bottom",right:"left",bottom:"top",left:"right"},dne=C.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=ONe(une,r),o=MNe[i.placedSide];return _.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]: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:_.jsx(TNe,{...s,ref:n,style:{...s.style,display:"block"}})})});dne.displayName=une;function INe(e){return e!==null}var LNe=e=>({name:"transformOrigin",options:e,fn(t){var x,y,b;const{placement:n,rects:r,middlewareData:s}=t,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,a=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,h]=fne(n),u={start:"0%",center:"50%",end:"100%"}[h],f=(((y=s.arrow)==null?void 0:y.x)??0)+a/2,g=(((b=s.arrow)==null?void 0:b.y)??0)+c/2;let v="",m="";return d==="bottom"?(v=o?u:`${f}px`,m=`${-c}px`):d==="top"?(v=o?u:`${f}px`,m=`${r.floating.height+c}px`):d==="right"?(v=`${-c}px`,m=o?u:`${g}px`):d==="left"&&(v=`${r.floating.width+c}px`,m=o?u:`${g}px`),{data:{x:v,y:m}}}});function fne(e){const[t,n="center"]=e.split("-");return[t,n]}var HD=one,Ux=lne,YA=cne,XA=dne,d4="rovingFocusGroup.onEntryFocus",jNe={bubbles:!1,cancelable:!0},WD="RovingFocusGroup",[QB,hne,$Ne]=Uf(WD),[FNe,Lu]=_r(WD,[$Ne]),[zNe,BNe]=FNe(WD),pne=C.forwardRef((e,t)=>_.jsx(QB.Provider,{scope:e.__scopeRovingFocusGroup,children:_.jsx(QB.Slot,{scope:e.__scopeRovingFocusGroup,children:_.jsx(UNe,{...e,ref:t})})}));pne.displayName=WD;var UNe=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...u}=e,f=C.useRef(null),g=_t(t,f),v=kc(i),[m=null,x]=os({prop:o,defaultProp:a,onChange:c}),[y,b]=C.useState(!1),w=bn(d),E=hne(n),R=C.useRef(!1),[T,N]=C.useState(0);return C.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(d4,w),()=>A.removeEventListener(d4,w)},[w]),_.jsx(zNe,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:m,onItemFocus:C.useCallback(A=>x(A),[x]),onItemShiftTab:C.useCallback(()=>b(!0),[]),onFocusableItemAdd:C.useCallback(()=>N(A=>A+1),[]),onFocusableItemRemove:C.useCallback(()=>N(A=>A-1),[]),children:_.jsx(He.div,{tabIndex:y||T===0?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{R.current=!0}),onFocus:Ae(e.onFocus,A=>{const D=!R.current;if(A.target===A.currentTarget&&D&&!y){const O=new CustomEvent(d4,jNe);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const I=E().filter(Z=>Z.focusable),$=I.find(Z=>Z.active),F=I.find(Z=>Z.id===m),W=[$,F,...I].filter(Boolean).map(Z=>Z.ref.current);vne(W,h)}}R.current=!1}),onBlur:Ae(e.onBlur,()=>b(!1))})})}),mne="RovingFocusGroupItem",gne=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...o}=e,a=si(),c=i||a,d=BNe(mne,n),h=d.currentTabStopId===c,u=hne(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=d;return C.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),_.jsx(QB.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:_.jsx(He.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...o,ref:t,onMouseDown:Ae(e.onMouseDown,v=>{r?d.onItemFocus(c):v.preventDefault()}),onFocus:Ae(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Ae(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const m=WNe(v,d.orientation,d.dir);if(m!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=u().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const b=y.indexOf(v.currentTarget);y=d.loop?qNe(y,b+1):y.slice(b+1)}setTimeout(()=>vne(y))}})})})});gne.displayName=mne;var VNe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HNe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function WNe(e,t,n){const r=HNe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return VNe[r]}function vne(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qNe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var QA=pne,ZA=gne,ZB=["Enter"," "],GNe=["ArrowDown","PageUp","Home"],yne=["ArrowUp","PageDown","End"],KNe=[...GNe,...yne],YNe={ltr:[...ZB,"ArrowRight"],rtl:[...ZB,"ArrowLeft"]},XNe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},JA="Menu",[CC,QNe,ZNe]=Uf(JA),[hy,eR]=_r(JA,[ZNe,Iu,Lu]),qD=Iu(),bne=Lu(),[JNe,py]=hy(JA),[eTe,tR]=hy(JA),xne=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=e,a=qD(t),[c,d]=C.useState(null),h=C.useRef(!1),u=bn(i),f=kc(s);return C.useEffect(()=>{const g=()=>{h.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>h.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),_.jsx(HD,{...a,children:_.jsx(JNe,{scope:t,open:n,onOpenChange:u,content:c,onContentChange:d,children:_.jsx(eTe,{scope:t,onClose:C.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:h,dir:f,modal:o,children:r})})})};xne.displayName=JA;var tTe="MenuAnchor",M6=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=qD(n);return _.jsx(Ux,{...s,...r,ref:t})});M6.displayName=tTe;var I6="MenuPortal",[nTe,_ne]=hy(I6,{forceMount:void 0}),wne=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=py(I6,t);return _.jsx(nTe,{scope:t,forceMount:n,children:_.jsx(Vr,{present:n||i.open,children:_.jsx(Dx,{asChild:!0,container:s,children:r})})})};wne.displayName=I6;var _l="MenuContent",[rTe,L6]=hy(_l),Sne=C.forwardRef((e,t)=>{const n=_ne(_l,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=py(_l,e.__scopeMenu),o=tR(_l,e.__scopeMenu);return _.jsx(CC.Provider,{scope:e.__scopeMenu,children:_.jsx(Vr,{present:r||i.open,children:_.jsx(CC.Slot,{scope:e.__scopeMenu,children:o.modal?_.jsx(sTe,{...s,ref:t}):_.jsx(iTe,{...s,ref:t})})})})}),sTe=C.forwardRef((e,t)=>{const n=py(_l,e.__scopeMenu),r=C.useRef(null),s=_t(t,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(j6,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),iTe=C.forwardRef((e,t)=>{const n=py(_l,e.__scopeMenu);return _.jsx(j6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),j6=C.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:u,onInteractOutside:f,onDismiss:g,disableOutsideScroll:v,...m}=e,x=py(_l,n),y=tR(_l,n),b=qD(n),w=bne(n),E=QNe(n),[R,T]=C.useState(null),N=C.useRef(null),A=_t(t,N,x.onContentChange),D=C.useRef(0),O=C.useRef(""),I=C.useRef(0),$=C.useRef(null),F=C.useRef("right"),B=C.useRef(0),W=v?IA:C.Fragment,Z=v?{as:Cc,allowPinchZoom:!0}:void 0,Y=se=>{var ve,Pe;const he=O.current+se,re=E().filter(Oe=>!Oe.disabled),J=document.activeElement,te=(ve=re.find(Oe=>Oe.ref.current===J))==null?void 0:ve.textValue,ae=re.map(Oe=>Oe.textValue),be=vTe(ae,he,te),xe=(Pe=re.find(Oe=>Oe.textValue===be))==null?void 0:Pe.ref.current;(function Oe(ke){O.current=ke,window.clearTimeout(D.current),ke!==""&&(D.current=window.setTimeout(()=>Oe(""),1e3))})(he),xe&&setTimeout(()=>xe.focus())};C.useEffect(()=>()=>window.clearTimeout(D.current),[]),uD();const H=C.useCallback(se=>{var re,J;return F.current===((re=$.current)==null?void 0:re.side)&&bTe(se,(J=$.current)==null?void 0:J.area)},[]);return _.jsx(rTe,{scope:n,searchRef:O,onItemEnter:C.useCallback(se=>{H(se)&&se.preventDefault()},[H]),onItemLeave:C.useCallback(se=>{var he;H(se)||((he=N.current)==null||he.focus(),T(null))},[H]),onTriggerLeave:C.useCallback(se=>{H(se)&&se.preventDefault()},[H]),pointerGraceTimerRef:I,onPointerGraceIntentChange:C.useCallback(se=>{$.current=se},[]),children:_.jsx(W,{...Z,children:_.jsx(MA,{asChild:!0,trapped:s,onMountAutoFocus:Ae(i,se=>{var he;se.preventDefault(),(he=N.current)==null||he.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:u,onInteractOutside:f,onDismiss:g,children:_.jsx(QA,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:T,onEntryFocus:Ae(c,se=>{y.isUsingKeyboardRef.current||se.preventDefault()}),preventScrollOnEntryFocus:!0,children:_.jsx(YA,{role:"menu","aria-orientation":"vertical","data-state":Fne(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...m,ref:A,style:{outline:"none",...m.style},onKeyDown:Ae(m.onKeyDown,se=>{const re=se.target.closest("[data-radix-menu-content]")===se.currentTarget,J=se.ctrlKey||se.altKey||se.metaKey,te=se.key.length===1;re&&(se.key==="Tab"&&se.preventDefault(),!J&&te&&Y(se.key));const ae=N.current;if(se.target!==ae||!KNe.includes(se.key))return;se.preventDefault();const xe=E().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);yne.includes(se.key)&&xe.reverse(),mTe(xe)}),onBlur:Ae(e.onBlur,se=>{se.currentTarget.contains(se.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:Ae(e.onPointerMove,EC(se=>{const he=se.target,re=B.current!==se.clientX;if(se.currentTarget.contains(he)&&re){const J=se.clientX>B.current?"right":"left";F.current=J,B.current=se.clientX}}))})})})})})})});Sne.displayName=_l;var oTe="MenuGroup",$6=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return _.jsx(He.div,{role:"group",...r,ref:t})});$6.displayName=oTe;var aTe="MenuLabel",Cne=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return _.jsx(He.div,{...r,ref:t})});Cne.displayName=aTe;var CT="MenuItem",$9="menu.itemSelect",GD=C.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=C.useRef(null),o=tR(CT,e.__scopeMenu),a=L6(CT,e.__scopeMenu),c=_t(t,i),d=C.useRef(!1),h=()=>{const u=i.current;if(!n&&u){const f=new CustomEvent($9,{bubbles:!0,cancelable:!0});u.addEventListener($9,g=>r==null?void 0:r(g),{once:!0}),vC(u,f),f.defaultPrevented?d.current=!1:o.onClose()}};return _.jsx(Ene,{...s,ref:c,disabled:n,onClick:Ae(e.onClick,h),onPointerDown:u=>{var f;(f=e.onPointerDown)==null||f.call(e,u),d.current=!0},onPointerUp:Ae(e.onPointerUp,u=>{var f;d.current||(f=u.currentTarget)==null||f.click()}),onKeyDown:Ae(e.onKeyDown,u=>{const f=a.searchRef.current!=="";n||f&&u.key===" "||ZB.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});GD.displayName=CT;var Ene=C.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,o=L6(CT,n),a=bne(n),c=C.useRef(null),d=_t(t,c),[h,u]=C.useState(!1),[f,g]=C.useState("");return C.useEffect(()=>{const v=c.current;v&&g((v.textContent??"").trim())},[i.children]),_.jsx(CC.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:_.jsx(ZA,{asChild:!0,...a,focusable:!r,children:_.jsx(He.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:Ae(e.onPointerMove,EC(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,EC(v=>o.onItemLeave(v))),onFocus:Ae(e.onFocus,()=>u(!0)),onBlur:Ae(e.onBlur,()=>u(!1))})})})}),lTe="MenuCheckboxItem",Ane=C.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return _.jsx(kne,{scope:e.__scopeMenu,checked:n,children:_.jsx(GD,{role:"menuitemcheckbox","aria-checked":ET(n)?"mixed":n,...s,ref:t,"data-state":z6(n),onSelect:Ae(s.onSelect,()=>r==null?void 0:r(ET(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ane.displayName=lTe;var Rne="MenuRadioGroup",[cTe,uTe]=hy(Rne,{value:void 0,onValueChange:()=>{}}),Pne=C.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=bn(r);return _.jsx(cTe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:_.jsx($6,{...s,ref:t})})});Pne.displayName=Rne;var Nne="MenuRadioItem",Tne=C.forwardRef((e,t)=>{const{value:n,...r}=e,s=uTe(Nne,e.__scopeMenu),i=n===s.value;return _.jsx(kne,{scope:e.__scopeMenu,checked:i,children:_.jsx(GD,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":z6(i),onSelect:Ae(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});Tne.displayName=Nne;var F6="MenuItemIndicator",[kne,dTe]=hy(F6,{checked:!1}),Dne=C.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=dTe(F6,n);return _.jsx(Vr,{present:r||ET(i.checked)||i.checked===!0,children:_.jsx(He.span,{...s,ref:t,"data-state":z6(i.checked)})})});Dne.displayName=F6;var fTe="MenuSeparator",One=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return _.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});One.displayName=fTe;var hTe="MenuArrow",Mne=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=qD(n);return _.jsx(XA,{...s,...r,ref:t})});Mne.displayName=hTe;var pTe="MenuSub",[l7e,Ine]=hy(pTe),l1="MenuSubTrigger",Lne=C.forwardRef((e,t)=>{const n=py(l1,e.__scopeMenu),r=tR(l1,e.__scopeMenu),s=Ine(l1,e.__scopeMenu),i=L6(l1,e.__scopeMenu),o=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},h=C.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return C.useEffect(()=>h,[h]),C.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),_.jsx(M6,{asChild:!0,...d,children:_.jsx(Ene,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":Fne(n.open),...e,ref:DA(t,s.onTriggerChange),onClick:u=>{var f;(f=e.onClick)==null||f.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,EC(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Ae(e.onPointerLeave,EC(u=>{var g,v;h();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const m=(v=n.content)==null?void 0:v.dataset.side,x=m==="right",y=x?-5:5,b=f[x?"left":"right"],w=f[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+y,y:u.clientY},{x:b,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:b,y:f.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,u=>{var g;const f=i.searchRef.current!=="";e.disabled||f&&u.key===" "||YNe[r.dir].includes(u.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),u.preventDefault())})})})});Lne.displayName=l1;var jne="MenuSubContent",$ne=C.forwardRef((e,t)=>{const n=_ne(_l,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=py(_l,e.__scopeMenu),o=tR(_l,e.__scopeMenu),a=Ine(jne,e.__scopeMenu),c=C.useRef(null),d=_t(t,c);return _.jsx(CC.Provider,{scope:e.__scopeMenu,children:_.jsx(Vr,{present:r||i.open,children:_.jsx(CC.Slot,{scope:e.__scopeMenu,children:_.jsx(j6,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var u;o.isUsingKeyboardRef.current&&((u=c.current)==null||u.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,h=>{h.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ae(e.onKeyDown,h=>{var g;const u=h.currentTarget.contains(h.target),f=XNe[o.dir].includes(h.key);u&&f&&(i.onOpenChange(!1),(g=a.trigger)==null||g.focus(),h.preventDefault())})})})})})});$ne.displayName=jne;function Fne(e){return e?"open":"closed"}function ET(e){return e==="indeterminate"}function z6(e){return ET(e)?"indeterminate":e?"checked":"unchecked"}function mTe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vTe(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=gTe(e,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function yTe(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;ir!=h>r&&n<(d-a)*(r-c)/(h-c)+a&&(s=!s)}return s}function bTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yTe(n,t)}function EC(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xTe=xne,B6=M6,U6=wne,V6=Sne,H6=$6,W6=Cne,q6=GD,G6=Ane,K6=Pne,Y6=Tne,X6=Dne,Q6=One,Z6=Mne,J6=Lne,e8=$ne,zne="ContextMenu",[_Te,c7e]=_r(zne,[eR]),ca=eR(),[u7e,Bne]=_Te(zne),Une="ContextMenuTrigger",wTe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,i=Bne(Une,n),o=ca(n),a=C.useRef({x:0,y:0}),c=C.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),d=C.useRef(0),h=C.useCallback(()=>window.clearTimeout(d.current),[]),u=f=>{a.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return C.useEffect(()=>h,[h]),C.useEffect(()=>void(r&&h()),[r,h]),_.jsxs(_.Fragment,{children:[_.jsx(B6,{...o,virtualRef:c}),_.jsx(He.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Ae(e.onContextMenu,f=>{h(),u(f),f.preventDefault()}),onPointerDown:r?e.onPointerDown:Ae(e.onPointerDown,oP(f=>{h(),d.current=window.setTimeout(()=>u(f),700)})),onPointerMove:r?e.onPointerMove:Ae(e.onPointerMove,oP(h)),onPointerCancel:r?e.onPointerCancel:Ae(e.onPointerCancel,oP(h)),onPointerUp:r?e.onPointerUp:Ae(e.onPointerUp,oP(h))})]})});wTe.displayName=Une;var STe="ContextMenuPortal",Vne=e=>{const{__scopeContextMenu:t,...n}=e,r=ca(t);return _.jsx(U6,{...r,...n})};Vne.displayName=STe;var Hne="ContextMenuContent",Wne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Bne(Hne,n),i=ca(n),o=C.useRef(!1);return _.jsx(V6,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var c;(c=e.onCloseAutoFocus)==null||c.call(e,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var c;(c=e.onInteractOutside)==null||c.call(e,a),!a.defaultPrevented&&!s.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Wne.displayName=Hne;var CTe="ContextMenuGroup",ETe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(H6,{...s,...r,ref:t})});ETe.displayName=CTe;var ATe="ContextMenuLabel",qne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(W6,{...s,...r,ref:t})});qne.displayName=ATe;var RTe="ContextMenuItem",Gne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(q6,{...s,...r,ref:t})});Gne.displayName=RTe;var PTe="ContextMenuCheckboxItem",Kne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(G6,{...s,...r,ref:t})});Kne.displayName=PTe;var NTe="ContextMenuRadioGroup",TTe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(K6,{...s,...r,ref:t})});TTe.displayName=NTe;var kTe="ContextMenuRadioItem",Yne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(Y6,{...s,...r,ref:t})});Yne.displayName=kTe;var DTe="ContextMenuItemIndicator",Xne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(X6,{...s,...r,ref:t})});Xne.displayName=DTe;var OTe="ContextMenuSeparator",Qne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(Q6,{...s,...r,ref:t})});Qne.displayName=OTe;var MTe="ContextMenuArrow",ITe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(Z6,{...s,...r,ref:t})});ITe.displayName=MTe;var LTe="ContextMenuSubTrigger",Zne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(J6,{...s,...r,ref:t})});Zne.displayName=LTe;var jTe="ContextMenuSubContent",Jne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(e8,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Jne.displayName=jTe;function oP(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var $Te=Vne,ere=Wne,tre=qne,nre=Gne,rre=Kne,sre=Yne,ire=Xne,ore=Qne,are=Zne,lre=Jne;const FTe=C.forwardRef(({className:e,inset:t,children:n,...r},s)=>_.jsxs(are,{ref:s,className:ge("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,_.jsx(Tx,{className:"ml-auto h-4 w-4"})]}));FTe.displayName=are.displayName;const zTe=C.forwardRef(({className:e,...t},n)=>_.jsx(lre,{ref:n,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));zTe.displayName=lre.displayName;const BTe=C.forwardRef(({className:e,...t},n)=>_.jsx($Te,{children:_.jsx(ere,{ref:n,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));BTe.displayName=ere.displayName;const UTe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(nre,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));UTe.displayName=nre.displayName;const VTe=C.forwardRef(({className:e,children:t,checked:n,...r},s)=>_.jsxs(rre,{ref:s,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(ire,{children:_.jsx(OA,{className:"h-4 w-4"})})}),t]}));VTe.displayName=rre.displayName;const HTe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(sre,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(ire,{children:_.jsx(cD,{className:"h-2 w-2 fill-current"})})}),t]}));HTe.displayName=sre.displayName;const WTe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(tre,{ref:r,className:ge("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));WTe.displayName=tre.displayName;const qTe=C.forwardRef(({className:e,...t},n)=>_.jsx(ore,{ref:n,className:ge("-mx-1 my-1 h-px bg-border",e),...t}));qTe.displayName=ore.displayName;function cp(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function F9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cre(...e){return t=>{let n=!1;const r=e.map(s=>{const i=F9(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:o,...a}=i,c=C.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=C.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function KTe(e,t=[]){let n=[];function r(i,o){const a=C.createContext(o),c=n.length;n=[...n,o];const d=u=>{var y;const{scope:f,children:g,...v}=u,m=((y=f==null?void 0:f[e])==null?void 0:y[c])||a,x=C.useMemo(()=>v,Object.values(v));return _.jsx(m.Provider,{value:x,children:g})};d.displayName=i+"Provider";function h(u,f){var m;const g=((m=f==null?void 0:f[e])==null?void 0:m[c])||a,v=C.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,YTe(s,...t)]}function YTe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var t8=C.forwardRef((e,t)=>{const{children:n,...r}=e,s=C.Children.toArray(n),i=s.find(QTe);if(i){const o=i.props.children,a=s.map(c=>c===i?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return _.jsx(JB,{...r,ref:t,children:C.isValidElement(o)?C.cloneElement(o,void 0,a):null})}return _.jsx(JB,{...r,ref:t,children:n})});t8.displayName="Slot";var JB=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const s=JTe(n),i=ZTe(r,n.props);return n.type!==C.Fragment&&(i.ref=t?cre(t,s):s),C.cloneElement(n,i)}return C.Children.count(n)>1?C.Children.only(null):null});JB.displayName="SlotClone";var XTe=({children:e})=>_.jsx(_.Fragment,{children:e});function QTe(e){return C.isValidElement(e)&&e.type===XTe}function ZTe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function JTe(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Gf=eke.reduce((e,t)=>{const n=C.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?t8:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function tke(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}var nke="DismissableLayer",eU="dismissableLayer.update",rke="dismissableLayer.pointerDownOutside",ske="dismissableLayer.focusOutside",z9,ure=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dre=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,d=C.useContext(ure),[h,u]=C.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),v=my(t,N=>u(N)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=h?m.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,R=ake(N=>{const A=N.target,D=[...d.branches].some(O=>O.contains(A));!E||D||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},f),T=lke(N=>{const A=N.target;[...d.branches].some(O=>O.contains(A))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},f);return MJ(N=>{b===d.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},f),C.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(z9=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),B9(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=z9)}},[h,f,n,d]),C.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),B9())},[h,d]),C.useEffect(()=>{const N=()=>g({});return document.addEventListener(eU,N),()=>document.removeEventListener(eU,N)},[]),_.jsx(Gf.div,{...c,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:cp(e.onFocusCapture,T.onFocusCapture),onBlurCapture:cp(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:cp(e.onPointerDownCapture,R.onPointerDownCapture)})});dre.displayName=nke;var ike="DismissableLayerBranch",oke=C.forwardRef((e,t)=>{const n=C.useContext(ure),r=C.useRef(null),s=my(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(Gf.div,{...e,ref:s})});oke.displayName=ike;function ake(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){fre(rke,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lke(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!r.current&&fre(ske,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function B9(){const e=new CustomEvent(eU);document.dispatchEvent(e)}function fre(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?tke(s,i):s.dispatchEvent(i)}var f4="focusScope.autoFocusOnMount",h4="focusScope.autoFocusOnUnmount",U9={bubbles:!1,cancelable:!0},cke="FocusScope",hre=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=C.useState(null),d=bn(s),h=bn(i),u=C.useRef(null),f=my(t,m=>c(m)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const E=w.target;a.contains(E)?u.current=E:rh(u.current,{select:!0})},x=function(w){if(g.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||rh(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&rh(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,g.paused]),C.useEffect(()=>{if(a){H9.add(g);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(f4,U9);a.addEventListener(f4,d),a.dispatchEvent(y),y.defaultPrevented||(uke(mke(pre(a)),{select:!0}),document.activeElement===m&&rh(a))}return()=>{a.removeEventListener(f4,d),setTimeout(()=>{const y=new CustomEvent(h4,U9);a.addEventListener(h4,h),a.dispatchEvent(y),y.defaultPrevented||rh(m??document.body,{select:!0}),a.removeEventListener(h4,h),H9.remove(g)},0)}}},[a,d,h,g]);const v=C.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[w,E]=dke(b);w&&E?!m.shiftKey&&y===E?(m.preventDefault(),n&&rh(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&rh(E,{select:!0})):y===b&&m.preventDefault()}},[n,r,g.paused]);return _.jsx(Gf.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});hre.displayName=cke;function uke(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(rh(r,{select:t}),document.activeElement!==n)return}function dke(e){const t=pre(e),n=V9(t,e),r=V9(t.reverse(),e);return[n,r]}function pre(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function V9(e,t){for(const n of e)if(!fke(n,{upTo:t}))return n}function fke(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 hke(e){return e instanceof HTMLInputElement&&"select"in e}function rh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hke(e)&&t&&e.select()}}var H9=pke();function pke(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=W9(e,t),e.unshift(t)},remove(t){var n;e=W9(e,t),(n=e[0])==null||n.resume()}}}function W9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mke(e){return e.filter(t=>t.tagName!=="A")}var gke="Portal",mre=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=C.useState(!1);Rr(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?kA.createPortal(_.jsx(Gf.div,{...r,ref:t}),o):null});mre.displayName=gke;function vke(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var KD=e=>{const{present:t,children:n}=e,r=yke(t),s=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=my(r.ref,bke(s));return typeof n=="function"||r.isPresent?C.cloneElement(s,{ref:i}):null};KD.displayName="Presence";function yke(e){const[t,n]=C.useState(),r=C.useRef({}),s=C.useRef(e),i=C.useRef("none"),o=e?"mounted":"unmounted",[a,c]=vke(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const d=aP(r.current);i.current=a==="mounted"?d:"none"},[a]),Rr(()=>{const d=r.current,h=s.current;if(h!==e){const f=i.current,g=aP(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Rr(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,u=g=>{const m=aP(r.current).includes(g.animationName);if(g.target===t&&m&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=g=>{g.target===t&&(i.current=aP(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function aP(e){return(e==null?void 0:e.animationName)||"none"}function bke(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var p4=0;function xke(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??q9()),document.body.insertAdjacentElement("beforeend",e[1]??q9()),p4++,()=>{p4===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),p4--}},[])}function q9(){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 gre=UH(),m4=function(){},YD=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:m4,onWheelCapture:m4,onTouchMoveCapture:m4}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,u=e.shards,f=e.sideCar,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,w=dD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,R=BH([n,t]),T=fs(fs({},w),s);return C.createElement(C.Fragment,null,h&&C.createElement(E,{sideCar:gre,removeScrollBar:d,shards:u,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),o?C.cloneElement(C.Children.only(a),fs(fs({},T),{ref:R})):C.createElement(y,fs({},T,{className:c,ref:R}),a))});YD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};YD.classNames={fullWidth:Nb,zeroRight:Pb};var tU=!1;if(typeof window<"u")try{var lP=Object.defineProperty({},"passive",{get:function(){return tU=!0,!0}});window.addEventListener("test",lP,lP),window.removeEventListener("test",lP,lP)}catch{tU=!1}var Iy=tU?{passive:!1}:!1,_ke=function(e){return e.tagName==="TEXTAREA"},vre=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_ke(e)&&n[t]==="visible")},wke=function(e){return vre(e,"overflowY")},Ske=function(e){return vre(e,"overflowX")},G9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=yre(e,r);if(s){var i=bre(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cke=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Eke=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yre=function(e,t){return e==="v"?wke(t):Ske(t)},bre=function(e,t){return e==="v"?Cke(t):Eke(t)},Ake=function(e,t){return e==="h"&&t==="rtl"?-1:1},Rke=function(e,t,n,r,s){var i=Ake(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),d=!1,h=o>0,u=0,f=0;do{var g=bre(e,a),v=g[0],m=g[1],x=g[2],y=m-x-i*v;(v||y)&&yre(e,a)&&(u+=y,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(h&&Math.abs(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},cP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K9=function(e){return[e.deltaX,e.deltaY]},Y9=function(e){return e&&"current"in e?e.current:e},Pke=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nke=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},Tke=0,Ly=[];function kke(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),s=C.useState(Tke++)[0],i=C.useState(hD)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zH([e.lockRef.current],(e.shards||[]).map(Y9),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=cP(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-y[0],E="deltaY"in m?m.deltaY:b[1]-y[1],R,T=m.target,N=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in m&&N==="h"&&T.type==="range")return!1;var A=G9(N,T);if(!A)return!0;if(A?R=N:(R=N==="v"?"h":"v",A=G9(N,T)),!A)return!1;if(!r.current&&"changedTouches"in m&&(w||E)&&(r.current=R),!R)return!0;var D=r.current||R;return Rke(D,x,m,D==="h"?w:E)},[]),c=C.useCallback(function(m){var x=m;if(!(!Ly.length||Ly[Ly.length-1]!==i)){var y="deltaY"in x?K9(x):cP(x),b=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&Pke(R.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(Y9).filter(Boolean).filter(function(R){return R.contains(x.target)}),E=w.length>0?a(x,w[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),d=C.useCallback(function(m,x,y,b){var w={name:m,delta:x,target:y,should:b,shadowParent:Dke(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),h=C.useCallback(function(m){n.current=cP(m),r.current=void 0},[]),u=C.useCallback(function(m){d(m.type,K9(m),m.target,a(m,e.lockRef.current))},[]),f=C.useCallback(function(m){d(m.type,cP(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return Ly.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Iy),document.addEventListener("touchmove",c,Iy),document.addEventListener("touchstart",h,Iy),function(){Ly=Ly.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Iy),document.removeEventListener("touchmove",c,Iy),document.removeEventListener("touchstart",h,Iy)}},[]);var g=e.removeScrollBar,v=e.inert;return C.createElement(C.Fragment,null,v?C.createElement(i,{styles:Nke(s)}):null,g?C.createElement(HH,{gapMode:e.gapMode}):null)}function Dke(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Oke=VH(gre,kke);var xre=C.forwardRef(function(e,t){return C.createElement(YD,fs({},e,{ref:t,sideCar:Oke}))});xre.classNames=YD.classNames;var n8="Dialog",[_re,d7e]=KTe(n8),[Mke,Mc]=_re(n8),wre=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=C.useRef(null),c=C.useRef(null),[d=!1,h]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(Mke,{scope:t,triggerRef:a,contentRef:c,contentId:si(),titleId:si(),descriptionId:si(),open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};wre.displayName=n8;var Sre="DialogTrigger",Ike=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(Sre,n),i=my(t,s.triggerRef);return _.jsx(Gf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":i8(s.open),...r,ref:i,onClick:cp(e.onClick,s.onOpenToggle)})});Ike.displayName=Sre;var r8="DialogPortal",[Lke,Cre]=_re(r8,{forceMount:void 0}),Ere=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Mc(r8,t);return _.jsx(Lke,{scope:t,forceMount:n,children:C.Children.map(r,o=>_.jsx(KD,{present:n||i.open,children:_.jsx(mre,{asChild:!0,container:s,children:o})}))})};Ere.displayName=r8;var AT="DialogOverlay",Are=C.forwardRef((e,t)=>{const n=Cre(AT,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Mc(AT,e.__scopeDialog);return i.modal?_.jsx(KD,{present:r||i.open,children:_.jsx(jke,{...s,ref:t})}):null});Are.displayName=AT;var jke=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(AT,n);return _.jsx(xre,{as:t8,allowPinchZoom:!0,shards:[s.contentRef],children:_.jsx(Gf.div,{"data-state":i8(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wv="DialogContent",Rre=C.forwardRef((e,t)=>{const n=Cre(Wv,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Mc(Wv,e.__scopeDialog);return _.jsx(KD,{present:r||i.open,children:i.modal?_.jsx($ke,{...s,ref:t}):_.jsx(Fke,{...s,ref:t})})});Rre.displayName=Wv;var $ke=C.forwardRef((e,t)=>{const n=Mc(Wv,e.__scopeDialog),r=C.useRef(null),s=my(t,n.contentRef,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(Pre,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:cp(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:cp(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:cp(e.onFocusOutside,i=>i.preventDefault())})}),Fke=C.forwardRef((e,t)=>{const n=Mc(Wv,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(Pre,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Pre=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=Mc(Wv,n),c=C.useRef(null),d=my(t,c);return xke(),_.jsxs(_.Fragment,{children:[_.jsx(hre,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(dre,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":i8(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(zke,{titleId:a.titleId}),_.jsx(Uke,{contentRef:c,descriptionId:a.descriptionId})]})]})}),s8="DialogTitle",Nre=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(s8,n);return _.jsx(Gf.h2,{id:s.titleId,...r,ref:t})});Nre.displayName=s8;var Tre="DialogDescription",kre=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(Tre,n);return _.jsx(Gf.p,{id:s.descriptionId,...r,ref:t})});kre.displayName=Tre;var Dre="DialogClose",Ore=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(Dre,n);return _.jsx(Gf.button,{type:"button",...r,ref:t,onClick:cp(e.onClick,()=>s.onOpenChange(!1))})});Ore.displayName=Dre;function i8(e){return e?"open":"closed"}var Mre="DialogTitleWarning",[f7e,Ire]=GTe(Mre,{contentName:Wv,titleName:s8,docsSlug:"dialog"}),zke=({titleId:e})=>{const t=Ire(Mre),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Bke="DialogDescriptionWarning",Uke=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ire(Bke).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Vke=wre,Hke=Ere,Wke=Are,qke=Rre,Gke=Nre,Kke=kre,Yke=Ore;function Xke(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Lre=fe.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),nR=()=>{const e=fe.useContext(Lre);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Xke(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( [data-state=closed] ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const Qke=24,Zke=typeof window<"u"?C.useLayoutEffect:C.useEffect;function X9(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function Jke(){return o8(/^Mac/)}function eDe(){return o8(/^iPhone/)}function Q9(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function tDe(){return o8(/^iPad/)||Jke()&&navigator.maxTouchPoints>1}function jre(){return eDe()||tDe()}function o8(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const g4=typeof document<"u"&&window.visualViewport;function Z9(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function $re(e){for(Z9(e)&&(e=e.parentElement);e&&!Z9(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const nDe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let uP=0,v4;function rDe(e={}){let{isDisabled:t}=e;Zke(()=>{if(!t)return uP++,uP===1&&jre()&&(v4=sDe()),()=>{uP--,uP===0&&(v4==null||v4())}},[t])}function sDe(){let e,t=0,n=u=>{e=$re(u.target),!(e===document.documentElement&&e===document.body)&&(t=u.changedTouches[0].pageY)},r=u=>{if(!e||e===document.documentElement||e===document.body){u.preventDefault();return}let f=u.changedTouches[0].pageY,g=e.scrollTop,v=e.scrollHeight-e.clientHeight;v!==0&&((g<=0&&f>t||g>=v&&f{let f=u.target;nU(f)&&f!==document.activeElement&&(u.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=u=>{let f=u.target;nU(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",g4&&(g4.height{J9(f)}):g4.addEventListener("resize",()=>J9(f),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,d=X9(iDe(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let h=X9(FS(document,"touchstart",n,{passive:!1,capture:!0}),FS(document,"touchmove",r,{passive:!1,capture:!0}),FS(document,"touchend",s,{passive:!1,capture:!0}),FS(document,"focus",i,!0),FS(window,"scroll",o));return()=>{d(),h(),window.scrollTo(a,c)}}function iDe(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function FS(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function J9(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=$re(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=n.getBoundingClientRect().bottom+Qke;i>o&&(n.scrollTop+=s-r)}e=n.parentElement}}function nU(e){return e instanceof HTMLInputElement&&!nDe.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function oDe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function aDe(...e){return t=>e.forEach(n=>oDe(n,t))}function Fre(...e){return C.useCallback(aDe(...e),e)}const zre=new WeakMap;function Ys(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([s,i])=>{if(s.startsWith("--")){e.style.setProperty(s,i);return}r[s]=e.style[s],e.style[s]=i}),!n&&zre.set(e,r)}function lDe(e,t){if(!e||!(e instanceof HTMLElement))return;let n=zre.get(e);n&&(e.style[t]=n[t])}const Xs=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function dP(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Xs(t)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Xs(t)?5:4]):null)}function cDe(e){return 8*(Math.log(e+1)-2)}function y4(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function uDe(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const ns={DURATION:.5,EASE:[.32,.72,0,1]},Bre=.4,dDe=.25,fDe=100,Ure=8,fP=16,rU=26,b4="vaul-dragging";function Vre(e){const t=fe.useRef(e);return fe.useEffect(()=>{t.current=e}),fe.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function hDe({defaultProp:e,onChange:t}){const n=fe.useState(e),[r]=n,s=fe.useRef(r),i=Vre(t);return fe.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function Hre({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=hDe({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=Vre(n),c=fe.useCallback(d=>{if(i){const u=typeof d=="function"?d(e):d;u!==e&&a(u)}else s(d)},[i,e,s,a]);return[o,c]}function pDe({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:a="bottom",container:c,snapToSequentialPoint:d}){const[h,u]=Hre({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,g]=fe.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);fe.useEffect(()=>{function N(){g({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);const v=fe.useMemo(()=>h===(n==null?void 0:n[n.length-1])||null,[n,h]),m=fe.useMemo(()=>n==null?void 0:n.findIndex(N=>N===h),[n,h]),x=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===h||!n,y=fe.useMemo(()=>{const N=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var A;return(A=n==null?void 0:n.map(D=>{const O=typeof D=="string";let I=0;if(O&&(I=parseInt(D,10)),Xs(a)){const F=O?I:f?D*N.height:0;return f?a==="bottom"?N.height-F:-N.height+F:F}const $=O?I:f?D*N.width:0;return f?a==="right"?N.width-$:-N.width+$:$}))!=null?A:[]},[n,f,c]),b=fe.useMemo(()=>m!==null?y==null?void 0:y[m]:null,[y,m]),w=fe.useCallback(N=>{var A;const D=(A=y==null?void 0:y.findIndex(O=>O===N))!=null?A:null;o(D),Ys(r.current,{transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,transform:Xs(a)?`translate3d(0, ${N}px, 0)`:`translate3d(${N}px, 0, 0)`}),y&&D!==y.length-1&&D!==i&&D{if(h||e){var N;const A=(N=n==null?void 0:n.findIndex(D=>D===e||D===h))!=null?N:-1;y&&A!==-1&&typeof y[A]=="number"&&w(y[A])}},[h,e,n,y,w]);function E({draggedDistance:N,closeDrawer:A,velocity:D,dismissible:O}){if(i===void 0)return;const I=a==="bottom"||a==="right"?(b??0)-N:(b??0)+N,$=m===i-1,F=m===0,B=N>0;if($&&Ys(s.current,{transition:`opacity ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`}),!d&&D>2&&!B){O?A():w(y[0]);return}if(!d&&D>2&&B&&y&&n){w(y[n.length-1]);return}const W=y==null?void 0:y.reduce((Y,H)=>typeof Y!="number"||typeof H!="number"?Y:Math.abs(H-I)Bre&&Math.abs(N)0&&v){w(y[n.length-1]);return}if(F&&Y<0&&O&&A(),m===null)return;w(y[m+Y]);return}w(W)}function R({draggedDistance:N}){if(b===null)return;const A=a==="bottom"||a==="right"?b-N:b+N;(a==="bottom"||a==="right")&&Ay[y.length-1]||Ys(r.current,{transform:Xs(a)?`translate3d(0, ${A}px, 0)`:`translate3d(${A}px, 0, 0)`})}function T(N,A){if(!n||typeof m!="number"||!y||i===void 0)return null;const D=m===i-1;if(m>=i&&A)return 0;if(D&&!A)return 1;if(!x&&!D)return null;const I=D?m+1:m-1,$=D?y[I]-y[I-1]:y[I+1]-y[I],F=N/Math.abs($);return D?1-F:F}return{isLastSnapPoint:v,activeSnapPoint:h,shouldFade:x,getPercentageDragged:T,setActiveSnapPoint:u,activeSnapPointIndex:m,onRelease:E,onDrag:R,snapPointsOffset:y}}const mDe=()=>()=>{};function gDe(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=nR(),i=fe.useRef(null),o=C.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-rU)/window.innerWidth}fe.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;uDe(r&&!s?y4(document.body,{background:"black"}):mDe,y4(c,{transformOrigin:Xs(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ns.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ns.EASE.join(",")})`}));const d=y4(c,{borderRadius:`${Ure}px`,overflow:"hidden",...Xs(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},ns.DURATION*1e3)}}},[t,n,o])}let zS=null;function vDe({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[o,a]=fe.useState(()=>typeof window<"u"?window.location.href:""),c=fe.useRef(0),d=fe.useCallback(()=>{if(Q9()&&zS===null&&e&&!i){zS={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:u,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-u}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const g=f-window.innerHeight;g&&c.current>=f&&(document.body.style.top=`${-(c.current+g)}px`)}),300)}},[e]),h=fe.useCallback(()=>{if(Q9()&&zS!==null&&!i){const u=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,zS),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){a(window.location.href);return}window.scrollTo(f,u)}),zS=null}},[o]);return fe.useEffect(()=>{function u(){c.current=window.scrollY}return u(),window.addEventListener("scroll",u),()=>{window.removeEventListener("scroll",u)}},[]),fe.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{h()},500)):h())},[e,r,o,t,n,d,h]),{restorePositionSetting:h}}function yDe({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:a=!0,closeThreshold:c=dDe,scrollLockTimeout:d=fDe,dismissible:h=!0,handleOnly:u=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:g,setActiveSnapPoint:v,fixed:m,modal:x=!0,onClose:y,nested:b,noBodyStyles:w,direction:E="bottom",defaultOpen:R=!1,disablePreventScroll:T=!0,snapToSequentialPoint:N=!1,preventScrollRestoration:A=!1,repositionInputs:D=!0,onAnimationEnd:O,container:I,autoFocus:$=!1}){var F,B;const[W=!1,Z]=Hre({defaultProp:R,prop:e,onChange:Ze=>{t==null||t(Ze),!Ze&&!b&&we(),setTimeout(()=>{O==null||O(Ze)},ns.DURATION*1e3),Ze&&!x&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ze||(document.body.style.pointerEvents="auto")}}),[Y,H]=fe.useState(!1),[se,he]=fe.useState(!1),[re,J]=fe.useState(!1),te=fe.useRef(null),ae=fe.useRef(null),be=fe.useRef(null),xe=fe.useRef(null),ve=fe.useRef(null),Pe=fe.useRef(!1),Oe=fe.useRef(null),ke=fe.useRef(0),ze=fe.useRef(!1),$e=fe.useRef(0),Te=fe.useRef(null),Ue=fe.useRef(((F=Te.current)==null?void 0:F.getBoundingClientRect().height)||0),wt=fe.useRef(((B=Te.current)==null?void 0:B.getBoundingClientRect().width)||0),ut=fe.useRef(0),St=fe.useCallback(Ze=>{i&&Ze===U.length-1&&(ae.current=new Date)},[]),{activeSnapPoint:Nn,activeSnapPointIndex:cn,setActiveSnapPoint:hn,onRelease:It,snapPointsOffset:U,onDrag:ee,shouldFade:ie,getPercentageDragged:_e}=pDe({snapPoints:i,activeSnapPointProp:g,setActiveSnapPointProp:v,drawerRef:Te,fadeFromIndex:f,overlayRef:te,onSnapPointChange:St,direction:E,container:I,snapToSequentialPoint:N});rDe({isDisabled:!W||se||!x||re||!Y||!D||!T});const{restorePositionSetting:we}=vDe({isOpen:W,modal:x,nested:b,hasBeenOpened:Y,preventScrollRestoration:A,noBodyStyles:w});function pe(){return(window.innerWidth-rU)/window.innerWidth}function Se(Ze){var Rt,Pt;!h&&!i||Te.current&&!Te.current.contains(Ze.target)||(Ue.current=((Rt=Te.current)==null?void 0:Rt.getBoundingClientRect().height)||0,wt.current=((Pt=Te.current)==null?void 0:Pt.getBoundingClientRect().width)||0,he(!0),be.current=new Date,jre()&&window.addEventListener("touchend",()=>Pe.current=!1,{once:!0}),Ze.target.setPointerCapture(Ze.pointerId),ke.current=Xs(E)?Ze.pageY:Ze.pageX)}function Fe(Ze,Rt){var Pt,Ut;let yt=Ze;const dn=(Pt=window.getSelection())==null?void 0:Pt.toString(),Gt=Te.current?dP(Te.current,E):null,Hn=new Date;if(yt.hasAttribute("data-vaul-no-drag")||yt.closest("[data-vaul-no-drag]"))return!1;if(E==="right"||E==="left")return!0;if(ae.current&&Hn.getTime()-ae.current.getTime()<500)return!1;if(Gt!==null&&(E==="bottom"?Gt>0:Gt<0))return!0;if(dn&&dn.length>0)return!1;if(Hn.getTime()-((Ut=ve.current)==null?void 0:Ut.getTime())yt.clientHeight){if(yt.scrollTop!==0)return ve.current=new Date,!1;if(yt.getAttribute("role")==="dialog")return!0}yt=yt.parentNode}return!0}function ft(Ze){if(Te.current&&se){const Rt=E==="bottom"||E==="right"?1:-1,Pt=(ke.current-(Xs(E)?Ze.pageY:Ze.pageX))*Rt,Ut=Pt>0,yt=i&&!h&&!Ut;if(yt&&cn===0)return;const dn=Math.abs(Pt),Gt=document.querySelector("[data-vaul-drawer-wrapper]"),Hn=E==="bottom"||E==="top"?Ue.current:wt.current;let In=dn/Hn;const Tn=_e(dn,Ut);if(Tn!==null&&(In=Tn),yt&&In>=1||!Pe.current&&!Fe(Ze.target,Ut))return;if(Te.current.classList.add(b4),Pe.current=!0,Ys(Te.current,{transition:"none"}),Ys(te.current,{transition:"none"}),i&&ee({draggedDistance:Pt}),Ut&&!i){const Kr=cDe(Pt),ir=Math.min(Kr*-1,0)*Rt;Ys(Te.current,{transform:Xs(E)?`translate3d(0, ${ir}px, 0)`:`translate3d(${ir}px, 0, 0)`});return}const sr=1-In;if((ie||f&&cn===f-1)&&(r==null||r(Ze,In),Ys(te.current,{opacity:`${sr}`,transition:"none"},!0)),Gt&&te.current&&o){const Kr=Math.min(pe()+In*(1-pe()),1),ir=8-In*8,de=Math.max(0,14-In*14);Ys(Gt,{borderRadius:`${ir}px`,transform:Xs(E)?`scale(${Kr}) translate3d(0, ${de}px, 0)`:`scale(${Kr}) translate3d(${de}px, 0, 0)`,transition:"none"},!0)}if(!i){const Kr=dn*Rt;Ys(Te.current,{transform:Xs(E)?`translate3d(0, ${Kr}px, 0)`:`translate3d(${Kr}px, 0, 0)`})}}}fe.useEffect(()=>{var Ze;function Rt(){if(!Te.current||!D)return;const Pt=document.activeElement;if(nU(Pt)||ze.current){var Ut;const yt=((Ut=window.visualViewport)==null?void 0:Ut.height)||0,dn=window.innerHeight;let Gt=dn-yt;const Hn=Te.current.getBoundingClientRect().height||0,In=Hn>dn*.8;ut.current||(ut.current=Hn);const Tn=Te.current.getBoundingClientRect().top;if(Math.abs($e.current-Gt)>60&&(ze.current=!ze.current),i&&i.length>0&&U&&cn){const sr=U[cn]||0;Gt+=sr}if($e.current=Gt,Hn>yt||ze.current){const sr=Te.current.getBoundingClientRect().height;let Kr=sr;sr>yt&&(Kr=yt-(In?Tn:rU)),m?Te.current.style.height=`${sr-Math.max(Gt,0)}px`:Te.current.style.height=`${Math.max(Kr,yt-Tn)}px`}else Te.current.style.height=`${ut.current}px`;i&&i.length>0&&!ze.current?Te.current.style.bottom="0px":Te.current.style.bottom=`${Math.max(Gt,0)}px`}}return(Ze=window.visualViewport)==null||Ze.addEventListener("resize",Rt),()=>{var Pt;return(Pt=window.visualViewport)==null?void 0:Pt.removeEventListener("resize",Rt)}},[cn,i,U]);function ht(Ze){Mn(),y==null||y(),Ze||Z(!1),setTimeout(()=>{i&&hn(i[0])},ns.DURATION*1e3)}function hs(){if(!Te.current)return;const Ze=document.querySelector("[data-vaul-drawer-wrapper]"),Rt=dP(Te.current,E);Ys(Te.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`}),Ys(te.current,{transition:`opacity ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,opacity:"1"}),o&&Rt&&Rt>0&&W&&Ys(Ze,{borderRadius:`${Ure}px`,overflow:"hidden",...Xs(E)?{transform:`scale(${pe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${pe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ns.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ns.EASE.join(",")})`},!0)}function Mn(){!se||!Te.current||(Te.current.classList.remove(b4),Pe.current=!1,he(!1),xe.current=new Date)}function Hr(Ze){if(!se||!Te.current)return;Te.current.classList.remove(b4),Pe.current=!1,he(!1),xe.current=new Date;const Rt=dP(Te.current,E);if(!Fe(Ze.target,!1)||!Rt||Number.isNaN(Rt)||be.current===null)return;const Pt=xe.current.getTime()-be.current.getTime(),Ut=ke.current-(Xs(E)?Ze.pageY:Ze.pageX),yt=Math.abs(Ut)/Pt;if(yt>.05&&(J(!0),setTimeout(()=>{J(!1)},200)),i){It({draggedDistance:Ut*(E==="bottom"||E==="right"?1:-1),closeDrawer:ht,velocity:yt,dismissible:h}),s==null||s(Ze,!0);return}if(E==="bottom"||E==="right"?Ut>0:Ut<0){hs(),s==null||s(Ze,!0);return}if(yt>Bre){ht(),s==null||s(Ze,!1);return}var dn;const Gt=Math.min((dn=Te.current.getBoundingClientRect().height)!=null?dn:0,window.innerHeight);var Hn;const In=Math.min((Hn=Te.current.getBoundingClientRect().width)!=null?Hn:0,window.innerWidth),Tn=E==="left"||E==="right";if(Math.abs(Rt)>=(Tn?In:Gt)*c){ht(),s==null||s(Ze,!1);return}s==null||s(Ze,!0),hs()}fe.useEffect(()=>(W&&(Ys(document.documentElement,{scrollBehavior:"auto"}),ae.current=new Date),()=>{lDe(document.documentElement,"scrollBehavior")}),[W]);function Yt(Ze){const Rt=Ze?(window.innerWidth-fP)/window.innerWidth:1,Pt=Ze?-16:0;Oe.current&&window.clearTimeout(Oe.current),Ys(Te.current,{transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,transform:`scale(${Rt}) translate3d(0, ${Pt}px, 0)`}),!Ze&&Te.current&&(Oe.current=setTimeout(()=>{const Ut=dP(Te.current,E);Ys(Te.current,{transition:"none",transform:Xs(E)?`translate3d(0, ${Ut}px, 0)`:`translate3d(${Ut}px, 0, 0)`})},500))}function un(Ze,Rt){if(Rt<0)return;const Pt=(window.innerWidth-fP)/window.innerWidth,Ut=Pt+Rt*(1-Pt),yt=-16+Rt*fP;Ys(Te.current,{transform:Xs(E)?`scale(${Ut}) translate3d(0, ${yt}px, 0)`:`scale(${Ut}) translate3d(${yt}px, 0, 0)`,transition:"none"})}function xn(Ze,Rt){const Pt=Xs(E)?window.innerHeight:window.innerWidth,Ut=Rt?(Pt-fP)/Pt:1,yt=Rt?-16:0;Rt&&Ys(Te.current,{transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,transform:Xs(E)?`scale(${Ut}) translate3d(0, ${yt}px, 0)`:`scale(${Ut}) translate3d(${yt}px, 0, 0)`})}return fe.createElement(Vke,{defaultOpen:R,onOpenChange:Ze=>{!h&&!Ze||(Ze?H(!0):ht(!0),Z(Ze))},open:W},fe.createElement(Lre.Provider,{value:{activeSnapPoint:Nn,snapPoints:i,setActiveSnapPoint:hn,drawerRef:Te,overlayRef:te,onOpenChange:t,onPress:Se,onRelease:Hr,onDrag:ft,dismissible:h,handleOnly:u,isOpen:W,isDragging:se,shouldFade:ie,closeDrawer:ht,onNestedDrag:un,onNestedOpenChange:Yt,onNestedRelease:xn,keyboardIsOpen:ze,modal:x,snapPointsOffset:U,direction:E,shouldScaleBackground:o,setBackgroundColorOnScale:a,noBodyStyles:w,container:I,autoFocus:$}},n))}const Wre=fe.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:o,modal:a}=nR(),c=Fre(t,n),d=r&&r.length>0;return a?fe.createElement(Wke,{onMouseUp:s,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":o&&d?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});Wre.displayName="Drawer.Overlay";const qre=fe.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:o,onRelease:a,onDrag:c,keyboardIsOpen:d,snapPointsOffset:h,modal:u,isOpen:f,direction:g,snapPoints:v,container:m,handleOnly:x,autoFocus:y}=nR(),[b,w]=fe.useState(!1),E=Fre(s,i),R=fe.useRef(null),T=fe.useRef(null),N=fe.useRef(!1),A=v&&v.length>0;gDe();const D=(I,$,F=0)=>{if(N.current)return!0;const B=Math.abs(I.y),W=Math.abs(I.x),Z=W>B,Y=["bottom","right"].includes($)?1:-1;if($==="left"||$==="right"){if(!(I.x*Y<0)&&W>=0&&W<=F)return Z}else if(!(I.y*Y<0)&&B>=0&&B<=F)return!Z;return N.current=!0,!0};fe.useEffect(()=>{A&&window.requestAnimationFrame(()=>{w(!0)})},[]);function O(I){R.current=null,N.current=!1,a(I)}return fe.createElement(qke,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":b?"true":"false","data-vaul-snap-points":f&&A?"true":"false","data-vaul-custom-container":m?"true":"false",...r,ref:E,style:h&&h.length>0?{"--snap-point-height":`${h[0]}px`,...t}:t,onPointerDown:I=>{x||(r.onPointerDown==null||r.onPointerDown.call(r,I),R.current={x:I.pageX,y:I.pageY},o(I))},onOpenAutoFocus:I=>{n==null||n(I),y||I.preventDefault()},onPointerDownOutside:I=>{if(e==null||e(I),!u||I.defaultPrevented){I.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:I=>{if(!u){I.preventDefault();return}},onPointerMove:I=>{if(T.current=I,x||(r.onPointerMove==null||r.onPointerMove.call(r,I),!R.current))return;const $=I.pageY-R.current.y,F=I.pageX-R.current.x,B=I.pointerType==="touch"?10:2;D({x:F,y:$},g,B)?c(I):(Math.abs(F)>B||Math.abs($)>B)&&(R.current=null)},onPointerUp:I=>{r.onPointerUp==null||r.onPointerUp.call(r,I),R.current=null,N.current=!1,a(I)},onPointerOut:I=>{r.onPointerOut==null||r.onPointerOut.call(r,I),O(T.current)},onContextMenu:I=>{r.onContextMenu==null||r.onContextMenu.call(r,I),O(T.current)}})});qre.displayName="Drawer.Content";const bDe=250,xDe=120,_De=fe.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:o,activeSnapPoint:a,setActiveSnapPoint:c,dismissible:d,handleOnly:h,isOpen:u,onPress:f,onDrag:g}=nR(),v=fe.useRef(null),m=fe.useRef(!1);function x(){if(m.current){w();return}window.setTimeout(()=>{y()},xDe)}function y(){if(i||e||m.current){w();return}if(w(),(!o||o.length===0)&&d){s();return}if(a===o[o.length-1]&&d){s();return}const R=o.findIndex(N=>N===a);if(R===-1)return;const T=o[R+1];c(T)}function b(){v.current=window.setTimeout(()=>{m.current=!0},bDe)}function w(){window.clearTimeout(v.current),m.current=!1}return fe.createElement("div",{onClick:x,onPointerCancel:w,onPointerDown:E=>{h&&f(E),b()},onPointerMove:E=>{h&&g(E)},ref:r,"data-vaul-drawer-visible":u?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},fe.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});_De.displayName="Drawer.Handle";function wDe(e){const t=nR(),{container:n=t.container,...r}=e;return fe.createElement(Hke,{container:n,...r})}const ju={Root:yDe,Content:qre,Overlay:Wre,Portal:wDe,Close:Yke,Title:Gke,Description:Kke},a8=({shouldScaleBackground:e=!0,...t})=>_.jsx(ju.Root,{shouldScaleBackground:e,...t});a8.displayName="Drawer";const SDe=ju.Portal,Gre=ju.Close,Kre=C.forwardRef(({className:e,...t},n)=>_.jsx(ju.Overlay,{ref:n,className:ge("fixed inset-0 z-50 bg-black/80",e),...t}));Kre.displayName=ju.Overlay.displayName;const l8=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(SDe,{children:[_.jsx(Kre,{}),_.jsxs(ju.Content,{ref:r,className:ge("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[_.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));l8.displayName="DrawerContent";const c8=({className:e,...t})=>_.jsx("div",{className:ge("grid gap-1.5 p-4 text-center sm:text-left",e),...t});c8.displayName="DrawerHeader";const u8=({className:e,...t})=>_.jsx("div",{className:ge("mt-auto flex flex-col gap-2 p-4",e),...t});u8.displayName="DrawerFooter";const d8=C.forwardRef(({className:e,...t},n)=>_.jsx(ju.Title,{ref:n,className:ge("text-lg font-semibold leading-none tracking-tight",e),...t}));d8.displayName=ju.Title.displayName;const f8=C.forwardRef(({className:e,...t},n)=>_.jsx(ju.Description,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));f8.displayName=ju.Description.displayName;var h8="DropdownMenu",[CDe,h7e]=_r(h8,[eR]),Lo=eR(),[EDe,Yre]=CDe(h8),Xre=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,c=Lo(t),d=C.useRef(null),[h=!1,u]=os({prop:s,defaultProp:i,onChange:o});return _.jsx(EDe,{scope:t,triggerId:si(),triggerRef:d,contentId:si(),open:h,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),modal:a,children:_.jsx(xTe,{...c,open:h,onOpenChange:u,dir:r,modal:a,children:n})})};Xre.displayName=h8;var Qre="DropdownMenuTrigger",Zre=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=Yre(Qre,n),o=Lo(n);return _.jsx(B6,{asChild:!0,...o,children:_.jsx(He.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,...s,ref:DA(t,i.triggerRef),onPointerDown:Ae(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Ae(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Zre.displayName=Qre;var ADe="DropdownMenuPortal",Jre=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Lo(t);return _.jsx(U6,{...r,...n})};Jre.displayName=ADe;var ese="DropdownMenuContent",tse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yre(ese,n),i=Lo(n),o=C.useRef(!1);return _.jsx(V6,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;(!s.modal||h)&&(o.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)"}})});tse.displayName=ese;var RDe="DropdownMenuGroup",nse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(H6,{...s,...r,ref:t})});nse.displayName=RDe;var PDe="DropdownMenuLabel",rse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(W6,{...s,...r,ref:t})});rse.displayName=PDe;var NDe="DropdownMenuItem",sse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(q6,{...s,...r,ref:t})});sse.displayName=NDe;var TDe="DropdownMenuCheckboxItem",ise=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(G6,{...s,...r,ref:t})});ise.displayName=TDe;var kDe="DropdownMenuRadioGroup",DDe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(K6,{...s,...r,ref:t})});DDe.displayName=kDe;var ODe="DropdownMenuRadioItem",ose=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(Y6,{...s,...r,ref:t})});ose.displayName=ODe;var MDe="DropdownMenuItemIndicator",ase=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(X6,{...s,...r,ref:t})});ase.displayName=MDe;var IDe="DropdownMenuSeparator",lse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(Q6,{...s,...r,ref:t})});lse.displayName=IDe;var LDe="DropdownMenuArrow",jDe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(Z6,{...s,...r,ref:t})});jDe.displayName=LDe;var $De="DropdownMenuSubTrigger",cse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(J6,{...s,...r,ref:t})});cse.displayName=$De;var FDe="DropdownMenuSubContent",use=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(e8,{...s,...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)"}})});use.displayName=FDe;var zDe=Xre,BDe=Zre,UDe=Jre,dse=tse,VDe=nse,fse=rse,hse=sse,pse=ise,mse=ose,gse=ase,vse=lse,yse=cse,bse=use;const rR=zDe,sR=BDe,HDe=VDe,WDe=C.forwardRef(({className:e,inset:t,children:n,...r},s)=>_.jsxs(yse,{ref:s,className:ge("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,_.jsx(Tx,{className:"w-4 h-4 ml-auto"})]}));WDe.displayName=yse.displayName;const qDe=C.forwardRef(({className:e,...t},n)=>_.jsx(bse,{ref:n,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));qDe.displayName=bse.displayName;const Vx=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(UDe,{children:_.jsx(dse,{ref:r,sideOffset:t,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Vx.displayName=dse.displayName;const up=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(hse,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));up.displayName=hse.displayName;const xse=C.forwardRef(({className:e,children:t,checked:n,...r},s)=>_.jsxs(pse,{ref:s,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(gse,{children:_.jsx(OA,{className:"w-4 h-4"})})}),t]}));xse.displayName=pse.displayName;const GDe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(mse,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(gse,{children:_.jsx(cD,{className:"w-2 h-2 fill-current"})})}),t]}));GDe.displayName=mse.displayName;const XD=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(fse,{ref:r,className:ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));XD.displayName=fse.displayName;const ax=C.forwardRef(({className:e,...t},n)=>_.jsx(vse,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));ax.displayName=vse.displayName;const _se=({className:e,...t})=>_.jsx("span",{className:ge("ml-auto text-xs tracking-widest opacity-60",e),...t});_se.displayName="DropdownMenuShortcut";var iR=e=>e.type==="checkbox",fg=e=>e instanceof Date,Eo=e=>e==null;const wse=e=>typeof e=="object";var ws=e=>!Eo(e)&&!Array.isArray(e)&&wse(e)&&!fg(e),Sse=e=>ws(e)&&e.target?iR(e.target)?e.target.checked:e.target.value:e,KDe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Cse=(e,t)=>e.has(KDe(t)),YDe=e=>{const t=e.constructor&&e.constructor.prototype;return ws(t)&&t.hasOwnProperty("isPrototypeOf")},p8=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ts(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(p8&&(e instanceof Blob||r))&&(n||ws(e)))if(t=n?[]:{},!n&&!YDe(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ts(e[s]));else return e;return t}var oR=e=>Array.isArray(e)?e.filter(Boolean):[],Br=e=>e===void 0,Ye=(e,t,n)=>{if(!t||!ws(e))return n;const r=oR(t.split(/[,[\].]+?/)).reduce((s,i)=>Eo(s)?s:s[i],e);return Br(r)||r===e?Br(e[t])?n:e[t]:r},Ua=e=>typeof e=="boolean",m8=e=>/^\w*$/.test(e),Ese=e=>oR(e.replace(/["|']|\]/g,"").split(/\.|\[/)),kn=(e,t,n)=>{let r=-1;const s=m8(t)?[t]:Ese(t),i=s.length,o=i-1;for(;++rfe.useContext(Ase),XDe=e=>{const{children:t,...n}=e;return fe.createElement(Ase.Provider,{value:n},t)};var Rse=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==gl.all&&(t._proxyFormState[o]=!r||gl.all),n&&(n[o]=!0),e[o]}});return s};function Pse(e){const t=ua(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[o,a]=fe.useState(n._formState),c=fe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=fe.useRef(s);return d.current=s,fe.useEffect(()=>n._subscribe({name:d.current,formState:c.current,exact:i,callback:h=>{!r&&a({...n._formState,...h})}}),[n,r,i]),fe.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),fe.useMemo(()=>Rse(o,n,c.current,!1),[o,n])}var yu=e=>typeof e=="string",Nse=(e,t,n,r,s)=>yu(e)?(r&&t.watch.add(e),Ye(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Ye(n,i))):(r&&(t.watchAll=!0),n);function Tse(e){const t=ua(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:o}=e||{},a=fe.useRef(r),c=fe.useRef(s);a.current=r,fe.useEffect(()=>n._subscribe({name:a.current,formState:{values:!0},exact:o,callback:u=>!i&&h(Nse(a.current,n._names,u.values||n._formValues,!1,c.current))}),[n,i,o]);const[d,h]=fe.useState(n._getWatch(r,s));return fe.useEffect(()=>n._removeUnmounted()),d}function QDe(e){const t=ua(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i}=e,o=Cse(s._names.array,n),a=Tse({control:s,name:n,defaultValue:Ye(s._formValues,n,Ye(s._defaultValues,n,e.defaultValue)),exact:!0}),c=Pse({control:s,name:n,exact:!0}),d=fe.useRef(e),h=fe.useRef(s.register(n,{...e.rules,value:a,...Ua(e.disabled)?{disabled:e.disabled}:{}})),u=fe.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ye(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ye(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ye(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ye(c.validatingFields,n)},error:{enumerable:!0,get:()=>Ye(c.errors,n)}}),[c,n]),f=fe.useCallback(x=>h.current.onChange({target:{value:Sse(x),name:n},type:RT.CHANGE}),[n]),g=fe.useCallback(()=>h.current.onBlur({target:{value:Ye(s._formValues,n),name:n},type:RT.BLUR}),[n,s._formValues]),v=fe.useCallback(x=>{const y=Ye(s._fields,n);y&&x&&(y._f.ref={focus:()=>x.focus(),select:()=>x.select(),setCustomValidity:b=>x.setCustomValidity(b),reportValidity:()=>x.reportValidity()})},[s._fields,n]),m=fe.useMemo(()=>({name:n,value:a,...Ua(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:f,onBlur:g,ref:v}),[n,r,c.disabled,f,g,v,a]);return fe.useEffect(()=>{const x=s._options.shouldUnregister||i;s.register(n,{...d.current.rules,...Ua(d.current.disabled)?{disabled:d.current.disabled}:{}});const y=(b,w)=>{const E=Ye(s._fields,b);E&&E._f&&(E._f.mount=w)};if(y(n,!0),x){const b=ts(Ye(s._options.defaultValues,n));kn(s._defaultValues,n,b),Br(Ye(s._formValues,n))&&kn(s._formValues,n,b)}return!o&&s.register(n),()=>{(o?x&&!s._state.action:x)?s.unregister(n):y(n,!1)}},[n,s,o,i]),fe.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),fe.useMemo(()=>({field:m,formState:c,fieldState:u}),[m,c,u])}const ZDe=e=>e.render(QDe(e));var kse=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Zo=e=>Array.isArray(e)?e:[e],e7=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},sU=e=>Eo(e)||!wse(e);function gh(e,t){if(sU(e)||sU(t))return e===t;if(fg(e)&&fg(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const i=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=t[s];if(fg(i)&&fg(o)||ws(i)&&ws(o)||Array.isArray(i)&&Array.isArray(o)?!gh(i,o):i!==o)return!1}}return!0}var Ji=e=>ws(e)&&!Object.keys(e).length,g8=e=>e.type==="file",mc=e=>typeof e=="function",PT=e=>{if(!p8)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Dse=e=>e.type==="select-multiple",v8=e=>e.type==="radio",JDe=e=>v8(e)||iR(e),x4=e=>PT(e)&&e.isConnected;function eOe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const t in e)if(mc(e[t]))return!0;return!1};function NT(e,t={}){const n=Array.isArray(e);if(ws(e)||n)for(const r in e)Array.isArray(e[r])||ws(e[r])&&!Ose(e[r])?(t[r]=Array.isArray(e[r])?[]:{},NT(e[r],t[r])):Eo(e[r])||(t[r]=!0);return t}function Mse(e,t,n){const r=Array.isArray(e);if(ws(e)||r)for(const s in e)Array.isArray(e[s])||ws(e[s])&&!Ose(e[s])?Br(t)||sU(n[s])?n[s]=Array.isArray(e[s])?NT(e[s],[]):{...NT(e[s])}:Mse(e[s],Eo(t)?{}:t[s],n[s]):n[s]=!gh(e[s],t[s]);return n}var BS=(e,t)=>Mse(e,t,NT(t));const t7={value:!1,isValid:!1},n7={value:!0,isValid:!0};var Ise=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Br(e[0].attributes.value)?Br(e[0].value)||e[0].value===""?n7:{value:e[0].value,isValid:!0}:n7:t7}return t7},Lse=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Br(e)?e:t?e===""?NaN:e&&+e:n&&yu(e)?new Date(e):r?r(e):e;const r7={isValid:!1,value:null};var jse=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,r7):r7;function s7(e){const t=e.ref;return g8(t)?t.files:v8(t)?jse(e.refs).value:Dse(t)?[...t.selectedOptions].map(({value:n})=>n):iR(t)?Ise(e.refs).value:Lse(Br(t.value)?e.ref.value:t.value,e)}var nOe=(e,t,n,r)=>{const s={};for(const i of e){const o=Ye(t,i);o&&kn(s,i,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},TT=e=>e instanceof RegExp,US=e=>Br(e)?e:TT(e)?e.source:ws(e)?TT(e.value)?e.value.source:e.value:e,gb=e=>({isOnSubmit:!e||e===gl.onSubmit,isOnBlur:e===gl.onBlur,isOnChange:e===gl.onChange,isOnAll:e===gl.all,isOnTouch:e===gl.onTouched});const i7="AsyncFunction";var rOe=e=>!!e&&!!e.validate&&!!(mc(e.validate)&&e.validate.constructor.name===i7||ws(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===i7)),sOe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),iU=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ob=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=Ye(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(Ob(a,t))break}else if(ws(a)&&Ob(a,t))break}}};function o7(e,t,n){const r=Ye(e,n);if(r||m8(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=Ye(t,i),a=Ye(e,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};s.pop()}return{name:n}}var iOe=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return Ji(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!r||gl.all))},oOe=(e,t,n)=>!e||!t||e===t||Zo(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),aOe=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,lOe=(e,t)=>!oR(Ye(e,t)).length&&Ps(e,t),$se=(e,t,n)=>{const r=Zo(Ye(e,n));return kn(r,"root",t[n]),kn(e,n,r),e},ZP=e=>yu(e);function a7(e,t,n="validate"){if(ZP(e)||Array.isArray(e)&&e.every(ZP)||Ua(e)&&!e)return{type:n,message:ZP(e)?e:"",ref:t}}var jy=e=>ws(e)&&!TT(e)?e:{value:e,message:""},oU=async(e,t,n,r,s,i)=>{const{ref:o,refs:a,required:c,maxLength:d,minLength:h,min:u,max:f,pattern:g,validate:v,name:m,valueAsNumber:x,mount:y}=e._f,b=Ye(n,m);if(!y||t.has(m))return{};const w=a?a[0]:o,E=$=>{s&&w.reportValidity&&(w.setCustomValidity(Ua($)?"":$||""),w.reportValidity())},R={},T=v8(o),N=iR(o),A=T||N,D=(x||g8(o))&&Br(o.value)&&Br(b)||PT(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,O=kse.bind(null,m,r,R),I=($,F,B,W=kd.maxLength,Z=kd.minLength)=>{const Y=$?F:B;R[m]={type:$?W:Z,message:Y,ref:o,...O($?W:Z,Y)}};if(i?!Array.isArray(b)||!b.length:c&&(!A&&(D||Eo(b))||Ua(b)&&!b||N&&!Ise(a).isValid||T&&!jse(a).isValid)){const{value:$,message:F}=ZP(c)?{value:!!c,message:c}:jy(c);if($&&(R[m]={type:kd.required,message:F,ref:w,...O(kd.required,F)},!r))return E(F),R}if(!D&&(!Eo(u)||!Eo(f))){let $,F;const B=jy(f),W=jy(u);if(!Eo(b)&&!isNaN(b)){const Z=o.valueAsNumber||b&&+b;Eo(B.value)||($=Z>B.value),Eo(W.value)||(F=Znew Date(new Date().toDateString()+" "+he),H=o.type=="time",se=o.type=="week";yu(B.value)&&b&&($=H?Y(b)>Y(B.value):se?b>B.value:Z>new Date(B.value)),yu(W.value)&&b&&(F=H?Y(b)+$.value,W=!Eo(F.value)&&b.length<+F.value;if((B||W)&&(I(B,$.message,F.message),!r))return E(R[m].message),R}if(g&&!D&&yu(b)){const{value:$,message:F}=jy(g);if(TT($)&&!b.match($)&&(R[m]={type:kd.pattern,message:F,ref:o,...O(kd.pattern,F)},!r))return E(F),R}if(v){if(mc(v)){const $=await v(b,n),F=a7($,w);if(F&&(R[m]={...F,...O(kd.validate,F.message)},!r))return E(F.message),R}else if(ws(v)){let $={};for(const F in v){if(!Ji($)&&!r)break;const B=a7(await v[F](b,n),w,F);B&&($={...B,...O(F,B.message)},E(B.message),r&&(R[m]=$))}if(!Ji($)&&(R[m]={ref:w,...$},!r))return R}}return E(!0),R};const cOe={mode:gl.onSubmit,reValidateMode:gl.onChange,shouldFocusError:!0};function uOe(e={}){let t={...cOe,...e},n={submitCount:0,isDirty:!1,isLoading:mc(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const r={};let s=ws(t.defaultValues)||ws(t.values)?ts(t.values||t.defaultValues)||{}:{},i=t.shouldUnregister?{}:ts(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...h};const f={array:e7(),state:e7()},g=gb(t.mode),v=gb(t.reValidateMode),m=t.criteriaMode===gl.all,x=U=>ee=>{clearTimeout(d),d=setTimeout(U,ee)},y=async U=>{if(!t.disabled&&(h.isValid||u.isValid||U)){const ee=t.resolver?Ji((await D()).errors):await I(r,!0);ee!==n.isValid&&f.state.next({isValid:ee})}},b=(U,ee)=>{!t.disabled&&(h.isValidating||h.validatingFields||u.isValidating||u.validatingFields)&&((U||Array.from(a.mount)).forEach(ie=>{ie&&(ee?kn(n.validatingFields,ie,ee):Ps(n.validatingFields,ie))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ji(n.validatingFields)}))},w=(U,ee=[],ie,_e,we=!0,pe=!0)=>{if(_e&&ie&&!t.disabled){if(o.action=!0,pe&&Array.isArray(Ye(r,U))){const Se=ie(Ye(r,U),_e.argA,_e.argB);we&&kn(r,U,Se)}if(pe&&Array.isArray(Ye(n.errors,U))){const Se=ie(Ye(n.errors,U),_e.argA,_e.argB);we&&kn(n.errors,U,Se),lOe(n.errors,U)}if((h.touchedFields||u.touchedFields)&&pe&&Array.isArray(Ye(n.touchedFields,U))){const Se=ie(Ye(n.touchedFields,U),_e.argA,_e.argB);we&&kn(n.touchedFields,U,Se)}(h.dirtyFields||u.dirtyFields)&&(n.dirtyFields=BS(s,i)),f.state.next({name:U,isDirty:F(U,ee),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else kn(i,U,ee)},E=(U,ee)=>{kn(n.errors,U,ee),f.state.next({errors:n.errors})},R=U=>{n.errors=U,f.state.next({errors:n.errors,isValid:!1})},T=(U,ee,ie,_e)=>{const we=Ye(r,U);if(we){const pe=Ye(i,U,Br(ie)?Ye(s,U):ie);Br(pe)||_e&&_e.defaultChecked||ee?kn(i,U,ee?pe:s7(we._f)):Z(U,pe),o.mount&&y()}},N=(U,ee,ie,_e,we)=>{let pe=!1,Se=!1;const Fe={name:U};if(!t.disabled){if(!ie||_e){(h.isDirty||u.isDirty)&&(Se=n.isDirty,n.isDirty=Fe.isDirty=F(),pe=Se!==Fe.isDirty);const ft=gh(Ye(s,U),ee);Se=!!Ye(n.dirtyFields,U),ft?Ps(n.dirtyFields,U):kn(n.dirtyFields,U,!0),Fe.dirtyFields=n.dirtyFields,pe=pe||(h.dirtyFields||u.dirtyFields)&&Se!==!ft}if(ie){const ft=Ye(n.touchedFields,U);ft||(kn(n.touchedFields,U,ie),Fe.touchedFields=n.touchedFields,pe=pe||(h.touchedFields||u.touchedFields)&&ft!==ie)}pe&&we&&f.state.next(Fe)}return pe?Fe:{}},A=(U,ee,ie,_e)=>{const we=Ye(n.errors,U),pe=(h.isValid||u.isValid)&&Ua(ee)&&n.isValid!==ee;if(t.delayError&&ie?(c=x(()=>E(U,ie)),c(t.delayError)):(clearTimeout(d),c=null,ie?kn(n.errors,U,ie):Ps(n.errors,U)),(ie?!gh(we,ie):we)||!Ji(_e)||pe){const Se={..._e,...pe&&Ua(ee)?{isValid:ee}:{},errors:n.errors,name:U};n={...n,...Se},f.state.next(Se)}},D=async U=>{b(U,!0);const ee=await t.resolver(i,t.context,nOe(U||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(U),ee},O=async U=>{const{errors:ee}=await D(U);if(U)for(const ie of U){const _e=Ye(ee,ie);_e?kn(n.errors,ie,_e):Ps(n.errors,ie)}else n.errors=ee;return ee},I=async(U,ee,ie={valid:!0})=>{for(const _e in U){const we=U[_e];if(we){const{_f:pe,...Se}=we;if(pe){const Fe=a.array.has(pe.name),ft=we._f&&rOe(we._f);ft&&h.validatingFields&&b([_e],!0);const ht=await oU(we,a.disabled,i,m,t.shouldUseNativeValidation&&!ee,Fe);if(ft&&h.validatingFields&&b([_e]),ht[pe.name]&&(ie.valid=!1,ee))break;!ee&&(Ye(ht,pe.name)?Fe?$se(n.errors,ht,pe.name):kn(n.errors,pe.name,ht[pe.name]):Ps(n.errors,pe.name))}!Ji(Se)&&await I(Se,ee,ie)}}return ie.valid},$=()=>{for(const U of a.unMount){const ee=Ye(r,U);ee&&(ee._f.refs?ee._f.refs.every(ie=>!x4(ie)):!x4(ee._f.ref))&&Oe(U)}a.unMount=new Set},F=(U,ee)=>!t.disabled&&(U&&ee&&kn(i,U,ee),!gh(J(),s)),B=(U,ee,ie)=>Nse(U,a,{...o.mount?i:Br(ee)?s:yu(U)?{[U]:ee}:ee},ie,ee),W=U=>oR(Ye(o.mount?i:s,U,t.shouldUnregister?Ye(s,U,[]):[])),Z=(U,ee,ie={})=>{const _e=Ye(r,U);let we=ee;if(_e){const pe=_e._f;pe&&(!pe.disabled&&kn(i,U,Lse(ee,pe)),we=PT(pe.ref)&&Eo(ee)?"":ee,Dse(pe.ref)?[...pe.ref.options].forEach(Se=>Se.selected=we.includes(Se.value)):pe.refs?iR(pe.ref)?pe.refs.length>1?pe.refs.forEach(Se=>(!Se.defaultChecked||!Se.disabled)&&(Se.checked=Array.isArray(we)?!!we.find(Fe=>Fe===Se.value):we===Se.value)):pe.refs[0]&&(pe.refs[0].checked=!!we):pe.refs.forEach(Se=>Se.checked=Se.value===we):g8(pe.ref)?pe.ref.value="":(pe.ref.value=we,pe.ref.type||f.state.next({name:U,values:ts(i)})))}(ie.shouldDirty||ie.shouldTouch)&&N(U,we,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&re(U)},Y=(U,ee,ie)=>{for(const _e in ee){const we=ee[_e],pe=`${U}.${_e}`,Se=Ye(r,pe);(a.array.has(U)||ws(we)||Se&&!Se._f)&&!fg(we)?Y(pe,we,ie):Z(pe,we,ie)}},H=(U,ee,ie={})=>{const _e=Ye(r,U),we=a.array.has(U),pe=ts(ee);kn(i,U,pe),we?(f.array.next({name:U,values:ts(i)}),(h.isDirty||h.dirtyFields||u.isDirty||u.dirtyFields)&&ie.shouldDirty&&f.state.next({name:U,dirtyFields:BS(s,i),isDirty:F(U,pe)})):_e&&!_e._f&&!Eo(pe)?Y(U,pe,ie):Z(U,pe,ie),iU(U,a)&&f.state.next({...n}),f.state.next({name:o.mount?U:void 0,values:ts(i)})},se=async U=>{o.mount=!0;const ee=U.target;let ie=ee.name,_e=!0;const we=Ye(r,ie),pe=Se=>{_e=Number.isNaN(Se)||fg(Se)&&isNaN(Se.getTime())||gh(Se,Ye(i,ie,Se))};if(we){let Se,Fe;const ft=ee.type?s7(we._f):Sse(U),ht=U.type===RT.BLUR||U.type===RT.FOCUS_OUT,hs=!sOe(we._f)&&!t.resolver&&!Ye(n.errors,ie)&&!we._f.deps||aOe(ht,Ye(n.touchedFields,ie),n.isSubmitted,v,g),Mn=iU(ie,a,ht);kn(i,ie,ft),ht?(we._f.onBlur&&we._f.onBlur(U),c&&c(0)):we._f.onChange&&we._f.onChange(U);const Hr=N(ie,ft,ht),Yt=!Ji(Hr)||Mn;if(!ht&&f.state.next({name:ie,type:U.type,values:ts(i)}),hs)return(h.isValid||u.isValid)&&(t.mode==="onBlur"?ht&&y():ht||y()),Yt&&f.state.next({name:ie,...Mn?{}:Hr});if(!ht&&Mn&&f.state.next({...n}),t.resolver){const{errors:un}=await D([ie]);if(pe(ft),_e){const xn=o7(n.errors,r,ie),Ze=o7(un,r,xn.name||ie);Se=Ze.error,ie=Ze.name,Fe=Ji(un)}}else b([ie],!0),Se=(await oU(we,a.disabled,i,m,t.shouldUseNativeValidation))[ie],b([ie]),pe(ft),_e&&(Se?Fe=!1:(h.isValid||u.isValid)&&(Fe=await I(r,!0)));_e&&(we._f.deps&&re(we._f.deps),A(ie,Fe,Se,Hr))}},he=(U,ee)=>{if(Ye(n.errors,ee)&&U.focus)return U.focus(),1},re=async(U,ee={})=>{let ie,_e;const we=Zo(U);if(t.resolver){const pe=await O(Br(U)?U:we);ie=Ji(pe),_e=U?!we.some(Se=>Ye(pe,Se)):ie}else U?(_e=(await Promise.all(we.map(async pe=>{const Se=Ye(r,pe);return await I(Se&&Se._f?{[pe]:Se}:Se)}))).every(Boolean),!(!_e&&!n.isValid)&&y()):_e=ie=await I(r);return f.state.next({...!yu(U)||(h.isValid||u.isValid)&&ie!==n.isValid?{}:{name:U},...t.resolver||!U?{isValid:ie}:{},errors:n.errors}),ee.shouldFocus&&!_e&&Ob(r,he,U?we:a.mount),_e},J=U=>{const ee={...o.mount?i:s};return Br(U)?ee:yu(U)?Ye(ee,U):U.map(ie=>Ye(ee,ie))},te=(U,ee)=>({invalid:!!Ye((ee||n).errors,U),isDirty:!!Ye((ee||n).dirtyFields,U),error:Ye((ee||n).errors,U),isValidating:!!Ye(n.validatingFields,U),isTouched:!!Ye((ee||n).touchedFields,U)}),ae=U=>{U&&Zo(U).forEach(ee=>Ps(n.errors,ee)),f.state.next({errors:U?n.errors:{}})},be=(U,ee,ie)=>{const _e=(Ye(r,U,{_f:{}})._f||{}).ref,we=Ye(n.errors,U)||{},{ref:pe,message:Se,type:Fe,...ft}=we;kn(n.errors,U,{...ft,...ee,ref:_e}),f.state.next({name:U,errors:n.errors,isValid:!1}),ie&&ie.shouldFocus&&_e&&_e.focus&&_e.focus()},xe=(U,ee)=>mc(U)?f.state.subscribe({next:ie=>U(B(void 0,ee),ie)}):B(U,ee,!0),ve=U=>f.state.subscribe({next:ee=>{oOe(U.name,ee.name,U.exact)&&iOe(ee,U.formState||h,cn,U.reRenderRoot)&&U.callback({values:{...i},...n,...ee})}}).unsubscribe,Pe=U=>(o.mount=!0,u={...u,...U.formState},ve({...U,formState:u})),Oe=(U,ee={})=>{for(const ie of U?Zo(U):a.mount)a.mount.delete(ie),a.array.delete(ie),ee.keepValue||(Ps(r,ie),Ps(i,ie)),!ee.keepError&&Ps(n.errors,ie),!ee.keepDirty&&Ps(n.dirtyFields,ie),!ee.keepTouched&&Ps(n.touchedFields,ie),!ee.keepIsValidating&&Ps(n.validatingFields,ie),!t.shouldUnregister&&!ee.keepDefaultValue&&Ps(s,ie);f.state.next({values:ts(i)}),f.state.next({...n,...ee.keepDirty?{isDirty:F()}:{}}),!ee.keepIsValid&&y()},ke=({disabled:U,name:ee})=>{(Ua(U)&&o.mount||U||a.disabled.has(ee))&&(U?a.disabled.add(ee):a.disabled.delete(ee))},ze=(U,ee={})=>{let ie=Ye(r,U);const _e=Ua(ee.disabled)||Ua(t.disabled);return kn(r,U,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:U}},name:U,mount:!0,...ee}}),a.mount.add(U),ie?ke({disabled:Ua(ee.disabled)?ee.disabled:t.disabled,name:U}):T(U,!0,ee.value),{..._e?{disabled:ee.disabled||t.disabled}:{},...t.progressive?{required:!!ee.required,min:US(ee.min),max:US(ee.max),minLength:US(ee.minLength),maxLength:US(ee.maxLength),pattern:US(ee.pattern)}:{},name:U,onChange:se,onBlur:se,ref:we=>{if(we){ze(U,ee),ie=Ye(r,U);const pe=Br(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,Se=JDe(pe),Fe=ie._f.refs||[];if(Se?Fe.find(ft=>ft===pe):pe===ie._f.ref)return;kn(r,U,{_f:{...ie._f,...Se?{refs:[...Fe.filter(x4),pe,...Array.isArray(Ye(s,U))?[{}]:[]],ref:{type:pe.type,name:U}}:{ref:pe}}}),T(U,!1,void 0,pe)}else ie=Ye(r,U,{}),ie._f&&(ie._f.mount=!1),(t.shouldUnregister||ee.shouldUnregister)&&!(Cse(a.array,U)&&o.action)&&a.unMount.add(U)}}},$e=()=>t.shouldFocusError&&Ob(r,he,a.mount),Te=U=>{Ua(U)&&(f.state.next({disabled:U}),Ob(r,(ee,ie)=>{const _e=Ye(r,ie);_e&&(ee.disabled=_e._f.disabled||U,Array.isArray(_e._f.refs)&&_e._f.refs.forEach(we=>{we.disabled=_e._f.disabled||U}))},0,!1))},Ue=(U,ee)=>async ie=>{let _e;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let we=ts(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:pe,values:Se}=await D();n.errors=pe,we=Se}else await I(r);if(a.disabled.size)for(const pe of a.disabled)kn(we,pe,void 0);if(Ps(n.errors,"root"),Ji(n.errors)){f.state.next({errors:{}});try{await U(we,ie)}catch(pe){_e=pe}}else ee&&await ee({...n.errors},ie),$e(),setTimeout($e);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ji(n.errors)&&!_e,submitCount:n.submitCount+1,errors:n.errors}),_e)throw _e},wt=(U,ee={})=>{Ye(r,U)&&(Br(ee.defaultValue)?H(U,ts(Ye(s,U))):(H(U,ee.defaultValue),kn(s,U,ts(ee.defaultValue))),ee.keepTouched||Ps(n.touchedFields,U),ee.keepDirty||(Ps(n.dirtyFields,U),n.isDirty=ee.defaultValue?F(U,ts(Ye(s,U))):F()),ee.keepError||(Ps(n.errors,U),h.isValid&&y()),f.state.next({...n}))},ut=(U,ee={})=>{const ie=U?ts(U):s,_e=ts(ie),we=Ji(U),pe=we?s:_e;if(ee.keepDefaultValues||(s=ie),!ee.keepValues){if(ee.keepDirtyValues){const Se=new Set([...a.mount,...Object.keys(BS(s,i))]);for(const Fe of Array.from(Se))Ye(n.dirtyFields,Fe)?kn(pe,Fe,Ye(i,Fe)):H(Fe,Ye(pe,Fe))}else{if(p8&&Br(U))for(const Se of a.mount){const Fe=Ye(r,Se);if(Fe&&Fe._f){const ft=Array.isArray(Fe._f.refs)?Fe._f.refs[0]:Fe._f.ref;if(PT(ft)){const ht=ft.closest("form");if(ht){ht.reset();break}}}}for(const Se of a.mount)H(Se,Ye(pe,Se))}i=ts(pe),f.array.next({values:{...pe}}),f.state.next({values:{...pe}})}a={mount:ee.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!h.isValid||!!ee.keepIsValid||!!ee.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:ee.keepSubmitCount?n.submitCount:0,isDirty:we?!1:ee.keepDirty?n.isDirty:!!(ee.keepDefaultValues&&!gh(U,s)),isSubmitted:ee.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:we?{}:ee.keepDirtyValues?ee.keepDefaultValues&&i?BS(s,i):n.dirtyFields:ee.keepDefaultValues&&U?BS(s,U):ee.keepDirty?n.dirtyFields:{},touchedFields:ee.keepTouched?n.touchedFields:{},errors:ee.keepErrors?n.errors:{},isSubmitSuccessful:ee.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},St=(U,ee)=>ut(mc(U)?U(i):U,ee),Nn=(U,ee={})=>{const ie=Ye(r,U),_e=ie&&ie._f;if(_e){const we=_e.refs?_e.refs[0]:_e.ref;we.focus&&(we.focus(),ee.shouldSelect&&mc(we.select)&&we.select())}},cn=U=>{n={...n,...U}},It={control:{register:ze,unregister:Oe,getFieldState:te,handleSubmit:Ue,setError:be,_subscribe:ve,_runSchema:D,_getWatch:B,_getDirty:F,_setValid:y,_setFieldArray:w,_setDisabledField:ke,_setErrors:R,_getFieldArray:W,_reset:ut,_resetDefaultValues:()=>mc(t.defaultValues)&&t.defaultValues().then(U=>{St(U,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:Te,_subjects:f,_proxyFormState:h,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(U){o=U},get _defaultValues(){return s},get _names(){return a},set _names(U){a=U},get _formState(){return n},get _options(){return t},set _options(U){t={...t,...U}}},subscribe:Pe,trigger:re,register:ze,handleSubmit:Ue,watch:xe,setValue:H,getValues:J,reset:St,resetField:wt,clearErrors:ae,unregister:Oe,setError:be,setFocus:Nn,getFieldState:te};return{...It,formControl:It}}var Jf=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},_4=(e,t,n={})=>n.shouldFocus||Br(n.shouldFocus)?n.focusName||`${e}.${Br(n.focusIndex)?t:n.focusIndex}.`:"",w4=(e,t)=>[...e,...Zo(t)],S4=e=>Array.isArray(e)?e.map(()=>{}):void 0;function C4(e,t,n){return[...e.slice(0,t),...Zo(n),...e.slice(t)]}var E4=(e,t,n)=>Array.isArray(e)?(Br(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],A4=(e,t)=>[...Zo(t),...Zo(e)];function dOe(e,t){let n=0;const r=[...e];for(const s of t)r.splice(s-n,1),n++;return oR(r).length?r:[]}var R4=(e,t)=>Br(t)?[]:dOe(e,Zo(t).sort((n,r)=>n-r)),P4=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},l7=(e,t,n)=>(e[t]=n,e);function fOe(e){const t=ua(),{control:n=t.control,name:r,keyName:s="id",shouldUnregister:i,rules:o}=e,[a,c]=fe.useState(n._getFieldArray(r)),d=fe.useRef(n._getFieldArray(r).map(Jf)),h=fe.useRef(a),u=fe.useRef(r),f=fe.useRef(!1);u.current=r,h.current=a,n._names.array.add(r),o&&n.register(r,o),fe.useEffect(()=>n._subjects.array.subscribe({next:({values:T,name:N})=>{if(N===u.current||!N){const A=Ye(T,u.current);Array.isArray(A)&&(c(A),d.current=A.map(Jf))}}}).unsubscribe,[n]);const g=fe.useCallback(T=>{f.current=!0,n._setFieldArray(r,T)},[n,r]),v=(T,N)=>{const A=Zo(ts(T)),D=w4(n._getFieldArray(r),A);n._names.focus=_4(r,D.length-1,N),d.current=w4(d.current,A.map(Jf)),g(D),c(D),n._setFieldArray(r,D,w4,{argA:S4(T)})},m=(T,N)=>{const A=Zo(ts(T)),D=A4(n._getFieldArray(r),A);n._names.focus=_4(r,0,N),d.current=A4(d.current,A.map(Jf)),g(D),c(D),n._setFieldArray(r,D,A4,{argA:S4(T)})},x=T=>{const N=R4(n._getFieldArray(r),T);d.current=R4(d.current,T),g(N),c(N),!Array.isArray(Ye(n._fields,r))&&kn(n._fields,r,void 0),n._setFieldArray(r,N,R4,{argA:T})},y=(T,N,A)=>{const D=Zo(ts(N)),O=C4(n._getFieldArray(r),T,D);n._names.focus=_4(r,T,A),d.current=C4(d.current,T,D.map(Jf)),g(O),c(O),n._setFieldArray(r,O,C4,{argA:T,argB:S4(N)})},b=(T,N)=>{const A=n._getFieldArray(r);P4(A,T,N),P4(d.current,T,N),g(A),c(A),n._setFieldArray(r,A,P4,{argA:T,argB:N},!1)},w=(T,N)=>{const A=n._getFieldArray(r);E4(A,T,N),E4(d.current,T,N),g(A),c(A),n._setFieldArray(r,A,E4,{argA:T,argB:N},!1)},E=(T,N)=>{const A=ts(N),D=l7(n._getFieldArray(r),T,A);d.current=[...D].map((O,I)=>!O||I===T?Jf():d.current[I]),g(D),c([...D]),n._setFieldArray(r,D,l7,{argA:T,argB:A},!0,!1)},R=T=>{const N=Zo(ts(T));d.current=N.map(Jf),g([...N]),c([...N]),n._setFieldArray(r,[...N],A=>A,{},!0,!1)};return fe.useEffect(()=>{if(n._state.action=!1,iU(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!gb(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!gb(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(T=>{const N=Ye(T.errors,r),A=Ye(n._formState.errors,r);(A?!N&&A.type||N&&(A.type!==N.type||A.message!==N.message):N&&N.type)&&(N?kn(n._formState.errors,r,N):Ps(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const T=Ye(n._fields,r);T&&T._f&&!(gb(n._options.reValidateMode).isOnSubmit&&gb(n._options.mode).isOnSubmit)&&oU(T,n._names.disabled,n._formValues,n._options.criteriaMode===gl.all,n._options.shouldUseNativeValidation,!0).then(N=>!Ji(N)&&n._subjects.state.next({errors:$se(n._formState.errors,N,r)}))}n._subjects.state.next({name:r,values:ts(n._formValues)}),n._names.focus&&Ob(n._fields,(T,N)=>{if(n._names.focus&&N.startsWith(n._names.focus)&&T.focus)return T.focus(),1}),n._names.focus="",n._setValid(),f.current=!1},[a,r,n]),fe.useEffect(()=>(!Ye(n._formValues,r)&&n._setFieldArray(r),()=>{const T=(N,A)=>{const D=Ye(n._fields,N);D&&D._f&&(D._f.mount=A)};n._options.shouldUnregister||i?n.unregister(r):T(r,!1)}),[r,n,s,i]),{swap:fe.useCallback(b,[g,r,n]),move:fe.useCallback(w,[g,r,n]),prepend:fe.useCallback(m,[g,r,n]),append:fe.useCallback(v,[g,r,n]),remove:fe.useCallback(x,[g,r,n]),insert:fe.useCallback(y,[g,r,n]),update:fe.useCallback(E,[g,r,n]),replace:fe.useCallback(R,[g,r,n]),fields:fe.useMemo(()=>a.map((T,N)=>({...T,[s]:d.current[N]||Jf()})),[a,s])}}function aR(e={}){const t=fe.useRef(void 0),n=fe.useRef(void 0),[r,s]=fe.useState({isDirty:!1,isValidating:!1,isLoading:mc(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:mc(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:uOe(e),formState:r},e.formControl&&e.defaultValues&&!mc(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const i=t.current.control;return i._options=e,fe.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0}),[i]),fe.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),fe.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),fe.useEffect(()=>{e.values&&!gh(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),fe.useEffect(()=>{e.errors&&!Ji(e.errors)&&i._setErrors(e.errors)},[e.errors,i]),fe.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),fe.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=Rse(r,i),t.current}var hOe="Label",Fse=C.forwardRef((e,t)=>_.jsx(He.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Fse.displayName=hOe;var zse=Fse;const pOe=Io("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gy=C.forwardRef(({className:e,...t},n)=>_.jsx(zse,{ref:n,className:ge(pOe(),e),...t}));gy.displayName=zse.displayName;const lR=XDe,Bse=C.createContext({}),Hx=({...e})=>_.jsx(Bse.Provider,{value:{name:e.name},children:_.jsx(ZDe,{...e})}),Wx=()=>{const e=C.useContext(Bse),t=C.useContext(Use),{getFieldState:n,formState:r}=ua(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},Use=C.createContext({}),vy=C.forwardRef(({className:e,...t},n)=>{const r=C.useId();return _.jsx(Use.Provider,{value:{id:r},children:_.jsx("div",{ref:n,className:ge("space-y-2",e),...t})})});vy.displayName="FormItem";const Vse=C.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Wx();return _.jsx(gy,{ref:n,className:ge(r&&"text-destructive",e),htmlFor:s,...t})});Vse.displayName="FormLabel";const yy=C.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=Wx();return _.jsx(Cc,{ref:t,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...e})});yy.displayName="FormControl";const by=C.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Wx();return _.jsx("p",{ref:n,id:r,className:ge("text-[0.8rem] text-muted-foreground",e),...t})});by.displayName="FormDescription";const Hse=C.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:i}=Wx(),o=s?String((s==null?void 0:s.message)??""):t;return o?_.jsx("p",{ref:r,id:i,className:ge("text-[0.8rem] font-medium text-destructive",e),...n,children:o}):null});Hse.displayName="FormMessage";var N4,Wse="HoverCard",[qse,p7e]=_r(Wse,[Iu]),y8=Iu(),[m7e,b8]=qse(Wse),Gse="HoverCardTrigger",mOe=C.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=b8(Gse,n),i=y8(n);return _.jsx(Ux,{asChild:!0,...i,children:_.jsx(He.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,DT(s.onOpen)),onPointerLeave:Ae(e.onPointerLeave,DT(s.onClose)),onFocus:Ae(e.onFocus,s.onOpen),onBlur:Ae(e.onBlur,s.onClose),onTouchStart:Ae(e.onTouchStart,o=>o.preventDefault())})})});mOe.displayName=Gse;var gOe="HoverCardPortal",[g7e,vOe]=qse(gOe,{forceMount:void 0}),kT="HoverCardContent",Kse=C.forwardRef((e,t)=>{const n=vOe(kT,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=b8(kT,e.__scopeHoverCard);return _.jsx(Vr,{present:r||i.open,children:_.jsx(yOe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Ae(e.onPointerEnter,DT(i.onOpen)),onPointerLeave:Ae(e.onPointerLeave,DT(i.onClose)),ref:t})})});Kse.displayName=kT;var yOe=C.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,...a}=e,c=b8(kT,n),d=y8(n),h=C.useRef(null),u=_t(t,h),[f,g]=C.useState(!1);return C.useEffect(()=>{if(f){const v=document.body;return N4=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=N4,v.style.webkitUserSelect=N4}}},[f]),C.useEffect(()=>{if(h.current){const v=()=>{g(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var x;((x=document.getSelection())==null?void 0:x.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),C.useEffect(()=>{h.current&&_Oe(h.current).forEach(m=>m.setAttribute("tabindex","-1"))}),_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Ae(i,v=>{v.preventDefault()}),onDismiss:c.onDismiss,children:_.jsx(YA,{...d,...a,onPointerDown:Ae(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:u,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),bOe="HoverCardArrow",xOe=C.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=y8(n);return _.jsx(XA,{...s,...r,ref:t})});xOe.displayName=bOe;function DT(e){return t=>t.pointerType==="touch"?void 0:e()}function _Oe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var Yse=Kse;const wOe=C.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>_.jsx(Yse,{ref:s,align:t,sideOffset:n,className:ge("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));wOe.displayName=Yse.displayName;const cR=C.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:ge("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));cR.displayName="Input";var QD="Menubar",[aU,SOe,COe]=Uf(QD),[Xse,v7e]=_r(QD,[COe,Lu]),da=eR(),Qse=Lu(),[EOe,Zse]=Xse(QD),Jse=C.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:o=!0,dir:a,...c}=e,d=kc(a),h=Qse(n),[u="",f]=os({prop:r,onChange:s,defaultProp:i}),[g,v]=C.useState(null);return _.jsx(EOe,{scope:n,value:u,onMenuOpen:C.useCallback(m=>{f(m),v(m)},[f]),onMenuClose:C.useCallback(()=>f(""),[f]),onMenuToggle:C.useCallback(m=>{f(x=>x?"":m),v(m)},[f]),dir:d,loop:o,children:_.jsx(aU.Provider,{scope:n,children:_.jsx(aU.Slot,{scope:n,children:_.jsx(QA,{asChild:!0,...h,orientation:"horizontal",loop:o,dir:d,currentTabStopId:g,onCurrentTabStopIdChange:v,children:_.jsx(He.div,{role:"menubar",...c,ref:t})})})})})});Jse.displayName=QD;var AOe="MenubarMenu",[y7e,eie]=Xse(AOe),lU="MenubarTrigger",tie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=e,i=Qse(n),o=da(n),a=Zse(lU,n),c=eie(lU,n),d=C.useRef(null),h=_t(t,d,c.triggerRef),[u,f]=C.useState(!1),g=a.value===c.value;return _.jsx(aU.ItemSlot,{scope:n,value:c.value,disabled:r,children:_.jsx(ZA,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:_.jsx(B6,{asChild:!0,...o,children:_.jsx(He.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?c.contentId:void 0,"data-highlighted":u?"":void 0,"data-state":g?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:h,onPointerDown:Ae(e.onPointerDown,v=>{!r&&v.button===0&&v.ctrlKey===!1&&(a.onMenuOpen(c.value),g||v.preventDefault())}),onPointerEnter:Ae(e.onPointerEnter,()=>{var m;!!a.value&&!g&&(a.onMenuOpen(c.value),(m=d.current)==null||m.focus())}),onKeyDown:Ae(e.onKeyDown,v=>{r||(["Enter"," "].includes(v.key)&&a.onMenuToggle(c.value),v.key==="ArrowDown"&&a.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(v.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,v.preventDefault()))}),onFocus:Ae(e.onFocus,()=>f(!0)),onBlur:Ae(e.onBlur,()=>f(!1))})})})})});tie.displayName=lU;var ROe="MenubarPortal",nie=e=>{const{__scopeMenubar:t,...n}=e,r=da(t);return _.jsx(U6,{...r,...n})};nie.displayName=ROe;var cU="MenubarContent",rie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...s}=e,i=da(n),o=Zse(cU,n),a=eie(cU,n),c=SOe(n),d=C.useRef(!1);return _.jsx(V6,{id:a.contentId,"aria-labelledby":a.triggerId,"data-radix-menubar-content":"",...i,...s,ref:t,align:r,onCloseAutoFocus:Ae(e.onCloseAutoFocus,h=>{var f;!!!o.value&&!d.current&&((f=a.triggerRef.current)==null||f.focus()),d.current=!1,h.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,h=>{const u=h.target;c().some(g=>{var v;return(v=g.ref.current)==null?void 0:v.contains(u)})&&h.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,()=>{d.current=!0}),onEntryFocus:h=>{a.wasKeyboardTriggerOpenRef.current||h.preventDefault()},onKeyDown:Ae(e.onKeyDown,h=>{if(["ArrowRight","ArrowLeft"].includes(h.key)){const u=h.target,f=u.hasAttribute("data-radix-menubar-subtrigger"),g=u.closest("[data-radix-menubar-content]")!==h.currentTarget,m=(o.dir==="rtl"?"ArrowRight":"ArrowLeft")===h.key;if(!m&&f||g&&m)return;let b=c().filter(R=>!R.disabled).map(R=>R.value);m&&b.reverse();const w=b.indexOf(a.value);b=o.loop?UOe(b,w+1):b.slice(w+1);const[E]=b;E&&o.onMenuOpen(E)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});rie.displayName=cU;var POe="MenubarGroup",NOe=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(H6,{...s,...r,ref:t})});NOe.displayName=POe;var TOe="MenubarLabel",sie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(W6,{...s,...r,ref:t})});sie.displayName=TOe;var kOe="MenubarItem",iie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(q6,{...s,...r,ref:t})});iie.displayName=kOe;var DOe="MenubarCheckboxItem",oie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(G6,{...s,...r,ref:t})});oie.displayName=DOe;var OOe="MenubarRadioGroup",MOe=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(K6,{...s,...r,ref:t})});MOe.displayName=OOe;var IOe="MenubarRadioItem",aie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(Y6,{...s,...r,ref:t})});aie.displayName=IOe;var LOe="MenubarItemIndicator",lie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(X6,{...s,...r,ref:t})});lie.displayName=LOe;var jOe="MenubarSeparator",cie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(Q6,{...s,...r,ref:t})});cie.displayName=jOe;var $Oe="MenubarArrow",FOe=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(Z6,{...s,...r,ref:t})});FOe.displayName=$Oe;var zOe="MenubarSubTrigger",uie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(J6,{"data-radix-menubar-subtrigger":"",...s,...r,ref:t})});uie.displayName=zOe;var BOe="MenubarSubContent",die=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(e8,{...s,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});die.displayName=BOe;function UOe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fie=Jse,hie=tie,VOe=nie,pie=rie,mie=sie,gie=iie,vie=oie,yie=aie,bie=lie,xie=cie,_ie=uie,wie=die;const HOe=C.forwardRef(({className:e,...t},n)=>_.jsx(fie,{ref:n,className:ge("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));HOe.displayName=fie.displayName;const WOe=C.forwardRef(({className:e,...t},n)=>_.jsx(hie,{ref:n,className:ge("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));WOe.displayName=hie.displayName;const qOe=C.forwardRef(({className:e,inset:t,children:n,...r},s)=>_.jsxs(_ie,{ref:s,className:ge("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,_.jsx(Tx,{className:"ml-auto h-4 w-4"})]}));qOe.displayName=_ie.displayName;const GOe=C.forwardRef(({className:e,...t},n)=>_.jsx(wie,{ref:n,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));GOe.displayName=wie.displayName;const KOe=C.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>_.jsx(VOe,{children:_.jsx(pie,{ref:i,align:t,alignOffset:n,sideOffset:r,className:ge("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));KOe.displayName=pie.displayName;const YOe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(gie,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));YOe.displayName=gie.displayName;const XOe=C.forwardRef(({className:e,children:t,checked:n,...r},s)=>_.jsxs(vie,{ref:s,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(bie,{children:_.jsx(OA,{className:"h-4 w-4"})})}),t]}));XOe.displayName=vie.displayName;const QOe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(yie,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(bie,{children:_.jsx(cD,{className:"h-2 w-2 fill-current"})})}),t]}));QOe.displayName=yie.displayName;const ZOe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(mie,{ref:r,className:ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));ZOe.displayName=mie.displayName;const JOe=C.forwardRef(({className:e,...t},n)=>_.jsx(xie,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));JOe.displayName=xie.displayName;var eMe="VisuallyHidden",uR=C.forwardRef((e,t)=>_.jsx(He.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));uR.displayName=eMe;var Sie=uR,qx="NavigationMenu",[x8,Cie,tMe]=Uf(qx),[uU,nMe,rMe]=Uf(qx),[_8,b7e]=_r(qx,[tMe,rMe]),[sMe,Pl]=_8(qx),[iMe,oMe]=_8(qx),Eie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:o=200,skipDelayDuration:a=300,orientation:c="horizontal",dir:d,...h}=e,[u,f]=C.useState(null),g=_t(t,D=>f(D)),v=kc(d),m=C.useRef(0),x=C.useRef(0),y=C.useRef(0),[b,w]=C.useState(!0),[E="",R]=os({prop:r,onChange:D=>{const O=D!=="",I=a>0;O?(window.clearTimeout(y.current),I&&w(!1)):(window.clearTimeout(y.current),y.current=window.setTimeout(()=>w(!0),a)),s==null||s(D)},defaultProp:i}),T=C.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>R(""),150)},[R]),N=C.useCallback(D=>{window.clearTimeout(x.current),R(D)},[R]),A=C.useCallback(D=>{E===D?window.clearTimeout(x.current):m.current=window.setTimeout(()=>{window.clearTimeout(x.current),R(D)},o)},[E,R,o]);return C.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(x.current),window.clearTimeout(y.current)},[]),_.jsx(Rie,{scope:n,isRootMenu:!0,value:E,dir:v,orientation:c,rootNavigationMenu:u,onTriggerEnter:D=>{window.clearTimeout(m.current),b?A(D):N(D)},onTriggerLeave:()=>{window.clearTimeout(m.current),T()},onContentEnter:()=>window.clearTimeout(x.current),onContentLeave:T,onItemSelect:D=>{R(O=>O===D?"":D)},onItemDismiss:()=>R(""),children:_.jsx(He.nav,{"aria-label":"Main","data-orientation":c,dir:v,...h,ref:g})})});Eie.displayName=qx;var Aie="NavigationMenuSub",aMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",...a}=e,c=Pl(Aie,n),[d="",h]=os({prop:r,onChange:s,defaultProp:i});return _.jsx(Rie,{scope:n,isRootMenu:!1,value:d,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:u=>h(u),onItemSelect:u=>h(u),onItemDismiss:()=>h(""),children:_.jsx(He.div,{"data-orientation":o,...a,ref:t})})});aMe.displayName=Aie;var Rie=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:o,value:a,onItemSelect:c,onItemDismiss:d,onTriggerEnter:h,onTriggerLeave:u,onContentEnter:f,onContentLeave:g}=e,[v,m]=C.useState(null),[x,y]=C.useState(new Map),[b,w]=C.useState(null);return _.jsx(sMe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:a,previousValue:$x(a),baseId:si(),dir:s,orientation:i,viewport:v,onViewportChange:m,indicatorTrack:b,onIndicatorTrackChange:w,onTriggerEnter:bn(h),onTriggerLeave:bn(u),onContentEnter:bn(f),onContentLeave:bn(g),onItemSelect:bn(c),onItemDismiss:bn(d),onViewportContentChange:C.useCallback((E,R)=>{y(T=>(T.set(E,R),new Map(T)))},[]),onViewportContentRemove:C.useCallback(E=>{y(R=>R.has(E)?(R.delete(E),new Map(R)):R)},[]),children:_.jsx(x8.Provider,{scope:t,children:_.jsx(iMe,{scope:t,items:x,children:o})})})},Pie="NavigationMenuList",Nie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Pl(Pie,n),i=_.jsx(He.ul,{"data-orientation":s.orientation,...r,ref:t});return _.jsx(He.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:_.jsx(x8.Slot,{scope:n,children:s.isRootMenu?_.jsx(jie,{asChild:!0,children:i}):i})})});Nie.displayName=Pie;var Tie="NavigationMenuItem",[lMe,kie]=_8(Tie),cMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...s}=e,i=si(),o=r||i||"LEGACY_REACT_AUTO_VALUE",a=C.useRef(null),c=C.useRef(null),d=C.useRef(null),h=C.useRef(()=>{}),u=C.useRef(!1),f=C.useCallback((v="start")=>{if(a.current){h.current();const m=fU(a.current);m.length&&C8(v==="start"?m:m.reverse())}},[]),g=C.useCallback(()=>{if(a.current){const v=fU(a.current);v.length&&(h.current=vMe(v))}},[]);return _.jsx(lMe,{scope:n,value:o,triggerRef:c,contentRef:a,focusProxyRef:d,wasEscapeCloseRef:u,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:g,onContentFocusOutside:g,children:_.jsx(He.li,{...s,ref:t})})});cMe.displayName=Tie;var dU="NavigationMenuTrigger",Die=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=e,i=Pl(dU,e.__scopeNavigationMenu),o=kie(dU,e.__scopeNavigationMenu),a=C.useRef(null),c=_t(a,o.triggerRef,t),d=Fie(i.baseId,o.value),h=zie(i.baseId,o.value),u=C.useRef(!1),f=C.useRef(!1),g=o.value===i.value;return _.jsxs(_.Fragment,{children:[_.jsx(x8.ItemSlot,{scope:n,value:o.value,children:_.jsx($ie,{asChild:!0,children:_.jsx(He.button,{id:d,disabled:r,"data-disabled":r?"":void 0,"data-state":E8(g),"aria-expanded":g,"aria-controls":h,...s,ref:c,onPointerEnter:Ae(e.onPointerEnter,()=>{f.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:Ae(e.onPointerMove,OT(()=>{r||f.current||o.wasEscapeCloseRef.current||u.current||(i.onTriggerEnter(o.value),u.current=!0)})),onPointerLeave:Ae(e.onPointerLeave,OT(()=>{r||(i.onTriggerLeave(),u.current=!1)})),onClick:Ae(e.onClick,()=>{i.onItemSelect(o.value),f.current=g}),onKeyDown:Ae(e.onKeyDown,v=>{const x={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];g&&v.key===x&&(o.onEntryKeyDown(),v.preventDefault())})})})}),g&&_.jsxs(_.Fragment,{children:[_.jsx(Sie,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:v=>{const m=o.contentRef.current,x=v.relatedTarget,y=x===a.current,b=m==null?void 0:m.contains(x);(y||!b)&&o.onFocusProxyEnter(y?"start":"end")}}),i.viewport&&_.jsx("span",{"aria-owns":h})]})]})});Die.displayName=dU;var uMe="NavigationMenuLink",c7="navigationMenu.linkSelect",dMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=e;return _.jsx($ie,{asChild:!0,children:_.jsx(He.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:Ae(e.onClick,o=>{const a=o.target,c=new CustomEvent(c7,{bubbles:!0,cancelable:!0});if(a.addEventListener(c7,d=>s==null?void 0:s(d),{once:!0}),vC(a,c),!c.defaultPrevented&&!o.metaKey){const d=new CustomEvent(JP,{bubbles:!0,cancelable:!0});vC(a,d)}},{checkForDefaultPrevented:!1})})})});dMe.displayName=uMe;var w8="NavigationMenuIndicator",Oie=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Pl(w8,e.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?kA.createPortal(_.jsx(Vr,{present:n||i,children:_.jsx(fMe,{...r,ref:t})}),s.indicatorTrack):null});Oie.displayName=w8;var fMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Pl(w8,n),i=Cie(n),[o,a]=C.useState(null),[c,d]=C.useState(null),h=s.orientation==="horizontal",u=!!s.value;C.useEffect(()=>{var m;const v=(m=i().find(x=>x.value===s.value))==null?void 0:m.ref.current;v&&a(v)},[i,s.value]);const f=()=>{o&&d({size:h?o.offsetWidth:o.offsetHeight,offset:h?o.offsetLeft:o.offsetTop})};return hU(o,f),hU(s.indicatorTrack,f),c?_.jsx(He.div,{"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":s.orientation,...r,ref:t,style:{position:"absolute",...h?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...r.style}}):null}),lx="NavigationMenuContent",Mie=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Pl(lx,e.__scopeNavigationMenu),i=kie(lx,e.__scopeNavigationMenu),o=_t(i.contentRef,t),a=i.value===s.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return s.viewport?_.jsx(hMe,{forceMount:n,...c,ref:o}):_.jsx(Vr,{present:n||a,children:_.jsx(Iie,{"data-state":E8(a),...c,ref:o,onPointerEnter:Ae(e.onPointerEnter,s.onContentEnter),onPointerLeave:Ae(e.onPointerLeave,OT(s.onContentLeave)),style:{pointerEvents:!a&&s.isRootMenu?"none":void 0,...c.style}})})});Mie.displayName=lx;var hMe=C.forwardRef((e,t)=>{const n=Pl(lx,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return Rr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Rr(()=>()=>s(e.value),[e.value,s]),null}),JP="navigationMenu.rootContentDismiss",Iie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:a,onContentFocusOutside:c,...d}=e,h=Pl(lx,n),u=C.useRef(null),f=_t(u,t),g=Fie(h.baseId,r),v=zie(h.baseId,r),m=Cie(n),x=C.useRef(null),{onItemDismiss:y}=h;C.useEffect(()=>{const w=u.current;if(h.isRootMenu&&w){const E=()=>{var R;y(),a(),w.contains(document.activeElement)&&((R=s.current)==null||R.focus())};return w.addEventListener(JP,E),()=>w.removeEventListener(JP,E)}},[h.isRootMenu,e.value,s,y,a]);const b=C.useMemo(()=>{const E=m().map(O=>O.value);h.dir==="rtl"&&E.reverse();const R=E.indexOf(h.value),T=E.indexOf(h.previousValue),N=r===h.value,A=T===E.indexOf(r);if(!N&&!A)return x.current;const D=(()=>{if(R!==T){if(N&&T!==-1)return R>T?"from-end":"from-start";if(A&&R!==-1)return R>T?"to-start":"to-end"}return null})();return x.current=D,D},[h.previousValue,h.value,h.dir,m,r]);return _.jsx(jie,{asChild:!0,children:_.jsx(Hf,{id:v,"aria-labelledby":g,"data-motion":b,"data-orientation":h.orientation,...d,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var E;const w=new Event(JP,{bubbles:!0,cancelable:!0});(E=u.current)==null||E.dispatchEvent(w)},onFocusOutside:Ae(e.onFocusOutside,w=>{var R;c();const E=w.target;(R=h.rootNavigationMenu)!=null&&R.contains(E)&&w.preventDefault()}),onPointerDownOutside:Ae(e.onPointerDownOutside,w=>{var N;const E=w.target,R=m().some(A=>{var D;return(D=A.ref.current)==null?void 0:D.contains(E)}),T=h.isRootMenu&&((N=h.viewport)==null?void 0:N.contains(E));(R||T||!h.isRootMenu)&&w.preventDefault()}),onKeyDown:Ae(e.onKeyDown,w=>{var T;const E=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!E){const N=fU(w.currentTarget),A=document.activeElement,D=N.findIndex($=>$===A),I=w.shiftKey?N.slice(0,D).reverse():N.slice(D+1,N.length);C8(I)?w.preventDefault():(T=i.current)==null||T.focus()}}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,w=>{o.current=!0})})})}),S8="NavigationMenuViewport",Lie=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!Pl(S8,e.__scopeNavigationMenu).value;return _.jsx(Vr,{present:n||i,children:_.jsx(pMe,{...r,ref:t})})});Lie.displayName=S8;var pMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...s}=e,i=Pl(S8,n),o=_t(t,i.onViewportChange),a=oMe(lx,e.__scopeNavigationMenu),[c,d]=C.useState(null),[h,u]=C.useState(null),f=c?(c==null?void 0:c.width)+"px":void 0,g=c?(c==null?void 0:c.height)+"px":void 0,v=!!i.value,m=v?i.value:i.previousValue;return hU(h,()=>{h&&d({width:h.offsetWidth,height:h.offsetHeight})}),_.jsx(He.div,{"data-state":E8(v),"data-orientation":i.orientation,...s,ref:o,style:{pointerEvents:!v&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":g,...s.style},onPointerEnter:Ae(e.onPointerEnter,i.onContentEnter),onPointerLeave:Ae(e.onPointerLeave,OT(i.onContentLeave)),children:Array.from(a.items).map(([y,{ref:b,forceMount:w,...E}])=>{const R=m===y;return _.jsx(Vr,{present:w||R,children:_.jsx(Iie,{...E,ref:DA(b,T=>{R&&T&&u(T)})})},y)})})}),mMe="FocusGroup",jie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Pl(mMe,n);return _.jsx(uU.Provider,{scope:n,children:_.jsx(uU.Slot,{scope:n,children:_.jsx(He.div,{dir:s.dir,...r,ref:t})})})}),u7=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],gMe="FocusGroupItem",$ie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=nMe(n),i=Pl(gMe,n);return _.jsx(uU.ItemSlot,{scope:n,children:_.jsx(He.button,{...r,ref:t,onKeyDown:Ae(e.onKeyDown,o=>{if(["Home","End",...u7].includes(o.key)){let c=s().map(u=>u.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),u7.includes(o.key)){const u=c.indexOf(o.currentTarget);c=c.slice(u+1)}setTimeout(()=>C8(c)),o.preventDefault()}})})})});function fU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function C8(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function vMe(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function hU(e,t){const n=bn(t);Rr(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}function E8(e){return e?"open":"closed"}function Fie(e,t){return`${e}-trigger-${t}`}function zie(e,t){return`${e}-content-${t}`}function OT(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Bie=Eie,Uie=Nie,Vie=Die,Hie=Oie,Wie=Mie,qie=Lie;const yMe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Bie,{ref:r,className:ge("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,_.jsx(Gie,{})]}));yMe.displayName=Bie.displayName;const bMe=C.forwardRef(({className:e,...t},n)=>_.jsx(Uie,{ref:n,className:ge("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));bMe.displayName=Uie.displayName;const xMe=Io("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),_Me=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Vie,{ref:r,className:ge(xMe(),"group",e),...n,children:[t," ",_.jsx(Nx,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));_Me.displayName=Vie.displayName;const wMe=C.forwardRef(({className:e,...t},n)=>_.jsx(Wie,{ref:n,className:ge("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));wMe.displayName=Wie.displayName;const Gie=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:ge("absolute left-0 top-full flex justify-center"),children:_.jsx(qie,{className:ge("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));Gie.displayName=qie.displayName;const SMe=C.forwardRef(({className:e,...t},n)=>_.jsx(Hie,{ref:n,className:ge("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:_.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));SMe.displayName=Hie.displayName;var CMe=typeof window>"u",pU=CMe?fe.useEffect:fe.useLayoutEffect,EMe=0,d7=()=>++EMe,f7=!1;function AMe(){let[e,t]=fe.useState(f7?d7:void 0);return pU(()=>{e===void 0&&t(d7()),f7=!0},[]),e===void 0?e:`rwb-${e.toString(32)}`}function RMe(){return fe.useMemo(()=>"useId"in fe?fe.useId:AMe,[])()}var mU="__wrap_b",F1="__wrap_n",h7="__wrap_o",Kie=(e,t,n)=>{n=n||document.querySelector(`[data-br="${e}"]`);let r=n==null?void 0:n.parentElement;if(!r)return;let s=h=>n.style.maxWidth=h+"px";n.style.maxWidth="";let i=r.clientWidth,o=r.clientHeight,a=i/2-.25,c=i+.5,d;if(i){for(s(a),a=Math.max(n.scrollWidth,a);a+1{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},PMe=Kie.toString(),NMe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',TMe=(e,t,n="")=>(n&&(n=`self.${F1}!=1&&${n}`),fe.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(e?"":`self.${F1}=self.${F1}||${NMe};self.${mU}=${PMe};`)+n},nonce:t})),kMe=fe.createContext({preferNative:!0,hasProvider:!1});fe.forwardRef(({ratio:e=1,preferNative:t,nonce:n,children:r,as:s,...i},o)=>{let a=RMe(),c=fe.useRef(),d=fe.useContext(kMe),h=t??d.preferNative,u=s||"span";return fe.useImperativeHandle(o,()=>c.current,[]),pU(()=>{h&&self[F1]===1||c.current&&(self[mU]=Kie)(0,e,c.current)},[r,h,e]),pU(()=>{if(!(h&&self[F1]===1))return()=>{if(!c.current)return;let f=c.current[h7];f&&(f.disconnect(),delete c.current[h7])}},[h]),fe.createElement(fe.Fragment,null,fe.createElement(u,{...i,"data-br":a,"data-brr":e,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:h?"balance":"initial"},suppressHydrationWarning:!0},r),TMe(d.hasProvider,n,`self.${mU}("${a}",${e})`))});var DMe="Separator",p7="horizontal",OMe=["horizontal","vertical"],Yie=C.forwardRef((e,t)=>{const{decorative:n,orientation:r=p7,...s}=e,i=MMe(r)?r:p7,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return _.jsx(He.div,{"data-orientation":i,...a,...s,ref:t})});Yie.displayName=DMe;function MMe(e){return OMe.includes(e)}var Xie=Yie;const Ef=C.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>_.jsx(Xie,{ref:s,decorative:n,orientation:t,className:ge("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Ef.displayName=Xie.displayName;const IMe=C.forwardRef(({className:e,...t},n)=>_.jsx("ul",{ref:n,className:ge("flex flex-row items-center gap-1",e),...t}));IMe.displayName="PaginationContent";const LMe=C.forwardRef(({className:e,...t},n)=>_.jsx("li",{ref:n,className:ge("",e),...t}));LMe.displayName="PaginationItem";var A8="Popover",[Qie,x7e]=_r(A8,[Iu]),dR=Iu(),[jMe,Np]=Qie(A8),Zie=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,a=dR(t),c=C.useRef(null),[d,h]=C.useState(!1),[u=!1,f]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(HD,{...a,children:_.jsx(jMe,{scope:t,contentId:si(),triggerRef:c,open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(g=>!g),[f]),hasCustomAnchor:d,onCustomAnchorAdd:C.useCallback(()=>h(!0),[]),onCustomAnchorRemove:C.useCallback(()=>h(!1),[]),modal:o,children:n})})};Zie.displayName=A8;var Jie="PopoverAnchor",$Me=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Np(Jie,n),i=dR(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=s;return C.useEffect(()=>(o(),()=>a()),[o,a]),_.jsx(Ux,{...i,...r,ref:t})});$Me.displayName=Jie;var eoe="PopoverTrigger",toe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Np(eoe,n),i=dR(n),o=_t(t,s.triggerRef),a=_.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ooe(s.open),...r,ref:o,onClick:Ae(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:_.jsx(Ux,{asChild:!0,...i,children:a})});toe.displayName=eoe;var R8="PopoverPortal",[FMe,zMe]=Qie(R8,{forceMount:void 0}),noe=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Np(R8,t);return _.jsx(FMe,{scope:t,forceMount:n,children:_.jsx(Vr,{present:n||i.open,children:_.jsx(Dx,{asChild:!0,container:s,children:r})})})};noe.displayName=R8;var cx="PopoverContent",roe=C.forwardRef((e,t)=>{const n=zMe(cx,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Np(cx,e.__scopePopover);return _.jsx(Vr,{present:r||i.open,children:i.modal?_.jsx(BMe,{...s,ref:t}):_.jsx(UMe,{...s,ref:t})})});roe.displayName=cx;var BMe=C.forwardRef((e,t)=>{const n=Np(cx,e.__scopePopover),r=C.useRef(null),s=_t(t,r),i=C.useRef(!1);return C.useEffect(()=>{const o=r.current;if(o)return Ox(o)},[]),_.jsx(IA,{as:Cc,allowPinchZoom:!0,children:_.jsx(soe,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,d=a.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ae(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),UMe=C.forwardRef((e,t)=>{const n=Np(cx,e.__scopePopover),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(soe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),soe=C.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...u}=e,f=Np(cx,n),g=dR(n);return uD(),_.jsx(MA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:_.jsx(YA,{"data-state":ooe(f.open),role:"dialog",id:f.contentId,...g,...u,ref:t,style:{...u.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)"}})})})}),ioe="PopoverClose",VMe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Np(ioe,n);return _.jsx(He.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});VMe.displayName=ioe;var HMe="PopoverArrow",WMe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=dR(n);return _.jsx(XA,{...s,...r,ref:t})});WMe.displayName=HMe;function ooe(e){return e?"open":"closed"}var qMe=Zie,GMe=toe,KMe=noe,aoe=roe;const YMe=qMe,XMe=GMe,loe=C.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>_.jsx(KMe,{children:_.jsx(aoe,{ref:s,align:t,sideOffset:n,className:ge("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));loe.displayName=aoe.displayName;var P8="Progress",N8=100,[QMe,_7e]=_r(P8),[ZMe,JMe]=QMe(P8),coe=C.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=eIe,...o}=e;(s||s===0)&&!m7(s)&&console.error(tIe(`${s}`,"Progress"));const a=m7(s)?s:N8;r!==null&&!g7(r,a)&&console.error(nIe(`${r}`,"Progress"));const c=g7(r,a)?r:null,d=MT(c)?i(c,a):void 0;return _.jsx(ZMe,{scope:n,value:c,max:a,children:_.jsx(He.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":MT(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":foe(c,a),"data-value":c??void 0,"data-max":a,...o,ref:t})})});coe.displayName=P8;var uoe="ProgressIndicator",doe=C.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=JMe(uoe,n);return _.jsx(He.div,{"data-state":foe(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});doe.displayName=uoe;function eIe(e,t){return`${Math.round(e/t*100)}%`}function foe(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function MT(e){return typeof e=="number"}function m7(e){return MT(e)&&!isNaN(e)&&e>0}function g7(e,t){return MT(e)&&!isNaN(e)&&e<=t&&e>=0}function tIe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${N8}\`.`}function nIe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${N8} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var hoe=coe,rIe=doe;const T8=C.forwardRef(({className:e,value:t,...n},r)=>_.jsx(hoe,{ref:r,className:ge("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:_.jsx(rIe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));T8.displayName=hoe.displayName;var k8="Radio",[sIe,poe]=_r(k8),[iIe,oIe]=sIe(k8),moe=C.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:o,value:a="on",onCheck:c,...d}=e,[h,u]=C.useState(null),f=_t(t,m=>u(m)),g=C.useRef(!1),v=h?!!h.closest("form"):!0;return _.jsxs(iIe,{scope:n,checked:s,disabled:o,children:[_.jsx(He.button,{type:"button",role:"radio","aria-checked":s,"data-state":yoe(s),"data-disabled":o?"":void 0,disabled:o,value:a,...d,ref:f,onClick:Ae(e.onClick,m=>{s||c==null||c(),v&&(g.current=m.isPropagationStopped(),g.current||m.stopPropagation())})}),v&&_.jsx(aIe,{control:h,bubbles:!g.current,name:r,value:a,checked:s,required:i,disabled:o,style:{transform:"translateX(-100%)"}})]})});moe.displayName=k8;var goe="RadioIndicator",voe=C.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,i=oIe(goe,n);return _.jsx(Vr,{present:r||i.checked,children:_.jsx(He.span,{"data-state":yoe(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});voe.displayName=goe;var aIe=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,i=C.useRef(null),o=$x(n),a=WA(t);return C.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&u){const f=new Event("click",{bubbles:r});u.call(c,n),c.dispatchEvent(f)}},[o,n,r]),_.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function yoe(e){return e?"checked":"unchecked"}var lIe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],D8="RadioGroup",[cIe,w7e]=_r(D8,[Lu,poe]),boe=Lu(),xoe=poe(),[uIe,dIe]=cIe(D8),_oe=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:o=!1,disabled:a=!1,orientation:c,dir:d,loop:h=!0,onValueChange:u,...f}=e,g=boe(n),v=kc(d),[m,x]=os({prop:i,defaultProp:s,onChange:u});return _.jsx(uIe,{scope:n,name:r,required:o,disabled:a,value:m,onValueChange:x,children:_.jsx(QA,{asChild:!0,...g,orientation:c,dir:v,loop:h,children:_.jsx(He.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:v,...f,ref:t})})})});_oe.displayName=D8;var woe="RadioGroupItem",Soe=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,i=dIe(woe,n),o=i.disabled||r,a=boe(n),c=xoe(n),d=C.useRef(null),h=_t(t,d),u=i.value===s.value,f=C.useRef(!1);return C.useEffect(()=>{const g=m=>{lIe.includes(m.key)&&(f.current=!0)},v=()=>f.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",v)}},[]),_.jsx(ZA,{asChild:!0,...a,focusable:!o,active:u,children:_.jsx(moe,{disabled:o,required:i.required,checked:u,...c,...s,name:i.name,ref:h,onCheck:()=>i.onValueChange(s.value),onKeyDown:Ae(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:Ae(s.onFocus,()=>{var g;f.current&&((g=d.current)==null||g.click())})})})});Soe.displayName=woe;var fIe="RadioGroupIndicator",Coe=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=xoe(n);return _.jsx(voe,{...s,...r,ref:t})});Coe.displayName=fIe;var Eoe=_oe,Aoe=Soe,hIe=Coe;const pIe=C.forwardRef(({className:e,...t},n)=>_.jsx(Eoe,{className:ge("grid gap-2",e),...t,ref:n}));pIe.displayName=Eoe.displayName;const mIe=C.forwardRef(({className:e,...t},n)=>_.jsx(Aoe,{ref:n,className:ge("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:_.jsx(hIe,{className:"flex items-center justify-center",children:_.jsx(cD,{className:"h-2.5 w-2.5 fill-current text-current"})})}));mIe.displayName=Aoe.displayName;const{createElement:ux,createContext:gIe,forwardRef:Roe,useCallback:Fo,useContext:Poe,useEffect:Ev,useImperativeHandle:Noe,useLayoutEffect:vIe,useMemo:yIe,useRef:Ko,useState:Mb}=Tv,v7=Tv[`useId${Math.random()}`.slice(0,5)],bIe=vIe,ZD=gIe(null);ZD.displayName="PanelGroupContext";const Av=bIe,xIe=typeof v7=="function"?v7:()=>null;let _Ie=0;function O8(e=null){const t=xIe(),n=Ko(e||t||null);return n.current===null&&(n.current=""+_Ie++),e??n.current}function Toe({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:h,onResize:u,order:f,style:g,tagName:v="div",...m}){const x=Poe(ZD);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:b,getPanelSize:w,getPanelStyle:E,groupId:R,isPanelCollapsed:T,reevaluatePanelConstraints:N,registerPanel:A,resizePanel:D,unregisterPanel:O}=x,I=O8(o),$=Ko({callbacks:{onCollapse:d,onExpand:h,onResize:u},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:a,minSize:c},id:I,idIsFromProps:o!==void 0,order:f});Ko({didLogMissingDefaultSizeWarning:!1}),Av(()=>{const{callbacks:B,constraints:W}=$.current,Z={...W};$.current.id=I,$.current.idIsFromProps=o!==void 0,$.current.order=f,B.onCollapse=d,B.onExpand=h,B.onResize=u,W.collapsedSize=n,W.collapsible=r,W.defaultSize=s,W.maxSize=a,W.minSize=c,(Z.collapsedSize!==W.collapsedSize||Z.collapsible!==W.collapsible||Z.maxSize!==W.maxSize||Z.minSize!==W.minSize)&&N($.current,Z)}),Av(()=>{const B=$.current;return A(B),()=>{O(B)}},[f,I,A,O]),Noe(i,()=>({collapse:()=>{y($.current)},expand:B=>{b($.current,B)},getId(){return I},getSize(){return w($.current)},isCollapsed(){return T($.current)},isExpanded(){return!T($.current)},resize:B=>{D($.current,B)}}),[y,b,w,T,I,D]);const F=E($.current,s);return ux(v,{...m,children:e,className:t,id:o,style:{...F,...g},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":R,"data-panel-id":I,"data-panel-size":parseFloat(""+F.flexGrow).toFixed(1)})}const koe=Roe((e,t)=>ux(Toe,{...e,forwardedRef:t}));Toe.displayName="Panel";koe.displayName="forwardRef(Panel)";let gU=null,hg=null;function wIe(e,t){if(t){const n=(t&Loe)!==0,r=(t&joe)!==0,s=(t&$oe)!==0,i=(t&Foe)!==0;if(n)return s?"se-resize":i?"ne-resize":"e-resize";if(r)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function SIe(){hg!==null&&(document.head.removeChild(hg),gU=null,hg=null)}function T4(e,t){const n=wIe(e,t);gU!==n&&(gU=n,hg===null&&(hg=document.createElement("style"),document.head.appendChild(hg)),hg.innerHTML=`*{cursor: ${n}!important;}`)}function Doe(e){return e.type==="keydown"}function Ooe(e){return e.type.startsWith("pointer")}function Moe(e){return e.type.startsWith("mouse")}function JD(e){if(Ooe(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Moe(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function CIe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function EIe(e,t,n){return e.xt.x&&e.yt.y}function AIe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:x7(e),b:x7(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;tn(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:b7(y7(n.a)),b:b7(y7(n.b))};if(s.a===s.b){const i=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(s.a-s.b)}const RIe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function PIe(e){var t;const n=getComputedStyle((t=Ioe(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function NIe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||PIe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||RIe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function y7(e){let t=e.length;for(;t--;){const n=e[t];if(tn(n,"Missing node"),NIe(n))return n}return null}function b7(e){return e&&Number(getComputedStyle(e).zIndex)||0}function x7(e){const t=[];for(;e;)t.push(e),e=Ioe(e);return t}function Ioe(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Loe=1,joe=2,$oe=4,Foe=8,TIe=CIe()==="coarse";let _c=[],AC=!1,vh=new Map,eO=new Map;const RC=new Set;function kIe(e,t,n,r,s){var i;const{ownerDocument:o}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},c=(i=vh.get(o))!==null&&i!==void 0?i:0;return vh.set(o,c+1),RC.add(a),IT(),function(){var h;eO.delete(e),RC.delete(a);const u=(h=vh.get(o))!==null&&h!==void 0?h:1;if(vh.set(o,u-1),IT(),u===1&&vh.delete(o),_c.includes(a)){const f=_c.indexOf(a);f>=0&&_c.splice(f,1),I8()}}}function _7(e){const{target:t}=e,{x:n,y:r}=JD(e);AC=!0,M8({target:t,x:n,y:r}),IT(),_c.length>0&&(LT("down",e),e.preventDefault(),e.stopPropagation())}function VS(e){const{x:t,y:n}=JD(e);if(e.buttons===0&&(AC=!1,LT("up",e)),!AC){const{target:r}=e;M8({target:r,x:t,y:n})}LT("move",e),I8(),_c.length>0&&e.preventDefault()}function $y(e){const{target:t}=e,{x:n,y:r}=JD(e);eO.clear(),AC=!1,_c.length>0&&e.preventDefault(),LT("up",e),M8({target:t,x:n,y:r}),I8(),IT()}function M8({target:e,x:t,y:n}){_c.splice(0);let r=null;e instanceof HTMLElement&&(r=e),RC.forEach(s=>{const{element:i,hitAreaMargins:o}=s,a=i.getBoundingClientRect(),{bottom:c,left:d,right:h,top:u}=a,f=TIe?o.coarse:o.fine;if(t>=d-f&&t<=h+f&&n>=u-f&&n<=c+f){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&AIe(r,i)>0){let v=r,m=!1;for(;v&&!v.contains(i);){if(EIe(v.getBoundingClientRect(),a)){m=!0;break}v=v.parentElement}if(m)return}_c.push(s)}})}function k4(e,t){eO.set(e,t)}function I8(){let e=!1,t=!1;_c.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;eO.forEach(r=>{n|=r}),e&&t?T4("intersection",n):e?T4("horizontal",n):t?T4("vertical",n):SIe()}function IT(){vh.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",$y),n.removeEventListener("pointerdown",_7),n.removeEventListener("pointerleave",VS),n.removeEventListener("pointermove",VS)}),window.removeEventListener("pointerup",$y),window.removeEventListener("pointercancel",$y),RC.size>0&&(AC?(_c.length>0&&vh.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",$y),n.addEventListener("pointerleave",VS),n.addEventListener("pointermove",VS))}),window.addEventListener("pointerup",$y),window.addEventListener("pointercancel",$y)):vh.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",_7,{capture:!0}),n.addEventListener("pointermove",VS))}))}function LT(e,t){RC.forEach(n=>{const{setResizeHandlerState:r}=n,s=_c.includes(n);r(e,s,t)})}function DIe(){const[e,t]=Mb(0);return Fo(()=>t(n=>n+1),[])}function tn(e,t){if(!e)throw console.error(t),Error(t)}const L8=10;function qv(e,t,n=L8){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function yf(e,t,n=L8){return qv(e,t,n)===0}function Ba(e,t,n){return qv(e,t,n)===0}function OIe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-y:y)}}}{const u=e<0?a:c,f=n[u];tn(f,`No panel constraints found for index ${u}`);const{collapsedSize:g=0,collapsible:v,minSize:m=0}=f;if(v){const x=t[u];if(tn(x!=null,`Previous layout not found for panel index ${u}`),Ba(x,m)){const y=x-g;qv(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const u=e<0?1:-1;let f=e<0?c:a,g=0;for(;;){const m=t[f];tn(m!=null,`Previous layout not found for panel index ${f}`);const y=vb({panelConstraints:n,panelIndex:f,size:100})-m;if(g+=y,f+=u,f<0||f>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-v:v}{let f=e<0?a:c;for(;f>=0&&f=0))break;e<0?f--:f++}}if(OIe(s,o))return s;{const u=e<0?c:a,f=t[u];tn(f!=null,`Previous layout not found for panel index ${u}`);const g=f+d,v=vb({panelConstraints:n,panelIndex:u,size:g});if(o[u]=v,!Ba(v,g)){let m=g-v,y=e<0?c:a;for(;y>=0&&y0?y--:y++}}}const h=o.reduce((u,f)=>f+u,0);return Ba(h,100)?o:s}function MIe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,o=0;const a=n[0];tn(a!=null,"No pivot index found"),t.forEach((u,f)=>{const{constraints:g}=u,{maxSize:v=100,minSize:m=0}=g;f===a?(r=m,s=v):(i+=m,o+=v)});const c=Math.min(s,100-i),d=Math.max(r,100-o),h=e[a];return{valueMax:c,valueMin:d,valueNow:h}}function PC(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function zoe(e,t,n=document){const s=PC(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return s??null}function Boe(e,t,n){const r=zoe(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Uoe(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function tO(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function IIe(e,t,n,r=document){var s,i,o,a;const c=tO(t,r),d=PC(e,r),h=c?d.indexOf(c):-1,u=(s=(i=n[h])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,f=(o=(a=n[h+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,f]}function LIe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:o}){Ko({didWarnAboutMissingResizeHandle:!1}),Av(()=>{if(!i)return;const a=PC(n,i);for(let c=0;c{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),Ev(()=>{if(!i)return;const a=t.current;tn(a,"Eager values not found");const{panelDataArray:c}=a,d=Uoe(n,i);tn(d!=null,`No group found for id "${n}"`);const h=PC(n,i);tn(h,`No resize handles found for group id "${n}"`);const u=h.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");tn(g,"Resize handle element has no handle id attribute");const[v,m]=IIe(n,g,c,i);if(v==null||m==null)return()=>{};const x=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const b=c.findIndex(w=>w.id===v);if(b>=0){const w=c[b];tn(w,`No panel data found for index ${b}`);const E=r[b],{collapsedSize:R=0,collapsible:T,minSize:N=0}=w.constraints;if(E!=null&&T){const A=c1({delta:Ba(E,R)?N-R:R-E,initialLayout:r,panelConstraints:c.map(D=>D.constraints),pivotIndices:Boe(n,g,i),prevLayout:r,trigger:"keyboard"});r!==A&&o(A)}}break}}};return f.addEventListener("keydown",x),()=>{f.removeEventListener("keydown",x)}});return()=>{u.forEach(f=>f())}},[i,e,t,n,r,s,o])}function w7(e,t){if(e.length!==t.length)return!1;for(let n=0;ni.constraints);let r=0,s=100;for(let i=0;i{const i=e[s];tn(i,`Panel data not found for index ${s}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:h}=a,u=n[c];if(u==null||r!==u){n[c]=r;const{onCollapse:f,onExpand:g,onResize:v}=o;v&&v(r,u),h&&(f||g)&&(g&&(u==null||yf(u,d))&&!yf(r,d)&&g(),f&&(u==null||!yf(u,d))&&yf(r,d)&&f())}})}function hP(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function S7(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Hoe(e){return`react-resizable-panels:${e}`}function Woe(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=t;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function qoe(e,t){try{const n=Hoe(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function UIe(e,t,n){var r,s;const i=(r=qoe(e,n))!==null&&r!==void 0?r:{},o=Woe(t);return(s=i[o])!==null&&s!==void 0?s:null}function VIe(e,t,n,r,s){var i;const o=Hoe(e),a=Woe(t),c=(i=qoe(e,s))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function C7({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,o)=>i+o,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Ba(r,100))for(let i=0;i(S7(u1),u1.getItem(e)),setItem:(e,t)=>{S7(u1),u1.setItem(e,t)}},E7={};function Goe({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=u1,style:d,tagName:h="div",...u}){const f=O8(i),g=Ko(null),[v,m]=Mb(null),[x,y]=Mb([]),b=DIe(),w=Ko({}),E=Ko(new Map),R=Ko(0),T=Ko({autoSaveId:e,direction:r,dragState:v,id:f,keyboardResizeBy:a,onLayout:o,storage:c}),N=Ko({layout:x,panelDataArray:[],panelDataArrayChanged:!1});Ko({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Noe(s,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:te}=N.current;return te},setLayout:te=>{const{onLayout:ae}=T.current,{layout:be,panelDataArray:xe}=N.current,ve=C7({layout:te,panelConstraints:xe.map(Pe=>Pe.constraints)});w7(be,ve)||(y(ve),N.current.layout=ve,ae&&ae(ve),Fy(xe,ve,w.current))}}),[]),Av(()=>{T.current.autoSaveId=e,T.current.direction=r,T.current.dragState=v,T.current.id=f,T.current.onLayout=o,T.current.storage=c}),LIe({committedValuesRef:T,eagerValuesRef:N,groupId:f,layout:x,panelDataArray:N.current.panelDataArray,setLayout:y,panelGroupElement:g.current}),Ev(()=>{const{panelDataArray:te}=N.current;if(e){if(x.length===0||x.length!==te.length)return;let ae=E7[e];ae==null&&(ae=BIe(VIe,HIe),E7[e]=ae);const be=[...te],xe=new Map(E.current);ae(e,be,xe,x,c)}},[e,x,c]),Ev(()=>{});const A=Fo(te=>{const{onLayout:ae}=T.current,{layout:be,panelDataArray:xe}=N.current;if(te.constraints.collapsible){const ve=xe.map(ze=>ze.constraints),{collapsedSize:Pe=0,panelSize:Oe,pivotIndices:ke}=Xm(xe,te,be);if(tn(Oe!=null,`Panel size not found for panel "${te.id}"`),!yf(Oe,Pe)){E.current.set(te.id,Oe);const $e=Xy(xe,te)===xe.length-1?Oe-Pe:Pe-Oe,Te=c1({delta:$e,initialLayout:be,panelConstraints:ve,pivotIndices:ke,prevLayout:be,trigger:"imperative-api"});hP(be,Te)||(y(Te),N.current.layout=Te,ae&&ae(Te),Fy(xe,Te,w.current))}}},[]),D=Fo((te,ae)=>{const{onLayout:be}=T.current,{layout:xe,panelDataArray:ve}=N.current;if(te.constraints.collapsible){const Pe=ve.map(Ue=>Ue.constraints),{collapsedSize:Oe=0,panelSize:ke=0,minSize:ze=0,pivotIndices:$e}=Xm(ve,te,xe),Te=ae??ze;if(yf(ke,Oe)){const Ue=E.current.get(te.id),wt=Ue!=null&&Ue>=Te?Ue:Te,St=Xy(ve,te)===ve.length-1?ke-wt:wt-ke,Nn=c1({delta:St,initialLayout:xe,panelConstraints:Pe,pivotIndices:$e,prevLayout:xe,trigger:"imperative-api"});hP(xe,Nn)||(y(Nn),N.current.layout=Nn,be&&be(Nn),Fy(ve,Nn,w.current))}}},[]),O=Fo(te=>{const{layout:ae,panelDataArray:be}=N.current,{panelSize:xe}=Xm(be,te,ae);return tn(xe!=null,`Panel size not found for panel "${te.id}"`),xe},[]),I=Fo((te,ae)=>{const{panelDataArray:be}=N.current,xe=Xy(be,te);return zIe({defaultSize:ae,dragState:v,layout:x,panelData:be,panelIndex:xe})},[v,x]),$=Fo(te=>{const{layout:ae,panelDataArray:be}=N.current,{collapsedSize:xe=0,collapsible:ve,panelSize:Pe}=Xm(be,te,ae);return tn(Pe!=null,`Panel size not found for panel "${te.id}"`),ve===!0&&yf(Pe,xe)},[]),F=Fo(te=>{const{layout:ae,panelDataArray:be}=N.current,{collapsedSize:xe=0,collapsible:ve,panelSize:Pe}=Xm(be,te,ae);return tn(Pe!=null,`Panel size not found for panel "${te.id}"`),!ve||qv(Pe,xe)>0},[]),B=Fo(te=>{const{panelDataArray:ae}=N.current;ae.push(te),ae.sort((be,xe)=>{const ve=be.order,Pe=xe.order;return ve==null&&Pe==null?0:ve==null?-1:Pe==null?1:ve-Pe}),N.current.panelDataArrayChanged=!0,b()},[b]);Av(()=>{if(N.current.panelDataArrayChanged){N.current.panelDataArrayChanged=!1;const{autoSaveId:te,onLayout:ae,storage:be}=T.current,{layout:xe,panelDataArray:ve}=N.current;let Pe=null;if(te){const ke=UIe(te,ve,be);ke&&(E.current=new Map(Object.entries(ke.expandToSizes)),Pe=ke.layout)}Pe==null&&(Pe=FIe({panelDataArray:ve}));const Oe=C7({layout:Pe,panelConstraints:ve.map(ke=>ke.constraints)});w7(xe,Oe)||(y(Oe),N.current.layout=Oe,ae&&ae(Oe),Fy(ve,Oe,w.current))}}),Av(()=>{const te=N.current;return()=>{te.layout=[]}},[]);const W=Fo(te=>function(be){be.preventDefault();const xe=g.current;if(!xe)return()=>null;const{direction:ve,dragState:Pe,id:Oe,keyboardResizeBy:ke,onLayout:ze}=T.current,{layout:$e,panelDataArray:Te}=N.current,{initialLayout:Ue}=Pe??{},wt=Boe(Oe,te,xe);let ut=$Ie(be,te,ve,Pe,ke,xe);const St=ve==="horizontal";document.dir==="rtl"&&St&&(ut=-ut);const Nn=Te.map(It=>It.constraints),cn=c1({delta:ut,initialLayout:Ue??$e,panelConstraints:Nn,pivotIndices:wt,prevLayout:$e,trigger:Doe(be)?"keyboard":"mouse-or-touch"}),hn=!hP($e,cn);(Ooe(be)||Moe(be))&&R.current!=ut&&(R.current=ut,hn?k4(te,0):St?k4(te,ut<0?Loe:joe):k4(te,ut<0?$oe:Foe)),hn&&(y(cn),N.current.layout=cn,ze&&ze(cn),Fy(Te,cn,w.current))},[]),Z=Fo((te,ae)=>{const{onLayout:be}=T.current,{layout:xe,panelDataArray:ve}=N.current,Pe=ve.map(Ue=>Ue.constraints),{panelSize:Oe,pivotIndices:ke}=Xm(ve,te,xe);tn(Oe!=null,`Panel size not found for panel "${te.id}"`);const $e=Xy(ve,te)===ve.length-1?Oe-ae:ae-Oe,Te=c1({delta:$e,initialLayout:xe,panelConstraints:Pe,pivotIndices:ke,prevLayout:xe,trigger:"imperative-api"});hP(xe,Te)||(y(Te),N.current.layout=Te,be&&be(Te),Fy(ve,Te,w.current))},[]),Y=Fo((te,ae)=>{const{layout:be,panelDataArray:xe}=N.current,{collapsedSize:ve=0,collapsible:Pe}=ae,{collapsedSize:Oe=0,collapsible:ke,maxSize:ze=100,minSize:$e=0}=te.constraints,{panelSize:Te}=Xm(xe,te,be);Te!=null&&(Pe&&ke&&yf(Te,ve)?yf(ve,Oe)||Z(te,Oe):Te<$e?Z(te,$e):Te>ze&&Z(te,ze))},[Z]),H=Fo((te,ae)=>{const{direction:be}=T.current,{layout:xe}=N.current;if(!g.current)return;const ve=tO(te,g.current);tn(ve,`Drag handle element not found for id "${te}"`);const Pe=Voe(be,ae);m({dragHandleId:te,dragHandleRect:ve.getBoundingClientRect(),initialCursorPosition:Pe,initialLayout:xe})},[]),se=Fo(()=>{m(null)},[]),he=Fo(te=>{const{panelDataArray:ae}=N.current,be=Xy(ae,te);be>=0&&(ae.splice(be,1),delete w.current[te.id],N.current.panelDataArrayChanged=!0,b())},[b]),re=yIe(()=>({collapsePanel:A,direction:r,dragState:v,expandPanel:D,getPanelSize:O,getPanelStyle:I,groupId:f,isPanelCollapsed:$,isPanelExpanded:F,reevaluatePanelConstraints:Y,registerPanel:B,registerResizeHandle:W,resizePanel:Z,startDragging:H,stopDragging:se,unregisterPanel:he,panelGroupElement:g.current}),[A,v,r,D,O,I,f,$,F,Y,B,W,Z,H,se,he]),J={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ux(ZD.Provider,{value:re},ux(h,{...u,children:t,className:n,id:i,ref:g,style:{...J,...d},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const Koe=Roe((e,t)=>ux(Goe,{...e,forwardedRef:t}));Goe.displayName="PanelGroup";Koe.displayName="forwardRef(PanelGroup)";function Xy(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Xm(e,t,n){const r=Xy(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],o=n[r];return{...t.constraints,panelSize:o,pivotIndices:i}}function WIe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Ev(()=>{if(e||n==null||r==null)return;const s=tO(t,r);if(s==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=s.getAttribute("data-panel-group-id");tn(a,`No group element found for id "${a}"`);const c=PC(a,r),d=zoe(a,t,r);tn(d!==null,`No resize element found for id "${t}"`);const h=o.shiftKey?d>0?d-1:c.length-1:d+1{s.removeEventListener("keydown",i)}},[r,e,t,n])}function Yoe({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:o,onFocus:a,style:c={},tabIndex:d=0,tagName:h="div",...u}){var f,g;const v=Ko(null),m=Ko({onDragging:o});Ev(()=>{m.current.onDragging=o});const x=Poe(ZD);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:b,registerResizeHandle:w,startDragging:E,stopDragging:R,panelGroupElement:T}=x,N=O8(s),[A,D]=Mb("inactive"),[O,I]=Mb(!1),[$,F]=Mb(null),B=Ko({state:A});Av(()=>{B.current.state=A}),Ev(()=>{if(n)F(null);else{const H=w(N);F(()=>H)}},[n,N,w]);const W=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,Z=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;return Ev(()=>{if(n||$==null)return;const H=v.current;return tn(H,"Element ref not attached"),kIe(N,H,y,{coarse:W,fine:Z},(he,re,J)=>{if(re)switch(he){case"down":{D("drag"),E(N,J);const{onDragging:te}=m.current;te&&te(!0);break}case"move":{const{state:te}=B.current;te!=="drag"&&D("hover"),$(J);break}case"up":{D("hover"),R();const{onDragging:te}=m.current;te&&te(!1);break}}else D("inactive")})},[W,y,n,Z,w,N,$,E,R]),WIe({disabled:n,handleId:N,resizeHandler:$,panelGroupElement:T}),ux(h,{...u,children:e,className:t,id:s,onBlur:()=>{I(!1),i==null||i()},onFocus:()=>{I(!0),a==null||a()},ref:v,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:d,"data-panel-group-direction":y,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":A==="drag"?"pointer":O?"keyboard":void 0,"data-resize-handle-state":A,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":N})}Yoe.displayName="PanelResizeHandle";const qIe=({className:e,...t})=>_.jsx(Koe,{className:ge("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),A7=koe,GIe=({withHandle:e,className:t,...n})=>_.jsx(Yoe,{className:ge("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&_.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:_.jsx(CJ,{className:"h-2.5 w-2.5"})})});function NC(e,[t,n]){return Math.min(n,Math.max(t,e))}function KIe(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var j8="ScrollArea",[Xoe,S7e]=_r(j8),[YIe,Nl]=Xoe(j8),Qoe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=e,[a,c]=C.useState(null),[d,h]=C.useState(null),[u,f]=C.useState(null),[g,v]=C.useState(null),[m,x]=C.useState(null),[y,b]=C.useState(0),[w,E]=C.useState(0),[R,T]=C.useState(!1),[N,A]=C.useState(!1),D=_t(t,I=>c(I)),O=kc(s);return _.jsx(YIe,{scope:n,type:r,dir:O,scrollHideDelay:i,scrollArea:a,viewport:d,onViewportChange:h,content:u,onContentChange:f,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:R,onScrollbarXEnabledChange:T,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:N,onScrollbarYEnabledChange:A,onCornerWidthChange:b,onCornerHeightChange:E,children:_.jsx(He.div,{dir:O,...o,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Qoe.displayName=j8;var Zoe="ScrollAreaViewport",Joe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=e,o=Nl(Zoe,n),a=C.useRef(null),c=_t(t,a,o.onViewportChange);return _.jsxs(_.Fragment,{children:[_.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:s}),_.jsx(He.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:_.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Joe.displayName=Zoe;var $u="ScrollAreaScrollbar",$8=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Nl($u,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=e.orientation==="horizontal";return C.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?_.jsx(XIe,{...r,ref:t,forceMount:n}):s.type==="scroll"?_.jsx(QIe,{...r,ref:t,forceMount:n}):s.type==="auto"?_.jsx(eae,{...r,ref:t,forceMount:n}):s.type==="always"?_.jsx(F8,{...r,ref:t}):null});$8.displayName=$u;var XIe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Nl($u,e.__scopeScrollArea),[i,o]=C.useState(!1);return C.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const d=()=>{window.clearTimeout(c),o(!0)},h=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),_.jsx(Vr,{present:n||i,children:_.jsx(eae,{"data-state":i?"visible":"hidden",...r,ref:t})})}),QIe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Nl($u,e.__scopeScrollArea),i=e.orientation==="horizontal",o=rO(()=>c("SCROLL_END"),100),[a,c]=KIe("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 C.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,s.scrollHideDelay,c]),C.useEffect(()=>{const d=s.viewport,h=i?"scrollLeft":"scrollTop";if(d){let u=d[h];const f=()=>{const g=d[h];u!==g&&(c("SCROLL"),o()),u=g};return d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[s.viewport,i,c,o]),_.jsx(Vr,{present:n||a!=="hidden",children:_.jsx(F8,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),eae=C.forwardRef((e,t)=>{const n=Nl($u,e.__scopeScrollArea),{forceMount:r,...s}=e,[i,o]=C.useState(!1),a=e.orientation==="horizontal",c=rO(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=Nl($u,e.__scopeScrollArea),i=C.useRef(null),o=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=iae(a.viewport,a.content),h={...r,sizes:a,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function u(f,g){return rLe(f,o.current,a,g)}return n==="horizontal"?_.jsx(ZIe,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollLeft,g=R7(f,a,s.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=u(f,s.dir))}}):n==="vertical"?_.jsx(JIe,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollTop,g=R7(f,a);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=u(f))}}):null}),ZIe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Nl($u,e.__scopeScrollArea),[o,a]=C.useState(),c=C.useRef(null),d=_t(t,c,i.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.jsx(nae,{"data-orientation":"horizontal",...s,ref:d,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":nO(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,u)=>{if(i.viewport){const f=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(f),aae(f,u)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:$T(o.paddingLeft),paddingEnd:$T(o.paddingRight)}})}})}),JIe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Nl($u,e.__scopeScrollArea),[o,a]=C.useState(),c=C.useRef(null),d=_t(t,c,i.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.jsx(nae,{"data-orientation":"vertical",...s,ref:d,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":nO(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,u)=>{if(i.viewport){const f=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(f),aae(f,u)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:$T(o.paddingTop),paddingEnd:$T(o.paddingBottom)}})}})}),[eLe,tae]=Xoe($u),nae=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:h,onResize:u,...f}=e,g=Nl($u,n),[v,m]=C.useState(null),x=_t(t,D=>m(D)),y=C.useRef(null),b=C.useRef(""),w=g.viewport,E=r.content-r.viewport,R=bn(h),T=bn(c),N=rO(u,10);function A(D){if(y.current){const O=D.clientX-y.current.left,I=D.clientY-y.current.top;d({x:O,y:I})}}return C.useEffect(()=>{const D=O=>{const I=O.target;(v==null?void 0:v.contains(I))&&R(O,E)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[w,v,E,R]),C.useEffect(T,[r,T]),dx(v,N),dx(g.content,N),_.jsx(eLe,{scope:n,scrollbar:v,hasThumb:s,onThumbChange:bn(i),onThumbPointerUp:bn(o),onThumbPositionChange:T,onThumbPointerDown:bn(a),children:_.jsx(He.div,{...f,ref:x,style:{position:"absolute",...f.style},onPointerDown:Ae(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),y.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(D))}),onPointerMove:Ae(e.onPointerMove,A),onPointerUp:Ae(e.onPointerUp,D=>{const O=D.target;O.hasPointerCapture(D.pointerId)&&O.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=b.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),jT="ScrollAreaThumb",rae=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=tae(jT,e.__scopeScrollArea);return _.jsx(Vr,{present:n||s.hasThumb,children:_.jsx(tLe,{ref:t,...r})})}),tLe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,i=Nl(jT,n),o=tae(jT,n),{onThumbPositionChange:a}=o,c=_t(t,u=>o.onThumbChange(u)),d=C.useRef(),h=rO(()=>{d.current&&(d.current(),d.current=void 0)},100);return C.useEffect(()=>{const u=i.viewport;if(u){const f=()=>{if(h(),!d.current){const g=sLe(u,a);d.current=g,a()}};return a(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,h,a]),_.jsx(He.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ae(e.onPointerDownCapture,u=>{const g=u.target.getBoundingClientRect(),v=u.clientX-g.left,m=u.clientY-g.top;o.onThumbPointerDown({x:v,y:m})}),onPointerUp:Ae(e.onPointerUp,o.onThumbPointerUp)})});rae.displayName=jT;var z8="ScrollAreaCorner",sae=C.forwardRef((e,t)=>{const n=Nl(z8,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?_.jsx(nLe,{...e,ref:t}):null});sae.displayName=z8;var nLe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Nl(z8,n),[i,o]=C.useState(0),[a,c]=C.useState(0),d=!!(i&&a);return dx(s.scrollbarX,()=>{var u;const h=((u=s.scrollbarX)==null?void 0:u.offsetHeight)||0;s.onCornerHeightChange(h),c(h)}),dx(s.scrollbarY,()=>{var u;const h=((u=s.scrollbarY)==null?void 0:u.offsetWidth)||0;s.onCornerWidthChange(h),o(h)}),d?_.jsx(He.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function $T(e){return e?parseInt(e,10):0}function iae(e,t){const n=e/t;return isNaN(n)?0:n}function nO(e){const t=iae(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function rLe(e,t,n,r="ltr"){const s=nO(n),i=s/2,o=t||i,a=s-o,c=n.scrollbar.paddingStart+o,d=n.scrollbar.size-n.scrollbar.paddingEnd-a,h=n.content-n.viewport,u=r==="ltr"?[0,h]:[h*-1,0];return oae([c,d],u)(e)}function R7(e,t,n="ltr"){const r=nO(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,a=i-r,c=n==="ltr"?[0,o]:[o*-1,0],d=NC(e,c);return oae([0,o],[0,a])(d)}function oae(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 aae(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,a=n.top!==i.top;(o||a)&&t(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function rO(e,t){const n=bn(e),r=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),C.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function dx(e,t){const n=bn(t);Rr(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var lae=Qoe,iLe=Joe,oLe=sae;const sO=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(lae,{ref:r,className:ge("relative overflow-hidden",e),...n,children:[_.jsx(iLe,{className:"h-full w-full rounded-[inherit]",children:t}),_.jsx(cae,{}),_.jsx(oLe,{})]}));sO.displayName=lae.displayName;const cae=C.forwardRef(({className:e,orientation:t="vertical",...n},r)=>_.jsx($8,{ref:r,orientation:t,className:ge("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:_.jsx(rae,{className:"relative flex-1 rounded-full bg-border"})}));cae.displayName=$8.displayName;var aLe=[" ","Enter","ArrowUp","ArrowDown"],lLe=[" ","Enter"],fR="Select",[iO,oO,cLe]=Uf(fR),[Gx,C7e]=_r(fR,[cLe,Iu]),aO=Iu(),[uLe,Tp]=Gx(fR),[dLe,fLe]=Gx(fR),uae=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:d,name:h,autoComplete:u,disabled:f,required:g}=e,v=aO(t),[m,x]=C.useState(null),[y,b]=C.useState(null),[w,E]=C.useState(!1),R=kc(d),[T=!1,N]=os({prop:r,defaultProp:s,onChange:i}),[A,D]=os({prop:o,defaultProp:a,onChange:c}),O=C.useRef(null),I=m?!!m.closest("form"):!0,[$,F]=C.useState(new Set),B=Array.from($).map(W=>W.props.value).join(";");return _.jsx(HD,{...v,children:_.jsxs(uLe,{required:g,scope:t,trigger:m,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:E,contentId:si(),value:A,onValueChange:D,open:T,onOpenChange:N,dir:R,triggerPointerDownPosRef:O,disabled:f,children:[_.jsx(iO.Provider,{scope:t,children:_.jsx(dLe,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(W=>{F(Z=>new Set(Z).add(W))},[]),onNativeOptionRemove:C.useCallback(W=>{F(Z=>{const Y=new Set(Z);return Y.delete(W),Y})},[]),children:n})}),I?_.jsxs(Iae,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:u,value:A,onChange:W=>D(W.target.value),disabled:f,children:[A===void 0?_.jsx("option",{value:""}):null,Array.from($)]},B):null]})})};uae.displayName=fR;var dae="SelectTrigger",fae=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=aO(n),o=Tp(dae,n),a=o.disabled||r,c=_t(t,o.onTriggerChange),d=oO(n),[h,u,f]=Lae(v=>{const m=d().filter(b=>!b.disabled),x=m.find(b=>b.value===o.value),y=jae(m,v,x);y!==void 0&&o.onValueChange(y.value)}),g=()=>{a||(o.onOpenChange(!0),f())};return _.jsx(Ux,{asChild:!0,...i,children:_.jsx(He.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Mae(o.value)?"":void 0,...s,ref:c,onClick:Ae(s.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Ae(s.onPointerDown,v=>{const m=v.target;m.hasPointerCapture(v.pointerId)&&m.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Ae(s.onKeyDown,v=>{const m=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&u(v.key),!(m&&v.key===" ")&&aLe.includes(v.key)&&(g(),v.preventDefault())})})})});fae.displayName=dae;var hae="SelectValue",pae=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=Tp(hae,n),{onValueNodeHasChildrenChange:d}=c,h=i!==void 0,u=_t(t,c.onValueNodeChange);return Rr(()=>{d(h)},[d,h]),_.jsx(He.span,{...a,ref:u,style:{pointerEvents:"none"},children:Mae(c.value)?_.jsx(_.Fragment,{children:o}):i})});pae.displayName=hae;var hLe="SelectIcon",mae=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return _.jsx(He.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});mae.displayName=hLe;var pLe="SelectPortal",gae=e=>_.jsx(Dx,{asChild:!0,...e});gae.displayName=pLe;var Gv="SelectContent",vae=C.forwardRef((e,t)=>{const n=Tp(Gv,e.__scopeSelect),[r,s]=C.useState();if(Rr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Li.createPortal(_.jsx(yae,{scope:e.__scopeSelect,children:_.jsx(iO.Slot,{scope:e.__scopeSelect,children:_.jsx("div",{children:e.children})})}),i):null}return _.jsx(bae,{...e,ref:t})});vae.displayName=Gv;var $d=10,[yae,kp]=Gx(Gv),mLe="SelectContentImpl",bae=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:d,alignOffset:h,arrowPadding:u,collisionBoundary:f,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x,...y}=e,b=Tp(Gv,n),[w,E]=C.useState(null),[R,T]=C.useState(null),N=_t(t,ve=>E(ve)),[A,D]=C.useState(null),[O,I]=C.useState(null),$=oO(n),[F,B]=C.useState(!1),W=C.useRef(!1);C.useEffect(()=>{if(w)return Ox(w)},[w]),uD();const Z=C.useCallback(ve=>{const[Pe,...Oe]=$().map($e=>$e.ref.current),[ke]=Oe.slice(-1),ze=document.activeElement;for(const $e of ve)if($e===ze||($e==null||$e.scrollIntoView({block:"nearest"}),$e===Pe&&R&&(R.scrollTop=0),$e===ke&&R&&(R.scrollTop=R.scrollHeight),$e==null||$e.focus(),document.activeElement!==ze))return},[$,R]),Y=C.useCallback(()=>Z([A,w]),[Z,A,w]);C.useEffect(()=>{F&&Y()},[F,Y]);const{onOpenChange:H,triggerPointerDownPosRef:se}=b;C.useEffect(()=>{if(w){let ve={x:0,y:0};const Pe=ke=>{var ze,$e;ve={x:Math.abs(Math.round(ke.pageX)-(((ze=se.current)==null?void 0:ze.x)??0)),y:Math.abs(Math.round(ke.pageY)-((($e=se.current)==null?void 0:$e.y)??0))}},Oe=ke=>{ve.x<=10&&ve.y<=10?ke.preventDefault():w.contains(ke.target)||H(!1),document.removeEventListener("pointermove",Pe),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",Pe),document.addEventListener("pointerup",Oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Pe),document.removeEventListener("pointerup",Oe,{capture:!0})}}},[w,H,se]),C.useEffect(()=>{const ve=()=>H(!1);return window.addEventListener("blur",ve),window.addEventListener("resize",ve),()=>{window.removeEventListener("blur",ve),window.removeEventListener("resize",ve)}},[H]);const[he,re]=Lae(ve=>{const Pe=$().filter(ze=>!ze.disabled),Oe=Pe.find(ze=>ze.ref.current===document.activeElement),ke=jae(Pe,ve,Oe);ke&&setTimeout(()=>ke.ref.current.focus())}),J=C.useCallback((ve,Pe,Oe)=>{const ke=!W.current&&!Oe;(b.value!==void 0&&b.value===Pe||ke)&&(D(ve),ke&&(W.current=!0))},[b.value]),te=C.useCallback(()=>w==null?void 0:w.focus(),[w]),ae=C.useCallback((ve,Pe,Oe)=>{const ke=!W.current&&!Oe;(b.value!==void 0&&b.value===Pe||ke)&&I(ve)},[b.value]),be=r==="popper"?vU:xae,xe=be===vU?{side:a,sideOffset:c,align:d,alignOffset:h,arrowPadding:u,collisionBoundary:f,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x}:{};return _.jsx(yae,{scope:n,content:w,viewport:R,onViewportChange:T,itemRefCallback:J,selectedItem:A,onItemLeave:te,itemTextRefCallback:ae,focusSelectedItem:Y,selectedItemText:O,position:r,isPositioned:F,searchRef:he,children:_.jsx(IA,{as:Cc,allowPinchZoom:!0,children:_.jsx(MA,{asChild:!0,trapped:b.open,onMountAutoFocus:ve=>{ve.preventDefault()},onUnmountAutoFocus:Ae(s,ve=>{var Pe;(Pe=b.trigger)==null||Pe.focus({preventScroll:!0}),ve.preventDefault()}),children:_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ve=>ve.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:_.jsx(be,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:ve=>ve.preventDefault(),...y,...xe,onPlaced:()=>B(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ae(y.onKeyDown,ve=>{const Pe=ve.ctrlKey||ve.altKey||ve.metaKey;if(ve.key==="Tab"&&ve.preventDefault(),!Pe&&ve.key.length===1&&re(ve.key),["ArrowUp","ArrowDown","Home","End"].includes(ve.key)){let ke=$().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);if(["ArrowUp","End"].includes(ve.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(ve.key)){const ze=ve.target,$e=ke.indexOf(ze);ke=ke.slice($e+1)}setTimeout(()=>Z(ke)),ve.preventDefault()}})})})})})})});bae.displayName=mLe;var gLe="SelectItemAlignedPosition",xae=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Tp(Gv,n),o=kp(Gv,n),[a,c]=C.useState(null),[d,h]=C.useState(null),u=_t(t,N=>h(N)),f=oO(n),g=C.useRef(!1),v=C.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=o,w=C.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&x&&y){const N=i.trigger.getBoundingClientRect(),A=d.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(i.dir!=="rtl"){const ze=O.left-A.left,$e=D.left-ze,Te=N.left-$e,Ue=N.width+Te,wt=Math.max(Ue,A.width),ut=window.innerWidth-$d,St=NC($e,[$d,ut-wt]);a.style.minWidth=Ue+"px",a.style.left=St+"px"}else{const ze=A.right-O.right,$e=window.innerWidth-D.right-ze,Te=window.innerWidth-N.right-$e,Ue=N.width+Te,wt=Math.max(Ue,A.width),ut=window.innerWidth-$d,St=NC($e,[$d,ut-wt]);a.style.minWidth=Ue+"px",a.style.right=St+"px"}const I=f(),$=window.innerHeight-$d*2,F=m.scrollHeight,B=window.getComputedStyle(d),W=parseInt(B.borderTopWidth,10),Z=parseInt(B.paddingTop,10),Y=parseInt(B.borderBottomWidth,10),H=parseInt(B.paddingBottom,10),se=W+Z+F+H+Y,he=Math.min(x.offsetHeight*5,se),re=window.getComputedStyle(m),J=parseInt(re.paddingTop,10),te=parseInt(re.paddingBottom,10),ae=N.top+N.height/2-$d,be=$-ae,xe=x.offsetHeight/2,ve=x.offsetTop+xe,Pe=W+Z+ve,Oe=se-Pe;if(Pe<=ae){const ze=x===I[I.length-1].ref.current;a.style.bottom="0px";const $e=d.clientHeight-m.offsetTop-m.offsetHeight,Te=Math.max(be,xe+(ze?te:0)+$e+Y),Ue=Pe+Te;a.style.height=Ue+"px"}else{const ze=x===I[0].ref.current;a.style.top="0px";const Te=Math.max(ae,W+m.offsetTop+(ze?J:0)+xe)+Oe;a.style.height=Te+"px",m.scrollTop=Pe-ae+m.offsetTop}a.style.margin=`${$d}px 0`,a.style.minHeight=he+"px",a.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,i.trigger,i.valueNode,a,d,m,x,y,i.dir,r]);Rr(()=>w(),[w]);const[E,R]=C.useState();Rr(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const T=C.useCallback(N=>{N&&v.current===!0&&(w(),b==null||b(),v.current=!1)},[w,b]);return _.jsx(yLe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:_.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:_.jsx(He.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});xae.displayName=gLe;var vLe="SelectPopperPosition",vU=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=$d,...i}=e,o=aO(n);return _.jsx(YA,{...o,...i,ref:t,align:r,collisionPadding:s,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)"}})});vU.displayName=vLe;var[yLe,B8]=Gx(Gv,{}),yU="SelectViewport",_ae=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=kp(yU,n),o=B8(yU,n),a=_t(t,i.onViewportChange),c=C.useRef(0);return _.jsxs(_.Fragment,{children:[_.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}),_.jsx(iO.Slot,{scope:n,children:_.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:Ae(s.onScroll,d=>{const h=d.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&u){const g=Math.abs(c.current-h.scrollTop);if(g>0){const v=window.innerHeight-$d*2,m=parseFloat(u.style.minHeight),x=parseFloat(u.style.height),y=Math.max(m,x);if(y0?E:0,u.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});_ae.displayName=yU;var wae="SelectGroup",[bLe,xLe]=Gx(wae),_Le=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=si();return _.jsx(bLe,{scope:n,id:s,children:_.jsx(He.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_Le.displayName=wae;var Sae="SelectLabel",Cae=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=xLe(Sae,n);return _.jsx(He.div,{id:s.id,...r,ref:t})});Cae.displayName=Sae;var FT="SelectItem",[wLe,Eae]=Gx(FT),Aae=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=Tp(FT,n),c=kp(FT,n),d=a.value===r,[h,u]=C.useState(i??""),[f,g]=C.useState(!1),v=_t(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,r,s)}),m=si(),x=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A 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 _.jsx(wLe,{scope:n,value:r,disabled:s,textId:m,isSelected:d,onItemTextChange:C.useCallback(y=>{u(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:_.jsx(iO.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:_.jsx(He.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:v,onFocus:Ae(o.onFocus,()=>g(!0)),onBlur:Ae(o.onBlur,()=>g(!1)),onPointerUp:Ae(o.onPointerUp,x),onPointerMove:Ae(o.onPointerMove,y=>{var b;s?(b=c.onItemLeave)==null||b.call(c):y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:Ae(o.onKeyDown,y=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&y.key===" "||(lLe.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Aae.displayName=FT;var d1="SelectItemText",Rae=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=Tp(d1,n),a=kp(d1,n),c=Eae(d1,n),d=fLe(d1,n),[h,u]=C.useState(null),f=_t(t,y=>u(y),c.onItemTextChange,y=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,y,c.value,c.disabled)}),g=h==null?void 0:h.textContent,v=C.useMemo(()=>_.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=d;return Rr(()=>(m(v),()=>x(v)),[m,x,v]),_.jsxs(_.Fragment,{children:[_.jsx(He.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Li.createPortal(i.children,o.valueNode):null]})});Rae.displayName=d1;var Pae="SelectItemIndicator",Nae=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Eae(Pae,n).isSelected?_.jsx(He.span,{"aria-hidden":!0,...r,ref:t}):null});Nae.displayName=Pae;var bU="SelectScrollUpButton",Tae=C.forwardRef((e,t)=>{const n=kp(bU,e.__scopeSelect),r=B8(bU,e.__scopeSelect),[s,i]=C.useState(!1),o=_t(t,r.onScrollButtonChange);return Rr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?_.jsx(Dae,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Tae.displayName=bU;var xU="SelectScrollDownButton",kae=C.forwardRef((e,t)=>{const n=kp(xU,e.__scopeSelect),r=B8(xU,e.__scopeSelect),[s,i]=C.useState(!1),o=_t(t,r.onScrollButtonChange);return Rr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?_.jsx(Dae,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});kae.displayName=xU;var Dae=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=kp("SelectScrollButton",n),o=C.useRef(null),a=oO(n),c=C.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),Rr(()=>{var h;const d=a().find(u=>u.ref.current===document.activeElement);(h=d==null?void 0:d.ref.current)==null||h.scrollIntoView({block:"nearest"})},[a]),_.jsx(He.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ae(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ae(s.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ae(s.onPointerLeave,()=>{c()})})}),SLe="SelectSeparator",Oae=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return _.jsx(He.div,{"aria-hidden":!0,...r,ref:t})});Oae.displayName=SLe;var _U="SelectArrow",CLe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=aO(n),i=Tp(_U,n),o=kp(_U,n);return i.open&&o.position==="popper"?_.jsx(XA,{...s,...r,ref:t}):null});CLe.displayName=_U;function Mae(e){return e===""||e===void 0}var Iae=C.forwardRef((e,t)=>{const{value:n,...r}=e,s=C.useRef(null),i=_t(t,s),o=$x(n);return C.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&h){const u=new Event("change",{bubbles:!0});h.call(a,n),a.dispatchEvent(u)}},[o,n]),_.jsx(uR,{asChild:!0,children:_.jsx("select",{...r,ref:i,defaultValue:n})})});Iae.displayName="BubbleSelect";function Lae(e){const t=bn(e),n=C.useRef(""),r=C.useRef(0),s=C.useCallback(o=>{const a=n.current+o;t(a),function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),i=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function jae(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=ELe(e,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function ELe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ALe=uae,$ae=fae,RLe=pae,PLe=mae,NLe=gae,Fae=vae,TLe=_ae,zae=Cae,Bae=Aae,kLe=Rae,DLe=Nae,Uae=Tae,Vae=kae,Hae=Oae;const U8=ALe,V8=RLe,lO=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs($ae,{ref:r,className:ge("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,_.jsx(PLe,{asChild:!0,children:_.jsx(Nx,{className:"h-4 w-4 opacity-50"})})]}));lO.displayName=$ae.displayName;const Wae=C.forwardRef(({className:e,...t},n)=>_.jsx(Uae,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(bJ,{className:"h-4 w-4"})}));Wae.displayName=Uae.displayName;const qae=C.forwardRef(({className:e,...t},n)=>_.jsx(Vae,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(Nx,{className:"h-4 w-4"})}));qae.displayName=Vae.displayName;const cO=C.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>_.jsx(NLe,{children:_.jsxs(Fae,{ref:s,className:ge("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[_.jsx(Wae,{}),_.jsx(TLe,{className:ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(qae,{})]})}));cO.displayName=Fae.displayName;const OLe=C.forwardRef(({className:e,...t},n)=>_.jsx(zae,{ref:n,className:ge("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));OLe.displayName=zae.displayName;const Ib=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Bae,{ref:r,className:ge("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(DLe,{children:_.jsx(OA,{className:"h-4 w-4"})})}),_.jsx(kLe,{children:t})]}));Ib.displayName=Bae.displayName;const MLe=C.forwardRef(({className:e,...t},n)=>_.jsx(Hae,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));MLe.displayName=Hae.displayName;const ILe=XH,LLe=QH,jLe=ZH,Gae=C.forwardRef(({className:e,...t},n)=>_.jsx(LA,{className:ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Gae.displayName=LA.displayName;const $Le=Io("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Kae=C.forwardRef(({side:e="right",className:t,children:n,...r},s)=>_.jsxs(jLe,{children:[_.jsx(Gae,{}),_.jsxs(jA,{ref:s,className:ge($Le({side:e}),t),...r,children:[n,_.jsxs(zA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[_.jsx(sx,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kae.displayName=jA.displayName;const FLe=C.forwardRef(({className:e,...t},n)=>_.jsx($A,{ref:n,className:ge("text-lg font-semibold text-foreground",e),...t}));FLe.displayName=$A.displayName;const zLe=C.forwardRef(({className:e,...t},n)=>_.jsx(FA,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));zLe.displayName=FA.displayName;function zo({className:e,...t}){return _.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",e),...t})}var Yae=["PageUp","PageDown"],Xae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Qae={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Kx="Slider",[wU,BLe,ULe]=Uf(Kx),[Zae,E7e]=_r(Kx,[ULe]),[VLe,uO]=Zae(Kx),Jae=C.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:h,onValueChange:u=()=>{},onValueCommit:f=()=>{},inverted:g=!1,...v}=e,m=C.useRef(new Set),x=C.useRef(0),b=o==="horizontal"?HLe:WLe,[w=[],E]=os({prop:h,defaultProp:d,onChange:O=>{var $;($=[...m.current][x.current])==null||$.focus(),u(O)}}),R=C.useRef(w);function T(O){const I=XLe(w,O);D(O,I)}function N(O){D(O,x.current)}function A(){const O=R.current[x.current];w[x.current]!==O&&f(w)}function D(O,I,{commit:$}={commit:!1}){const F=eje(i),B=tje(Math.round((O-r)/i)*i+r,F),W=NC(B,[r,s]);E((Z=[])=>{const Y=KLe(Z,W,I);if(JLe(Y,c*i)){x.current=Y.indexOf(W);const H=String(Y)!==String(Z);return H&&$&&f(Y),H?Y:Z}else return Z})}return _.jsx(VLe,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:s,valueIndexToChangeRef:x,thumbs:m.current,values:w,orientation:o,children:_.jsx(wU.Provider,{scope:e.__scopeSlider,children:_.jsx(wU.Slot,{scope:e.__scopeSlider,children:_.jsx(b,{"aria-disabled":a,"data-disabled":a?"":void 0,...v,ref:t,onPointerDown:Ae(v.onPointerDown,()=>{a||(R.current=w)}),min:r,max:s,inverted:g,onSlideStart:a?void 0:T,onSlideMove:a?void 0:N,onSlideEnd:a?void 0:A,onHomeKeyDown:()=>!a&&D(r,0,{commit:!0}),onEndKeyDown:()=>!a&&D(s,w.length-1,{commit:!0}),onStepKeyDown:({event:O,direction:I})=>{if(!a){const B=Yae.includes(O.key)||O.shiftKey&&Xae.includes(O.key)?10:1,W=x.current,Z=w[W],Y=i*B*I;D(Z+Y,W,{commit:!0})}}})})})})});Jae.displayName=Kx;var[ele,tle]=Zae(Kx,{startEdge:"left",endEdge:"right",size:"width",direction:1}),HLe=C.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onStepKeyDown:d,...h}=e,[u,f]=C.useState(null),g=_t(t,w=>f(w)),v=C.useRef(),m=kc(s),x=m==="ltr",y=x&&!i||!x&&i;function b(w){const E=v.current||u.getBoundingClientRect(),R=[0,E.width],N=H8(R,y?[n,r]:[r,n]);return v.current=E,N(w-E.left)}return _.jsx(ele,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:_.jsx(nle,{dir:m,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const E=b(w.clientX);o==null||o(E)},onSlideMove:w=>{const E=b(w.clientX);a==null||a(E)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:w=>{const R=Qae[y?"from-left":"from-right"].includes(w.key);d==null||d({event:w,direction:R?-1:1})}})})}),WLe=C.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:o,onSlideEnd:a,onStepKeyDown:c,...d}=e,h=C.useRef(null),u=_t(t,h),f=C.useRef(),g=!s;function v(m){const x=f.current||h.current.getBoundingClientRect(),y=[0,x.height],w=H8(y,g?[r,n]:[n,r]);return f.current=x,w(m-x.top)}return _.jsx(ele,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:_.jsx(nle,{"data-orientation":"vertical",...d,ref:u,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const x=v(m.clientY);i==null||i(x)},onSlideMove:m=>{const x=v(m.clientY);o==null||o(x)},onSlideEnd:()=>{f.current=void 0,a==null||a()},onStepKeyDown:m=>{const y=Qae[g?"from-bottom":"from-top"].includes(m.key);c==null||c({event:m,direction:y?-1:1})}})})}),nle=C.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:c,...d}=e,h=uO(Kx,n);return _.jsx(He.span,{...d,ref:t,onKeyDown:Ae(e.onKeyDown,u=>{u.key==="Home"?(o(u),u.preventDefault()):u.key==="End"?(a(u),u.preventDefault()):Yae.concat(Xae).includes(u.key)&&(c(u),u.preventDefault())}),onPointerDown:Ae(e.onPointerDown,u=>{const f=u.target;f.setPointerCapture(u.pointerId),u.preventDefault(),h.thumbs.has(f)?f.focus():r(u)}),onPointerMove:Ae(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&s(u)}),onPointerUp:Ae(e.onPointerUp,u=>{const f=u.target;f.hasPointerCapture(u.pointerId)&&(f.releasePointerCapture(u.pointerId),i(u))})})}),rle="SliderTrack",sle=C.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=uO(rle,n);return _.jsx(He.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});sle.displayName=rle;var SU="SliderRange",ile=C.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=uO(SU,n),i=tle(SU,n),o=C.useRef(null),a=_t(t,o),c=s.values.length,d=s.values.map(f=>ale(f,s.min,s.max)),h=c>1?Math.min(...d):0,u=100-Math.max(...d);return _.jsx(He.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:a,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:u+"%"}})});ile.displayName=SU;var CU="SliderThumb",ole=C.forwardRef((e,t)=>{const n=BLe(e.__scopeSlider),[r,s]=C.useState(null),i=_t(t,a=>s(a)),o=C.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return _.jsx(qLe,{...e,ref:i,index:o})}),qLe=C.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...i}=e,o=uO(CU,n),a=tle(CU,n),[c,d]=C.useState(null),h=_t(t,b=>d(b)),u=c?!!c.closest("form"):!0,f=WA(c),g=o.values[r],v=g===void 0?0:ale(g,o.min,o.max),m=YLe(r,o.values.length),x=f==null?void 0:f[a.size],y=x?QLe(x,v,a.direction):0;return C.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),_.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${v}% + ${y}px)`},children:[_.jsx(wU.ItemSlot,{scope:e.__scopeSlider,children:_.jsx(He.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:g===void 0?{display:"none"}:e.style,onFocus:Ae(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),u&&_.jsx(GLe,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),value:g},r)]})});ole.displayName=CU;var GLe=e=>{const{value:t,...n}=e,r=C.useRef(null),s=$x(t);return C.useEffect(()=>{const i=r.current,o=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(o,"value").set;if(s!==t&&c){const d=new Event("input",{bubbles:!0});c.call(i,t),i.dispatchEvent(d)}},[s,t]),_.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function KLe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,i)=>s-i)}function ale(e,t,n){const i=100/(n-t)*(e-t);return NC(i,[0,100])}function YLe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function XLe(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function QLe(e,t,n){const r=e/2,i=H8([0,50],[0,r]);return(r-i(t)*n)*n}function ZLe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function JLe(e,t){if(t>0){const n=ZLe(e);return Math.min(...n)>=t}return!0}function H8(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 eje(e){return(String(e).split(".")[1]||"").length}function tje(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var lle=Jae,nje=sle,rje=ile,sje=ole;const ije=C.forwardRef(({className:e,...t},n)=>_.jsxs(lle,{ref:n,className:ge("relative flex w-full touch-none select-none items-center",e),...t,children:[_.jsx(nje,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:_.jsx(rje,{className:"absolute h-full bg-primary"})}),_.jsx(sje,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));ije.displayName=lle.displayName;var W8="Switch",[oje,A7e]=_r(W8),[aje,lje]=oje(W8),cle=C.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:d,...h}=e,[u,f]=C.useState(null),g=_t(t,b=>f(b)),v=C.useRef(!1),m=u?!!u.closest("form"):!0,[x=!1,y]=os({prop:s,defaultProp:i,onChange:d});return _.jsxs(aje,{scope:n,checked:x,disabled:a,children:[_.jsx(He.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":fle(x),"data-disabled":a?"":void 0,disabled:a,value:c,...h,ref:g,onClick:Ae(e.onClick,b=>{y(w=>!w),m&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),m&&_.jsx(cje,{control:u,bubbles:!v.current,name:r,value:c,checked:x,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});cle.displayName=W8;var ule="SwitchThumb",dle=C.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=lje(ule,n);return _.jsx(He.span,{"data-state":fle(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});dle.displayName=ule;var cje=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,i=C.useRef(null),o=$x(n),a=WA(t);return C.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&u){const f=new Event("click",{bubbles:r});u.call(c,n),c.dispatchEvent(f)}},[o,n,r]),_.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function fle(e){return e?"checked":"unchecked"}var hle=cle,uje=dle;const ple=C.forwardRef(({className:e,...t},n)=>_.jsx(hle,{className:ge("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:_.jsx(uje,{className:ge("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ple.displayName=hle.displayName;const dO=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:"relative w-full overflow-auto",children:_.jsx("table",{ref:n,className:ge("w-full caption-bottom text-sm",e),...t})}));dO.displayName="Table";const fO=C.forwardRef(({className:e,...t},n)=>_.jsx("thead",{ref:n,className:ge("[&_tr]:border-b",e),...t}));fO.displayName="TableHeader";const hO=C.forwardRef(({className:e,...t},n)=>_.jsx("tbody",{ref:n,className:ge("[&_tr:last-child]:border-0",e),...t}));hO.displayName="TableBody";const dje=C.forwardRef(({className:e,...t},n)=>_.jsx("tfoot",{ref:n,className:ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));dje.displayName="TableFooter";const dp=C.forwardRef(({className:e,...t},n)=>_.jsx("tr",{ref:n,className:ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));dp.displayName="TableRow";const pO=C.forwardRef(({className:e,...t},n)=>_.jsx("th",{ref:n,className:ge("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));pO.displayName="TableHead";const TC=C.forwardRef(({className:e,...t},n)=>_.jsx("td",{ref:n,className:ge("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));TC.displayName="TableCell";const mle=C.forwardRef(({className:e,...t},n)=>_.jsx("caption",{ref:n,className:ge("mt-4 text-sm text-muted-foreground",e),...t}));mle.displayName="TableCaption";var q8="Tabs",[fje,R7e]=_r(q8,[Lu]),gle=Lu(),[hje,G8]=fje(q8),vle=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:c="automatic",...d}=e,h=kc(a),[u,f]=os({prop:r,onChange:s,defaultProp:i});return _.jsx(hje,{scope:n,baseId:si(),value:u,onValueChange:f,orientation:o,dir:h,activationMode:c,children:_.jsx(He.div,{dir:h,"data-orientation":o,...d,ref:t})})});vle.displayName=q8;var yle="TabsList",ble=C.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=G8(yle,n),o=gle(n);return _.jsx(QA,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:_.jsx(He.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});ble.displayName=yle;var xle="TabsTrigger",_le=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,o=G8(xle,n),a=gle(n),c=Cle(o.baseId,r),d=Ele(o.baseId,r),h=r===o.value;return _.jsx(ZA,{asChild:!0,...a,focusable:!s,active:h,children:_.jsx(He.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:Ae(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?o.onValueChange(r):u.preventDefault()}),onKeyDown:Ae(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const u=o.activationMode!=="manual";!h&&!s&&u&&o.onValueChange(r)})})})});_le.displayName=xle;var wle="TabsContent",Sle=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=e,a=G8(wle,n),c=Cle(a.baseId,r),d=Ele(a.baseId,r),h=r===a.value,u=C.useRef(h);return C.useEffect(()=>{const f=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(f)},[]),_.jsx(Vr,{present:s||h,children:({present:f})=>_.jsx(He.div,{"data-state":h?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:f&&i})})});Sle.displayName=wle;function Cle(e,t){return`${e}-trigger-${t}`}function Ele(e,t){return`${e}-content-${t}`}var pje=vle,Ale=ble,Rle=_le,Ple=Sle;const Nle=pje,K8=C.forwardRef(({className:e,...t},n)=>_.jsx(Ale,{ref:n,className:ge("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",e),...t}));K8.displayName=Ale.displayName;const zT=C.forwardRef(({className:e,...t},n)=>_.jsx(Rle,{ref:n,className:ge("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));zT.displayName=Rle.displayName;const BT=C.forwardRef(({className:e,...t},n)=>_.jsx(Ple,{ref:n,className:ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));BT.displayName=Ple.displayName;const Tle=C.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:ge("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Tle.displayName="Textarea";var Y8="ToastProvider",[X8,mje,gje]=Uf("Toast"),[kle,P7e]=_r("Toast",[gje]),[vje,mO]=kle(Y8),Dle=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[a,c]=C.useState(null),[d,h]=C.useState(0),u=C.useRef(!1),f=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Y8}\`. Expected non-empty \`string\`.`),_.jsx(X8.Provider,{scope:t,children:_.jsx(vje,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:a,onViewportChange:c,onToastAdd:C.useCallback(()=>h(g=>g+1),[]),onToastRemove:C.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:f,children:o})})};Dle.displayName=Y8;var Ole="ToastViewport",yje=["F8"],EU="toast.viewportPause",AU="toast.viewportResume",Mle=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=yje,label:s="Notifications ({hotkey})",...i}=e,o=mO(Ole,n),a=mje(n),c=C.useRef(null),d=C.useRef(null),h=C.useRef(null),u=C.useRef(null),f=_t(t,u,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;C.useEffect(()=>{const x=y=>{var w;r.every(E=>y[E]||y.code===E)&&((w=u.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),C.useEffect(()=>{const x=c.current,y=u.current;if(v&&x&&y){const b=()=>{if(!o.isClosePausedRef.current){const T=new CustomEvent(EU);y.dispatchEvent(T),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const T=new CustomEvent(AU);y.dispatchEvent(T),o.isClosePausedRef.current=!1}},E=T=>{!x.contains(T.relatedTarget)&&w()},R=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",b),x.addEventListener("focusout",E),x.addEventListener("pointermove",b),x.addEventListener("pointerleave",R),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",b),x.removeEventListener("focusout",E),x.removeEventListener("pointermove",b),x.removeEventListener("pointerleave",R),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[v,o.isClosePausedRef]);const m=C.useCallback(({tabbingDirection:x})=>{const b=a().map(w=>{const E=w.ref.current,R=[E,...kje(E)];return x==="forwards"?R:R.reverse()});return(x==="forwards"?b.reverse():b).flat()},[a]);return C.useEffect(()=>{const x=u.current;if(x){const y=b=>{var R,T,N;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const A=document.activeElement,D=b.shiftKey;if(b.target===x&&D){(R=d.current)==null||R.focus();return}const $=m({tabbingDirection:D?"backwards":"forwards"}),F=$.findIndex(B=>B===A);D4($.slice(F+1))?b.preventDefault():D?(T=d.current)==null||T.focus():(N=h.current)==null||N.focus()}};return x.addEventListener("keydown",y),()=>x.removeEventListener("keydown",y)}},[a,m]),_.jsxs(s0e,{ref:c,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&_.jsx(RU,{ref:d,onFocusFromOutsideViewport:()=>{const x=m({tabbingDirection:"forwards"});D4(x)}}),_.jsx(X8.Slot,{scope:n,children:_.jsx(He.ol,{tabIndex:-1,...i,ref:f})}),v&&_.jsx(RU,{ref:h,onFocusFromOutsideViewport:()=>{const x=m({tabbingDirection:"backwards"});D4(x)}})]})});Mle.displayName=Ole;var Ile="ToastFocusProxy",RU=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=mO(Ile,n);return _.jsx(uR,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const a=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(a))&&r()}})});RU.displayName=Ile;var gO="Toast",bje="toast.swipeStart",xje="toast.swipeMove",_je="toast.swipeCancel",wje="toast.swipeEnd",Lle=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[a=!0,c]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(Vr,{present:n||a,children:_.jsx(Eje,{open:a,...o,ref:t,onClose:()=>c(!1),onPause:bn(e.onPause),onResume:bn(e.onResume),onSwipeStart:Ae(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ae(e.onSwipeMove,d=>{const{x:h,y:u}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:Ae(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ae(e.onSwipeEnd,d=>{const{x:h,y:u}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),c(!1)})})})});Lle.displayName=gO;var[Sje,Cje]=kle(gO,{onClose(){}}),Eje=C.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:d,onSwipeStart:h,onSwipeMove:u,onSwipeCancel:f,onSwipeEnd:g,...v}=e,m=mO(gO,n),[x,y]=C.useState(null),b=_t(t,B=>y(B)),w=C.useRef(null),E=C.useRef(null),R=s||m.duration,T=C.useRef(0),N=C.useRef(R),A=C.useRef(0),{onToastAdd:D,onToastRemove:O}=m,I=bn(()=>{var W;(x==null?void 0:x.contains(document.activeElement))&&((W=m.viewport)==null||W.focus()),o()}),$=C.useCallback(B=>{!B||B===1/0||(window.clearTimeout(A.current),T.current=new Date().getTime(),A.current=window.setTimeout(I,B))},[I]);C.useEffect(()=>{const B=m.viewport;if(B){const W=()=>{$(N.current),d==null||d()},Z=()=>{const Y=new Date().getTime()-T.current;N.current=N.current-Y,window.clearTimeout(A.current),c==null||c()};return B.addEventListener(EU,Z),B.addEventListener(AU,W),()=>{B.removeEventListener(EU,Z),B.removeEventListener(AU,W)}}},[m.viewport,R,c,d,$]),C.useEffect(()=>{i&&!m.isClosePausedRef.current&&$(R)},[i,R,m.isClosePausedRef,$]),C.useEffect(()=>(D(),()=>O()),[D,O]);const F=C.useMemo(()=>x?Vle(x):null,[x]);return m.viewport?_.jsxs(_.Fragment,{children:[F&&_.jsx(Aje,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),_.jsx(Sje,{scope:n,onClose:I,children:Li.createPortal(_.jsx(X8.ItemSlot,{scope:n,children:_.jsx(r0e,{asChild:!0,onEscapeKeyDown:Ae(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||I(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:_.jsx(He.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ae(e.onKeyDown,B=>{B.key==="Escape"&&(a==null||a(B.nativeEvent),B.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,I()))}),onPointerDown:Ae(e.onPointerDown,B=>{B.button===0&&(w.current={x:B.clientX,y:B.clientY})}),onPointerMove:Ae(e.onPointerMove,B=>{if(!w.current)return;const W=B.clientX-w.current.x,Z=B.clientY-w.current.y,Y=!!E.current,H=["left","right"].includes(m.swipeDirection),se=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,he=H?se(0,W):0,re=H?0:se(0,Z),J=B.pointerType==="touch"?10:2,te={x:he,y:re},ae={originalEvent:B,delta:te};Y?(E.current=te,pP(xje,u,ae,{discrete:!1})):P7(te,m.swipeDirection,J)?(E.current=te,pP(bje,h,ae,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(W)>J||Math.abs(Z)>J)&&(w.current=null)}),onPointerUp:Ae(e.onPointerUp,B=>{const W=E.current,Z=B.target;if(Z.hasPointerCapture(B.pointerId)&&Z.releasePointerCapture(B.pointerId),E.current=null,w.current=null,W){const Y=B.currentTarget,H={originalEvent:B,delta:W};P7(W,m.swipeDirection,m.swipeThreshold)?pP(wje,g,H,{discrete:!0}):pP(_je,f,H,{discrete:!0}),Y.addEventListener("click",se=>se.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Aje=e=>{const{__scopeToast:t,children:n,...r}=e,s=mO(gO,t),[i,o]=C.useState(!1),[a,c]=C.useState(!1);return Nje(()=>o(!0)),C.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),a?null:_.jsx(Dx,{asChild:!0,children:_.jsx(uR,{...r,children:i&&_.jsxs(_.Fragment,{children:[s.label," ",n]})})})},Rje="ToastTitle",jle=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return _.jsx(He.div,{...r,ref:t})});jle.displayName=Rje;var Pje="ToastDescription",$le=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return _.jsx(He.div,{...r,ref:t})});$le.displayName=Pje;var Fle="ToastAction",zle=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?_.jsx(Ule,{altText:n,asChild:!0,children:_.jsx(Q8,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Fle}\`. Expected non-empty \`string\`.`),null)});zle.displayName=Fle;var Ble="ToastClose",Q8=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=Cje(Ble,n);return _.jsx(Ule,{asChild:!0,children:_.jsx(He.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,s.onClose)})})});Q8.displayName=Ble;var Ule=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return _.jsx(He.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function Vle(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Tje(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...Vle(r))}}),t}function pP(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?vC(s,i):s.dispatchEvent(i)}var P7=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function Nje(e=()=>{}){const t=bn(e);Rr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Tje(e){return e.nodeType===e.ELEMENT_NODE}function kje(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function D4(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Dje=Dle,Hle=Mle,Wle=Lle,qle=jle,Gle=$le,Kle=zle,Yle=Q8;const Oje=Dje,Xle=C.forwardRef(({className:e,...t},n)=>_.jsx(Hle,{ref:n,className:ge("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Xle.displayName=Hle.displayName;const Mje=Io("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success bg-green-300 text-success-foreground border-green-400 group"},position:{center:"bottom-0 mx-auto w-auto sm:bottom-0"}},defaultVariants:{variant:"default"}}),Qle=C.forwardRef(({className:e,variant:t,...n},r)=>_.jsx(Wle,{ref:r,className:ge(Mje({variant:t}),e),...n}));Qle.displayName=Wle.displayName;const Ije=C.forwardRef(({className:e,...t},n)=>_.jsx(Kle,{ref:n,className:ge("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Ije.displayName=Kle.displayName;const Zle=C.forwardRef(({className:e,...t},n)=>_.jsx(Yle,{ref:n,className:ge("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:_.jsx(sx,{className:"w-4 h-4"})}));Zle.displayName=Yle.displayName;const Jle=C.forwardRef(({className:e,...t},n)=>_.jsx(qle,{ref:n,className:ge("text-sm font-semibold",e),...t}));Jle.displayName=qle.displayName;const ece=C.forwardRef(({className:e,...t},n)=>_.jsx(Gle,{ref:n,className:ge("text-sm opacity-90",e),...t}));ece.displayName=Gle.displayName;const Lje=3,jje=1e6;let O4=0;function $je(){return O4=(O4+1)%Number.MAX_SAFE_INTEGER,O4.toString()}const M4=new Map,N7=e=>{if(M4.has(e))return;const t=setTimeout(()=>{M4.delete(e),z1({type:"REMOVE_TOAST",toastId:e})},jje);M4.set(e,t)},Fje=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Lje)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?N7(n):e.toasts.forEach(r=>{N7(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},eN=[];let tN={toasts:[]};function z1(e){tN=Fje(tN,e),eN.forEach(t=>{t(tN)})}function zje({...e}){const t=$je(),n=s=>z1({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>z1({type:"DISMISS_TOAST",toastId:t});return z1({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Fu(){const[e,t]=C.useState(tN);return C.useEffect(()=>(eN.push(t),()=>{const n=eN.indexOf(t);n>-1&&eN.splice(n,1)}),[e]),{...e,toast:zje,dismiss:n=>z1({type:"DISMISS_TOAST",toastId:n})}}function tce(){const{toasts:e}=Fu();return _.jsxs(Oje,{swipeDirection:"down",children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return _.jsxs(Qle,{...i,children:[_.jsxs("div",{className:"grid gap-1",children:[n&&_.jsx(Jle,{children:n}),r&&_.jsx(ece,{children:r})]}),s,_.jsx(Zle,{})]},t)}),_.jsx(Xle,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var Bje="Toggle",Z8=C.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=e,[o=!1,a]=os({prop:n,onChange:s,defaultProp:r});return _.jsx(He.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Ae(e.onClick,()=>{e.disabled||a(!o)})})});Z8.displayName=Bje;var nce=Z8;const rce=Io("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),sce=C.forwardRef(({className:e,variant:t,size:n,...r},s)=>_.jsx(nce,{ref:s,className:ge(rce({variant:t,size:n,className:e})),...r}));sce.displayName=nce.displayName;var Yx="ToggleGroup",[ice,N7e]=_r(Yx,[Lu]),oce=Lu(),J8=fe.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const s=r;return _.jsx(Uje,{...s,ref:t})}if(n==="multiple"){const s=r;return _.jsx(Vje,{...s,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Yx}\``)});J8.displayName=Yx;var[ace,lce]=ice(Yx),Uje=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o,a]=os({prop:n,defaultProp:r,onChange:s});return _.jsx(ace,{scope:e.__scopeToggleGroup,type:"single",value:o?[o]:[],onItemActivate:a,onItemDeactivate:fe.useCallback(()=>a(""),[a]),children:_.jsx(cce,{...i,ref:t})})}),Vje=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o=[],a]=os({prop:n,defaultProp:r,onChange:s}),c=fe.useCallback(h=>a((u=[])=>[...u,h]),[a]),d=fe.useCallback(h=>a((u=[])=>u.filter(f=>f!==h)),[a]);return _.jsx(ace,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:c,onItemDeactivate:d,children:_.jsx(cce,{...i,ref:t})})});J8.displayName=Yx;var[Hje,Wje]=ice(Yx),cce=fe.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:o,loop:a=!0,...c}=e,d=oce(n),h=kc(o),u={role:"group",dir:h,...c};return _.jsx(Hje,{scope:n,rovingFocus:s,disabled:r,children:s?_.jsx(QA,{asChild:!0,...d,orientation:i,dir:h,loop:a,children:_.jsx(He.div,{...u,ref:t})}):_.jsx(He.div,{...u,ref:t})})}),UT="ToggleGroupItem",uce=fe.forwardRef((e,t)=>{const n=lce(UT,e.__scopeToggleGroup),r=Wje(UT,e.__scopeToggleGroup),s=oce(e.__scopeToggleGroup),i=n.value.includes(e.value),o=r.disabled||e.disabled,a={...e,pressed:i,disabled:o},c=fe.useRef(null);return r.rovingFocus?_.jsx(ZA,{asChild:!0,...s,focusable:!o,active:i,ref:c,children:_.jsx(T7,{...a,ref:t})}):_.jsx(T7,{...a,ref:t})});uce.displayName=UT;var T7=fe.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...s}=e,i=lce(UT,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=i.type==="single"?o:void 0;return _.jsx(Z8,{...a,...s,ref:t,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),dce=J8,fce=uce;const hce=C.createContext({size:"default",variant:"default"}),qje=C.forwardRef(({className:e,variant:t,size:n,children:r,...s},i)=>_.jsx(dce,{ref:i,className:ge("flex items-center justify-center gap-1",e),...s,children:_.jsx(hce.Provider,{value:{variant:t,size:n},children:r})}));qje.displayName=dce.displayName;const Gje=C.forwardRef(({className:e,children:t,variant:n,size:r,...s},i)=>{const o=C.useContext(hce);return _.jsx(fce,{ref:i,className:ge(rce({variant:o.variant||n,size:o.size||r}),e),...s,children:t})});Gje.displayName=fce.displayName;var[vO,T7e]=_r("Tooltip",[Iu]),yO=Iu(),pce="TooltipProvider",Kje=700,PU="tooltip.open",[Yje,eW]=vO(pce),mce=e=>{const{__scopeTooltip:t,delayDuration:n=Kje,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,[o,a]=C.useState(!0),c=C.useRef(!1),d=C.useRef(0);return C.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),_.jsx(Yje,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(d.current),a(!1)},[]),onClose:C.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:C.useCallback(h=>{c.current=h},[]),disableHoverableContent:s,children:i})};mce.displayName=pce;var bO="Tooltip",[Xje,xO]=vO(bO),gce=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=e,c=eW(bO,e.__scopeTooltip),d=yO(t),[h,u]=C.useState(null),f=si(),g=C.useRef(0),v=o??c.disableHoverableContent,m=a??c.delayDuration,x=C.useRef(!1),[y=!1,b]=os({prop:r,defaultProp:s,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(PU))):c.onClose(),i==null||i(N)}}),w=C.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),E=C.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,b(!0)},[b]),R=C.useCallback(()=>{window.clearTimeout(g.current),b(!1)},[b]),T=C.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,b(!0)},m)},[m,b]);return C.useEffect(()=>()=>window.clearTimeout(g.current),[]),_.jsx(HD,{...d,children:_.jsx(Xje,{scope:t,contentId:f,open:y,stateAttribute:w,trigger:h,onTriggerChange:u,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayed?T():E()},[c.isOpenDelayed,T,E]),onTriggerLeave:C.useCallback(()=>{v?R():window.clearTimeout(g.current)},[R,v]),onOpen:E,onClose:R,disableHoverableContent:v,children:n})})};gce.displayName=bO;var NU="TooltipTrigger",vce=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=xO(NU,n),i=eW(NU,n),o=yO(n),a=C.useRef(null),c=_t(t,a,s.onTriggerChange),d=C.useRef(!1),h=C.useRef(!1),u=C.useCallback(()=>d.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),_.jsx(Ux,{asChild:!0,...o,children:_.jsx(He.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:Ae(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Ae(e.onBlur,s.onClose),onClick:Ae(e.onClick,s.onClose)})})});vce.displayName=NU;var Qje="TooltipPortal",[k7e,Zje]=vO(Qje,{forceMount:void 0}),fx="TooltipContent",yce=C.forwardRef((e,t)=>{const n=Zje(fx,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=xO(fx,e.__scopeTooltip);return _.jsx(Vr,{present:r||o.open,children:o.disableHoverableContent?_.jsx(bce,{side:s,...i,ref:t}):_.jsx(Jje,{side:s,...i,ref:t})})}),Jje=C.forwardRef((e,t)=>{const n=xO(fx,e.__scopeTooltip),r=eW(fx,e.__scopeTooltip),s=C.useRef(null),i=_t(t,s),[o,a]=C.useState(null),{trigger:c,onClose:d}=n,h=s.current,{onPointerInTransitChange:u}=r,f=C.useCallback(()=>{a(null),u(!1)},[u]),g=C.useCallback((v,m)=>{const x=v.currentTarget,y={x:v.clientX,y:v.clientY},b=r2e(y,x.getBoundingClientRect()),w=s2e(y,b),E=i2e(m.getBoundingClientRect()),R=a2e([...w,...E]);a(R),u(!0)},[u]);return C.useEffect(()=>()=>f(),[f]),C.useEffect(()=>{if(c&&h){const v=x=>g(x,h),m=x=>g(x,c);return c.addEventListener("pointerleave",v),h.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",v),h.removeEventListener("pointerleave",m)}}},[c,h,g,f]),C.useEffect(()=>{if(o){const v=m=>{const x=m.target,y={x:m.clientX,y:m.clientY},b=(c==null?void 0:c.contains(x))||(h==null?void 0:h.contains(x)),w=!o2e(y,o);b?f():w&&(f(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,h,o,d,f]),_.jsx(bce,{...e,ref:i})}),[e2e,t2e]=vO(bO,{isInside:!1}),bce=C.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,c=xO(fx,n),d=yO(n),{onClose:h}=c;return C.useEffect(()=>(document.addEventListener(PU,h),()=>document.removeEventListener(PU,h)),[h]),C.useEffect(()=>{if(c.trigger){const u=f=>{const g=f.target;g!=null&&g.contains(c.trigger)&&h()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,h]),_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:h,children:_.jsxs(YA,{"data-state":c.stateAttribute,...d,...a,ref:t,style:{...a.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:[_.jsx(CH,{children:r}),_.jsx(e2e,{scope:n,isInside:!0,children:_.jsx(Sie,{id:c.contentId,role:"tooltip",children:s||r})})]})})});yce.displayName=fx;var xce="TooltipArrow",n2e=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=yO(n);return t2e(xce,n).isInside?null:_.jsx(XA,{...s,...r,ref:t})});n2e.displayName=xce;function r2e(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function s2e(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 i2e(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function o2e(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;ir!=h>r&&n<(d-a)*(r-c)/(h-c)+a&&(s=!s)}return s}function a2e(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),l2e(t)}function l2e(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}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 c2e=mce,u2e=gce,d2e=vce,_ce=yce;const wce=c2e,Mi=u2e,Ii=d2e,di=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(_ce,{ref:r,sideOffset:t,className:ge("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));di.displayName=_ce.displayName;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function qr(){return qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function hx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function h2e(){return Math.random().toString(36).substr(2,8)}function D7(e,t){return{usr:e.state,key:e.key,idx:t}}function kC(e,t,n,r){return n===void 0&&(n=null),qr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Dp(t):t,{state:n,key:t&&t.key||r||h2e()})}function Kv(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Dp(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function p2e(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Ns.Pop,c=null,d=h();d==null&&(d=0,o.replaceState(qr({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function u(){a=Ns.Pop;let x=h(),y=x==null?null:x-d;d=x,c&&c({action:a,location:m.location,delta:y})}function f(x,y){a=Ns.Push;let b=kC(m.location,x,y);d=h()+1;let w=D7(b,d),E=m.createHref(b);try{o.pushState(w,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;s.location.assign(E)}i&&c&&c({action:a,location:m.location,delta:1})}function g(x,y){a=Ns.Replace;let b=kC(m.location,x,y);d=h();let w=D7(b,d),E=m.createHref(b);o.replaceState(w,"",E),i&&c&&c({action:a,location:m.location,delta:0})}function v(x){let y=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof x=="string"?x:Kv(x);return b=b.replace(/ $/,"%20"),sn(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let m={get action(){return a},get location(){return e(s,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(k7,u),c=x,()=>{s.removeEventListener(k7,u),c=null}},createHref(x){return t(s,x)},createURL:v,encodeLocation(x){let y=v(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:g,go(x){return o.go(x)}};return m}var er;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(er||(er={}));const m2e=new Set(["lazy","caseSensitive","path","id","index","children"]);function g2e(e){return e.index===!0}function VT(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,i)=>{let o=[...n,String(i)],a=typeof s.id=="string"?s.id:o.join("-");if(sn(s.index!==!0||!s.children,"Cannot specify children on an index route"),sn(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),g2e(s)){let c=qr({},s,t(s),{id:a});return r[a]=c,c}else{let c=qr({},s,t(s),{id:a,children:void 0});return r[a]=c,s.children&&(c.children=VT(s.children,t,o,r)),c}})}function ig(e,t,n){return n===void 0&&(n="/"),nN(e,t,n,!1)}function nN(e,t,n,r){let s=typeof t=="string"?Dp(t):t,i=yp(s.pathname||"/",n);if(i==null)return null;let o=Sce(e);y2e(o);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(sn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Af([r,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(sn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Sce(i.children,t,h,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:E2e(d,i.index),routesMeta:h})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of Cce(i.path))s(i,o,c)}),t}function Cce(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Cce(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function y2e(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:A2e(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const b2e=/^:[\w-]+$/,x2e=3,_2e=2,w2e=1,S2e=10,C2e=-2,O7=e=>e==="*";function E2e(e,t){let n=e.split("/"),r=n.length;return n.some(O7)&&(r+=C2e),t&&(r+=_2e),n.filter(s=>!O7(s)).reduce((s,i)=>s+(b2e.test(i)?x2e:i===""?w2e:S2e),r)}function A2e(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function R2e(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a{let{paramName:f,isOptional:g}=h;if(f==="*"){let m=a[u]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const v=a[u];return g&&!v?d[f]=void 0:d[f]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function P2e(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),hx(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function N2e(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return hx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function yp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function T2e(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Dp(e):e;return{pathname:n?n.startsWith("/")?n:k2e(n,t):t,search:O2e(r),hash:M2e(s)}}function k2e(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function I4(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ece(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _O(e,t){let n=Ece(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function wO(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Dp(e):(s=qr({},e),sn(!s.pathname||!s.pathname.includes("?"),I4("?","pathname","search",s)),sn(!s.pathname||!s.pathname.includes("#"),I4("#","pathname","hash",s)),sn(!s.search||!s.search.includes("#"),I4("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),u-=1;s.pathname=f.join("/")}a=u>=0?t[u]:"/"}let c=T2e(s,a),d=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||h)&&(c.pathname+="/"),c}const Af=e=>e.join("/").replace(/\/\/+/g,"/"),D2e=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O2e=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,M2e=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class HT{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function DC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ace=["post","put","patch","delete"],I2e=new Set(Ace),L2e=["get",...Ace],j2e=new Set(L2e),$2e=new Set([301,302,303,307,308]),F2e=new Set([307,308]),L4={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},z2e={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qy={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},tW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,B2e=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Rce="remix-router-transitions";function U2e(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;sn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let de=e.detectErrorBoundary;s=ye=>({hasErrorBoundary:de(ye)})}else s=B2e;let i={},o=VT(e.routes,s,void 0,i),a,c=e.basename||"/",d=e.dataStrategy||q2e,h=e.patchRoutesOnNavigation,u=qr({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,g=new Set,v=null,m=null,x=null,y=e.hydrationData!=null,b=ig(o,e.history.location,c),w=!1,E=null;if(b==null&&!h){let de=Wo(404,{pathname:e.history.location.pathname}),{matches:ye,route:Ce}=W7(o);b=ye,E={[Ce.id]:de}}b&&!e.hydrationData&&Tn(b,o,e.history.location.pathname).active&&(b=null);let R;if(b)if(b.some(de=>de.route.lazy))R=!1;else if(!b.some(de=>de.route.loader))R=!0;else if(u.v7_partialHydration){let de=e.hydrationData?e.hydrationData.loaderData:null,ye=e.hydrationData?e.hydrationData.errors:null;if(ye){let Ce=b.findIndex(Me=>ye[Me.route.id]!==void 0);R=b.slice(0,Ce+1).every(Me=>!kU(Me.route,de,ye))}else R=b.every(Ce=>!kU(Ce.route,de,ye))}else R=e.hydrationData!=null;else if(R=!1,b=[],u.v7_partialHydration){let de=Tn(null,o,e.history.location.pathname);de.active&&de.matches&&(w=!0,b=de.matches)}let T,N={historyAction:e.history.action,location:e.history.location,matches:b,initialized:R,navigation:L4,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},A=Ns.Pop,D=!1,O,I=!1,$=new Map,F=null,B=!1,W=!1,Z=[],Y=new Set,H=new Map,se=0,he=-1,re=new Map,J=new Set,te=new Map,ae=new Map,be=new Set,xe=new Map,ve=new Map,Pe;function Oe(){if(f=e.history.listen(de=>{let{action:ye,location:Ce,delta:Me}=de;if(Pe){Pe(),Pe=void 0;return}hx(ve.size===0||Me!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ge=Pt({currentLocation:N.location,nextLocation:Ce,historyAction:ye});if(Ge&&Me!=null){let lt=new Promise(Ct=>{Pe=Ct});e.history.go(Me*-1),Rt(Ge,{state:"blocked",location:Ce,proceed(){Rt(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:Ce}),lt.then(()=>e.history.go(Me))},reset(){let Ct=new Map(N.blockers);Ct.set(Ge,Qy),$e({blockers:Ct})}});return}return ut(ye,Ce)}),n){o$e(t,$);let de=()=>a$e(t,$);t.addEventListener("pagehide",de),F=()=>t.removeEventListener("pagehide",de)}return N.initialized||ut(Ns.Pop,N.location,{initialHydration:!0}),T}function ke(){f&&f(),F&&F(),g.clear(),O&&O.abort(),N.fetchers.forEach((de,ye)=>ht(ye)),N.blockers.forEach((de,ye)=>Ze(ye))}function ze(de){return g.add(de),()=>g.delete(de)}function $e(de,ye){ye===void 0&&(ye={}),N=qr({},N,de);let Ce=[],Me=[];u.v7_fetcherPersist&&N.fetchers.forEach((Ge,lt)=>{Ge.state==="idle"&&(be.has(lt)?Me.push(lt):Ce.push(lt))}),be.forEach(Ge=>{!N.fetchers.has(Ge)&&!H.has(Ge)&&Me.push(Ge)}),[...g].forEach(Ge=>Ge(N,{deletedFetchers:Me,viewTransitionOpts:ye.viewTransitionOpts,flushSync:ye.flushSync===!0})),u.v7_fetcherPersist?(Ce.forEach(Ge=>N.fetchers.delete(Ge)),Me.forEach(Ge=>ht(Ge))):Me.forEach(Ge=>be.delete(Ge))}function Te(de,ye,Ce){var Me,Ge;let{flushSync:lt}=Ce===void 0?{}:Ce,Ct=N.actionData!=null&&N.navigation.formMethod!=null&&fc(N.navigation.formMethod)&&N.navigation.state==="loading"&&((Me=de.state)==null?void 0:Me._isRedirect)!==!0,st;ye.actionData?Object.keys(ye.actionData).length>0?st=ye.actionData:st=null:Ct?st=N.actionData:st=null;let dt=ye.loaderData?V7(N.loaderData,ye.loaderData,ye.matches||[],ye.errors):N.loaderData,ot=N.blockers;ot.size>0&&(ot=new Map(ot),ot.forEach((Jt,ps)=>ot.set(ps,Qy)));let gt=D===!0||N.navigation.formMethod!=null&&fc(N.navigation.formMethod)&&((Ge=de.state)==null?void 0:Ge._isRedirect)!==!0;a&&(o=a,a=void 0),B||A===Ns.Pop||(A===Ns.Push?e.history.push(de,de.state):A===Ns.Replace&&e.history.replace(de,de.state));let Lt;if(A===Ns.Pop){let Jt=$.get(N.location.pathname);Jt&&Jt.has(de.pathname)?Lt={currentLocation:N.location,nextLocation:de}:$.has(de.pathname)&&(Lt={currentLocation:de,nextLocation:N.location})}else if(I){let Jt=$.get(N.location.pathname);Jt?Jt.add(de.pathname):(Jt=new Set([de.pathname]),$.set(N.location.pathname,Jt)),Lt={currentLocation:N.location,nextLocation:de}}$e(qr({},ye,{actionData:st,loaderData:dt,historyAction:A,location:de,initialized:!0,navigation:L4,revalidation:"idle",restoreScrollPosition:In(de,ye.matches||N.matches),preventScrollReset:gt,blockers:ot}),{viewTransitionOpts:Lt,flushSync:lt===!0}),A=Ns.Pop,D=!1,I=!1,B=!1,W=!1,Z=[]}async function Ue(de,ye){if(typeof de=="number"){e.history.go(de);return}let Ce=TU(N.location,N.matches,c,u.v7_prependBasename,de,u.v7_relativeSplatPath,ye==null?void 0:ye.fromRouteId,ye==null?void 0:ye.relative),{path:Me,submission:Ge,error:lt}=I7(u.v7_normalizeFormMethod,!1,Ce,ye),Ct=N.location,st=kC(N.location,Me,ye&&ye.state);st=qr({},st,e.history.encodeLocation(st));let dt=ye&&ye.replace!=null?ye.replace:void 0,ot=Ns.Push;dt===!0?ot=Ns.Replace:dt===!1||Ge!=null&&fc(Ge.formMethod)&&Ge.formAction===N.location.pathname+N.location.search&&(ot=Ns.Replace);let gt=ye&&"preventScrollReset"in ye?ye.preventScrollReset===!0:void 0,Lt=(ye&&ye.flushSync)===!0,Jt=Pt({currentLocation:Ct,nextLocation:st,historyAction:ot});if(Jt){Rt(Jt,{state:"blocked",location:st,proceed(){Rt(Jt,{state:"proceeding",proceed:void 0,reset:void 0,location:st}),Ue(de,ye)},reset(){let ps=new Map(N.blockers);ps.set(Jt,Qy),$e({blockers:ps})}});return}return await ut(ot,st,{submission:Ge,pendingError:lt,preventScrollReset:gt,replace:ye&&ye.replace,enableViewTransition:ye&&ye.viewTransition,flushSync:Lt})}function wt(){if(pe(),$e({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){ut(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}ut(A||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:I===!0})}}async function ut(de,ye,Ce){O&&O.abort(),O=null,A=de,B=(Ce&&Ce.startUninterruptedRevalidation)===!0,Hn(N.location,N.matches),D=(Ce&&Ce.preventScrollReset)===!0,I=(Ce&&Ce.enableViewTransition)===!0;let Me=a||o,Ge=Ce&&Ce.overrideNavigation,lt=Ce!=null&&Ce.initialHydration&&N.matches&&N.matches.length>0&&!w?N.matches:ig(Me,ye,c),Ct=(Ce&&Ce.flushSync)===!0;if(lt&&N.initialized&&!W&&Z2e(N.location,ye)&&!(Ce&&Ce.submission&&fc(Ce.submission.formMethod))){Te(ye,{matches:lt},{flushSync:Ct});return}let st=Tn(lt,Me,ye.pathname);if(st.active&&st.matches&&(lt=st.matches),!lt){let{error:Wn,notFoundMatches:pn,route:wr}=Ut(ye.pathname);Te(ye,{matches:pn,loaderData:{},errors:{[wr.id]:Wn}},{flushSync:Ct});return}O=new AbortController;let dt=zy(e.history,ye,O.signal,Ce&&Ce.submission),ot;if(Ce&&Ce.pendingError)ot=[og(lt).route.id,{type:er.error,error:Ce.pendingError}];else if(Ce&&Ce.submission&&fc(Ce.submission.formMethod)){let Wn=await St(dt,ye,Ce.submission,lt,st.active,{replace:Ce.replace,flushSync:Ct});if(Wn.shortCircuited)return;if(Wn.pendingActionResult){let[pn,wr]=Wn.pendingActionResult;if(Va(wr)&&DC(wr.error)&&wr.error.status===404){O=null,Te(ye,{matches:Wn.matches,loaderData:{},errors:{[pn]:wr.error}});return}}lt=Wn.matches||lt,ot=Wn.pendingActionResult,Ge=j4(ye,Ce.submission),Ct=!1,st.active=!1,dt=zy(e.history,dt.url,dt.signal)}let{shortCircuited:gt,matches:Lt,loaderData:Jt,errors:ps}=await Nn(dt,ye,lt,st.active,Ge,Ce&&Ce.submission,Ce&&Ce.fetcherSubmission,Ce&&Ce.replace,Ce&&Ce.initialHydration===!0,Ct,ot);gt||(O=null,Te(ye,qr({matches:Lt||lt},H7(ot),{loaderData:Jt,errors:ps})))}async function St(de,ye,Ce,Me,Ge,lt){lt===void 0&&(lt={}),pe();let Ct=s$e(ye,Ce);if($e({navigation:Ct},{flushSync:lt.flushSync===!0}),Ge){let ot=await sr(Me,ye.pathname,de.signal);if(ot.type==="aborted")return{shortCircuited:!0};if(ot.type==="error"){let gt=og(ot.partialMatches).route.id;return{matches:ot.partialMatches,pendingActionResult:[gt,{type:er.error,error:ot.error}]}}else if(ot.matches)Me=ot.matches;else{let{notFoundMatches:gt,error:Lt,route:Jt}=Ut(ye.pathname);return{matches:gt,pendingActionResult:[Jt.id,{type:er.error,error:Lt}]}}}let st,dt=f1(Me,ye);if(!dt.route.action&&!dt.route.lazy)st={type:er.error,error:Wo(405,{method:de.method,pathname:ye.pathname,routeId:dt.route.id})};else if(st=(await _e("action",N,de,[dt],Me,null))[dt.route.id],de.signal.aborted)return{shortCircuited:!0};if(pg(st)){let ot;return lt&<.replace!=null?ot=lt.replace:ot=z7(st.response.headers.get("Location"),new URL(de.url),c)===N.location.pathname+N.location.search,await ie(de,st,!0,{submission:Ce,replace:ot}),{shortCircuited:!0}}if(Zh(st))throw Wo(400,{type:"defer-action"});if(Va(st)){let ot=og(Me,dt.route.id);return(lt&<.replace)!==!0&&(A=Ns.Push),{matches:Me,pendingActionResult:[ot.route.id,st]}}return{matches:Me,pendingActionResult:[dt.route.id,st]}}async function Nn(de,ye,Ce,Me,Ge,lt,Ct,st,dt,ot,gt){let Lt=Ge||j4(ye,lt),Jt=lt||Ct||G7(Lt),ps=!B&&(!u.v7_partialHydration||!dt);if(Me){if(ps){let Sr=cn(gt);$e(qr({navigation:Lt},Sr!==void 0?{actionData:Sr}:{}),{flushSync:ot})}let en=await sr(Ce,ye.pathname,de.signal);if(en.type==="aborted")return{shortCircuited:!0};if(en.type==="error"){let Sr=og(en.partialMatches).route.id;return{matches:en.partialMatches,loaderData:{},errors:{[Sr]:en.error}}}else if(en.matches)Ce=en.matches;else{let{error:Sr,notFoundMatches:Fc,route:Uu}=Ut(ye.pathname);return{matches:Fc,loaderData:{},errors:{[Uu.id]:Sr}}}}let Wn=a||o,[pn,wr]=j7(e.history,N,Ce,Jt,ye,u.v7_partialHydration&&dt===!0,u.v7_skipActionErrorRevalidation,W,Z,Y,be,te,J,Wn,c,gt);if(yt(en=>!(Ce&&Ce.some(Sr=>Sr.route.id===en))||pn&&pn.some(Sr=>Sr.route.id===en)),he=++se,pn.length===0&&wr.length===0){let en=Yt();return Te(ye,qr({matches:Ce,loaderData:{},errors:gt&&Va(gt[1])?{[gt[0]]:gt[1].error}:null},H7(gt),en?{fetchers:new Map(N.fetchers)}:{}),{flushSync:ot}),{shortCircuited:!0}}if(ps){let en={};if(!Me){en.navigation=Lt;let Sr=cn(gt);Sr!==void 0&&(en.actionData=Sr)}wr.length>0&&(en.fetchers=hn(wr)),$e(en,{flushSync:ot})}wr.forEach(en=>{Mn(en.key),en.controller&&H.set(en.key,en.controller)});let Lc=()=>wr.forEach(en=>Mn(en.key));O&&O.signal.addEventListener("abort",Lc);let{loaderResults:oo,fetcherResults:fa}=await we(N,Ce,pn,wr,de);if(de.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Lc),wr.forEach(en=>H.delete(en.key));let As=mP(oo);if(As)return await ie(de,As.result,!0,{replace:st}),{shortCircuited:!0};if(As=mP(fa),As)return J.add(As.key),await ie(de,As.result,!0,{replace:st}),{shortCircuited:!0};let{loaderData:$p,errors:Bu}=U7(N,Ce,oo,gt,wr,fa,xe);xe.forEach((en,Sr)=>{en.subscribe(Fc=>{(Fc||en.done)&&xe.delete(Sr)})}),u.v7_partialHydration&&dt&&N.errors&&(Bu=qr({},N.errors,Bu));let Tl=Yt(),jc=un(he),$c=Tl||jc||wr.length>0;return qr({matches:Ce,loaderData:$p,errors:Bu},$c?{fetchers:new Map(N.fetchers)}:{})}function cn(de){if(de&&!Va(de[1]))return{[de[0]]:de[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function hn(de){return de.forEach(ye=>{let Ce=N.fetchers.get(ye.key),Me=HS(void 0,Ce?Ce.data:void 0);N.fetchers.set(ye.key,Me)}),new Map(N.fetchers)}function It(de,ye,Ce,Me){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Mn(de);let Ge=(Me&&Me.flushSync)===!0,lt=a||o,Ct=TU(N.location,N.matches,c,u.v7_prependBasename,Ce,u.v7_relativeSplatPath,ye,Me==null?void 0:Me.relative),st=ig(lt,Ct,c),dt=Tn(st,lt,Ct);if(dt.active&&dt.matches&&(st=dt.matches),!st){Fe(de,ye,Wo(404,{pathname:Ct}),{flushSync:Ge});return}let{path:ot,submission:gt,error:Lt}=I7(u.v7_normalizeFormMethod,!0,Ct,Me);if(Lt){Fe(de,ye,Lt,{flushSync:Ge});return}let Jt=f1(st,ot),ps=(Me&&Me.preventScrollReset)===!0;if(gt&&fc(gt.formMethod)){U(de,ye,ot,Jt,st,dt.active,Ge,ps,gt);return}te.set(de,{routeId:ye,path:ot}),ee(de,ye,ot,Jt,st,dt.active,Ge,ps,gt)}async function U(de,ye,Ce,Me,Ge,lt,Ct,st,dt){pe(),te.delete(de);function ot(Wr){if(!Wr.route.action&&!Wr.route.lazy){let nl=Wo(405,{method:dt.formMethod,pathname:Ce,routeId:ye});return Fe(de,ye,nl,{flushSync:Ct}),!0}return!1}if(!lt&&ot(Me))return;let gt=N.fetchers.get(de);Se(de,i$e(dt,gt),{flushSync:Ct});let Lt=new AbortController,Jt=zy(e.history,Ce,Lt.signal,dt);if(lt){let Wr=await sr(Ge,new URL(Jt.url).pathname,Jt.signal,de);if(Wr.type==="aborted")return;if(Wr.type==="error"){Fe(de,ye,Wr.error,{flushSync:Ct});return}else if(Wr.matches){if(Ge=Wr.matches,Me=f1(Ge,Ce),ot(Me))return}else{Fe(de,ye,Wo(404,{pathname:Ce}),{flushSync:Ct});return}}H.set(de,Lt);let ps=se,pn=(await _e("action",N,Jt,[Me],Ge,de))[Me.route.id];if(Jt.signal.aborted){H.get(de)===Lt&&H.delete(de);return}if(u.v7_fetcherPersist&&be.has(de)){if(pg(pn)||Va(pn)){Se(de,sh(void 0));return}}else{if(pg(pn))if(H.delete(de),he>ps){Se(de,sh(void 0));return}else return J.add(de),Se(de,HS(dt)),ie(Jt,pn,!1,{fetcherSubmission:dt,preventScrollReset:st});if(Va(pn)){Fe(de,ye,pn.error);return}}if(Zh(pn))throw Wo(400,{type:"defer-action"});let wr=N.navigation.location||N.location,Lc=zy(e.history,wr,Lt.signal),oo=a||o,fa=N.navigation.state!=="idle"?ig(oo,N.navigation.location,c):N.matches;sn(fa,"Didn't find any matches after fetcher action");let As=++se;re.set(de,As);let $p=HS(dt,pn.data);N.fetchers.set(de,$p);let[Bu,Tl]=j7(e.history,N,fa,dt,wr,!1,u.v7_skipActionErrorRevalidation,W,Z,Y,be,te,J,oo,c,[Me.route.id,pn]);Tl.filter(Wr=>Wr.key!==de).forEach(Wr=>{let nl=Wr.key,Kf=N.fetchers.get(nl),Fp=HS(void 0,Kf?Kf.data:void 0);N.fetchers.set(nl,Fp),Mn(nl),Wr.controller&&H.set(nl,Wr.controller)}),$e({fetchers:new Map(N.fetchers)});let jc=()=>Tl.forEach(Wr=>Mn(Wr.key));Lt.signal.addEventListener("abort",jc);let{loaderResults:$c,fetcherResults:en}=await we(N,fa,Bu,Tl,Lc);if(Lt.signal.aborted)return;Lt.signal.removeEventListener("abort",jc),re.delete(de),H.delete(de),Tl.forEach(Wr=>H.delete(Wr.key));let Sr=mP($c);if(Sr)return ie(Lc,Sr.result,!1,{preventScrollReset:st});if(Sr=mP(en),Sr)return J.add(Sr.key),ie(Lc,Sr.result,!1,{preventScrollReset:st});let{loaderData:Fc,errors:Uu}=U7(N,fa,$c,void 0,Tl,en,xe);if(N.fetchers.has(de)){let Wr=sh(pn.data);N.fetchers.set(de,Wr)}un(As),N.navigation.state==="loading"&&As>he?(sn(A,"Expected pending action"),O&&O.abort(),Te(N.navigation.location,{matches:fa,loaderData:Fc,errors:Uu,fetchers:new Map(N.fetchers)})):($e({errors:Uu,loaderData:V7(N.loaderData,Fc,fa,Uu),fetchers:new Map(N.fetchers)}),W=!1)}async function ee(de,ye,Ce,Me,Ge,lt,Ct,st,dt){let ot=N.fetchers.get(de);Se(de,HS(dt,ot?ot.data:void 0),{flushSync:Ct});let gt=new AbortController,Lt=zy(e.history,Ce,gt.signal);if(lt){let pn=await sr(Ge,new URL(Lt.url).pathname,Lt.signal,de);if(pn.type==="aborted")return;if(pn.type==="error"){Fe(de,ye,pn.error,{flushSync:Ct});return}else if(pn.matches)Ge=pn.matches,Me=f1(Ge,Ce);else{Fe(de,ye,Wo(404,{pathname:Ce}),{flushSync:Ct});return}}H.set(de,gt);let Jt=se,Wn=(await _e("loader",N,Lt,[Me],Ge,de))[Me.route.id];if(Zh(Wn)&&(Wn=await nW(Wn,Lt.signal,!0)||Wn),H.get(de)===gt&&H.delete(de),!Lt.signal.aborted){if(be.has(de)){Se(de,sh(void 0));return}if(pg(Wn))if(he>Jt){Se(de,sh(void 0));return}else{J.add(de),await ie(Lt,Wn,!1,{preventScrollReset:st});return}if(Va(Wn)){Fe(de,ye,Wn.error);return}sn(!Zh(Wn),"Unhandled fetcher deferred data"),Se(de,sh(Wn.data))}}async function ie(de,ye,Ce,Me){let{submission:Ge,fetcherSubmission:lt,preventScrollReset:Ct,replace:st}=Me===void 0?{}:Me;ye.response.headers.has("X-Remix-Revalidate")&&(W=!0);let dt=ye.response.headers.get("Location");sn(dt,"Expected a Location header on the redirect Response"),dt=z7(dt,new URL(de.url),c);let ot=kC(N.location,dt,{_isRedirect:!0});if(n){let pn=!1;if(ye.response.headers.has("X-Remix-Reload-Document"))pn=!0;else if(tW.test(dt)){const wr=e.history.createURL(dt);pn=wr.origin!==t.location.origin||yp(wr.pathname,c)==null}if(pn){st?t.location.replace(dt):t.location.assign(dt);return}}O=null;let gt=st===!0||ye.response.headers.has("X-Remix-Replace")?Ns.Replace:Ns.Push,{formMethod:Lt,formAction:Jt,formEncType:ps}=N.navigation;!Ge&&!lt&&Lt&&Jt&&ps&&(Ge=G7(N.navigation));let Wn=Ge||lt;if(F2e.has(ye.response.status)&&Wn&&fc(Wn.formMethod))await ut(gt,ot,{submission:qr({},Wn,{formAction:dt}),preventScrollReset:Ct||D,enableViewTransition:Ce?I:void 0});else{let pn=j4(ot,Ge);await ut(gt,ot,{overrideNavigation:pn,fetcherSubmission:lt,preventScrollReset:Ct||D,enableViewTransition:Ce?I:void 0})}}async function _e(de,ye,Ce,Me,Ge,lt){let Ct,st={};try{Ct=await G2e(d,de,ye,Ce,Me,Ge,lt,i,s)}catch(dt){return Me.forEach(ot=>{st[ot.route.id]={type:er.error,error:dt}}),st}for(let[dt,ot]of Object.entries(Ct))if(J2e(ot)){let gt=ot.result;st[dt]={type:er.redirect,response:X2e(gt,Ce,dt,Ge,c,u.v7_relativeSplatPath)}}else st[dt]=await Y2e(ot);return st}async function we(de,ye,Ce,Me,Ge){let lt=de.matches,Ct=_e("loader",de,Ge,Ce,ye,null),st=Promise.all(Me.map(async gt=>{if(gt.matches&>.match&>.controller){let Jt=(await _e("loader",de,zy(e.history,gt.path,gt.controller.signal),[gt.match],gt.matches,gt.key))[gt.match.route.id];return{[gt.key]:Jt}}else return Promise.resolve({[gt.key]:{type:er.error,error:Wo(404,{pathname:gt.path})}})})),dt=await Ct,ot=(await st).reduce((gt,Lt)=>Object.assign(gt,Lt),{});return await Promise.all([n$e(ye,dt,Ge.signal,lt,de.loaderData),r$e(ye,ot,Me)]),{loaderResults:dt,fetcherResults:ot}}function pe(){W=!0,Z.push(...yt()),te.forEach((de,ye)=>{H.has(ye)&&Y.add(ye),Mn(ye)})}function Se(de,ye,Ce){Ce===void 0&&(Ce={}),N.fetchers.set(de,ye),$e({fetchers:new Map(N.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function Fe(de,ye,Ce,Me){Me===void 0&&(Me={});let Ge=og(N.matches,ye);ht(de),$e({errors:{[Ge.route.id]:Ce},fetchers:new Map(N.fetchers)},{flushSync:(Me&&Me.flushSync)===!0})}function ft(de){return ae.set(de,(ae.get(de)||0)+1),be.has(de)&&be.delete(de),N.fetchers.get(de)||z2e}function ht(de){let ye=N.fetchers.get(de);H.has(de)&&!(ye&&ye.state==="loading"&&re.has(de))&&Mn(de),te.delete(de),re.delete(de),J.delete(de),u.v7_fetcherPersist&&be.delete(de),Y.delete(de),N.fetchers.delete(de)}function hs(de){let ye=(ae.get(de)||0)-1;ye<=0?(ae.delete(de),be.add(de),u.v7_fetcherPersist||ht(de)):ae.set(de,ye),$e({fetchers:new Map(N.fetchers)})}function Mn(de){let ye=H.get(de);ye&&(ye.abort(),H.delete(de))}function Hr(de){for(let ye of de){let Ce=ft(ye),Me=sh(Ce.data);N.fetchers.set(ye,Me)}}function Yt(){let de=[],ye=!1;for(let Ce of J){let Me=N.fetchers.get(Ce);sn(Me,"Expected fetcher: "+Ce),Me.state==="loading"&&(J.delete(Ce),de.push(Ce),ye=!0)}return Hr(de),ye}function un(de){let ye=[];for(let[Ce,Me]of re)if(Me0}function xn(de,ye){let Ce=N.blockers.get(de)||Qy;return ve.get(de)!==ye&&ve.set(de,ye),Ce}function Ze(de){N.blockers.delete(de),ve.delete(de)}function Rt(de,ye){let Ce=N.blockers.get(de)||Qy;sn(Ce.state==="unblocked"&&ye.state==="blocked"||Ce.state==="blocked"&&ye.state==="blocked"||Ce.state==="blocked"&&ye.state==="proceeding"||Ce.state==="blocked"&&ye.state==="unblocked"||Ce.state==="proceeding"&&ye.state==="unblocked","Invalid blocker state transition: "+Ce.state+" -> "+ye.state);let Me=new Map(N.blockers);Me.set(de,ye),$e({blockers:Me})}function Pt(de){let{currentLocation:ye,nextLocation:Ce,historyAction:Me}=de;if(ve.size===0)return;ve.size>1&&hx(!1,"A router only supports one blocker at a time");let Ge=Array.from(ve.entries()),[lt,Ct]=Ge[Ge.length-1],st=N.blockers.get(lt);if(!(st&&st.state==="proceeding")&&Ct({currentLocation:ye,nextLocation:Ce,historyAction:Me}))return lt}function Ut(de){let ye=Wo(404,{pathname:de}),Ce=a||o,{matches:Me,route:Ge}=W7(Ce);return yt(),{notFoundMatches:Me,route:Ge,error:ye}}function yt(de){let ye=[];return xe.forEach((Ce,Me)=>{(!de||de(Me))&&(Ce.cancel(),ye.push(Me),xe.delete(Me))}),ye}function dn(de,ye,Ce){if(v=de,x=ye,m=Ce||null,!y&&N.navigation===L4){y=!0;let Me=In(N.location,N.matches);Me!=null&&$e({restoreScrollPosition:Me})}return()=>{v=null,x=null,m=null}}function Gt(de,ye){return m&&m(de,ye.map(Me=>v2e(Me,N.loaderData)))||de.key}function Hn(de,ye){if(v&&x){let Ce=Gt(de,ye);v[Ce]=x()}}function In(de,ye){if(v){let Ce=Gt(de,ye),Me=v[Ce];if(typeof Me=="number")return Me}return null}function Tn(de,ye,Ce){if(h)if(de){if(Object.keys(de[0].params).length>0)return{active:!0,matches:nN(ye,Ce,c,!0)}}else return{active:!0,matches:nN(ye,Ce,c,!0)||[]};return{active:!1,matches:null}}async function sr(de,ye,Ce,Me){if(!h)return{type:"success",matches:de};let Ge=de;for(;;){let lt=a==null,Ct=a||o,st=i;try{await h({signal:Ce,path:ye,matches:Ge,fetcherKey:Me,patch:(gt,Lt)=>{Ce.aborted||F7(gt,Lt,Ct,st,s)}})}catch(gt){return{type:"error",error:gt,partialMatches:Ge}}finally{lt&&!Ce.aborted&&(o=[...o])}if(Ce.aborted)return{type:"aborted"};let dt=ig(Ct,ye,c);if(dt)return{type:"success",matches:dt};let ot=nN(Ct,ye,c,!0);if(!ot||Ge.length===ot.length&&Ge.every((gt,Lt)=>gt.route.id===ot[Lt].route.id))return{type:"success",matches:null};Ge=ot}}function Kr(de){i={},a=VT(de,s,void 0,i)}function ir(de,ye){let Ce=a==null;F7(de,ye,a||o,i,s),Ce&&(o=[...o],$e({}))}return T={get basename(){return c},get future(){return u},get state(){return N},get routes(){return o},get window(){return t},initialize:Oe,subscribe:ze,enableScrollRestoration:dn,navigate:Ue,fetch:It,revalidate:wt,createHref:de=>e.history.createHref(de),encodeLocation:de=>e.history.encodeLocation(de),getFetcher:ft,deleteFetcher:hs,dispose:ke,getBlocker:xn,deleteBlocker:Ze,patchRoutes:ir,_internalFetchControllers:H,_internalActiveDeferreds:xe,_internalSetRoutes:Kr},T}function V2e(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function TU(e,t,n,r,s,i,o,a){let c,d;if(o){c=[];for(let u of t)if(c.push(u),u.route.id===o){d=u;break}}else c=t,d=t[t.length-1];let h=wO(s||".",_O(c,i),yp(e.pathname,n)||e.pathname,a==="path");if(s==null&&(h.search=e.search,h.hash=e.hash),(s==null||s===""||s===".")&&d){let u=rW(h.search);if(d.route.index&&!u)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&u){let f=new URLSearchParams(h.search),g=f.getAll("index");f.delete("index"),g.filter(m=>m).forEach(m=>f.append("index",m));let v=f.toString();h.search=v?"?"+v:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Af([n,h.pathname])),Kv(h)}function I7(e,t,n,r){if(!r||!V2e(r))return{path:n};if(r.formMethod&&!t$e(r.formMethod))return{path:n,error:Wo(405,{method:r.formMethod})};let s=()=>({path:n,error:Wo(400,{type:"invalid-body"})}),i=r.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),a=Tce(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!fc(o))return s();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,v)=>{let[m,x]=v;return""+g+m+"="+x+` `},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!fc(o))return s();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return s()}}}sn(typeof FormData=="function","FormData is not available in this environment");let c,d;if(r.formData)c=DU(r.formData),d=r.formData;else if(r.body instanceof FormData)c=DU(r.body),d=r.body;else if(r.body instanceof URLSearchParams)c=r.body,d=B7(c);else if(r.body==null)c=new URLSearchParams,d=new FormData;else try{c=new URLSearchParams(r.body),d=B7(c)}catch{return s()}let h={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(fc(h.formMethod))return{path:n,submission:h};let u=Dp(n);return t&&u.search&&rW(u.search)&&c.append("index",""),u.search="?"+c,{path:Kv(u),submission:h}}function L7(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(s=>s.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function j7(e,t,n,r,s,i,o,a,c,d,h,u,f,g,v,m){let x=m?Va(m[1])?m[1].error:m[1].data:void 0,y=e.createURL(t.location),b=e.createURL(s),w=n;i&&t.errors?w=L7(n,Object.keys(t.errors)[0],!0):m&&Va(m[1])&&(w=L7(n,m[0]));let E=m?m[1].statusCode:void 0,R=o&&E&&E>=400,T=w.filter((A,D)=>{let{route:O}=A;if(O.lazy)return!0;if(O.loader==null)return!1;if(i)return kU(O,t.loaderData,t.errors);if(H2e(t.loaderData,t.matches[D],A)||c.some(F=>F===A.route.id))return!0;let I=t.matches[D],$=A;return $7(A,qr({currentUrl:y,currentParams:I.params,nextUrl:b,nextParams:$.params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:R?!1:a||y.pathname+y.search===b.pathname+b.search||y.search!==b.search||Pce(I,$)}))}),N=[];return u.forEach((A,D)=>{if(i||!n.some(B=>B.route.id===A.routeId)||h.has(D))return;let O=ig(g,A.path,v);if(!O){N.push({key:D,routeId:A.routeId,path:A.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(D),$=f1(O,A.path),F=!1;f.has(D)?F=!1:d.has(D)?(d.delete(D),F=!0):I&&I.state!=="idle"&&I.data===void 0?F=a:F=$7($,qr({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:R?!1:a})),F&&N.push({key:D,routeId:A.routeId,path:A.path,matches:O,match:$,controller:new AbortController})}),[T,N]}function kU(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function H2e(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function Pce(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function $7(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function F7(e,t,n,r,s){var i;let o;if(e){let d=r[e];sn(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),o=d.children}else o=n;let a=t.filter(d=>!o.some(h=>Nce(d,h))),c=VT(a,s,[e||"_","patch",String(((i=o)==null?void 0:i.length)||"0")],r);o.push(...c)}function Nce(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var s;return(s=t.children)==null?void 0:s.some(i=>Nce(n,i))}):!1}async function W2e(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];sn(s,"No route found in manifest");let i={};for(let o in r){let c=s[o]!==void 0&&o!=="hasErrorBoundary";hx(!c,'Route "'+s.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!c&&!m2e.has(o)&&(i[o]=r[o])}Object.assign(s,i),Object.assign(s,qr({},t(s),{lazy:void 0}))}async function q2e(e){let{matches:t}=e,n=t.filter(s=>s.shouldLoad);return(await Promise.all(n.map(s=>s.resolve()))).reduce((s,i,o)=>Object.assign(s,{[n[o].route.id]:i}),{})}async function G2e(e,t,n,r,s,i,o,a,c,d){let h=i.map(g=>g.route.lazy?W2e(g.route,c,a):void 0),u=i.map((g,v)=>{let m=h[v],x=s.some(b=>b.route.id===g.route.id);return qr({},g,{shouldLoad:x,resolve:async b=>(b&&r.method==="GET"&&(g.route.lazy||g.route.loader)&&(x=!0),x?K2e(t,r,g,m,b,d):Promise.resolve({type:er.data,result:void 0}))})}),f=await e({matches:u,request:r,params:i[0].params,fetcherKey:o,context:d});try{await Promise.all(h)}catch{}return f}async function K2e(e,t,n,r,s,i){let o,a,c=d=>{let h,u=new Promise((v,m)=>h=m);a=()=>h(),t.signal.addEventListener("abort",a);let f=v=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:i},...v!==void 0?[v]:[]),g=(async()=>{try{return{type:"data",result:await(s?s(m=>f(m)):f())}}catch(v){return{type:"error",result:v}}})();return Promise.race([g,u])};try{let d=n.route[e];if(r)if(d){let h,[u]=await Promise.all([c(d).catch(f=>{h=f}),r]);if(h!==void 0)throw h;o=u}else if(await r,d=n.route[e],d)o=await c(d);else if(e==="action"){let h=new URL(t.url),u=h.pathname+h.search;throw Wo(405,{method:t.method,pathname:u,routeId:n.route.id})}else return{type:er.data,result:void 0};else if(d)o=await c(d);else{let h=new URL(t.url),u=h.pathname+h.search;throw Wo(404,{pathname:u})}sn(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:er.error,result:d}}finally{a&&t.signal.removeEventListener("abort",a)}return o}async function Y2e(e){let{result:t,type:n}=e;if(kce(t)){let u;try{let f=t.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(f){return{type:er.error,error:f}}return n===er.error?{type:er.error,error:new HT(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:er.data,data:u,statusCode:t.status,headers:t.headers}}if(n===er.error){if(q7(t)){var r,s;if(t.data instanceof Error){var i,o;return{type:er.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:er.error,error:new HT(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:DC(t)?t.status:void 0,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:er.error,error:t,statusCode:DC(t)?t.status:void 0}}if(e$e(t)){var a,c;return{type:er.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((c=t.init)==null?void 0:c.headers)&&new Headers(t.init.headers)}}if(q7(t)){var d,h;return{type:er.data,data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}}return{type:er.data,data:t}}function X2e(e,t,n,r,s,i){let o=e.headers.get("Location");if(sn(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!tW.test(o)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=TU(new URL(t.url),a,s,!0,o,i),e.headers.set("Location",o)}return e}function z7(e,t,n){if(tW.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=yp(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function zy(e,t,n,r){let s=e.createURL(Tce(t)).toString(),i={signal:n};if(r&&fc(r.formMethod)){let{formMethod:o,formEncType:a}=r;i.method=o.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=DU(r.formData):i.body=r.formData}return new Request(s,i)}function DU(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function B7(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Q2e(e,t,n,r,s){let i={},o=null,a,c=!1,d={},h=n&&Va(n[1])?n[1].error:void 0;return e.forEach(u=>{if(!(u.route.id in t))return;let f=u.route.id,g=t[f];if(sn(!pg(g),"Cannot handle redirect results in processLoaderData"),Va(g)){let v=g.error;h!==void 0&&(v=h,h=void 0),o=o||{};{let m=og(e,f);o[m.route.id]==null&&(o[m.route.id]=v)}i[f]=void 0,c||(c=!0,a=DC(g.error)?g.error.status:500),g.headers&&(d[f]=g.headers)}else Zh(g)?(r.set(f,g.deferredData),i[f]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!c&&(a=g.statusCode),g.headers&&(d[f]=g.headers)):(i[f]=g.data,g.statusCode&&g.statusCode!==200&&!c&&(a=g.statusCode),g.headers&&(d[f]=g.headers))}),h!==void 0&&n&&(o={[n[0]]:h},i[n[0]]=void 0),{loaderData:i,errors:o,statusCode:a||200,loaderHeaders:d}}function U7(e,t,n,r,s,i,o){let{loaderData:a,errors:c}=Q2e(t,n,r,o);return s.forEach(d=>{let{key:h,match:u,controller:f}=d,g=i[h];if(sn(g,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Va(g)){let v=og(e.matches,u==null?void 0:u.route.id);c&&c[v.route.id]||(c=qr({},c,{[v.route.id]:g.error})),e.fetchers.delete(h)}else if(pg(g))sn(!1,"Unhandled fetcher revalidation redirect");else if(Zh(g))sn(!1,"Unhandled fetcher deferred data");else{let v=sh(g.data);e.fetchers.set(h,v)}}),{loaderData:a,errors:c}}function V7(e,t,n,r){let s=qr({},t);for(let i of n){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(s[o]=t[o]):e[o]!==void 0&&i.route.loader&&(s[o]=e[o]),r&&r.hasOwnProperty(o))break}return s}function H7(e){return e?Va(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function og(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function W7(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Wo(e,t){let{pathname:n,routeId:r,method:s,type:i,message:o}=t===void 0?{}:t,a="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(a="Bad Request",s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",c='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",s&&n&&r?c="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new HT(e||500,a,new Error(c),!0)}function mP(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(pg(s))return{key:r,result:s}}}function Tce(e){let t=typeof e=="string"?Dp(e):e;return Kv(qr({},t,{hash:""}))}function Z2e(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function J2e(e){return kce(e.result)&&$2e.has(e.result.status)}function Zh(e){return e.type===er.deferred}function Va(e){return e.type===er.error}function pg(e){return(e&&e.type)===er.redirect}function q7(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function e$e(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function kce(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function t$e(e){return j2e.has(e.toLowerCase())}function fc(e){return I2e.has(e.toLowerCase())}async function n$e(e,t,n,r,s){let i=Object.entries(t);for(let o=0;o(f==null?void 0:f.route.id)===a);if(!d)continue;let h=r.find(f=>f.route.id===d.route.id),u=h!=null&&!Pce(h,d)&&(s&&s[d.route.id])!==void 0;Zh(c)&&u&&await nW(c,n,!1).then(f=>{f&&(t[a]=f)})}}async function r$e(e,t,n){for(let r=0;r(d==null?void 0:d.route.id)===i)&&Zh(a)&&(sn(o,"Expected an AbortController for revalidating fetcher deferred result"),await nW(a,o.signal,!0).then(d=>{d&&(t[s]=d)}))}}async function nW(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:er.data,data:e.deferredData.unwrappedData}}catch(s){return{type:er.error,error:s}}return{type:er.data,data:e.deferredData.data}}}function rW(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function f1(e,t){let n=typeof t=="string"?Dp(t).search:t.search;if(e[e.length-1].route.index&&rW(n||""))return e[e.length-1];let r=Ece(e);return r[r.length-1]}function G7(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:i,json:o}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function j4(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function s$e(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function HS(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function i$e(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function sh(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function o$e(e,t){try{let n=e.sessionStorage.getItem(Rce);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function a$e(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(Rce,JSON.stringify(n))}catch(r){hx(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function px(){return px=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),C.useCallback(function(d,h){if(h===void 0&&(h={}),!a.current)return;if(typeof d=="number"){r.go(d);return}let u=wO(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Af([t,u.pathname])),(h.replace?r.replace:r.push)(u,h.state,h)},[t,r,o,i,e])}const u$e=C.createContext(null);function d$e(e){let t=C.useContext(zu).outlet;return t&&C.createElement(u$e.Provider,{value:e},t)}function f$e(){let{matches:e}=C.useContext(zu),t=e[e.length-1];return t?t.params:{}}function Ice(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(Op),{matches:s}=C.useContext(zu),{pathname:i}=Mp(),o=JSON.stringify(_O(s,r.v7_relativeSplatPath));return C.useMemo(()=>wO(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function h$e(e,t,n,r){Xx()||sn(!1);let{navigator:s,static:i}=C.useContext(Op),{matches:o}=C.useContext(zu),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let d=a?a.pathnameBase:"/";a&&a.route;let h=Mp(),u;u=h;let f=u.pathname||"/",g=f;if(d!=="/"){let x=d.replace(/^\//,"").split("/");g="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let v=!i&&n&&n.matches&&n.matches.length>0?n.matches:ig(e,{pathname:g});return y$e(v&&v.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Af([d,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Af([d,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),o,n,r)}function p$e(){let e=x$e(),t=DC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:s},n):null,null)}const m$e=C.createElement(p$e,null);class g$e extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(zu.Provider,{value:this.props.routeContext},C.createElement(Oce.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function v$e(e){let{routeContext:t,match:n,children:r}=e,s=C.useContext(SO);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(zu.Provider,{value:t},r)}function y$e(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let h=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);h>=0||sn(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,u,f)=>{let g,v=!1,m=null,x=null;n&&(g=a&&u.route.id?a[u.route.id]:void 0,m=u.route.errorElement||m$e,c&&(d<0&&f===0?(C$e("route-fallback"),v=!0,x=null):d===f&&(v=!0,x=u.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,f+1)),b=()=>{let w;return g?w=m:v?w=x:u.route.Component?w=C.createElement(u.route.Component,null):u.route.element?w=u.route.element:w=h,C.createElement(v$e,{match:u,routeContext:{outlet:h,matches:y,isDataRoute:n!=null},children:w})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?C.createElement(g$e,{location:n.location,revalidation:n.revalidation,component:m,error:g,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var Lce=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Lce||{}),jce=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(jce||{});function $ce(e){let t=C.useContext(SO);return t||sn(!1),t}function Fce(e){let t=C.useContext(Dce);return t||sn(!1),t}function b$e(e){let t=C.useContext(zu);return t||sn(!1),t}function zce(e){let t=b$e(),n=t.matches[t.matches.length-1];return n.route.id||sn(!1),n.route.id}function x$e(){var e;let t=C.useContext(Oce),n=Fce(),r=zce();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let _$e=0;function w$e(e){let{router:t,basename:n}=$ce(),r=Fce(),[s,i]=C.useState(""),o=C.useCallback(a=>{if(typeof e!="function")return!!e;if(n==="/")return e(a);let{currentLocation:c,nextLocation:d,historyAction:h}=a;return e({currentLocation:px({},c,{pathname:yp(c.pathname,n)||c.pathname}),nextLocation:px({},d,{pathname:yp(d.pathname,n)||d.pathname}),historyAction:h})},[n,e]);return C.useEffect(()=>{let a=String(++_$e);return i(a),()=>t.deleteBlocker(a)},[t]),C.useEffect(()=>{s!==""&&t.getBlocker(s,o)},[t,s,o]),s&&r.blockers.has(s)?r.blockers.get(s):Qy}function S$e(){let{router:e}=$ce(Lce.UseNavigateStable),t=zce(jce.UseNavigateStable),n=C.useRef(!1);return Mce(()=>{n.current=!0}),C.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,px({fromRouteId:t},i)))},[e,t])}const K7={};function C$e(e,t,n){K7[e]||(K7[e]=!0)}function E$e(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function Bce(e){let{to:t,replace:n,state:r,relative:s}=e;Xx()||sn(!1);let{future:i,static:o}=C.useContext(Op),{matches:a}=C.useContext(zu),{pathname:c}=Mp(),d=io(),h=wO(t,_O(a,i.v7_relativeSplatPath),c,s==="path"),u=JSON.stringify(h);return C.useEffect(()=>d(JSON.parse(u),{replace:n,state:r,relative:s}),[d,u,s,n,r]),null}function gP(e){return d$e(e.context)}function A$e(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Ns.Pop,navigator:i,static:o=!1,future:a}=e;Xx()&&sn(!1);let c=t.replace(/^\/*/,"/"),d=C.useMemo(()=>({basename:c,navigator:i,static:o,future:px({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=Dp(r));let{pathname:h="/",search:u="",hash:f="",state:g=null,key:v="default"}=r,m=C.useMemo(()=>{let x=yp(h,c);return x==null?null:{location:{pathname:x,search:u,hash:f,state:g,key:v},navigationType:s}},[c,h,u,f,g,v,s]);return m==null?null:C.createElement(Op.Provider,{value:d},C.createElement(sW.Provider,{children:n,value:m}))}new Promise(()=>{});function R$e(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:C.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function OC(){return OC=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function N$e(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function T$e(e,t){return e.button===0&&(!t||t==="_self")&&!N$e(e)}function OU(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function k$e(e,t){let n=OU(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const D$e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],O$e="6";try{window.__reactRouterVersion=O$e}catch{}function M$e(e,t){return U2e({basename:t==null?void 0:t.basename,future:OC({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:f2e({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||I$e(),routes:e,mapRouteProperties:R$e,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function I$e(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=OC({},t,{errors:L$e(t.errors)})),t}function L$e(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new HT(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const j$e=C.createContext({isTransitioning:!1}),$$e=C.createContext(new Map),F$e="startTransition",Y7=Tv[F$e],z$e="flushSync",X7=xve[z$e];function B$e(e){Y7?Y7(e):e()}function WS(e){X7?X7(e):e()}class U$e{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function V$e(e){let{fallbackElement:t,router:n,future:r}=e,[s,i]=C.useState(n.state),[o,a]=C.useState(),[c,d]=C.useState({isTransitioning:!1}),[h,u]=C.useState(),[f,g]=C.useState(),[v,m]=C.useState(),x=C.useRef(new Map),{v7_startTransition:y}=r||{},b=C.useCallback(A=>{y?B$e(A):A()},[y]),w=C.useCallback((A,D)=>{let{deletedFetchers:O,flushSync:I,viewTransitionOpts:$}=D;A.fetchers.forEach((B,W)=>{B.data!==void 0&&x.current.set(W,B.data)}),O.forEach(B=>x.current.delete(B));let F=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!$||F){I?WS(()=>i(A)):b(()=>i(A));return}if(I){WS(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:$.currentLocation,nextLocation:$.nextLocation})});let B=n.window.document.startViewTransition(()=>{WS(()=>i(A))});B.finished.finally(()=>{WS(()=>{u(void 0),g(void 0),a(void 0),d({isTransitioning:!1})})}),WS(()=>g(B));return}f?(h&&h.resolve(),f.skipTransition(),m({state:A,currentLocation:$.currentLocation,nextLocation:$.nextLocation})):(a(A),d({isTransitioning:!0,flushSync:!1,currentLocation:$.currentLocation,nextLocation:$.nextLocation}))},[n.window,f,h,x,b]);C.useLayoutEffect(()=>n.subscribe(w),[n,w]),C.useEffect(()=>{c.isTransitioning&&!c.flushSync&&u(new U$e)},[c]),C.useEffect(()=>{if(h&&o&&n.window){let A=o,D=h.promise,O=n.window.document.startViewTransition(async()=>{b(()=>i(A)),await D});O.finished.finally(()=>{u(void 0),g(void 0),a(void 0),d({isTransitioning:!1})}),g(O)}},[b,o,h,n.window]),C.useEffect(()=>{h&&o&&s.location.key===o.location.key&&h.resolve()},[h,f,s.location,o]),C.useEffect(()=>{!c.isTransitioning&&v&&(a(v.state),d({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),m(void 0))},[c.isTransitioning,v]),C.useEffect(()=>{},[]);let E=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:A=>n.navigate(A),push:(A,D,O)=>n.navigate(A,{state:D,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(A,D,O)=>n.navigate(A,{replace:!0,state:D,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),R=n.basename||"/",T=C.useMemo(()=>({router:n,navigator:E,static:!1,basename:R}),[n,E,R]),N=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.useEffect(()=>E$e(r,n.future),[r,n.future]),C.createElement(C.Fragment,null,C.createElement(SO.Provider,{value:T},C.createElement(Dce.Provider,{value:s},C.createElement($$e.Provider,{value:x.current},C.createElement(j$e.Provider,{value:c},C.createElement(A$e,{basename:R,location:s.location,navigationType:s.historyAction,navigator:E,future:N},s.initialized||n.future.v7_partialHydration?C.createElement(H$e,{routes:n.routes,future:n.future,state:s}):t))))),null)}const H$e=C.memo(W$e);function W$e(e){let{routes:t,future:n,state:r}=e;return h$e(t,void 0,r,n)}const q$e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G$e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bf=C.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:c,to:d,preventScrollReset:h,viewTransition:u}=t,f=P$e(t,D$e),{basename:g}=C.useContext(Op),v,m=!1;if(typeof d=="string"&&G$e.test(d)&&(v=d,q$e))try{let w=new URL(window.location.href),E=d.startsWith("//")?new URL(w.protocol+d):new URL(d),R=yp(E.pathname,g);E.origin===w.origin&&R!=null?d=R+E.search+E.hash:m=!0}catch{}let x=l$e(d,{relative:s}),y=K$e(d,{replace:o,state:a,target:c,preventScrollReset:h,relative:s,viewTransition:u});function b(w){r&&r(w),w.defaultPrevented||y(w)}return C.createElement("a",OC({},f,{href:v||x,onClick:m||i?r:b,ref:n,target:c}))});var Q7;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Q7||(Q7={}));var Z7;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Z7||(Z7={}));function K$e(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,c=io(),d=Mp(),h=Ice(e,{relative:o});return C.useCallback(u=>{if(T$e(u,n)){u.preventDefault();let f=r!==void 0?r:Kv(d)===Kv(h);c(e,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[d,c,h,r,s,n,e,i,o,a])}function Y$e(e){let t=C.useRef(OU(e)),n=C.useRef(!1),r=Mp(),s=C.useMemo(()=>k$e(r.search,n.current?null:t.current),[r.search]),i=io(),o=C.useCallback((a,c)=>{const d=OU(typeof a=="function"?a(s):a);n.current=!0,i("?"+d,c)},[i,s]);return[s,o]}const Uce=({isOpen:e,onCancel:t,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:o})=>_.jsx(JH,{open:e,children:_.jsxs(pD,{children:[_.jsxs(mD,{children:[_.jsx(vD,{children:r}),_.jsx(yD,{children:s})]}),_.jsxs(gD,{children:[_.jsx(xD,{children:_.jsx(bf,{to:"#",onClick:t,children:i})}),_.jsx(bD,{children:_.jsx(bf,{to:"#",onClick:n,children:o})})]})]})}),Bt=e=>typeof e=="string",qS=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},J7=e=>e==null?"":""+e,X$e=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Q$e=/###/g,eK=e=>e&&e.indexOf("###")>-1?e.replace(Q$e,"."):e,tK=e=>!e||Bt(e),B1=(e,t,n)=>{const r=Bt(t)?t.split("."):t;let s=0;for(;s{const{obj:r,k:s}=B1(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let i=t[t.length-1],o=t.slice(0,t.length-1),a=B1(e,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=B1(e,o,Object),a&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Z$e=(e,t,n,r)=>{const{obj:s,k:i}=B1(e,t,Object);s[i]=s[i]||[],s[i].push(n)},WT=(e,t)=>{const{obj:n,k:r}=B1(e,t);if(n)return n[r]},J$e=(e,t,n)=>{const r=WT(e,n);return r!==void 0?r:WT(t,n)},Vce=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Bt(e[r])||e[r]instanceof String||Bt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Vce(e[r],t[r],n):e[r]=t[r]);return e},By=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var eFe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const tFe=e=>Bt(e)?e.replace(/[&<>"'\/]/g,t=>eFe[t]):e;class nFe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const rFe=[" ",",","?","!",";"],sFe=new nFe(20),iFe=(e,t,n)=>{t=t||"",n=n||"";const r=rFe.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=sFe.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(e);if(!i){const o=e.indexOf(n);o>0&&!s.test(e.substring(0,o))&&(i=!0)}return i},MU=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let i=0;i-1&&ce&&e.replace("_","-"),oFe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class GT{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||oFe,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[a,c]=o;for(let d=0;d{let[a,c]=o;for(let d=0;d1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):Bt(r)&&i?a.push(...r.split(i)):a.push(r)));const c=WT(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!o||!Bt(r)?c:MU(this.data&&this.data[t]&&this.data[t][n],r,i)}addResource(t,n,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(a=t.split("."),s=n,n=a[1]),this.addNamespaces(n),nK(this.data,a,s),i.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(Bt(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=WT(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?Vce(c,r,i):c={...c,...r},nK(this.data,a,c),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var Hce={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(i=>{this.processors[i]&&(t=this.processors[i].process(t,n,r,s))}),t}};const sK={};class KT extends CO{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),X$e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=bu.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!iFe(t,r,s);if(o&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Bt(i)?[i]:i};const d=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(d[0])>-1)&&(i=d.shift()),t=d.join(s)}return{key:t,namespaces:Bt(i)?[i]:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],d=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(h){const E=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${E}${o}`,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${E}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const u=this.resolve(t,n);let f=u&&u.res;const g=u&&u.usedKey||o,v=u&&u.exactUsedKey||o,m=Object.prototype.toString.apply(f),x=["[object Number]","[object Function]","[object RegExp]"],y=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!Bt(f)&&typeof f!="boolean"&&typeof f!="number";if(b&&f&&w&&x.indexOf(m)<0&&!(Bt(y)&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const E=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,f,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(u.res=E,u.usedParams=this.getUsedParamsDetails(n),u):E}if(i){const E=Array.isArray(f),R=E?[]:{},T=E?v:g;for(const N in f)if(Object.prototype.hasOwnProperty.call(f,N)){const A=`${T}${i}${N}`;R[N]=this.translate(A,{...n,joinArrays:!1,ns:a}),R[N]===A&&(R[N]=f[N])}f=R}}else if(b&&Bt(y)&&Array.isArray(f))f=f.join(y),f&&(f=this.extendTranslation(f,t,n,r));else{let E=!1,R=!1;const T=n.count!==void 0&&!Bt(n.count),N=KT.hasDefaultValue(n),A=T?this.pluralResolver.getSuffix(d,n.count,n):"",D=n.ordinal&&T?this.pluralResolver.getSuffix(d,n.count,{ordinal:!1}):"",O=T&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),I=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${D}`]||n.defaultValue;!this.isValidLookup(f)&&N&&(E=!0,f=I),this.isValidLookup(f)||(R=!0,f=o);const F=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:f,B=N&&I!==f&&this.options.updateMissing;if(R||E||B){if(this.logger.log(B?"updateKey":"missingKey",d,c,o,B?I:f),i){const H=this.resolve(o,{...n,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const Z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Z&&Z[0])for(let H=0;H{const re=N&&he!==f?he:F;this.options.missingKeyHandler?this.options.missingKeyHandler(H,c,se,re,B,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,c,se,re,B,n),this.emit("missingKey",H,c,se,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?W.forEach(H=>{const se=this.pluralResolver.getSuffixes(H,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&se.indexOf(`${this.options.pluralSeparator}zero`)<0&&se.push(`${this.options.pluralSeparator}zero`),se.forEach(he=>{Y([H],o+he,n[`defaultValue${he}`]||I)})}):Y(W,o,I))}f=this.extendTranslation(f,t,n,u,r),R&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(R||E)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,E?f:void 0):f=this.options.parseMissingKeyHandler(f))}return s?(u.res=f,u.usedParams=this.getUsedParamsDetails(n),u):f}extendTranslation(t,n,r,s,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=Bt(t)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const f=t.match(this.interpolator.nestingRegexp);h=f&&f.length}let u=r.replace&&!Bt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),t=this.interpolator.interpolate(t,u,r.lng||this.language||s.usedLng,r),d){const f=t.match(this.interpolator.nestingRegexp),g=f&&f.length;h1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,o,a;return Bt(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(c,n),h=d.key;s=h;let u=d.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const f=n.count!==void 0&&!Bt(n.count),g=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),v=n.context!==void 0&&(Bt(n.context)||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);u.forEach(x=>{this.isValidLookup(r)||(a=x,!sK[`${m[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(sK[`${m[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(y=>{if(this.isValidLookup(r))return;o=y;const b=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(b,h,y,x,n);else{let E;f&&(E=this.pluralResolver.getSuffix(y,n.count,n));const R=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(b.push(h+E),n.ordinal&&E.indexOf(T)===0&&b.push(h+E.replace(T,this.options.pluralSeparator)),g&&b.push(h+R)),v){const N=`${h}${this.options.contextSeparator}${n.context}`;b.push(N),f&&(b.push(N+E),n.ordinal&&E.indexOf(T)===0&&b.push(N+E.replace(T,this.options.pluralSeparator)),g&&b.push(N+R))}}let w;for(;w=b.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(y,x,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Bt(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const $4=e=>e.charAt(0).toUpperCase()+e.slice(1);class iK{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=bu.create("languageUtils")}getScriptPartFromCode(t){if(t=qT(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=qT(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Bt(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(t)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=$4(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=$4(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=$4(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Bt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Bt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):Bt(t)&&i(this.formatLanguageCode(t)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}let aFe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],lFe={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const cFe=["v1","v2","v3"],uFe=["v4"],oK={zero:0,one:1,two:2,few:3,many:4,other:5},dFe=()=>{const e={};return aFe.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:lFe[t.fc]}})}),e};class fFe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=bu.create("pluralResolver"),(!this.options.compatibilityJSON||uFe.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=dFe(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=qT(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!t.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[i]=o,o}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,i)=>oK[s]-oK[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const i=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!cFe.includes(this.options.compatibilityJSON)}}const aK=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=J$e(e,t,n);return!i&&s&&Bt(n)&&(i=MU(e,n,r),i===void 0&&(i=MU(t,n,r))),i},F4=e=>e.replace(/\$/g,"$$$$");class hFe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=bu.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:d,unescapeSuffix:h,unescapePrefix:u,nestingPrefix:f,nestingPrefixEscaped:g,nestingSuffix:v,nestingSuffixEscaped:m,nestingOptionsSeparator:x,maxReplaces:y,alwaysFormat:b}=t.interpolation;this.escape=n!==void 0?n:tFe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?By(i):o||"{{",this.suffix=a?By(a):c||"}}",this.formatSeparator=d||",",this.unescapePrefix=h?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=f?By(f):g||By("$t("),this.nestingSuffix=v?By(v):m||By(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=g=>{if(g.indexOf(this.formatSeparator)<0){const y=aK(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...s,...n,interpolationkey:g}):y}const v=g.split(this.formatSeparator),m=v.shift().trim(),x=v.join(this.formatSeparator).trim();return this.format(aK(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...s,...n,interpolationkey:m})};this.resetRegExp();const h=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,u=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>F4(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?F4(this.escape(g)):F4(g)}].forEach(g=>{for(a=0;i=g.regex.exec(t);){const v=i[1].trim();if(o=d(v),o===void 0)if(typeof h=="function"){const x=h(t,i,s);o=Bt(x)?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,v))o="";else if(u){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),o="";else!Bt(o)&&!this.useRawValueToEscape&&(o=J7(o));const m=g.safeValue(o);if(t=t.replace(i[0],m),u?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;const a=(c,d)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const u=c.split(new RegExp(`${h}[ ]*{`));let f=`{${u[1]}`;c=u[0],f=this.interpolate(f,o);const g=f.match(/'/g),v=f.match(/"/g);(g&&g.length%2===0&&!v||v.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),d&&(o={...d,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${h}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(t);){let c=[];o={...r},o=o.replace&&!Bt(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const h=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=h.shift(),c=h,d=!0}if(i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===t&&!Bt(i))return i;Bt(i)||(i=J7(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),i=""),d&&(i=c.reduce((h,u)=>this.format(h,u,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),t=t.replace(s[0],i),this.regexp.lastIndex=0}return t}}const pFe=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),d=c.join(":").trim().replace(/^'+|'+$/g,""),h=a.trim();n[h]||(n[h]=d),d==="false"&&(n[h]=!1),d==="true"&&(n[h]=!0),isNaN(d)||(n[h]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},Uy=e=>{const t={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=t[o];return a||(a=e(qT(r),s),t[o]=a),a(n)}};class mFe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=bu.create("formatter"),this.options=t,this.formats={number:Uy((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Uy((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Uy((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Uy((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Uy((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Uy(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{const{formatName:d,formatOptions:h}=pFe(c);if(this.formats[d]){let u=a;try{const f=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},g=f.locale||f.lng||s.locale||s.lng||r;u=this.formats[d](a,g,{...h,...s,...f})}catch(f){this.logger.warn(f)}return u}else this.logger.warn(`there was no format function for ${d}`);return a},t)}}const gFe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class vFe extends CO{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=bu.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const i={},o={},a={},c={};return t.forEach(d=>{let h=!0;n.forEach(u=>{const f=`${d}|${u}`;!r.reload&&this.store.hasResourceBundle(d,u)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,h=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),c[u]===void 0&&(c[u]=!0)))}),h||(a[d]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const s=t.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(c=>{Z$e(c.loaded,[i],o),gFe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(d=>{a[d]||(a[d]={});const h=c.loaded[d];h.length&&h.forEach(u=>{a[d][u]===void 0&&(a[d][u]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(d,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(d&&h&&s{this.read.call(this,t,n,r,s+1,i*2,o)},i);return}o(d,h)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const d=c(t,n);d&&typeof d.then=="function"?d.then(h=>a(null,h)).catch(a):a(null,d)}catch(d){a(d)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Bt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Bt(n)&&(n=[n]);const i=this.queueLoad(t,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(t,o,a)})}saveMissing(t,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:i},d=this.backend.create.bind(this.backend);if(d.length<6)try{let h;d.length===5?h=d(t,n,r,s,c):h=d(t,n,r,s),h&&typeof h.then=="function"?h.then(u=>a(null,u)).catch(a):a(null,h)}catch(h){a(h)}else d(t,n,r,s,a,c)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const lK=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Bt(e[1])&&(t.defaultValue=e[1]),Bt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),cK=e=>(Bt(e.ns)&&(e.ns=[e.ns]),Bt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Bt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),vP=()=>{},yFe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class MC extends CO{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=cK(t),this.services={},this.logger=bu,this.modules={external:[]},yFe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(Bt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=lK();this.options={...s,...this.options,...cK(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const i=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?bu.init(i(this.modules.logger),this.options):bu.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=mFe);const u=new iK(this.options);this.store=new rK(this.options.resources,this.options);const f=this.services;f.logger=bu,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new fFe(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=i(h),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new hFe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new vFe(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var v=arguments.length,m=new Array(v>1?v-1:0),x=1;x1?v-1:0),x=1;x{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,r||(r=vP),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const c=qS(),d=()=>{const h=(u,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),r(u,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vP;const s=Bt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(d=>{d!=="cimode"&&i.indexOf(d)<0&&i.push(d)})};s?o(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const s=qS();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=vP),this.services.backendConnector.reload(t,n,i=>{s.resolve(),r(i)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Hce.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=qS();this.emit("languageChanging",t);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,d)=>{d?(i(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const d=Bt(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(d)),this.loadResources(d,h=>{o(h,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),s}getFixedT(t,n,r){var s=this;const i=function(o,a){let c;if(typeof a!="object"){for(var d=arguments.length,h=new Array(d>2?d-2:0),u=2;u`${c.keyPrefix}${f}${v}`):g=c.keyPrefix?`${c.keyPrefix}${f}${o}`:o,s.t(g,c)};return Bt(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const d=this.services.backendConnector.state[`${a}|${c}`];return d===-1||d===0||d===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!s||o(i,t)))}loadNamespaces(t,n){const r=qS();return this.options.ns?(Bt(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=qS();Bt(t)&&(t=[t]);const s=this.options.preload||[],i=t.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new iK(lK());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new MC(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vP;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},i=new MC(s);return(t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new rK(this.store.data,s),i.services.resourceStore=i.store),i.translator=new KT(i.services,s),i.translator.on("*",function(a){for(var c=arguments.length,d=new Array(c>1?c-1:0),h=1;h{const[t,n]=C.useState(!1),[r,s]=C.useState({title:"Título",description:"Descripción",cancelLabel:ue("common.no"),confirmLabel:ue("common.yes"),onCancel:()=>{},onConfirm:()=>{},...e}),i=(d,h)=>{d==null||d.preventDefault(),h&&s(h),n(!0)},o=d=>{d==null||d.preventDefault(),n(!1),r==null||r.onCancel(d)},a=d=>{d==null||d.preventDefault(),n(!1),r==null||r.onConfirm(d)},c=r?_.jsx(Uce,{isOpen:t,onCancel:o,onConfirm:a,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):_.jsx(_.Fragment,{});return{openDialog:i,cancelDialog:o,confirmDialog:a,DialogComponent:c}};var Wce={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9474),h=o(1687),u=o(8652),f=o(8160),g=o(3292),v=o(6354),m=o(8901),x=o(9708),y=o(6914),b=o(2294),w=o(6133),E=o(1152),R=o(8863),T=o(2036),N={Base:class{constructor(A){this.type=A,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new b.Ids,this._preferences=null,this._refs=new w.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof x.describe=="function","Manifest functionality disabled"),x.describe(this)}allow(...A){return f.verifyFlat(A,"allow"),this._values(A,"_valids")}alter(A){a(A&&typeof A=="object"&&!Array.isArray(A),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const D=this.clone();D.$_terms.alterations=D.$_terms.alterations||[];for(const O in A){const I=A[O];a(typeof I=="function","Alteration adjuster for",O,"must be a function"),D.$_terms.alterations.push({target:O,adjuster:I})}return D.$_temp.ruleset=!1,D}artifact(A){return a(A!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",A)}cast(A){return a(A===!1||typeof A=="string","Invalid to value"),a(A===!1||this._definition.cast[A],"Type",this.type,"does not support casting to",A),this.$_setFlag("cast",A===!1?void 0:A)}default(A,D){return this._default("default",A,D)}description(A){return a(A&&typeof A=="string","Description must be a non-empty string"),this.$_setFlag("description",A)}empty(A){const D=this.clone();return A!==void 0&&(A=D.$_compile(A,{override:!1})),D.$_setFlag("empty",A,{clone:!1})}error(A){return a(A,"Missing error"),a(A instanceof Error||typeof A=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",A)}example(A,D={}){return a(A!==void 0,"Missing example"),f.assertOptions(D,["override"]),this._inner("examples",A,{single:!0,override:D.override})}external(A,D){return typeof A=="object"&&(a(!D,"Cannot combine options with description"),D=A.description,A=A.method),a(typeof A=="function","Method must be a function"),a(D===void 0||D&&typeof D=="string","Description must be a non-empty string"),this._inner("externals",{method:A,description:D},{single:!0})}failover(A,D){return this._default("failover",A,D)}forbidden(){return this.presence("forbidden")}id(A){return A?(a(typeof A=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(A),"id cannot contain period character"),this.$_setFlag("id",A)):this.$_setFlag("id",void 0)}invalid(...A){return this._values(A,"_invalids")}label(A){return a(A&&typeof A=="string","Label name must be a non-empty string"),this.$_setFlag("label",A)}meta(A){return a(A!==void 0,"Meta cannot be undefined"),this._inner("metas",A,{single:!0})}note(...A){a(A.length,"Missing notes");for(const D of A)a(D&&typeof D=="string","Notes must be non-empty strings");return this._inner("notes",A)}only(A=!0){return a(typeof A=="boolean","Invalid mode:",A),this.$_setFlag("only",A)}optional(){return this.presence("optional")}prefs(A){a(A,"Missing preferences"),a(A.context===void 0,"Cannot override context"),a(A.externals===void 0,"Cannot override externals"),a(A.warnings===void 0,"Cannot override warnings"),a(A.debug===void 0,"Cannot override debug"),f.checkPreferences(A);const D=this.clone();return D._preferences=f.preferences(D._preferences,A),D}presence(A){return a(["optional","required","forbidden"].includes(A),"Unknown presence mode",A),this.$_setFlag("presence",A)}raw(A=!0){return this.$_setFlag("result",A?"raw":void 0)}result(A){return a(["raw","strip"].includes(A),"Unknown result mode",A),this.$_setFlag("result",A)}required(){return this.presence("required")}strict(A){const D=this.clone(),O=A!==void 0&&!A;return D._preferences=f.preferences(D._preferences,{convert:O}),D}strip(A=!0){return this.$_setFlag("result",A?"strip":void 0)}tag(...A){a(A.length,"Missing tags");for(const D of A)a(D&&typeof D=="string","Tags must be non-empty strings");return this._inner("tags",A)}unit(A){return a(A&&typeof A=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",A)}valid(...A){f.verifyFlat(A,"valid");const D=this.allow(...A);return D.$_setFlag("only",!!D._valids,{clone:!1}),D}when(A,D){const O=this.clone();O.$_terms.whens||(O.$_terms.whens=[]);const I=g.when(O,A,D);if(!["any","link"].includes(O.type)){const $=I.is?[I]:I.switch;for(const F of $)a(!F.then||F.then.type==="any"||F.then.type===O.type,"Cannot combine",O.type,"with",F.then&&F.then.type),a(!F.otherwise||F.otherwise.type==="any"||F.otherwise.type===O.type,"Cannot combine",O.type,"with",F.otherwise&&F.otherwise.type)}return O.$_terms.whens.push(I),O.$_mutateRebuild()}cache(A){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const D=this.clone();return D._cache=A||u.provider.provision(),D.$_temp.ruleset=!1,D}clone(){const A=Object.create(Object.getPrototypeOf(this));return this._assign(A)}concat(A){a(f.isSchema(A),"Invalid schema object"),a(this.type==="any"||A.type==="any"||A.type===this.type,"Cannot merge type",this.type,"with another type:",A.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!A._inRuleset(),"Cannot concatenate a schema with open ruleset");let D=this.clone();if(this.type==="any"&&A.type!=="any"){const O=A.clone();for(const I of Object.keys(D))I!=="type"&&(O[I]=D[I]);D=O}D._ids.concat(A._ids),D._refs.register(A,w.toSibling),D._preferences=D._preferences?f.preferences(D._preferences,A._preferences):A._preferences,D._valids=T.merge(D._valids,A._valids,A._invalids),D._invalids=T.merge(D._invalids,A._invalids,A._valids);for(const O of A._singleRules.keys())D._singleRules.has(O)&&(D._rules=D._rules.filter(I=>I.keep||I.name!==O),D._singleRules.delete(O));for(const O of A._rules)A._definition.rules[O.method].multi||D._singleRules.set(O.name,O),D._rules.push(O);if(D._flags.empty&&A._flags.empty){D._flags.empty=D._flags.empty.concat(A._flags.empty);const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else if(A._flags.empty){D._flags.empty=A._flags.empty;const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else h(D._flags,A._flags);for(const O in A.$_terms){const I=A.$_terms[O];I?D.$_terms[O]?D.$_terms[O]=D.$_terms[O].concat(I):D.$_terms[O]=I.slice():D.$_terms[O]||(D.$_terms[O]=I)}return this.$_root._tracer&&this.$_root._tracer._combine(D,[this,A]),D.$_mutateRebuild()}extend(A){return a(!A.base,"Cannot extend type with another base"),m.type(this,A)}extract(A){return A=Array.isArray(A)?A:A.split("."),this._ids.reach(A)}fork(A,D){a(!this._inRuleset(),"Cannot fork inside a ruleset");let O=this;for(let I of[].concat(A))I=Array.isArray(I)?I:I.split("."),O=O._ids.fork(I,D,O);return O.$_temp.ruleset=!1,O}rule(A){const D=this._definition;f.assertOptions(A,Object.keys(D.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const O=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(O>=0&&OO.tailor(A),ref:!1}),D.$_temp.ruleset=!1,D.$_mutateRebuild()}tracer(){return E.location?E.location(this):this}validate(A,D){return R.entry(A,this,D)}validateAsync(A,D){return R.entryAsync(A,this,D)}$_addRule(A){typeof A=="string"&&(A={name:A}),a(A&&typeof A=="object","Invalid options"),a(A.name&&typeof A.name=="string","Invalid rule name");for(const F in A)a(F[0]!=="_","Cannot set private rule properties");const D=Object.assign({},A);D._resolve=[],D.method=D.method||D.name;const O=this._definition.rules[D.method],I=D.args;a(O,"Unknown rule",D.method);const $=this.clone();if(I){a(Object.keys(I).length===1||Object.keys(I).length===this._definition.rules[D.name].args.length,"Invalid rule definition for",this.type,D.name);for(const F in I){let B=I[F];if(O.argsByName){const W=O.argsByName.get(F);if(W.ref&&f.isResolvable(B))D._resolve.push(F),$.$_mutateRegister(B);else if(W.normalize&&(B=W.normalize(B),I[F]=B),W.assert){const Z=f.validateArg(B,F,W);a(!Z,Z,"or reference")}}B!==void 0?I[F]=B:delete I[F]}}return O.multi||($._ruleRemove(D.name,{clone:!1}),$._singleRules.set(D.name,D)),$.$_temp.ruleset===!1&&($.$_temp.ruleset=null),O.priority?$._rules.unshift(D):$._rules.push(D),$}$_compile(A,D){return g.schema(this.$_root,A,D)}$_createError(A,D,O,I,$,F={}){const B=F.flags!==!1?this._flags:{},W=F.messages?y.merge(this._definition.messages,F.messages):this._definition.messages;return new v.Report(A,D,O,B,W,I,$)}$_getFlag(A){return this._flags[A]}$_getRule(A){return this._singleRules.get(A)}$_mapLabels(A){return A=Array.isArray(A)?A:A.split("."),this._ids.labels(A)}$_match(A,D,O,I){(O=Object.assign({},O)).abortEarly=!0,O._externals=!1,D.snapshot();const $=!R.validate(A,this,D,O,I).errors;return D.restore(),$}$_modify(A){return f.assertOptions(A,["each","once","ref","schema"]),b.schema(this,A)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(A,{source:D,name:O,path:I,key:$})=>{const F=this._definition[D][O]&&this._definition[D][O].register;F!==!1&&this.$_mutateRegister(A,{family:F,key:$})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(A,{family:D,key:O}={}){this._refs.register(A,D),this._ids.register(A,{key:O})}$_property(A){return this._definition.properties[A]}$_reach(A){return this._ids.reach(A)}$_rootReferences(){return this._refs.roots()}$_setFlag(A,D,O={}){a(A[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const I=this._definition.flags[A]||{};if(d(D,I.default)&&(D=void 0),d(D,this._flags[A]))return this;const $=O.clone!==!1?this.clone():this;return D!==void 0?($._flags[A]=D,$.$_mutateRegister(D)):delete $._flags[A],A[0]!=="_"&&($.$_temp.ruleset=!1),$}$_parent(A,...D){return this[A][f.symbols.parent].call(this,...D)}$_validate(A,D,O){return R.validate(A,this,D,O)}_assign(A){A.type=this.type,A.$_root=this.$_root,A.$_temp=Object.assign({},this.$_temp),A.$_temp.whens={},A._ids=this._ids.clone(),A._preferences=this._preferences,A._valids=this._valids&&this._valids.clone(),A._invalids=this._invalids&&this._invalids.clone(),A._rules=this._rules.slice(),A._singleRules=c(this._singleRules,{shallow:!0}),A._refs=this._refs.clone(),A._flags=Object.assign({},this._flags),A._cache=null,A.$_terms={};for(const D in this.$_terms)A.$_terms[D]=this.$_terms[D]?this.$_terms[D].slice():null;A.$_super={};for(const D in this.$_super)A.$_super[D]=this._super[D].bind(A);return A}_bare(){const A=this.clone();A._reset();const D=A._definition.terms;for(const O in D){const I=D[O];A.$_terms[O]=I.init}return A.$_mutateRebuild()}_default(A,D,O={}){return f.assertOptions(O,"literal"),a(D!==void 0,"Missing",A,"value"),a(typeof D=="function"||!O.literal,"Only function value supports literal option"),typeof D=="function"&&O.literal&&(D={[f.symbols.literal]:!0,literal:D}),this.$_setFlag(A,D)}_generate(A,D,O){if(!this.$_terms.whens)return{schema:this};const I=[],$=[];for(let W=0;Wse)break}const F=$.join(", ");if(D.mainstay.tracer.debug(D,"rule","when",F),!F)return{schema:this};if(!D.mainstay.tracer.active&&this.$_temp.whens[F])return{schema:this.$_temp.whens[F],id:F};let B=this;this._definition.generate&&(B=this._definition.generate(this,A,D,O));for(const W of I)B=B.concat(W);return this.$_root._tracer&&this.$_root._tracer._combine(B,[this,...I]),this.$_temp.whens[F]=B,{schema:B,id:F}}_inner(A,D,O={}){a(!this._inRuleset(),`Cannot set ${A} inside a ruleset`);const I=this.clone();return I.$_terms[A]&&!O.override||(I.$_terms[A]=[]),O.single?I.$_terms[A].push(D):I.$_terms[A].push(...D),I.$_temp.ruleset=!1,I}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(A,D={}){if(!this._singleRules.has(A))return this;const O=D.clone!==!1?this.clone():this;O._singleRules.delete(A);const I=[];for(let $=0;${const a=o(375),c=o(8571),d=o(8160),h={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:u=>new h.Cache(u)},h.Cache=class{constructor(u={}){d.assertOptions(u,["max"]),a(u.max===void 0||u.max&&u.max>0&&isFinite(u.max),"Invalid max cache size"),this._max=u.max||h.max,this._map=new Map,this._list=new h.List}get length(){return this._map.size}set(u,f){if(u!==null&&!h.supported.has(typeof u))return;let g=this._map.get(u);if(g)return g.value=f,void this._list.first(g);g=this._list.unshift({key:u,value:f}),this._map.set(u,g),this._compact()}get(u){const f=this._map.get(u);if(f)return this._list.first(f),c(f.value)}_compact(){if(this._map.size>this._max){const u=this._list.pop();this._map.delete(u.key)}}},h.List=class{constructor(){this.tail=null,this.head=null}unshift(u){return u.next=null,u.prev=this.head,this.head&&(this.head.next=u),this.head=u,this.tail||(this.tail=u),u}first(u){u!==this.head&&(this._remove(u),this.unshift(u))}pop(){return this._remove(this.tail)}_remove(u){const{next:f,prev:g}=u;return f.prev=g,g&&(g.next=f),u===this.tail&&(this.tail=f),u.prev=null,u.next=null,u}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),d=o(5934);let h,u;const f={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=d.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(g,v,m="Options"){a(g&&typeof g=="object"&&!Array.isArray(g),"Options must be of type object");const x=Object.keys(g).filter(y=>!v.includes(y));a(x.length===0,`${m} contain unknown keys: ${x}`)},i.checkPreferences=function(g){u=u||o(3378);const v=u.preferences.validate(g);if(v.error)throw new c([v.error.details[0].message])},i.compare=function(g,v,m){switch(m){case"=":return g===v;case">":return g>v;case"<":return g=":return g>=v;case"<=":return g<=v}},i.default=function(g,v){return g===void 0?v:g},i.isIsoDate=function(g){return f.isoDate.test(g)},i.isNumber=function(g){return typeof g=="number"&&!isNaN(g)},i.isResolvable=function(g){return!!g&&(g[i.symbols.ref]||g[i.symbols.template])},i.isSchema=function(g,v={}){const m=g&&g[i.symbols.any];return!!m&&(a(v.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(g){return g[i.symbols.values]},i.limit=function(g){return Number.isSafeInteger(g)&&g>=0},i.preferences=function(g,v){h=h||o(6914),g=g||{},v=v||{};const m=Object.assign({},g,v);return v.errors&&g.errors&&(m.errors=Object.assign({},g.errors,v.errors),m.errors.wrap=Object.assign({},g.errors.wrap,v.errors.wrap)),v.messages&&(m.messages=h.compile(v.messages,g.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(g,v,m={}){try{return g()}catch(x){throw x.path!==void 0?x.path=v+"."+x.path:x.path=v,m.append&&(x.message=`${x.message} (${x.path})`),x}},i.validateArg=function(g,v,{assert:m,message:x}){if(i.isSchema(m)){const y=m.validate(g);return y.error?y.error.message:void 0}if(!m(g))return v?`${v} ${x}`:x},i.verifyFlat=function(g,v){for(const m of g)a(!Array.isArray(m),"Method no longer accepts array arguments:",v)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.schema=function(u,f,g={}){c.assertOptions(g,["appendPath","override"]);try{return h.schema(u,f,g)}catch(v){throw g.appendPath&&v.path!==void 0&&(v.message=`${v.message} (${v.path})`),v}},h.schema=function(u,f,g){a(f!==void 0,"Invalid undefined schema"),Array.isArray(f)&&(a(f.length,"Invalid empty array schema"),f.length===1&&(f=f[0]));const v=(m,...x)=>g.override!==!1?m.valid(u.override,...x):m.valid(...x);if(h.simple(f))return v(u,f);if(typeof f=="function")return u.custom(f);if(a(typeof f=="object","Invalid schema content:",typeof f),c.isResolvable(f))return v(u,f);if(c.isSchema(f))return f;if(Array.isArray(f)){for(const m of f)if(!h.simple(m))return u.alternatives().try(...f);return v(u,...f)}return f instanceof RegExp?u.string().regex(f):f instanceof Date?v(u.date(),f):(a(Object.getPrototypeOf(f)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),u.object().keys(f))},i.ref=function(u,f){return d.isRef(u)?u:d.create(u,f)},i.compile=function(u,f,g={}){c.assertOptions(g,["legacy"]);const v=f&&f[c.symbols.any];if(v)return a(g.legacy||v.version===c.version,"Cannot mix different versions of joi schemas:",v.version,c.version),f;if(typeof f!="object"||!g.legacy)return i.schema(u,f,{appendPath:!0});const m=h.walk(f);return m?m.compile(m.root,f):i.schema(u,f,{appendPath:!0})},h.walk=function(u){if(typeof u!="object")return null;if(Array.isArray(u)){for(const g of u){const v=h.walk(g);if(v)return v}return null}const f=u[c.symbols.any];if(f)return{root:u[f.root],compile:f.compile};a(Object.getPrototypeOf(u)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const g in u){const v=h.walk(u[g]);if(v)return v}return null},h.simple=function(u){return u===null||["boolean","string","number"].includes(typeof u)},i.when=function(u,f,g){if(g===void 0&&(a(f&&typeof f=="object","Missing options"),g=f,f=d.create(".")),Array.isArray(g)&&(g={switch:g}),c.assertOptions(g,["is","not","then","otherwise","switch","break"]),c.isSchema(f))return a(g.is===void 0,'"is" can not be used with a schema condition'),a(g.not===void 0,'"not" can not be used with a schema condition'),a(g.switch===void 0,'"switch" can not be used with a schema condition'),h.condition(u,{is:f,then:g.then,otherwise:g.otherwise,break:g.break});if(a(d.isRef(f)||typeof f=="string","Invalid condition:",f),a(g.not===void 0||g.is===void 0,'Cannot combine "is" with "not"'),g.switch===void 0){let m=g;g.not!==void 0&&(m={is:g.not,then:g.otherwise,otherwise:g.then,break:g.break});let x=m.is!==void 0?u.$_compile(m.is):u.$_root.invalid(null,!1,0,"").required();return a(m.then!==void 0||m.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(m.break===void 0||m.then===void 0||m.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),g.is===void 0||d.isRef(g.is)||c.isSchema(g.is)||(x=x.required()),h.condition(u,{ref:i.ref(f),is:x,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(g.switch),'"switch" must be an array'),a(g.is===void 0,'Cannot combine "switch" with "is"'),a(g.not===void 0,'Cannot combine "switch" with "not"'),a(g.then===void 0,'Cannot combine "switch" with "then"');const v={ref:i.ref(f),switch:[],break:g.break};for(let m=0;m{const a=o(5688),c=o(8160),d=o(3328);i.Report=class{constructor(h,u,f,g,v,m,x){if(this.code=h,this.flags=g,this.messages=v,this.path=m.path,this.prefs=x,this.state=m,this.value=u,this.message=null,this.template=null,this.local=f||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const y=this.path[this.path.length-1];typeof y!="object"&&(this.local.key=y)}}_setTemplate(h){if(this.template=h,!this.flags.label&&this.path.length===0){const u=this._template(this.template,"root");u&&(this.local.label=u)}}toString(){if(this.message)return this.message;const h=this.code;if(!this.prefs.errors.render)return this.code;const u=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return u===void 0?`Error code "${h}" is not defined, your custom type is missing the correct messages definition`:(this.message=u.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(h,u){return i.template(this.value,h,u||this.code,this.state,this.prefs)}},i.path=function(h){let u="";for(const f of h)typeof f!="object"&&(typeof f=="string"?(u&&(u+="."),u+=f):u+=`[${f}]`);return u},i.template=function(h,u,f,g,v){if(!u)return;if(d.isTemplate(u))return f!=="root"?u:null;let m=v.errors.language;if(c.isResolvable(m)&&(m=m.resolve(h,g,v)),m&&u[m]){if(u[m][f]!==void 0)return u[m][f];if(u[m]["*"]!==void 0)return u[m]["*"]}return u[f]?u[f]:u["*"]},i.label=function(h,u,f,g){if(!f.errors.label)return"";if(h.label)return h.label;let v=u.path;return f.errors.label==="key"&&u.path.length>1&&(v=u.path.slice(-1)),i.path(v)||i.template(null,f.messages,"root",u,f)||g&&i.template(null,g,"root",u,f)||"value"},i.process=function(h,u,f){if(!h)return null;const{override:g,message:v,details:m}=i.details(h);if(g)return g;if(f.errors.stack)return new i.ValidationError(v,m,u);const x=Error.stackTraceLimit;Error.stackTraceLimit=0;const y=new i.ValidationError(v,m,u);return Error.stackTraceLimit=x,y},i.details=function(h,u={}){let f=[];const g=[];for(const v of h){if(v instanceof Error){if(u.override!==!1)return{override:v};const x=v.toString();f.push(x),g.push({message:x,type:"override",context:{error:v}});continue}const m=v.toString();f.push(m),g.push({message:m,path:v.path.filter(x=>typeof x!="object"),type:v.code,context:v.local})}return f.length>1&&(f=[...new Set(f)]),{message:f.join(". "),details:g}},i.ValidationError=class extends Error{constructor(h,u,f){super(h),this._original=f,this.details=u}static isError(h){return h instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),h=o(6914),u={};i.type=function(f,g){const v=Object.getPrototypeOf(f),m=c(v),x=f._assign(Object.create(m)),y=Object.assign({},g);delete y.base,m._definition=y;const b=v._definition||{};y.messages=h.merge(b.messages,y.messages),y.properties=Object.assign({},b.properties,y.properties),x.type=y.type,y.flags=Object.assign({},b.flags,y.flags);const w=Object.assign({},b.terms);if(y.terms)for(const N in y.terms){const A=y.terms[N];a(x.$_terms[N]===void 0,"Invalid term override for",y.type,N),x.$_terms[N]=A.init,w[N]=A}y.terms=w,y.args||(y.args=b.args),y.prepare=u.prepare(y.prepare,b.prepare),y.coerce&&(typeof y.coerce=="function"&&(y.coerce={method:y.coerce}),y.coerce.from&&!Array.isArray(y.coerce.from)&&(y.coerce={method:y.coerce.method,from:[].concat(y.coerce.from)})),y.coerce=u.coerce(y.coerce,b.coerce),y.validate=u.validate(y.validate,b.validate);const E=Object.assign({},b.rules);if(y.rules)for(const N in y.rules){const A=y.rules[N];a(typeof A=="object","Invalid rule definition for",y.type,N);let D=A.method;if(D===void 0&&(D=function(){return this.$_addRule(N)}),D&&(a(!m[N],"Rule conflict in",y.type,N),m[N]=D),a(!E[N],"Rule conflict in",y.type,N),E[N]=A,A.alias){const O=[].concat(A.alias);for(const I of O)m[I]=A.method}A.args&&(A.argsByName=new Map,A.args=A.args.map(O=>(typeof O=="string"&&(O={name:O}),a(!A.argsByName.has(O.name),"Duplicated argument name",O.name),d.isSchema(O.assert)&&(O.assert=O.assert.strict().label(O.name)),A.argsByName.set(O.name,O),O)))}y.rules=E;const R=Object.assign({},b.modifiers);if(y.modifiers)for(const N in y.modifiers){a(!m[N],"Rule conflict in",y.type,N);const A=y.modifiers[N];a(typeof A=="function","Invalid modifier definition for",y.type,N);const D=function(O){return this.rule({[N]:O})};m[N]=D,R[N]=A}if(y.modifiers=R,y.overrides){m._super=v,x.$_super={};for(const N in y.overrides)a(v[N],"Cannot override missing",N),y.overrides[N][d.symbols.parent]=v[N],x.$_super[N]=v[N].bind(x);Object.assign(m,y.overrides)}y.cast=Object.assign({},b.cast,y.cast);const T=Object.assign({},b.manifest,y.manifest);return T.build=u.build(y.manifest&&y.manifest.build,b.manifest&&b.manifest.build),y.manifest=T,y.rebuild=u.rebuild(y.rebuild,b.rebuild),x},u.build=function(f,g){return f&&g?function(v,m){return g(f(v,m),m)}:f||g},u.coerce=function(f,g){return f&&g?{from:f.from&&g.from?[...new Set([...f.from,...g.from])]:null,method(v,m){let x;if((!g.from||g.from.includes(typeof v))&&(x=g.method(v,m),x)){if(x.errors||x.value===void 0)return x;v=x.value}if(!f.from||f.from.includes(typeof v)){const y=f.method(v,m);if(y)return y}return x}}:f||g},u.prepare=function(f,g){return f&&g?function(v,m){const x=f(v,m);if(x){if(x.errors||x.value===void 0)return x;v=x.value}return g(v,m)||x}:f||g},u.rebuild=function(f,g){return f&&g?function(v){g(v),f(v)}:f||g},u.validate=function(f,g){return f&&g?function(v,m){const x=g(v,m);if(x){if(x.errors&&(!Array.isArray(x.errors)||x.errors.length))return x;v=x.value}return f(v,m)||x}:f||g}},5107:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8652),h=o(8160),u=o(3292),f=o(6354),g=o(8901),v=o(9708),m=o(6133),x=o(3328),y=o(1152);let b;const w={types:{alternatives:o(4946),any:o(8068),array:o(546),boolean:o(4937),date:o(7500),function:o(390),link:o(8785),number:o(3832),object:o(8966),string:o(7417),symbol:o(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const E={_types:new Set(Object.keys(w.types))};for(const R of E._types)E[R]=function(...T){return a(!T.length||["alternatives","link","object"].includes(R),"The",R,"type does not allow arguments"),w.generate(this,w.types[R],T)};for(const R of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])E[R]=function(...T){return this.any()[R](...T)};Object.assign(E,w.methods);for(const R in w.aliases){const T=w.aliases[R];E[R]=E[T]}return E.x=E.expression,y.setup&&y.setup(E),E}};w.methods={ValidationError:f.ValidationError,version:h.version,cache:d.provider,assert(E,R,...T){w.assert(E,R,!0,T)},attempt:(E,R,...T)=>w.assert(E,R,!1,T),build(E){return a(typeof v.build=="function","Manifest functionality disabled"),v.build(this,E)},checkPreferences(E){h.checkPreferences(E)},compile(E,R){return u.compile(this,E,R)},defaults(E){a(typeof E=="function","modifier must be a function");const R=Object.assign({},this);for(const T of R._types){const N=E(R[T]());a(h.isSchema(N),"modifier must return a valid schema object"),R[T]=function(...A){return w.generate(this,N,A)}}return R},expression:(...E)=>new x(...E),extend(...E){h.verifyFlat(E,"extend"),b=b||o(3378),a(E.length,"You need to provide at least one extension"),this.assert(E,b.extensions);const R=Object.assign({},this);R._types=new Set(R._types);for(let T of E){typeof T=="function"&&(T=T(R)),this.assert(T,b.extension);const N=w.expandExtension(T,R);for(const A of N){a(R[A.type]===void 0||R._types.has(A.type),"Cannot override name",A.type);const D=A.base||this.any(),O=g.type(D,A);R._types.add(A.type),R[A.type]=function(...I){return w.generate(this,O,I)}}}return R},isError:f.ValidationError.isError,isExpression:x.isTemplate,isRef:m.isRef,isSchema:h.isSchema,in:(...E)=>m.in(...E),override:h.symbols.override,ref:(...E)=>m.create(...E),types(){const E={};for(const R of this._types)E[R]=this[R]();for(const R in w.aliases)E[R]=this[R]();return E}},w.assert=function(E,R,T,N){const A=N[0]instanceof Error||typeof N[0]=="string"?N[0]:null,D=A!==null?N[1]:N[0],O=R.validate(E,h.preferences({errors:{stack:!0}},D||{}));let I=O.error;if(!I)return O.value;if(A instanceof Error)throw A;const $=T&&typeof I.annotate=="function"?I.annotate():I.message;throw I instanceof f.ValidationError==0&&(I=c(I)),I.message=A?`${A} ${$}`:$,I},w.generate=function(E,R,T){return a(E,"Must be invoked on a Joi instance."),R.$_root=E,R._definition.args&&T.length?R._definition.args(R,...T):R},w.expandExtension=function(E,R){if(typeof E.type=="string")return[E];const T=[];for(const N of R._types)if(E.type.test(N)){const A=Object.assign({},E);A.type=N,A.base=R[N](),T.push(A)}return T},s.exports=w.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),d=o(3328);i.compile=function(h,u){if(typeof h=="string")return a(!u,"Cannot set single message string"),new d(h);if(d.isTemplate(h))return a(!u,"Cannot set single message template"),h;a(typeof h=="object"&&!Array.isArray(h),"Invalid message options"),u=u?c(u):{};for(let f in h){const g=h[f];if(f==="root"||d.isTemplate(g)){u[f]=g;continue}if(typeof g=="string"){u[f]=new d(g);continue}a(typeof g=="object"&&!Array.isArray(g),"Invalid message for",f);const v=f;for(f in u[v]=u[v]||{},g){const m=g[f];f==="root"||d.isTemplate(m)?u[v][f]=m:(a(typeof m=="string","Invalid message for",f,"in",v),u[v][f]=new d(m))}}return u},i.decompile=function(h){const u={};for(let f in h){const g=h[f];if(f==="root"){u.root=g;continue}if(d.isTemplate(g)){u[f]=g.describe({compact:!0});continue}const v=f;for(f in u[v]={},g){const m=g[f];f!=="root"?u[v][f]=m.describe({compact:!0}):u[v].root=m}}return u},i.merge=function(h,u){if(!h)return i.compile(u);if(!u)return h;if(typeof u=="string")return new d(u);if(d.isTemplate(u))return u;const f=c(h);for(let g in u){const v=u[g];if(g==="root"||d.isTemplate(v)){f[g]=v;continue}if(typeof v=="string"){f[g]=new d(v);continue}a(typeof v=="object"&&!Array.isArray(v),"Invalid message for",g);const m=g;for(g in f[m]=f[m]||{},v){const x=v[g];g==="root"||d.isTemplate(x)?f[m][g]=x:(a(typeof x=="string","Invalid message for",g,"in",m),f[m][g]=new d(x))}}return f}},2294:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.Ids=h.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const u=new h.Ids;return u._byId=new Map(this._byId),u._byKey=new Map(this._byKey),u._schemaChain=this._schemaChain,u}concat(u){u._schemaChain&&(this._schemaChain=!0);for(const[f,g]of u._byId.entries())a(!this._byKey.has(f),"Schema id conflicts with existing key:",f),this._byId.set(f,g);for(const[f,g]of u._byKey.entries())a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,g)}fork(u,f,g){const v=this._collect(u);v.push({schema:g});const m=v.shift();let x={id:m.id,schema:f(m.schema)};a(c.isSchema(x.schema),"adjuster function failed to return a joi schema type");for(const y of v)x={id:y.id,schema:h.fork(y.schema,x.id,x.schema)};return x.schema}labels(u,f=[]){const g=u[0],v=this._get(g);if(!v)return[...f,...u].join(".");const m=u.slice(1);return f=[...f,v.schema._flags.label||g],m.length?v.schema._ids.labels(m,f):f.join(".")}reach(u,f=[]){const g=u[0],v=this._get(g);a(v,"Schema does not contain path",[...f,...u].join("."));const m=u.slice(1);return m.length?v.schema._ids.reach(m,[...f,g]):v.schema}register(u,{key:f}={}){if(!u||!c.isSchema(u))return;(u.$_property("schemaChain")||u._ids._schemaChain)&&(this._schemaChain=!0);const g=u._flags.id;if(g){const v=this._byId.get(g);a(!v||v.schema===u,"Cannot add different schemas with the same id:",g),a(!this._byKey.has(g),"Schema id conflicts with existing key:",g),this._byId.set(g,{schema:u,id:g})}f&&(a(!this._byKey.has(f),"Schema already contains key:",f),a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,{schema:u,id:f}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(u,f=[],g=[]){const v=u[0],m=this._get(v);a(m,"Schema does not contain path",[...f,...u].join(".")),g=[m,...g];const x=u.slice(1);return x.length?m.schema._ids._collect(x,[...f,v],g):g}_get(u){return this._byId.get(u)||this._byKey.get(u)}},h.fork=function(u,f,g){const v=i.schema(u,{each:(m,{key:x})=>{if(f===(m._flags.id||x))return g},ref:!1});return v?v.$_mutateRebuild():u},i.schema=function(u,f){let g;for(const v in u._flags){if(v[0]==="_")continue;const m=h.scan(u._flags[v],{source:"flags",name:v},f);m!==void 0&&(g=g||u.clone(),g._flags[v]=m)}for(let v=0;v{const a=o(375),c=o(8571),d=o(9621),h=o(8160);let u;const f={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(g,v={}){a(typeof g=="string","Invalid reference key:",g),h.assertOptions(v,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!v.prefix||typeof v.prefix=="object","options.prefix must be of type object");const m=Object.assign({},f.defaults,v);delete m.prefix;const x=m.separator,y=f.context(g,x,v.prefix);if(m.type=y.type,g=y.key,m.type==="value")if(y.root&&(a(!x||g[0]!==x,"Cannot specify relative path with root prefix"),m.ancestor="root",g||(g=null)),x&&x===g)g=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!x||!g||g[0]!==x,"Cannot combine prefix with ancestor option");else{const[b,w]=f.ancestor(g,x);w&&(g=g.slice(w))===""&&(g=null),m.ancestor=b}return m.path=x?g===null?[]:g.split(x):[g],new f.Ref(m)},i.in=function(g,v={}){return i.create(g,{...v,in:!0})},i.isRef=function(g){return!!g&&!!g[h.symbols.ref]},f.Ref=class{constructor(g){a(typeof g=="object","Invalid reference construction"),h.assertOptions(g,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(g.separator)||typeof g.separator=="string"&&g.separator.length===1,"Invalid separator"),a(!g.adjust||typeof g.adjust=="function","options.adjust must be a function"),a(!g.map||Array.isArray(g.map),"options.map must be an array"),a(!g.map||!g.adjust,"Cannot set both map and adjust options"),Object.assign(this,f.defaults,g),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(g,v,m,x,y={}){return a(!this.in||y.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,v,y):this.type==="local"?this._resolve(x,v,y):this.ancestor?this.ancestor==="root"?this._resolve(v.ancestors[v.ancestors.length-1],v,y):(a(this.ancestor<=v.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(v.ancestors[this.ancestor-1],v,y)):this._resolve(g,v,y)}_resolve(g,v,m){let x;if(this.type==="value"&&v.mainstay.shadow&&m.shadow!==!1&&(x=v.mainstay.shadow.get(this.absolute(v))),x===void 0&&(x=d(g,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(x=this.adjust(x)),this.map){const y=this.map.get(x);y!==void 0&&(x=y)}return v.mainstay&&v.mainstay.tracer.resolve(v,this,x),x}toString(){return this.display}absolute(g){return[...g.path.slice(0,-this.ancestor),...this.path]}clone(){return new f.Ref(this)}describe(){const g={path:this.path};this.type!=="value"&&(g.type=this.type),this.separator!=="."&&(g.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(g.ancestor=this.ancestor),this.map&&(g.map=[...this.map]);for(const v of["adjust","iterables","render"])this[v]!==null&&this[v]!==void 0&&(g[v]=this[v]);return this.in!==!1&&(g.in=!0),{ref:g}}updateDisplay(){const g=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${g}`);if(!this.separator)return void(this.display=`ref:${g}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${g}`);if(this.ancestor==="root")return void(this.display=`ref:root:${g}`);if(this.ancestor===1)return void(this.display=`ref:${g||".."}`);const v=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${v}${g||""}`}},f.Ref.prototype[h.symbols.ref]=!0,i.build=function(g){return(g=Object.assign({},f.defaults,g)).type==="value"&&g.ancestor===void 0&&(g.ancestor=1),new f.Ref(g)},f.context=function(g,v,m={}){if(g=g.trim(),m){const x=m.global===void 0?"$":m.global;if(x!==v&&g.startsWith(x))return{key:g.slice(x.length),type:"global"};const y=m.local===void 0?"#":m.local;if(y!==v&&g.startsWith(y))return{key:g.slice(y.length),type:"local"};const b=m.root===void 0?"/":m.root;if(b!==v&&g.startsWith(b))return{key:g.slice(b.length),type:"value",root:!0}}return{key:g,type:"value"}},f.ancestor=function(g,v){if(!v)return[1,0];if(g[0]!==v)return[1,0];if(g[1]!==v)return[0,1];let m=2;for(;g[m]===v;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(g,v){if(g)if(v=v===void 0?i.toParent:v,Array.isArray(g))for(const m of g)this.register(m,v);else if(h.isSchema(g))for(const m of g._refs.refs)m.ancestor-v>=0&&this.refs.push({ancestor:m.ancestor-v,root:m.root});else i.isRef(g)&&g.type==="value"&&g.ancestor-v>=0&&this.refs.push({ancestor:g.ancestor-v,root:g.root}),u=u||o(3328),u.isTemplate(g)&&this.register(g.refs(),v)}get length(){return this.refs.length}clone(){const g=new i.Manager;return g.refs=c(this.refs),g}reset(){this.refs=[]}roots(){return this.refs.filter(g=>!g.ancestor).map(g=>g.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),d=o(8160),h={value:Symbol("value")};s.exports=h.State=class{constructor(u,f,g){this.path=u,this.ancestors=f,this.mainstay=g.mainstay,this.schemas=g.schemas,this.debug=null}localize(u,f=null,g=null){const v=new h.State(u,f,this);return g&&v.schemas&&(v.schemas=[h.schemas(g),...v.schemas]),v}nest(u,f){const g=new h.State(this.path,this.ancestors,this);return g.schemas=g.schemas&&[h.schemas(u),...g.schemas],g.debug=f,g}shadow(u,f){this.mainstay.shadow=this.mainstay.shadow||new h.Shadow,this.mainstay.shadow.set(this.path,u,f)}snapshot(){this.mainstay.shadow&&(this._snapshot=a(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},h.schemas=function(u){return d.isSchema(u)?{schema:u}:u},h.Shadow=class{constructor(){this._values=null}set(u,f,g){if(!u.length||g==="strip"&&typeof u[u.length-1]=="number")return;this._values=this._values||new Map;let v=this._values;for(let m=0;m{const a=o(375),c=o(8571),d=o(5277),h=o(1447),u=o(8160),f=o(6354),g=o(6133),v={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=v.Template=class{constructor(m,x){if(a(typeof m=="string","Template source must be a string"),a(!m.includes("\0")&&!m.includes(""),"Template source cannot contain reserved control characters"),this.source=m,this.rendered=m,this._template=null,x){const{functions:y,...b}=x;this._settings=Object.keys(b).length?c(b):void 0,this._functions=y,this._functions&&(a(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=v.encode(this.source),x=v.split(m);let y=!1;const b=[],w=x.shift();w&&b.push(w);for(const E of x){const R=E[0]!=="{",T=R?"}":"}}",N=E.indexOf(T);if(N===-1||E[1]==="{"){b.push(`{${v.decode(E)}`);continue}let A=E.slice(R?0:1,N);const D=A[0]===":";D&&(A=A.slice(1));const O=this._ref(v.decode(A),{raw:R,wrapped:D});b.push(O),typeof O!="string"&&(y=!0);const I=E.slice(N+T.length);I&&b.push(v.decode(I))}y?this._template=b:this.rendered=b.join("")}static date(m,x){return v.dateFormat[x.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const x={template:this.source};return this._settings&&(x.options=this._settings),this._functions&&(x.functions=this._functions),x}static build(m){return new v.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[u.symbols.template]}refs(){if(!this._template)return;const m=[];for(const x of this._template)typeof x!="string"&&m.push(...x.refs);return m}resolve(m,x,y,b){return this._template&&this._template.length===1?this._part(this._template[0],m,x,y,b,{}):this.render(m,x,y,b)}_part(m,...x){return m.ref?m.ref.resolve(...x):m.formula.evaluate(x)}render(m,x,y,b,w={}){if(!this.isDynamic())return this.rendered;const E=[];for(const R of this._template)if(typeof R=="string")E.push(R);else{const T=this._part(R,m,x,y,b,w),N=v.stringify(T,m,x,y,b,w);if(N!==void 0){const A=R.raw||(w.errors&&w.errors.escapeHtml)===!1?N:d(N);E.push(v.wrap(A,R.wrapped&&y.errors.wrap.label))}}return E.join("")}_ref(m,{raw:x,wrapped:y}){const b=[],w=R=>{const T=g.create(R,this._settings);return b.push(T),N=>{const A=T.resolve(...N);return A!==void 0?A:null}};try{const R=this._functions?{...v.functions,...this._functions}:v.functions;var E=new h.Parser(m,{reference:w,functions:R,constants:v.constants})}catch(R){throw R.message=`Invalid template variable "${m}" fails due to: ${R.message}`,R}if(E.single){if(E.single.type==="reference"){const R=b[0];return{ref:R,raw:x,refs:b,wrapped:y||R.type==="local"&&R.key==="label"}}return v.stringify(E.single.value)}return{formula:E,raw:x,refs:b}}toString(){return this.source}},v.Template.prototype[u.symbols.template]=!0,v.Template.prototype.isImmutable=!0,v.encode=function(m){return m.replace(/\\(\{+)/g,(x,y)=>v.opens.slice(0,y.length)).replace(/\\(\}+)/g,(x,y)=>v.closes.slice(0,y.length))},v.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},v.split=function(m){const x=[];let y="";for(let b=0;b ${I.toString()}`);m=D}if(!Array.isArray(m))return m.toString();const A=[];for(const D of m)A.push(v.stringify(D,x,y,b,w,{arrayItems:!0,...E}));return v.wrap(A.join(", "),!N&&T.array)},v.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},v.functions={if:(m,x,y)=>m?x:y,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[x,y,b,w,E]=this,R=E.messages;if(!R)return"";const T=f.template(x,R[0],m,y,b)||f.template(x,R[1],m,y,b);return T?T.render(x,y,b,w,E):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),d=o(8068),h=o(8160),u=o(3292),f=o(6354),g=o(6133),v={};s.exports=d.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:g.toSibling}},args:(m,...x)=>x.length===1&&Array.isArray(x[0])?m.try(...x[0]):m.try(...x),validate(m,x){const{schema:y,error:b,state:w,prefs:E}=x;if(y._flags.match){const T=[],N=[];for(let D=0;Df.details(D,{override:!1}))})};if(y._flags.match==="one")return T.length===1?{value:T[0]}:{errors:b("alternatives.one")};if(T.length!==y.$_terms.matches.length)return{errors:b("alternatives.all",{details:N.map(D=>f.details(D,{override:!1}))})};const A=D=>D.$_terms.matches.some(O=>O.schema.type==="object"||O.schema.type==="alternatives"&&A(O.schema));return A(y)?{value:T.reduce((D,O)=>c(D,O,{mergeArrays:!1}))}:{value:T[T.length-1]}}const R=[];for(let T=0;Ty.path[0]!=="is"&&typeof x._flags.label!="string"?x.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:x=>{h.isSchema(x)&&x.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,x){if(x.matches)for(const y of x.matches){const{schema:b,ref:w,is:E,not:R,then:T,otherwise:N}=y;m=b?m.try(b):w?m.conditional(w,{is:E,then:T,not:R,otherwise:N,switch:y.switch}):m.conditional(E,{then:T,otherwise:N})}return m}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),v.errors=function(m,{error:x,state:y}){if(!m.length)return{errors:x("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const b=new Set,w=[];for(const{reports:E,schema:R}of m){if(E.length>1)return v.unmatched(m,x);const T=E[0];if(T instanceof f.Report==0)return v.unmatched(m,x);if(T.state.path.length!==y.path.length){w.push({type:R.type,report:T});continue}if(T.code==="any.only"){for(const D of T.local.valids)b.add(D);continue}const[N,A]=T.code.split(".");A!=="base"?w.push({type:R.type,report:T}):T.code==="object.base"?b.add(T.local.type):b.add(N)}return w.length?w.length===1?{errors:w[0].report}:v.unmatched(m,x):{errors:x("alternatives.types",{types:[...b]})}},v.unmatched=function(m,x){const y=[];for(const b of m)y.push(...b.reports);return{errors:x("alternatives.match",f.details(y,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),d=o(8160),h=o(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(u,f){return a(typeof u=="function","Method must be a function"),a(f===void 0||f&&typeof f=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:u,description:f}})},validate(u,f,{method:g}){try{return g(u,f)}catch(v){return f.error("any.custom",{error:v})}},args:["method","description"],multi:!0},messages:{method(u){return this.prefs({messages:u})}},shared:{method(u){a(d.isSchema(u)&&u._flags.id,"Schema must be a schema with an id");const f=this.clone();return f.$_terms.shared=f.$_terms.shared||[],f.$_terms.shared.push(u),f.$_mutateRegister(u),f}},warning:{method(u,f){return a(u&&typeof u=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:u,local:f},warn:!0})},validate:(u,f,{code:g,local:v})=>f.error(g,v),args:["code","local"],multi:!0}},modifiers:{keep(u,f=!0){u.keep=f},message(u,f){u.message=h.compile(f)},warn(u,f=!0){u.warn=f}},manifest:{build(u,f){for(const g in f){const v=f[g];if(["examples","externals","metas","notes","tags"].includes(g))for(const m of v)u=u[g.slice(0,-1)](m);else if(g!=="alterations")if(g!=="whens"){if(g==="shared")for(const m of v)u=u.shared(m)}else for(const m of v){const{ref:x,is:y,not:b,then:w,otherwise:E,concat:R}=m;u=R?u.concat(R):x?u.when(x,{is:y,not:b,then:w,otherwise:E,switch:m.switch,break:m.break}):u.when(y,{then:w,otherwise:E,break:m.break})}else{const m={};for(const{target:x,adjuster:y}of v)m[x]=y;u=u.alter(m)}}return u}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),d=o(9621),h=o(8068),u=o(8160),f=o(3292),g={};s.exports=h.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(v,{schema:m,state:x,prefs:y}){if(!Array.isArray(v))return;const b=m.$_getRule("sort");return b?g.sort(m,v,b.args.options,x,y):void 0}},validate(v,{schema:m,error:x}){if(!Array.isArray(v)){if(m._flags.single){const y=[v];return y[u.symbols.arraySingle]=!0,{value:y}}return{errors:x("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:v.slice()}},rules:{has:{method(v){v=this.$_compile(v,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:v}});return m.$_mutateRegister(v),m},validate(v,{state:m,prefs:x,error:y},{schema:b}){const w=[v,...m.ancestors];for(let R=0;Rthis.$_compile(v[x]),x,{append:!0});m.$_terms.items.push(y)}return m.$_mutateRebuild()},validate(v,{schema:m,error:x,state:y,prefs:b,errorsArray:w}){const E=m.$_terms._requireds.slice(),R=m.$_terms.ordered.slice(),T=[...m.$_terms._inclusions,...E],N=!v[u.symbols.arraySingle];delete v[u.symbols.arraySingle];const A=w();let D=v.length;for(let O=0;O="})}},ordered:{method(...v){u.verifyFlat(v,"ordered");const m=this.$_addRule("items");for(let x=0;xthis.$_compile(v[x]),x,{append:!0});g.validateSingle(y,m),m.$_mutateRegister(y),m.$_terms.ordered.push(y)}return m.$_mutateRebuild()}},single:{method(v){const m=v===void 0||!!v;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(v={}){u.assertOptions(v,["by","order"]);const m={order:v.order||"ascending"};return v.by&&(m.by=f.ref(v.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(v,{error:m,state:x,prefs:y,schema:b},{options:w}){const{value:E,errors:R}=g.sort(b,v,w,x,y);if(R)return R;for(let T=0;Tnew Set(v)}},rebuild(v){v.$_terms._inclusions=[],v.$_terms._exclusions=[],v.$_terms._requireds=[];for(const m of v.$_terms.items)g.validateSingle(m,v),m._flags.presence==="required"?v.$_terms._requireds.push(m):m._flags.presence==="forbidden"?v.$_terms._exclusions.push(m):v.$_terms._inclusions.push(m);for(const m of v.$_terms.ordered)g.validateSingle(m,v)},manifest:{build:(v,m)=>(m.items&&(v=v.items(...m.items)),m.ordered&&(v=v.ordered(...m.ordered)),v)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),g.fillMissedErrors=function(v,m,x,y,b,w){const E=[];let R=0;for(const T of x){const N=T._flags.label;N?E.push(N):++R}E.length?R?m.push(v.$_createError("array.includesRequiredBoth",y,{knownMisses:E,unknownMisses:R},b,w)):m.push(v.$_createError("array.includesRequiredKnowns",y,{knownMisses:E},b,w)):m.push(v.$_createError("array.includesRequiredUnknowns",y,{unknownMisses:R},b,w))},g.fillOrderedErrors=function(v,m,x,y,b,w){const E=[];for(const R of x)R._flags.presence==="required"&&E.push(R);E.length&&g.fillMissedErrors(v,m,E,y,b,w)},g.fillDefault=function(v,m,x,y){const b=[];let w=!0;for(let E=v.length-1;E>=0;--E){const R=v[E],T=[m,...x.ancestors],N=R.$_validate(void 0,x.localize(x.path,T,R),y).value;if(w){if(N===void 0)continue;w=!1}b.unshift(N)}b.length&&m.push(...b)},g.fastSplice=function(v,m){let x=m;for(;x{let D=g.compare(N,A,E,R);if(D!==null||(x.by&&(N=x.by.resolve(N,y,b),A=x.by.resolve(A,y,b)),D=g.compare(N,A,E,R),D!==null))return D;const O=typeof N;if(O!==typeof A)throw v.$_createError("array.sort.mismatching",m,null,y,b);if(O!=="number"&&O!=="string")throw v.$_createError("array.sort.unsupported",m,{type:O},y,b);return O==="number"?(N-A)*w:N{const a=o(375),c=o(8068),d=o(8160),h=o(2036),u={isBool:function(f){return typeof f=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(f,{schema:g}){if(typeof f!="boolean"){if(typeof f=="string"){const v=g._flags.sensitive?f:f.toLowerCase();f=v==="true"||v!=="false"&&f}return typeof f!="boolean"&&(f=g.$_terms.truthy&&g.$_terms.truthy.has(f,null,null,!g._flags.sensitive)||(!g.$_terms.falsy||!g.$_terms.falsy.has(f,null,null,!g._flags.sensitive))&&f),{value:f}}},validate(f,{error:g}){if(typeof f!="boolean")return{value:f,errors:g("boolean.base")}},rules:{truthy:{method(...f){d.verifyFlat(f,"truthy");const g=this.clone();g.$_terms.truthy=g.$_terms.truthy||new h;for(let v=0;vf?1:0},string:{from:u.isBool,to:(f,g)=>f?"true":"false"}},manifest:{build:(f,g)=>(g.truthy&&(f=f.truthy(...g.truthy)),g.falsy&&(f=f.falsy(...g.falsy)),f)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(3328),u={isDate:function(f){return f instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(f,{schema:g})=>({value:u.parse(f,g._flags.format)||f})},validate(f,{schema:g,error:v,prefs:m}){if(f instanceof Date&&!isNaN(f.getTime()))return;const x=g._flags.format;return m.convert&&x&&typeof f=="string"?{value:f,errors:v("date.format",{format:x})}:{value:f,errors:v("date.base")}},rules:{compare:{method:!1,validate(f,g,{date:v},{name:m,operator:x,args:y}){const b=v==="now"?Date.now():v.getTime();return d.compare(f.getTime(),b,x)?f:g.error("date."+m,{limit:y.date,value:f})},args:[{name:"date",ref:!0,normalize:f=>f==="now"?f:u.parse(f),assert:f=>f!==null,message:"must have a valid date format"}]},format:{method(f){return a(["iso","javascript","unix"].includes(f),"Unknown date format",f),this.$_setFlag("format",f)}},greater:{method(f){return this.$_addRule({name:"greater",method:"compare",args:{date:f},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(f){return this.$_addRule({name:"less",method:"compare",args:{date:f},operator:"<"})}},max:{method(f){return this.$_addRule({name:"max",method:"compare",args:{date:f},operator:"<="})}},min:{method(f){return this.$_addRule({name:"min",method:"compare",args:{date:f},operator:">="})}},timestamp:{method(f="javascript"){return a(["javascript","unix"].includes(f),'"type" must be one of "javascript, unix"'),this.format(f)}}},cast:{number:{from:u.isDate,to:(f,g)=>f.getTime()},string:{from:u.isDate,to:(f,{prefs:g})=>h.date(f,g)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),u.parse=function(f,g){if(f instanceof Date)return f;if(typeof f!="string"&&(isNaN(f)||!isFinite(f))||/^\s*$/.test(f))return null;if(g==="iso")return d.isIsoDate(f)?u.date(f.toString()):null;const v=f;if(typeof f=="string"&&/^[+-]?\d+(\.\d+)?$/.test(f)&&(f=parseFloat(f)),g){if(g==="javascript")return u.date(1*f);if(g==="unix")return u.date(1e3*f);if(typeof v=="string")return null}return u.date(f)},u.date=function(f){const g=new Date(f);return isNaN(g.getTime())?null:g}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:d}})},validate:(d,h,{n:u})=>d.length===u?d:h.error("function.arity",{n:u})},class:{method(){return this.$_addRule("class")},validate:(d,h)=>/^\s*class\s/.test(d.toString())?d:h.error("function.class",{value:d})},minArity:{method(d){return a(Number.isSafeInteger(d)&&d>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length>=u?d:h.error("function.minArity",{n:u})},maxArity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length<=u?d:h.error("function.maxArity",{n:u})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,o)=>{const a=o(978),c=o(375),d=o(8571),h=o(3652),u=o(8068),f=o(8160),g=o(3292),v=o(6354),m=o(6133),x=o(3328),y={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=u.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(b,w)=>b.keys(w),validate(b,{schema:w,error:E,state:R,prefs:T}){if(!b||typeof b!==w.$_property("typeof")||Array.isArray(b))return{value:b,errors:E("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;b=y.clone(b,T);const N=[];if(w.$_terms.renames&&!y.rename(w,b,R,T,N))return{value:b,errors:N};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:b,errors:N};const A=new Set(Object.keys(b));if(w.$_terms.keys){const D=[b,...R.ancestors];for(const O of w.$_terms.keys){const I=O.key,$=b[I];A.delete(I);const F=R.localize([...R.path,I],D,O),B=O.schema.$_validate($,F,T);if(B.errors){if(T.abortEarly)return{value:b,errors:B.errors};B.value!==void 0&&(b[I]=B.value),N.push(...B.errors)}else O.schema._flags.result==="strip"||B.value===void 0&&$!==void 0?delete b[I]:B.value!==void 0&&(b[I]=B.value)}}if(A.size||w._flags._hasPatternMatch){const D=y.unknown(w,b,A,N,R,T);if(D)return D}if(w.$_terms.dependencies)for(const D of w.$_terms.dependencies){if(D.key!==null&&y.isPresent(D.options)(D.key.resolve(b,R,T,null,{shadow:!1}))===!1)continue;const O=y.dependencies[D.rel](w,D,b,R,T);if(O){const I=w.$_createError(O.code,b,O.context,R,T);if(T.abortEarly)return{value:b,errors:I};N.push(I)}}return{value:b,errors:N}},rules:{and:{method(...b){return f.verifyFlat(b,"and"),y.dependency(this,"and",null,b)}},append:{method(b){return b==null||Object.keys(b).length===0?this:this.keys(b)}},assert:{method(b,w,E){x.isTemplate(b)||(b=g.ref(b)),c(E===void 0||typeof E=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const R=this.$_addRule({name:"assert",args:{subject:b,schema:w,message:E}});return R.$_mutateRegister(b),R.$_mutateRegister(w),R},validate(b,{error:w,prefs:E,state:R},{subject:T,schema:N,message:A}){const D=T.resolve(b,R,E),O=m.isRef(T)?T.absolute(R):[];return N.$_match(D,R.localize(O,[b,...R.ancestors],N),E)?b:w("object.assert",{subject:T,message:A})},args:["subject","schema","message"],multi:!0},instance:{method(b,w){return c(typeof b=="function","constructor must be a function"),w=w||b.name,this.$_addRule({name:"instance",args:{constructor:b,name:w}})},validate:(b,w,{constructor:E,name:R})=>b instanceof E?b:w.error("object.instance",{type:R,value:b}),args:["constructor","name"]},keys:{method(b){c(b===void 0||typeof b=="object","Object schema must be a valid object"),c(!f.isSchema(b),"Object schema cannot be a joi schema");const w=this.clone();if(b)if(Object.keys(b).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(E=>!b.hasOwnProperty(E.key)):new y.Keys;for(const E in b)f.tryWithPath(()=>w.$_terms.keys.push({key:E,schema:this.$_compile(b[E])}),E)}else w.$_terms.keys=new y.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(b){return this.$_addRule({name:"length",args:{limit:b},operator:"="})},validate:(b,w,{limit:E},{name:R,operator:T,args:N})=>f.compare(Object.keys(b).length,E,T)?b:w.error("object."+R,{limit:N.limit,value:b}),args:[{name:"limit",ref:!0,assert:f.limit,message:"must be a positive integer"}]},max:{method(b){return this.$_addRule({name:"max",method:"length",args:{limit:b},operator:"<="})}},min:{method(b){return this.$_addRule({name:"min",method:"length",args:{limit:b},operator:">="})}},nand:{method(...b){return f.verifyFlat(b,"nand"),y.dependency(this,"nand",null,b)}},or:{method(...b){return f.verifyFlat(b,"or"),y.dependency(this,"or",null,b)}},oxor:{method(...b){return y.dependency(this,"oxor",null,b)}},pattern:{method(b,w,E={}){const R=b instanceof RegExp;R||(b=this.$_compile(b,{appendPath:!0})),c(w!==void 0,"Invalid rule"),f.assertOptions(E,["fallthrough","matches"]),R&&c(!b.flags.includes("g")&&!b.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const T=this.clone();T.$_terms.patterns=T.$_terms.patterns||[];const N={[R?"regex":"schema"]:b,rule:w};return E.matches&&(N.matches=this.$_compile(E.matches),N.matches.type!=="array"&&(N.matches=N.matches.$_root.array().items(N.matches)),T.$_mutateRegister(N.matches),T.$_setFlag("_hasPatternMatch",!0,{clone:!1})),E.fallthrough&&(N.fallthrough=!0),T.$_terms.patterns.push(N),T.$_mutateRegister(w),T}},ref:{method(){return this.$_addRule("ref")},validate:(b,w)=>m.isRef(b)?b:w.error("object.refType",{value:b})},regex:{method(){return this.$_addRule("regex")},validate:(b,w)=>b instanceof RegExp?b:w.error("object.regex",{value:b})},rename:{method(b,w,E={}){c(typeof b=="string"||b instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof x,"Invalid rename to argument"),c(w!==b,"Cannot rename key to same name:",b),f.assertOptions(E,["alias","ignoreUndefined","override","multiple"]);const R=this.clone();R.$_terms.renames=R.$_terms.renames||[];for(const T of R.$_terms.renames)c(T.from!==b,"Cannot rename the same key multiple times");return w instanceof x&&R.$_mutateRegister(w),R.$_terms.renames.push({from:b,to:w,options:a(y.renameDefaults,E)}),R}},schema:{method(b="any"){return this.$_addRule({name:"schema",args:{type:b}})},validate:(b,w,{type:E})=>!f.isSchema(b)||E!=="any"&&b.type!==E?w.error("object.schema",{type:E}):b},unknown:{method(b){return this.$_setFlag("unknown",b!==!1)}},with:{method(b,w,E={}){return y.dependency(this,"with",b,w,E)}},without:{method(b,w,E={}){return y.dependency(this,"without",b,w,E)}},xor:{method(...b){return f.verifyFlat(b,"xor"),y.dependency(this,"xor",null,b)}}},overrides:{default(b,w){return b===void 0&&(b=f.symbols.deepDefault),this.$_parent("default",b,w)}},rebuild(b){if(b.$_terms.keys){const w=new h.Sorter;for(const E of b.$_terms.keys)f.tryWithPath(()=>w.add(E,{after:E.schema.$_rootReferences(),group:E.key}),E.key);b.$_terms.keys=new y.Keys(...w.nodes)}},manifest:{build(b,w){if(w.keys&&(b=b.keys(w.keys)),w.dependencies)for(const{rel:E,key:R=null,peers:T,options:N}of w.dependencies)b=y.dependency(b,E,R,T,N);if(w.patterns)for(const{regex:E,schema:R,rule:T,fallthrough:N,matches:A}of w.patterns)b=b.pattern(E||R,T,{fallthrough:N,matches:A});if(w.renames)for(const{from:E,to:R,options:T}of w.renames)b=b.rename(E,R,T);return b}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),y.clone=function(b,w){if(typeof b=="object"){if(w.nonEnumerables)return d(b,{shallow:!0});const R=Object.create(Object.getPrototypeOf(b));return Object.assign(R,b),R}const E=function(...R){return b.apply(this,R)};return E.prototype=d(b.prototype),Object.defineProperty(E,"name",{value:b.name,writable:!1}),Object.defineProperty(E,"length",{value:b.length,writable:!1}),Object.assign(E,b),E},y.dependency=function(b,w,E,R,T){c(E===null||typeof E=="string",w,"key must be a strings"),T||(T=R.length>1&&typeof R[R.length-1]=="object"?R.pop():{}),f.assertOptions(T,["separator","isPresent"]),R=[].concat(R);const N=f.default(T.separator,"."),A=[];for(const O of R)c(typeof O=="string",w,"peers must be strings"),A.push(g.ref(O,{separator:N,ancestor:0,prefix:!1}));E!==null&&(E=g.ref(E,{separator:N,ancestor:0,prefix:!1}));const D=b.clone();return D.$_terms.dependencies=D.$_terms.dependencies||[],D.$_terms.dependencies.push(new y.Dependency(w,E,A,R,T)),D},y.dependencies={and(b,w,E,R,T){const N=[],A=[],D=w.peers.length,O=y.isPresent(w.options);for(const I of w.peers)O(I.resolve(E,R,T,null,{shadow:!1}))===!1?N.push(I.key):A.push(I.key);if(N.length!==D&&A.length!==D)return{code:"object.and",context:{present:A,presentWithLabels:y.keysToLabels(b,A),missing:N,missingWithLabels:y.keysToLabels(b,N)}}},nand(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const I of w.peers)A(I.resolve(E,R,T,null,{shadow:!1}))&&N.push(I.key);if(N.length!==w.peers.length)return;const D=w.paths[0],O=w.paths.slice(1);return{code:"object.nand",context:{main:D,mainWithLabel:y.keysToLabels(b,D),peers:O,peersWithLabels:y.keysToLabels(b,O)}}},or(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)}}},oxor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(!N.length||N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.oxor",context:D}},with(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},without(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},xor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return N.length===0?{code:"object.missing",context:D}:(D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.xor",context:D})}},y.keysToLabels=function(b,w){return Array.isArray(w)?w.map(E=>b.$_mapLabels(E)):b.$_mapLabels(w)},y.isPresent=function(b){return typeof b.isPresent=="function"?b.isPresent:w=>w!==void 0},y.rename=function(b,w,E,R,T){const N={};for(const A of b.$_terms.renames){const D=[],O=typeof A.from!="string";if(O)for(const I in w){if(w[I]===void 0&&A.options.ignoreUndefined||I===A.to)continue;const $=A.from.exec(I);$&&D.push({from:I,to:A.to,match:$})}else!Object.prototype.hasOwnProperty.call(w,A.from)||w[A.from]===void 0&&A.options.ignoreUndefined||D.push(A);for(const I of D){const $=I.from;let F=I.to;if(F instanceof x&&(F=F.render(w,E,R,I.match)),$!==F){if(!A.options.multiple&&N[F]&&(T.push(b.$_createError("object.rename.multiple",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly)||Object.prototype.hasOwnProperty.call(w,F)&&!A.options.override&&!N[F]&&(T.push(b.$_createError("object.rename.override",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly))return!1;w[$]===void 0?delete w[F]:w[F]=w[$],N[F]=!0,A.options.alias||delete w[$]}}}return!0},y.unknown=function(b,w,E,R,T,N){if(b.$_terms.patterns){let A=!1;const D=b.$_terms.patterns.map(I=>{if(I.matches)return A=!0,[]}),O=[w,...T.ancestors];for(const I of E){const $=w[I],F=[...T.path,I];for(let B=0;B{const a=o(375),c=o(8068),d=o(8160),h=o(3292),u=o(6354),f={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(g,v)=>g.ref(v),validate(g,{schema:v,state:m,prefs:x}){a(v.$_terms.link,"Uninitialized link schema");const y=f.generate(v,g,m,x),b=v.$_terms.link[0].ref;return y.$_validate(g,m.nest(y,`link:${b.display}:${y.type}`),x)},generate:(g,v,m,x)=>f.generate(g,v,m,x),rules:{ref:{method(g){a(!this.$_terms.link,"Cannot reinitialize schema"),g=h.ref(g),a(g.type==="value"||g.type==="local","Invalid reference type:",g.type),a(g.type==="local"||g.ancestor==="root"||g.ancestor>0,"Link cannot reference itself");const v=this.clone();return v.$_terms.link=[{ref:g}],v}},relative:{method(g=!0){return this.$_setFlag("relative",g)}}},overrides:{concat(g){a(this.$_terms.link,"Uninitialized link schema"),a(d.isSchema(g),"Invalid schema object"),a(g.type!=="link","Cannot merge type link with another link");const v=this.clone();return v.$_terms.whens||(v.$_terms.whens=[]),v.$_terms.whens.push({concat:g}),v.$_mutateRebuild()}},manifest:{build:(g,v)=>(a(v.link,"Invalid link description missing link"),g.ref(v.link))}}),f.generate=function(g,v,m,x){let y=m.mainstay.links.get(g);if(y)return y._generate(v,m,x).schema;const b=g.$_terms.link[0].ref,{perspective:w,path:E}=f.perspective(b,m);f.assert(w,"which is outside of schema boundaries",b,g,m,x);try{y=E.length?w.$_reach(E):w}catch{f.assert(!1,"to non-existing schema",b,g,m,x)}return f.assert(y.type!=="link","which is another link",b,g,m,x),g._flags.relative||m.mainstay.links.set(g,y),y._generate(v,m,x).schema},f.perspective=function(g,v){if(g.type==="local"){for(const{schema:m,key:x}of v.schemas){if((m._flags.id||x)===g.path[0])return{perspective:m,path:g.path.slice(1)};if(m.$_terms.shared){for(const y of m.$_terms.shared)if(y._flags.id===g.path[0])return{perspective:y,path:g.path.slice(1)}}}return{perspective:null,path:null}}return g.ancestor==="root"?{perspective:v.schemas[v.schemas.length-1].schema,path:g.path}:{perspective:v.schemas[g.ancestor]&&v.schemas[g.ancestor].schema,path:g.path}},f.assert=function(g,v,m,x,y,b){g||a(!1,`"${u.label(x._flags,y,b)}" contains link reference "${m.display}" ${v}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(u){const f=u.toString(),g=f.indexOf("."),v=f.indexOf("e");return(g<0?0:(v<0?f.length:v)-g-1)+(v<0?0:Math.max(0,-parseInt(f.slice(v+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(u,{schema:f,error:g}){if(!u.match(h.numberRx))return;u=u.trim();const v={value:parseFloat(u)};if(v.value===0&&(v.value=0),!f._flags.unsafe)if(u.match(/e/i)){if(h.extractSignificantDigits(u)!==h.extractSignificantDigits(String(v.value)))return v.errors=g("number.unsafe"),v}else{const m=v.value.toString();if(m.match(/e/i))return v;if(m!==h.normalizeDecimal(u))return v.errors=g("number.unsafe"),v}return v}},validate(u,{schema:f,error:g,prefs:v}){if(u===1/0||u===-1/0)return{value:u,errors:g("number.infinity")};if(!d.isNumber(u))return{value:u,errors:g("number.base")};const m={value:u};if(v.convert){const x=f.$_getRule("precision");if(x){const y=Math.pow(10,x.args.limit);m.value=Math.round(m.value*y)/y}}return m.value===0&&(m.value=0),!f._flags.unsafe&&(u>Number.MAX_SAFE_INTEGER||ud.compare(u,g,m)?u:f.error("number."+v,{limit:x.limit,value:u}),args:[{name:"limit",ref:!0,assert:d.isNumber,message:"must be a number"}]},greater:{method(u){return this.$_addRule({name:"greater",method:"compare",args:{limit:u},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(u,f)=>Math.trunc(u)-u==0?u:f.error("number.integer")},less:{method(u){return this.$_addRule({name:"less",method:"compare",args:{limit:u},operator:"<"})}},max:{method(u){return this.$_addRule({name:"max",method:"compare",args:{limit:u},operator:"<="})}},min:{method(u){return this.$_addRule({name:"min",method:"compare",args:{limit:u},operator:">="})}},multiple:{method(u){const f=typeof u=="number"?h.decimalPlaces(u):null,g=Math.pow(10,f);return this.$_addRule({name:"multiple",args:{base:u,baseDecimalPlace:f,pfactor:g}})},validate:(u,f,{base:g,baseDecimalPlace:v,pfactor:m},x)=>h.decimalPlaces(u)>v?f.error("number.multiple",{multiple:x.args.base,value:u}):Math.round(m*u)%Math.round(m*g)==0?u:f.error("number.multiple",{multiple:x.args.base,value:u}),args:[{name:"base",ref:!0,assert:u=>typeof u=="number"&&isFinite(u)&&u>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(u,f)=>Number.isSafeInteger(u)&&u>=0&&u<=65535?u:f.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(u){return a(Number.isSafeInteger(u),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:u}})},validate(u,f,{limit:g}){const v=u.toString().match(h.precisionRx);return Math.max((v[1]?v[1].length:0)-(v[2]?parseInt(v[2],10):0),0)<=g?u:f.error("number.precision",{limit:g,value:u})},convert:!0},sign:{method(u){return a(["negative","positive"].includes(u),"Invalid sign",u),this.$_addRule({name:"sign",args:{sign:u}})},validate:(u,f,{sign:g})=>g==="negative"&&u<0||g==="positive"&&u>0?u:f.error(`number.${g}`)},unsafe:{method(u=!0){return a(typeof u=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",u)}}},cast:{string:{from:u=>typeof u=="number",to:(u,f)=>u.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),h.extractSignificantDigits=function(u){return u.replace(h.exponentialPartRegex,"").replace(h.dotRegex,"").replace(h.trailingZerosRegex,"").replace(h.leadingSignAndZerosRegex,"")},h.normalizeDecimal=function(u){return(u=u.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&u.endsWith("0")&&(u=u.replace(/0+$/,"")),u==="-0"?"0":u}},8966:(s,i,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,d)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),d=o(1745),h=o(9959),u=o(6064),f=o(9926),g=o(5752),v=o(8068),m=o(8160),x={tlds:f instanceof Set&&{tlds:{allow:f,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:h.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=v.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(y,{schema:b,state:w,prefs:E}){const R=b.$_getRule("normalize");R&&(y=y.normalize(R.args.form));const T=b.$_getRule("case");T&&(y=T.args.direction==="upper"?y.toLocaleUpperCase():y.toLocaleLowerCase());const N=b.$_getRule("trim");if(N&&N.args.enabled&&(y=y.trim()),b.$_terms.replacements)for(const D of b.$_terms.replacements)y=y.replace(D.pattern,D.replacement);const A=b.$_getRule("hex");if(A&&A.args.options.byteAligned&&y.length%2!=0&&(y=`0${y}`),b.$_getRule("isoDate")){const D=x.isoDate(y);D&&(y=D)}if(b._flags.truncate){const D=b.$_getRule("max");if(D){let O=D.args.limit;if(m.isResolvable(O)&&(O=O.resolve(y,w,E),!m.limit(O)))return{value:y,errors:b.$_createError("any.ref",O,{ref:D.args.limit,arg:"limit",reason:"must be a positive integer"},w,E)};y=y.slice(0,O)}}return{value:y}}},validate(y,{schema:b,error:w}){if(typeof y!="string")return{value:y,errors:w("string.base")};if(y===""){const E=b.$_getRule("min");return E&&E.args.limit===0?void 0:{value:y,errors:w("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(y,b)=>/^[a-zA-Z0-9]+$/.test(y)?y:b.error("string.alphanum")},base64:{method(y={}){return m.assertOptions(y,["paddingRequired","urlSafe"]),y={urlSafe:!1,paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof y.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:y}})},validate:(y,b,{options:w})=>x.base64Regex[w.paddingRequired][w.urlSafe].test(y)?y:b.error("string.base64")},case:{method(y){return a(["lower","upper"].includes(y),"Invalid case:",y),this.$_addRule({name:"case",args:{direction:y}})},validate:(y,b,{direction:w})=>w==="lower"&&y===y.toLocaleLowerCase()||w==="upper"&&y===y.toLocaleUpperCase()?y:b.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(y,b){let w=y.length,E=0,R=1;for(;w--;){const T=y.charAt(w)*R;E+=T-9*(T>9),R^=3}return E>0&&E%10==0?y:b.error("string.creditCard")}},dataUri:{method(y={}){return m.assertOptions(y,["paddingRequired"]),y={paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:y}})},validate(y,b,{options:w}){const E=y.match(x.dataUriRegex);return E&&(!E[2]||E[2]!=="base64"||x.base64Regex[w.paddingRequired].false.test(E[3]))?y:b.error("string.dataUri")}},domain:{method(y){y&&m.assertOptions(y,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const b=x.addressOptions(y);return this.$_addRule({name:"domain",args:{options:y},address:b})},validate:(y,b,w,{address:E})=>c.isValid(y,E)?y:b.error("string.domain")},email:{method(y={}){m.assertOptions(y,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(y.multiple===void 0||typeof y.multiple=="boolean","multiple option must be an boolean");const b=x.addressOptions(y),w=new RegExp(`\\s*[${y.separator?u(y.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:y},regex:w,address:b})},validate(y,b,{options:w},{regex:E,address:R}){const T=w.multiple?y.split(E):[y],N=[];for(const A of T)d.isValid(A,R)||N.push(A);return N.length?b.error("string.email",{value:y,invalids:N}):y}},guid:{alias:"uuid",method(y={}){m.assertOptions(y,["version","separator"]);let b="";if(y.version){const R=[].concat(y.version);a(R.length>=1,"version must have at least 1 valid version specified");const T=new Set;for(let N=0;N(w.prefix==="optional"?x.hexRegex.withOptionalPrefix:w.prefix===!0?x.hexRegex.withPrefix:x.hexRegex.withoutPrefix).test(y)?w.byteAligned&&y.length%2!=0?b.error("string.hexAlign"):y:b.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(y,b)=>c.isValid(y,{minDomainSegments:1})||x.ipRegex.test(y)?y:b.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(y={}){m.assertOptions(y,["cidr","version"]);const{cidr:b,versions:w,regex:E}=h.regex(y),R=y.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:b,version:R}},regex:E})},validate:(y,b,{options:w},{regex:E})=>E.test(y)?y:w.version?b.error("string.ipVersion",{value:y,cidr:w.cidr,version:w.version}):b.error("string.ip",{value:y,cidr:w.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(y,{error:b})=>x.isoDate(y)?y:b("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(y,b)=>x.isoDurationRegex.test(y)?y:b.error("string.isoDuration")},length:{method(y,b){return x.length(this,"length",y,"=",b)},validate(y,b,{limit:w,encoding:E},{name:R,operator:T,args:N}){const A=!E&&y.length;return m.compare(A,w,T)?y:b.error("string."+R,{limit:N.limit,value:y,encoding:E})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(y,b){return x.length(this,"max",y,"<=",b)},args:["limit","encoding"]},min:{method(y,b){return x.length(this,"min",y,">=",b)},args:["limit","encoding"]},normalize:{method(y="NFC"){return a(x.normalizationForms.includes(y),"normalization form must be one of "+x.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:y}})},validate:(y,{error:b},{form:w})=>y===y.normalize(w)?y:b("string.normalize",{value:y,form:w}),convert:!0},pattern:{alias:"regex",method(y,b={}){a(y instanceof RegExp,"regex must be a RegExp"),a(!y.flags.includes("g")&&!y.flags.includes("y"),"regex should not use global or sticky mode"),typeof b=="string"&&(b={name:b}),m.assertOptions(b,["invert","name"]);const w=["string.pattern",b.invert?".invert":"",b.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:y,options:b},errorCode:w})},validate:(y,b,{regex:w,options:E},{errorCode:R})=>w.test(y)^E.invert?y:b.error(R,{name:E.name,regex:w,value:y}),args:["regex","options"],multi:!0},replace:{method(y,b){typeof y=="string"&&(y=new RegExp(u(y),"g")),a(y instanceof RegExp,"pattern must be a RegExp"),a(typeof b=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:y,replacement:b}),w}},token:{method(){return this.$_addRule("token")},validate:(y,b)=>/^\w+$/.test(y)?y:b.error("string.token")},trim:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:y}})},validate:(y,b,{enabled:w})=>w&&y!==y.trim()?b.error("string.trim"):y,convert:!0},truncate:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",y)}},uppercase:{method(){return this.case("upper")}},uri:{method(y={}){m.assertOptions(y,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),y.domain&&m.assertOptions(y.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:b,scheme:w}=g.regex(y),E=y.domain?x.addressOptions(y.domain):null;return this.$_addRule({name:"uri",args:{options:y},regex:b,domain:E,scheme:w})},validate(y,b,{options:w},{regex:E,domain:R,scheme:T}){if(["http:/","https:/"].includes(y))return b.error("string.uri");let N=E.exec(y);if(!N&&b.prefs.convert&&w.encodeUri){const A=encodeURI(y);N=E.exec(A),N&&(y=A)}if(N){const A=N[1]||N[2];return!R||w.allowRelative&&!A||c.isValid(A,R)?y:b.error("string.domain",{value:A})}return w.relativeOnly?b.error("string.uriRelativeOnly"):w.scheme?b.error("string.uriCustomScheme",{scheme:T,value:y}):b.error("string.uri")}}},manifest:{build(y,b){if(b.replacements)for(const{pattern:w,replacement:E}of b.replacements)y=y.replace(w,E);return y}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),x.addressOptions=function(y){if(!y)return x.tlds||y;if(a(y.minDomainSegments===void 0||Number.isSafeInteger(y.minDomainSegments)&&y.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(y.maxDomainSegments===void 0||Number.isSafeInteger(y.maxDomainSegments)&&y.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),y.tlds===!1)return y;if(y.tlds===!0||y.tlds===void 0)return a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds);a(typeof y.tlds=="object","tlds must be true, false, or an object");const b=y.tlds.deny;if(b)return Array.isArray(b)&&(y=Object.assign({},y,{tlds:{deny:new Set(b)}})),a(y.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!y.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),x.validateTlds(y.tlds.deny,"tlds.deny"),y;const w=y.tlds.allow;return w?w===!0?(a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds)):(Array.isArray(w)&&(y=Object.assign({},y,{tlds:{allow:new Set(w)}})),a(y.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),x.validateTlds(y.tlds.allow,"tlds.allow"),y):y},x.validateTlds=function(y,b){for(const w of y)a(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${b} must contain valid top level domain names`)},x.isoDate=function(y){if(!m.isIsoDate(y))return null;/.*T.*[+-]\d\d$/.test(y)&&(y+="00");const b=new Date(y);return isNaN(b.getTime())?null:b.toISOString()},x.length=function(y,b,w,E,R){return a(!R||!1,"Invalid encoding:",R),y.$_addRule({name:b,method:"length",args:{limit:w,encoding:R},operator:E})}},8826:(s,i,o)=>{const a=o(375),c=o(8068),d={};d.Map=class extends Map{slice(){return new d.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new d.Map}},coerce:{method(h,{schema:u,error:f}){const g=u.$_terms.map.get(h);return g&&(h=g),u._flags.only&&typeof h!="symbol"?{value:h,errors:f("symbol.map",{map:u.$_terms.map})}:{value:h}}},validate(h,{error:u}){if(typeof h!="symbol")return{value:h,errors:u("symbol.base")}},rules:{map:{method(h){h&&!h[Symbol.iterator]&&typeof h=="object"&&(h=Object.entries(h)),a(h&&h[Symbol.iterator],"Iterable must be an iterable or object");const u=this.clone(),f=[];for(const g of h){a(g&&g[Symbol.iterator],"Entry must be an iterable");const[v,m]=g;a(typeof v!="object"&&typeof v!="function"&&typeof v!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),u.$_terms.map.set(v,m),f.push(m)}return u.valid(...f)}}},manifest:{build:(h,u)=>(u.map&&(h=h.map(u.map)),h)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,o)=>{const a=o(375),c=o(8571),d=o(738),h=o(9621),u=o(8160),f=o(6354),g=o(493),v={result:Symbol("result")};i.entry=function(m,x,y){let b=u.defaults;y&&(a(y.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(y.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),b=u.preferences(u.defaults,y));const w=v.entry(m,x,b);a(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const E={value:w.value};return w.error&&(E.error=w.error),w.mainstay.warnings.length&&(E.warning=f.details(w.mainstay.warnings)),w.mainstay.debug&&(E.debug=w.mainstay.debug),w.mainstay.artifacts&&(E.artifacts=w.mainstay.artifacts),E},i.entryAsync=async function(m,x,y){let b=u.defaults;y&&(b=u.preferences(u.defaults,y));const w=v.entry(m,x,b),E=w.mainstay;if(w.error)throw E.debug&&(w.error.debug=E.debug),w.error;if(E.externals.length){let T=w.value;const N=[];for(const A of E.externals){const D=A.state.path,O=A.schema.type==="link"?E.links.get(A.schema):null;let I,$,F=T;const B=D.length?[T]:[],W=D.length?h(m,D):m;if(D.length){I=D[D.length-1];let Z=T;for(const Y of D.slice(0,-1))Z=Z[Y],B.unshift(Z);$=B[0],F=$[I]}try{const Z=(H,se)=>(O||A.schema).$_createError(H,F,se,A.state,b),Y=await A.method(F,{schema:A.schema,linked:O,state:A.state,prefs:y,original:W,error:Z,errorsArray:v.errorsArray,warn:(H,se)=>E.warnings.push((O||A.schema).$_createError(H,F,se,A.state,b)),message:(H,se)=>(O||A.schema).$_createError("external",F,se,A.state,b,{messages:H})});if(Y===void 0||Y===F)continue;if(Y instanceof f.Report){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(Y),b.abortEarly)break;continue}if(Array.isArray(Y)&&Y[u.symbols.errors]){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(...Y),b.abortEarly)break;continue}$?(E.tracer.value(A.state,"rule",F,Y,"external"),$[I]=Y):(E.tracer.value(A.state,"rule",T,Y,"external"),T=Y)}catch(Z){throw b.errors.label&&(Z.message+=` (${A.label})`),Z}}if(w.value=T,N.length)throw w.error=f.process(N,m,b),E.debug&&(w.error.debug=E.debug),w.error}if(!b.warnings&&!b.debug&&!b.artifacts)return w.value;const R={value:w.value};return E.warnings.length&&(R.warning=f.details(E.warnings)),E.debug&&(R.debug=E.debug),E.artifacts&&(R.artifacts=E.artifacts),R},v.Mainstay=class{constructor(m,x,y){this.externals=[],this.warnings=[],this.tracer=m,this.debug=x,this.links=y,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const m=this._snapshots.pop();this.externals=m.externals,this.warnings=m.warnings}commit(){this._snapshots.pop()}},v.entry=function(m,x,y){const{tracer:b,cleanup:w}=v.tracer(x,y),E=y.debug?[]:null,R=x._ids._schemaChain?new Map:null,T=new v.Mainstay(b,E,R),N=x._ids._schemaChain?[{schema:x}]:null,A=new g([],[],{mainstay:T,schemas:N}),D=i.validate(m,x,A,y);w&&x.$_root.untrace();const O=f.process(D.errors,m,y);return{value:D.value,error:O,mainstay:T}},v.tracer=function(m,x){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:x.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:v.ignore}},i.validate=function(m,x,y,b,w={}){if(x.$_terms.whens&&(x=x._generate(m,y,b).schema),x._preferences&&(b=v.prefs(x,b)),x._cache&&b.cache){const O=x._cache.get(m);if(y.mainstay.tracer.debug(y,"validate","cached",!!O),O)return O}const E=(O,I,$)=>x.$_createError(O,m,I,$||y,b),R={original:m,prefs:b,schema:x,state:y,error:E,errorsArray:v.errorsArray,warn:(O,I,$)=>y.mainstay.warnings.push(E(O,I,$)),message:(O,I)=>x.$_createError("custom",m,I,y,b,{messages:O})};y.mainstay.tracer.entry(x,y);const T=x._definition;if(T.prepare&&m!==void 0&&b.convert){const O=T.prepare(m,R);if(O){if(y.mainstay.tracer.value(y,"prepare",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}if(T.coerce&&m!==void 0&&b.convert&&(!T.coerce.from||T.coerce.from.includes(typeof m))){const O=T.coerce.method(m,R);if(O){if(y.mainstay.tracer.value(y,"coerced",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}const N=x._flags.empty;N&&N.$_match(v.trim(m,x),y.nest(N),u.defaults)&&(y.mainstay.tracer.value(y,"empty",m,void 0),m=void 0);const A=w.presence||x._flags.presence||(x._flags._endedSwitch?null:b.presence);if(m===void 0){if(A==="forbidden")return v.finalize(m,null,R);if(A==="required")return v.finalize(m,[x.$_createError("any.required",m,null,y,b)],R);if(A==="optional"){if(x._flags.default!==u.symbols.deepDefault)return v.finalize(m,null,R);y.mainstay.tracer.value(y,"default",m,{}),m={}}}else if(A==="forbidden")return v.finalize(m,[x.$_createError("any.unknown",m,null,y,b)],R);const D=[];if(x._valids){const O=x._valids.get(m,y,b,x._flags.insensitive);if(O)return b.convert&&(y.mainstay.tracer.value(y,"valids",m,O.value),m=O.value),y.mainstay.tracer.filter(x,y,"valid",O),v.finalize(m,null,R);if(x._flags.only){const I=x.$_createError("any.only",m,{valids:x._valids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(x._invalids){const O=x._invalids.get(m,y,b,x._flags.insensitive);if(O){y.mainstay.tracer.filter(x,y,"invalid",O);const I=x.$_createError("any.invalid",m,{invalids:x._invalids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(T.validate){const O=T.validate(m,R);if(O&&(y.mainstay.tracer.value(y,"base",m,O.value),m=O.value,O.errors)){if(!Array.isArray(O.errors))return D.push(O.errors),v.finalize(m,D,R);if(O.errors.length)return D.push(...O.errors),v.finalize(m,D,R)}}return x._rules.length?v.rules(m,D,R):v.finalize(m,D,R)},v.rules=function(m,x,y){const{schema:b,state:w,prefs:E}=y;for(const R of b._rules){const T=b._definition.rules[R.method];if(T.convert&&E.convert){w.mainstay.tracer.log(b,w,"rule",R.name,"full");continue}let N,A=R.args;if(R._resolve.length){A=Object.assign({},A);for(const O of R._resolve){const I=T.argsByName.get(O),$=A[O].resolve(m,w,E),F=I.normalize?I.normalize($):$,B=u.validateArg(F,null,I);if(B){N=b.$_createError("any.ref",$,{arg:O,ref:A[O],reason:B},w,E);break}A[O]=F}}N=N||T.validate(m,y,A,R);const D=v.rule(N,R);if(D.errors){if(w.mainstay.tracer.log(b,w,"rule",R.name,"error"),R.warn){w.mainstay.warnings.push(...D.errors);continue}if(E.abortEarly)return v.finalize(m,D.errors,y);x.push(...D.errors)}else w.mainstay.tracer.log(b,w,"rule",R.name,"pass"),w.mainstay.tracer.value(w,"rule",m,D.value,R.name),m=D.value}return v.finalize(m,x,y)},v.rule=function(m,x){return m instanceof f.Report?(v.error(m,x),{errors:[m],value:null}):Array.isArray(m)&&m[u.symbols.errors]?(m.forEach(y=>v.error(y,x)),{errors:m,value:null}):{errors:null,value:m}},v.error=function(m,x){return x.message&&m._setTemplate(x.message),m},v.finalize=function(m,x,y){x=x||[];const{schema:b,state:w,prefs:E}=y;if(x.length){const T=v.default("failover",void 0,x,y);T!==void 0&&(w.mainstay.tracer.value(w,"failover",m,T),m=T,x=[])}if(x.length&&b._flags.error)if(typeof b._flags.error=="function"){x=b._flags.error(x),Array.isArray(x)||(x=[x]);for(const T of x)a(T instanceof Error||T instanceof f.Report,"error() must return an Error object")}else x=[b._flags.error];if(m===void 0){const T=v.default("default",m,x,y);w.mainstay.tracer.value(w,"default",m,T),m=T}if(b._flags.cast&&m!==void 0){const T=b._definition.cast[b._flags.cast];if(T.from(m)){const N=T.to(m,y);w.mainstay.tracer.value(w,"cast",m,N,b._flags.cast),m=N}}if(b.$_terms.externals&&E.externals&&E._externals!==!1)for(const{method:T}of b.$_terms.externals)w.mainstay.externals.push({method:T,schema:b,state:w,label:f.label(b._flags,w,E)});const R={value:m,errors:x.length?x:null};return b._flags.result&&(R.value=b._flags.result==="strip"?void 0:y.original,w.mainstay.tracer.value(w,b._flags.result,m,R.value),w.shadow(m,b._flags.result)),b._cache&&E.cache!==!1&&!b._refs.length&&b._cache.set(y.original,R),m===void 0||R.errors||b._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(b._flags.artifact)||w.mainstay.artifacts.set(b._flags.artifact,[]),w.mainstay.artifacts.get(b._flags.artifact).push(w.path)),R},v.prefs=function(m,x){const y=x===u.defaults;return y&&m._preferences[u.symbols.prefs]?m._preferences[u.symbols.prefs]:(x=u.preferences(x,m._preferences),y&&(m._preferences[u.symbols.prefs]=x),x)},v.default=function(m,x,y,b){const{schema:w,state:E,prefs:R}=b,T=w._flags[m];if(R.noDefaults||T===void 0)return x;if(E.mainstay.tracer.log(w,E,"rule",m,"full"),!T)return T;if(typeof T=="function"){const N=T.length?[c(E.ancestors[0]),b]:[];try{return T(...N)}catch(A){return void y.push(w.$_createError(`any.${m}`,null,{error:A},E,R))}}return typeof T!="object"?T:T[u.symbols.literal]?T.literal:u.isResolvable(T)?T.resolve(x,E,R):c(T)},v.trim=function(m,x){if(typeof m!="string")return m;const y=x.$_getRule("trim");return y&&y.args.enabled?m.trim():m},v.ignore={active:!1,debug:d,entry:d,filter:d,log:d,resolve:d,value:d},v.errorsArray=function(){const m=[];return m[u.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),d=o(8160),h={};s.exports=h.Values=class{constructor(u,f){this._values=new Set(u),this._refs=new Set(f),this._lowercase=h.lowercases(u),this._override=!1}get length(){return this._values.size+this._refs.size}add(u,f){d.isResolvable(u)?this._refs.has(u)||(this._refs.add(u),f&&f.register(u)):this.has(u,null,null,!1)||(this._values.add(u),typeof u=="string"&&this._lowercase.set(u.toLowerCase(),u))}static merge(u,f,g){if(u=u||new h.Values,f){if(f._override)return f.clone();for(const v of[...f._values,...f._refs])u.add(v)}if(g)for(const v of[...g._values,...g._refs])u.remove(v);return u.length?u:null}remove(u){d.isResolvable(u)?this._refs.delete(u):(this._values.delete(u),typeof u=="string"&&this._lowercase.delete(u.toLowerCase()))}has(u,f,g,v){return!!this.get(u,f,g,v)}get(u,f,g,v){if(!this.length)return!1;if(this._values.has(u))return{value:u};if(typeof u=="string"&&u&&v){const m=this._lowercase.get(u.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof u!="object")return!1;if(typeof u=="object"){for(const m of this._values)if(c(m,u))return{value:m}}if(f)for(const m of this._refs){const x=m.resolve(u,f,g,null,{in:!0});if(x===void 0)continue;const y=m.in&&typeof x=="object"?Array.isArray(x)?x:Object.keys(x):[x];for(const b of y)if(typeof b==typeof u){if(v&&u&&typeof u=="string"){if(b.toLowerCase()===u.toLowerCase())return{value:b,ref:m}}else if(c(b,u))return{value:b,ref:m}}}return!1}override(){this._override=!0}values(u){if(u&&u.display){const f=[];for(const g of[...this._values,...this._refs])g!==void 0&&f.push(g);return f}return Array.from([...this._values,...this._refs])}clone(){const u=new h.Values(this._values,this._refs);return u._override=this._override,u}concat(u){a(!u._override,"Cannot concat override set of values");const f=new h.Values([...this._values,...u._values],[...this._refs,...u._refs]);return f._override=this._override,f}describe(){const u=[];this._override&&u.push({override:!0});for(const f of this._values.values())u.push(f&&typeof f=="object"?{value:f}:f);for(const f of this._refs.values())u.push(f.describe());return u}},h.Values.prototype[d.symbols.values]=!0,h.Values.prototype.slice=h.Values.prototype.clone,h.lowercases=function(u){const f=new Map;if(u)for(const g of u)typeof g=="string"&&f.set(g.toLowerCase(),g);return f}},978:(s,i,o)=>{const a=o(375),c=o(8571),d=o(1687),h=o(9621),u={};s.exports=function(f,g,v={}){if(a(f&&typeof f=="object","Invalid defaults value: must be an object"),a(!g||g===!0||typeof g=="object","Invalid source value: must be true, falsy or an object"),a(typeof v=="object","Invalid options: must be an object"),!g)return null;if(v.shallow)return u.applyToDefaultsWithShallow(f,g,v);const m=c(f);if(g===!0)return m;const x=v.nullOverride!==void 0&&v.nullOverride;return d(m,g,{nullOverride:x,mergeArrays:!1})},u.applyToDefaultsWithShallow=function(f,g,v){const m=v.shallow;a(Array.isArray(m),"Invalid keys");const x=new Map,y=g===!0?null:new Set;for(let E of m){E=Array.isArray(E)?E:E.split(".");const R=h(f,E);R&&typeof R=="object"?x.set(R,y&&h(g,E)||R):y&&y.add(E)}const b=c(f,{},x);if(!y)return b;for(const E of y)u.reachCopy(b,g,E);const w=v.nullOverride!==void 0&&v.nullOverride;return d(b,g,{nullOverride:w,mergeArrays:!1})},u.reachCopy=function(f,g,v){for(const y of v){if(!(y in g))return;const b=g[y];if(typeof b!="object"||b===null)return;g=b}const m=g;let x=f;for(let y=0;y{const a=o(7916);s.exports=function(c,...d){if(!c)throw d.length===1&&d[0]instanceof Error?d[0]:new a(d)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),d=o(7043),h={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=h.clone=function(u,f={},g=null){if(typeof u!="object"||u===null)return u;let v=h.clone,m=g;if(f.shallow){if(f.shallow!==!0)return h.cloneWithShallow(u,f);v=w=>w}else if(m){const w=m.get(u);if(w)return w}else m=new Map;const x=c.getInternalProto(u);if(x===c.buffer)return!1;if(x===c.date)return new Date(u.getTime());if(x===c.regex)return new RegExp(u);const y=h.base(u,x,f);if(y===u)return u;if(m&&m.set(u,y),x===c.set)for(const w of u)y.add(v(w,f,m));else if(x===c.map)for(const[w,E]of u)y.set(w,v(E,f,m));const b=d.keys(u,f);for(const w of b){if(w==="__proto__")continue;if(x===c.array&&w==="length"){y.length=u.length;continue}const E=Object.getOwnPropertyDescriptor(u,w);E?E.get||E.set?Object.defineProperty(y,w,E):E.enumerable?y[w]=v(u[w],f,m):Object.defineProperty(y,w,{enumerable:!1,writable:!0,configurable:!0,value:v(u[w],f,m)}):Object.defineProperty(y,w,{enumerable:!0,writable:!0,configurable:!0,value:v(u[w],f,m)})}return y},h.cloneWithShallow=function(u,f){const g=f.shallow;(f=Object.assign({},f)).shallow=!1;const v=new Map;for(const m of g){const x=a(u,m);typeof x!="object"&&typeof x!="function"||v.set(x,x)}return h.clone(u,f,v)},h.base=function(u,f,g){if(g.prototype===!1)return h.needsProtoHack.has(f)?new f.constructor:f===c.array?[]:{};const v=Object.getPrototypeOf(u);if(v&&v.isImmutable)return u;if(f===c.array){const m=[];return v!==f&&Object.setPrototypeOf(m,v),m}if(h.needsProtoHack.has(f)){const m=new v.constructor;return v!==f&&Object.setPrototypeOf(m,v),m}return Object.create(v)}},9474:(s,i,o)=>{const a=o(4277),c={mismatched:null};s.exports=function(d,h,u){return u=Object.assign({prototype:!0},u),!!c.isDeepEqual(d,h,u,[])},c.isDeepEqual=function(d,h,u,f){if(d===h)return d!==0||1/d==1/h;const g=typeof d;if(g!==typeof h||d===null||h===null)return!1;if(g==="function"){if(!u.deepFunction||d.toString()!==h.toString())return!1}else if(g!=="object")return d!=d&&h!=h;const v=c.getSharedType(d,h,!!u.prototype);switch(v){case a.buffer:return!1;case a.promise:return d===h;case a.regex:return d.toString()===h.toString();case c.mismatched:return!1}for(let m=f.length-1;m>=0;--m)if(f[m].isSame(d,h))return!0;f.push(new c.SeenEntry(d,h));try{return!!c.isDeepEqualObj(v,d,h,u,f)}finally{f.pop()}},c.getSharedType=function(d,h,u){if(u)return Object.getPrototypeOf(d)!==Object.getPrototypeOf(h)?c.mismatched:a.getInternalProto(d);const f=a.getInternalProto(d);return f!==a.getInternalProto(h)?c.mismatched:f},c.valueOf=function(d){const h=d.valueOf;if(h===void 0)return d;try{return h.call(d)}catch(u){return u}},c.hasOwnEnumerableProperty=function(d,h){return Object.prototype.propertyIsEnumerable.call(d,h)},c.isSetSimpleEqual=function(d,h){for(const u of Set.prototype.values.call(d))if(!Set.prototype.has.call(h,u))return!1;return!0},c.isDeepEqualObj=function(d,h,u,f,g){const{isDeepEqual:v,valueOf:m,hasOwnEnumerableProperty:x}=c,{keys:y,getOwnPropertySymbols:b}=Object;if(d===a.array){if(!f.part){if(h.length!==u.length)return!1;for(let N=0;N{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(d=>d!=="").map(d=>typeof d=="string"?d:d instanceof Error?d.message:a(d)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c=256?"&#"+o+";":`&#x${o.toString(16).padStart(2,"0")};`)},i.isSafe=function(o){return i.safeCharCodes.has(o)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const o=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&o.add(a);return o}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,o)=>{const a=o(375),c=o(8571),d=o(7043),h={};s.exports=h.merge=function(u,f,g){if(a(u&&typeof u=="object","Invalid target value: must be an object"),a(f==null||typeof f=="object","Invalid source value: must be null, undefined, or an object"),!f)return u;if(g=Object.assign({nullOverride:!0,mergeArrays:!0},g),Array.isArray(f)){a(Array.isArray(u),"Cannot merge array onto an object"),g.mergeArrays||(u.length=0);for(let m=0;m{const a=o(375),c={};s.exports=function(d,h,u){if(h===!1||h==null)return d;typeof(u=u||{})=="string"&&(u={separator:u});const f=Array.isArray(h);a(!f||!u.separator,"Separator option is not valid for array-based chain");const g=f?h:h.split(u.separator||".");let v=d;for(let m=0;m{s.exports=function(...i){try{return JSON.stringify(...i)}catch(o){return"[Cannot display object: "+o.message+"]"}}},4277:(s,i)=>{const o={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},o.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(a){if(Array.isArray(a))return i.array;if(a instanceof Date)return i.date;if(a instanceof RegExp)return i.regex;if(a instanceof Error)return i.error;const c=Object.prototype.toString.call(a);return o.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(o,a={}){return a.symbols!==!1?Reflect.ownKeys(o):Object.getOwnPropertyNames(o)}},3652:(s,i,o)=>{const a=o(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(d,h){const u=[].concat((h=h||{}).before||[]),f=[].concat(h.after||[]),g=h.group||"?",v=h.sort||0;a(!u.includes(g),`Item cannot come before itself: ${g}`),a(!u.includes("?"),"Item cannot come before unassociated items"),a(!f.includes(g),`Item cannot come after itself: ${g}`),a(!f.includes("?"),"Item cannot come after unassociated items"),Array.isArray(d)||(d=[d]);for(const m of d){const x={seq:this._items.length,sort:v,before:u,after:f,group:g,node:m};this._items.push(x)}if(!h.manual){const m=this._sort();a(m,"item",g!=="?"?`added into group ${g}`:"","created a dependencies error")}return this.nodes}merge(d){Array.isArray(d)||(d=[d]);for(const u of d)if(u)for(const f of u._items)this._items.push(Object.assign({},f));this._items.sort(c.mergeSort);for(let u=0;ud.sort===h.sort?0:d.sort{const a=o(443),c=o(2178),d={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:a.URL||URL};i.analyze=function(h,u={}){if(!h)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof h!="string")throw new Error("Invalid input: domain must be a string");if(h.length>256)return c.code("DOMAIN_TOO_LONG");if(d.nonAsciiRx.test(h)){if(u.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");h=h.normalize("NFC")}if(d.domainControlRx.test(h))return c.code("DOMAIN_INVALID_CHARS");h=d.punycode(h),u.allowFullyQualified&&h[h.length-1]==="."&&(h=h.slice(0,-1));const f=u.minDomainSegments||d.minDomainSegments,g=h.split(".");if(g.lengthu.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const v=u.tlds;if(v){const m=g[g.length-1].toLowerCase();if(v.deny&&v.deny.has(m)||v.allow&&!v.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m63)return c.code("DOMAIN_LONG_SEGMENT");if(m{const a=o(9848),c=o(5380),d=o(2178),h={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};i.analyze=function(u,f){return h.email(u,f)},i.isValid=function(u,f){return!h.email(u,f)},h.email=function(u,f={}){if(typeof u!="string")throw new Error("Invalid input: email must be a string");if(!u)return d.code("EMPTY_STRING");const g=!h.nonAsciiRx.test(u);if(!g){if(f.allowUnicode===!1)return d.code("FORBIDDEN_UNICODE");u=u.normalize("NFC")}const v=u.split("@");if(v.length!==2)return v.length>2?d.code("MULTIPLE_AT_CHAR"):d.code("MISSING_AT_CHAR");const[m,x]=v;if(!m)return d.code("EMPTY_LOCAL");if(!f.ignoreLength){if(u.length>254)return d.code("ADDRESS_TOO_LONG");if(h.encoder.encode(m).length>64)return d.code("LOCAL_TOO_LONG")}return h.local(m,g)||c.analyze(x,f)},h.local=function(u,f){const g=u.split(".");for(const v of g){if(!v.length)return d.code("EMPTY_LOCAL_SEGMENT");if(f){if(!h.atextRx.test(v))return d.code("INVALID_LOCAL_CHARS")}else for(const m of v){if(h.atextRx.test(m))continue;const x=h.binary(m);if(!h.atomRx.test(x))return d.code("INVALID_LOCAL_CHARS")}}},h.binary=function(u){return Array.from(h.encoder.encode(u)).map(f=>String.fromCharCode(f)).join("")},h.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,h.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(d={}){a(d.cidr===void 0||typeof d.cidr=="string","options.cidr must be a string");const h=d.cidr?d.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(h),"options.cidr must be one of required, optional, forbidden"),a(d.version===void 0||typeof d.version=="string"||Array.isArray(d.version),"options.version must be a string or an array of string");let u=d.version||["ipv4","ipv6","ipvfuture"];Array.isArray(u)||(u=[u]),a(u.length>=1,"options.version must have at least 1 version specified");for(let v=0;v{if(h==="forbidden")return c.ip[v];const m=`\\/${v==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return h==="required"?`${c.ip[v]}${m}`:`${c.ip[v]}(?:${m})?`}).join("|")})`,g=new RegExp(`^${f}$`);return{cidr:h,versions:u,regex:g,raw:f}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),d={generate:function(){const h={},u="\\dA-Fa-f",f="["+u+"]",g="\\w-\\.~",v="!\\$&'\\(\\)\\*\\+,;=",m="%"+u,x=g+m+v+":@",y="["+x+"]",b="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";h.ipv4address="(?:"+b+"\\.){3}"+b;const w=f+"{1,4}",E="(?:"+w+":"+w+"|"+h.ipv4address+")",R="(?:"+w+":){6}"+E,T="::(?:"+w+":){5}"+E,N="(?:"+w+")?::(?:"+w+":){4}"+E,A="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+E,D="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+E,O="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+E,I="(?:(?:"+w+":){0,4}"+w+")?::"+E,$="(?:(?:"+w+":){0,5}"+w+")?::"+w,F="(?:(?:"+w+":){0,6}"+w+")?::";h.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",h.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",h.ipv6address="(?:"+R+"|"+T+"|"+N+"|"+A+"|"+D+"|"+O+"|"+I+"|"+$+"|"+F+")",h.ipvFuture="v"+f+"+\\.["+g+v+":]+",h.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",h.schemeRegex=new RegExp(h.scheme);const B="["+g+m+v+":]*",W="["+g+m+v+"]{1,255}",Z="(?:\\[(?:"+h.ipv6address+"|"+h.ipvFuture+")\\]|"+h.ipv4address+"|"+W+")",Y="(?:"+B+"@)?"+Z+"(?::\\d*)?",H="(?:"+B+"@)?("+Z+")(?::\\d*)?",se=y+"*",he=y+"+",re="(?:\\/"+se+")*",J="\\/(?:"+he+re+")?",te=he+re,ae="["+g+m+v+"@]+"+re,be="(?:\\/\\/\\/"+se+re+")";return h.hierPart="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+te+"|"+be+")",h.hierPartCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+te+")",h.relativeRef="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+ae+"|)",h.relativeRefCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+ae+"|)",h.query="["+x+"\\/\\?]*(?=#|$)",h.queryWithSquareBrackets="["+x+"\\[\\]\\/\\?]*(?=#|$)",h.fragment="["+x+"\\/\\?]*",h}};d.rfc3986=d.generate(),i.ip={v4Cidr:d.rfc3986.ipv4Cidr,v6Cidr:d.rfc3986.ipv6Cidr,ipv4:d.rfc3986.ipv4address,ipv6:d.rfc3986.ipv6address,ipvfuture:d.rfc3986.ipvFuture},d.createRegex=function(h){const u=d.rfc3986,f="(?:\\?"+(h.allowQuerySquareBrackets?u.queryWithSquareBrackets:u.query)+")?(?:#"+u.fragment+")?",g=h.domain?u.relativeRefCapture:u.relativeRef;if(h.relativeOnly)return d.wrap(g+f);let v="";if(h.scheme){a(h.scheme instanceof RegExp||typeof h.scheme=="string"||Array.isArray(h.scheme),"scheme must be a RegExp, String, or Array");const y=[].concat(h.scheme);a(y.length>=1,"scheme must have at least 1 scheme specified");const b=[];for(let w=0;w{const o={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(a,c={}){if(!c[o.settings]&&c.constants)for(const d in c.constants){const h=c.constants[d];if(h!==null&&!["boolean","number","string"].includes(typeof h))throw new Error(`Formula constant ${d} contains invalid ${typeof h} value type`)}this.settings=c[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],d="",h=0,u=!1;const f=v=>{if(h)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(u||d||v){if(m&&m.type==="reference"&&v===")")return m.type="function",m.value=this._subFormula(d,m.value),void(d="");if(v===")"){const x=new i.Parser(d,this.settings);c.push({type:"segment",value:x})}else if(u){if(u==="]")return c.push({type:"reference",value:d}),void(d="");c.push({type:"literal",value:d})}else if(o.operatorCharacters.includes(d))m&&m.type==="operator"&&o.operators.includes(m.value+d)?m.value+=d:c.push({type:"operator",value:d});else if(d.match(o.numberRx))c.push({type:"constant",value:parseFloat(d)});else if(this.settings.constants[d]!==void 0)c.push({type:"constant",value:this.settings.constants[d]});else{if(!d.match(o.tokenRx))throw new Error(`Formula contains invalid token: ${d}`);c.push({type:"reference",value:d})}d=""}};for(const v of a)u?v===u?(f(),u=!1):d+=v:h?v==="("?(d+=v,++h):v===")"?(--h,h?d+=v:f(v)):d+=v:v in o.literals?u=o.literals[v]:v==="("?(f(),++h):o.operatorCharacters.includes(v)?(f(),d=v,f()):v!==" "?d+=v:f();f(),c=c.map((v,m)=>v.type!=="operator"||v.value!=="-"||m&&c[m-1].type!=="operator"?v:{type:"operator",value:"n"});let g=!1;for(const v of c){if(v.type==="operator"){if(o.operatorsPrefix.includes(v.value))continue;if(!g)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(v.value))throw new Error(`Formula contains an unknown operator ${v.value}`)}else if(g)throw new Error("Formula missing expected operator");g=!g}if(!g)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(v=>{if(v.type==="operator")return o.operatorsPrefix.includes(v.value)?v:v.value;if(v.type!=="reference")return v.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(v.value))throw new Error(`Formula contains invalid reference ${v.value}`);return this.settings.reference?this.settings.reference(v.value):o.reference(v.value)})}_subFormula(a,c){const d=this.settings.functions[c];if(typeof d!="function")throw new Error(`Formula contains unknown function ${c}`);let h=[];if(a){let u="",f=0,g=!1;const v=()=>{if(!u)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);h.push(u),u=""};for(let m=0;mnew i.Parser(u,this.settings)),function(u){const f=[];for(const g of h)f.push(g.evaluate(u));return d.call(u,...f)}}evaluate(a){const c=this._parts.slice();for(let d=c.length-2;d>=0;--d){const h=c[d];if(h&&h.type==="operator"){const u=c[d+1];c.splice(d+1,1);const f=o.evaluate(u,a);c[d]=o.single(h.value,f)}}return o.operatorsOrder.forEach(d=>{for(let h=1;h":return c>d;case">=":return c>=d;case"==":return c===d;case"!=":return c!==d;case"&&":return c&&d;case"||":return c||d}return null},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(Wce);var xFe=Wce.exports;const wn=Al(xFe),_Fe=e=>typeof e=="object"&&e!==null&&e.hasOwnProperty("total_items");class Vn{constructor(t){Be(this,"_object");Be(this,"_error");Be(this,"isSuccess");Be(this,"isFailure");const{isSuccess:n,error:r,object:s}=t;if(n&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!n&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error message");this.isSuccess=n,this.isFailure=!n,this._error=r,this._object=s,Object.freeze(this)}get object(){if(this.isFailure)throw new Error("Result is not successful");return this._object}get error(){if(this.isSuccess)throw new Error("Result is not error");return this._error}static ok(t){return new Vn({isSuccess:!0,object:t})}static fail(t){return new Vn({isSuccess:!1,error:t})}static combine(t){for(const n of t)if(n.isFailure)return n;return Vn.ok()}}class nr{static validate(t,n,r={}){if(!wn.isSchema(t))throw new wFe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=t.validate(n,s);return i.error?Vn.fail(i.error):Vn.ok(i.value)}static validateFnc(t){return(n,r)=>{const s=t(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}Be(nr,"RULE_NOT_NULL_OR_UNDEFINED",wn.any().required().invalid(null)),Be(nr,"RULE_ALLOW_NULL_OR_UNDEFINED",wn.any().optional().valid(null)),Be(nr,"RULE_ALLOW_NULL",wn.any().valid(null)),Be(nr,"RULE_ALLOW_EMPTY",wn.any().optional().valid(null,"")),Be(nr,"RULE_IS_TYPE_STRING",wn.string()),Be(nr,"RULE_IS_TYPE_NUMBER",wn.number());class wFe extends Error{}class iW extends Error{constructor(n,r,s={}){super(r);Be(this,"code");Be(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,iW.prototype)}}const wk=class wk extends iW{static create(t,n,r){return new wk(t,n,r)}};Be(wk,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let Pc=wk;function bp(e,t="",n){return Pc.create(e,t,n)}var qce={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Object.prototype.hasOwnProperty;e.is=function(n,r){return n===r?n!==0||r!==0||1/n===1/r:n!==n&&r!==r},e.shallowEqual=function(n,r,s){if(n===r)return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),o=Object.keys(r);if(i.length!==o.length)return!1;for(var a=s&&typeof s.customEqual=="function"?s.customEqual:e.is,c=0;cthis.props===null)}}class uh extends hR{static validate(t,n){const r=nr.RULE_ALLOW_EMPTY.default(""),s=wn.string().guid({version:["uuidv4"]}).label(n.label?n.label:"id"),i=wn.alternatives(r,s);return nr.validate(i,t)}static sanitize(t){return t.trim()}static create(t,n={}){const r={label:"id",generateOnEmpty:!1,...n};if(!t&&!r.generateOnEmpty)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,"ID is null or empty"));if(t){const s=uh.validate(t,r);return s.isFailure?Vn.fail(bp(Pc.INVALID_INPUT_DATA,s.error.message,r)):Vn.ok(new uh(uh.sanitize(s.object)))}return r.generateOnEmpty?uh.generateNewID():Vn.ok(new uh(null))}static generateNewID(){return Vn.ok(new uh(RFe()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}class M7e extends wn.ValidationError{}class I7e extends wn.ValidationError{}class L7e extends wn.ValidationError{}class j7e extends wn.ValidationError{}class $7e extends wn.ValidationError{}const z4={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"€",name:"Euro",symbol_native:"€",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},BTC:{symbol:"BTC",name:"Bitcoin",symbol_native:"฿",decimal_digits:8,rounding:0,code:"BTC",name_plural:"Bitcoins"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"د.إ.‏",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"؋",decimal_digits:2,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:2,rounding:0,code:"ALL",name_plural:"Albanian lekë"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"դր.",decimal_digits:2,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"ман.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"৳",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"лв.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"د.ب.‏",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbol_native:"BYR",decimal_digits:0,rounding:0,code:"BYR",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN¥",name:"Chinese Yuan",symbol_native:"CN¥",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"₡",name:"Costa Rican Colón",symbol_native:"₡",decimal_digits:2,rounding:0,code:"CRC",name_plural:"Costa Rican colóns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"Kč",name:"Czech Republic Koruna",symbol_native:"Kč",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"د.ج.‏",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbol_native:"kr",decimal_digits:2,rounding:0,code:"EEK",name_plural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"ج.م.‏",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"£",name:"British Pound Sterling",symbol_native:"£",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH₵",name:"Ghanaian Cedi",symbol_native:"GH₵",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:2,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:2,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"₪",name:"Israeli New Sheqel",symbol_native:"₪",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbol_native:"টকা",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"د.ع.‏",decimal_digits:3,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"﷼",decimal_digits:2,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Króna",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic krónur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"د.أ.‏",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"¥",name:"Japanese Yen",symbol_native:"¥",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"៛",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"₩",name:"South Korean Won",symbol_native:"₩",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"د.ك.‏",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"тңг.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LAK:{symbol:"₭",name:"Lao kip",symbol_native:"ກີບ",decimal_digits:2,rounding:0,code:"LAK",name_plural:"Lao kips"},LBP:{symbol:"LB£",name:"Lebanese Pound",symbol_native:"ل.ل.‏",decimal_digits:2,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbol_native:"Lt",decimal_digits:2,rounding:0,code:"LTL",name_plural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbol_native:"Ls",decimal_digits:2,rounding:0,code:"LVL",name_plural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"د.ل.‏",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"د.م.‏",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:2,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:2,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:2,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"₦",name:"Nigerian Naira",symbol_native:"₦",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan Córdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan córdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"नेरू",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"ر.ع.‏",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"₱",name:"Philippine Peso",symbol_native:"₱",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"₨",decimal_digits:2,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"zł",name:"Polish Zloty",symbol_native:"zł",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"₲",name:"Paraguayan Guarani",symbol_native:"₲",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"ر.ق.‏",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"дин.",decimal_digits:2,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"₽",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"ر.س.‏",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:2,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY£",name:"Syrian Pound",symbol_native:"ل.س.‏",decimal_digits:2,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"฿",name:"Thai Baht",symbol_native:"฿",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"د.ت.‏",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Paʻanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan paʻanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:2,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"₴",name:"Ukrainian Hryvnia",symbol_native:"₴",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:2,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bolívar",symbol_native:"Bs.F.",decimal_digits:2,rounding:0,code:"VEF",name_plural:"Venezuelan bolívars"},VND:{symbol:"₫",name:"Vietnamese Dong",symbol_native:"₫",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"ر.ي.‏",decimal_digits:2,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"ZK",decimal_digits:0,rounding:0,code:"ZMK",name_plural:"Zambian kwachas"}},fh=class fh extends hR{constructor(){super(...arguments);Be(this,"toString",()=>this.code)}get symbol(){return this.props?String(this.props.symbol_native):""}get code(){return this.props?String(this.props.code):""}static validate(n,r){const s=wn.alternatives(nr.RULE_ALLOW_EMPTY.default(""),wn.string().uppercase().valid(...Object.keys(z4)).label(String(r.label)));return nr.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=fh.validate(n,s);return i.isFailure?Vn.fail(bp(Pc.INVALID_INPUT_DATA,i.error.message,s)):Vn.ok(new fh(z4[i.object]))}static createDefaultCode(){return fh.createFromCode(fh.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Be(fh,"DEFAULT_CURRENCY_CODE","EUR"),Be(fh,"CURRENCIES",z4);let Rv=fh;class F7e extends wn.ValidationError{}const B4={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},hh=class hh extends hR{constructor(){super(...arguments);Be(this,"toString",()=>this.code)}static validate(n,r){const s=wn.alternatives(nr.RULE_ALLOW_EMPTY.default(""),wn.string().lowercase().valid(...Object.keys(B4)).label(String(r.label)));return nr.validate(s,n)}static sanitize(n){return n?String(n).toLowerCase():void 0}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"lang_code"},i=hh.validate(n,s);if(i.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,i.error.message,s));const o=hh.sanitize(i.object),a=o?{...B4[i.object],code:o}:void 0;return Vn.ok(new hh(a))}static createDefaultCode(){return hh.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Be(hh,"DEFAULT_LANGUAGE_CODE","es"),Be(hh,"LANGUAGES",B4);let U1=hh;var PFe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},NFe={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function V1(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V1=function(t){return typeof t}:V1=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V1(e)}function dK(e){return TFe(e)||kFe(e)||DFe(e)||OFe()}function TFe(e){if(Array.isArray(e))return e}function kFe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function DFe(e,t){if(e){if(typeof e=="string")return fK(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fK(e,t)}}function fK(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0}function LFe(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function hK(e){return e%2===0}function pK(e){return Gce(e)&&!Number.isInteger(e)}function jFe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}function GS(e){return Math.abs(e)%1===.5}function $Fe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,r){var s=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){s.readyState===4&&(s.status>=200&&s.status<400?n(JSON.parse(s.responseText)):r(new Error(s.statusText)))},onerror:function(){r(new Error("Network error"))}});s.open("GET",e,!0),FFe(s,t.headers),s.send()})}function FFe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function h1(e){return typeof e>"u"}function Kce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(e).forEach(function(r){if(V1(r[1])==="object"){var s=Kce(r[1]);Object.entries(s).forEach(function(i){n[r[0]+t+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function zFe(e){return!!e&&(V1(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Yce(){var e=function(r,s){var i=function(c){return Math.pow(10,jFe(c))},o=Math.max(i(r),i(s));return Math.round(r*o)*Math.round(s*o)/(o*o)},t={HALF_ODD:function(r){var s=Math.round(r);return GS(r)&&hK(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return GS(r)?hK(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return GS(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return GS(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return GS(r)?Math.sign(r)*Math.ceil(Math.abs(r)):Math.round(r)},DOWN:function(r){return Math.floor(r)}};return{add:function(r,s){return r+s},subtract:function(r,s){return r-s},multiply:function(r,s){return pK(r)||pK(s)?e(r,s):r*s},divide:function(r,s){return r/s},modulo:function(r,s){return r%s},round:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[s](r)}}}var BFe=Yce();function UFe(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(r){return!h1(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return h1(this.getMatches().find(r))?0:this.getMatches()[BFe.add(this.getMatches().findIndex(r),1)].split("").length},getCurrencyDisplay:function(){var r={USD:"code",dollar:"name",$:"symbol"};return r[this.getMatches().find(function(s){return s==="USD"||s==="dollar"||s==="$"})]},getStyle:function(){return h1(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!h1(this.getMatches().find(function(r){return r===","}))}}}function VFe(e){var t=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;for(var o in i)s=s.replace("{{".concat(o,"}}"),i[o]);return s},n=function(s,i){return $Fe(t(e.endpoint,{from:s,to:i}),{headers:e.headers})};return{getExchangeRate:function(s,i){return(zFe(e.endpoint)?e.endpoint:n(s,i)).then(function(o){return Kce(o)[t(e.propertyPath,{from:s,to:i})]})}}}function IC(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new n(t)}function HFe(e){IC(IFe(e),"You must provide a numeric value between 0 and 100.",RangeError)}function WFe(e){IC(LFe(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function U4(e){IC(Number.isInteger(e),"You must provide an integer.",TypeError)}var $r=Yce(),qFe=function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,s=n.currency,i=n.precision;U4(r),U4(i);var o=e.globalLocale,a=e.globalFormat,c=e.globalRoundingMode,d=e.globalFormatRoundingMode,h=Object.assign({},e.globalExchangeRatesApi),u=function(v){var m=Object.assign({},Object.assign({},{amount:r,currency:s,precision:i},v),Object.assign({},{locale:this.locale},v));return Object.assign(e({amount:m.amount,currency:m.currency,precision:m.precision}),{locale:m.locale})},f=function(v){IC(this.hasSameCurrency(v),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return s},getLocale:function(){return this.locale||o},setLocale:function(v){return u.call(this,{locale:v})},getPrecision:function(){return i},convertPrecision:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d;U4(v);var x=this.getPrecision(),y=v>x,b=y?$r.multiply:$r.divide,w=y?[v,x]:[x,v],E=Math.pow(10,$r.subtract.apply($r,w));return u.call(this,{amount:$r.round(b(this.getAmount(),E),m),precision:v})},add:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return u.call(this,{amount:$r.add(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},subtract:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return u.call(this,{amount:$r.subtract(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},multiply:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u.call(this,{amount:$r.round($r.multiply(this.getAmount(),v),m)})},divide:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u.call(this,{amount:$r.round($r.divide(this.getAmount(),v),m)})},percentage:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return HFe(v),this.multiply($r.divide(v,100),m)},allocate:function(v){var m=this;WFe(v);for(var x=v.reduce(function(E,R){return $r.add(E,R)}),y=this.getAmount(),b=v.map(function(E){var R=Math.floor($r.divide($r.multiply(m.getAmount(),E),x));return y=$r.subtract(y,R),u.call(m,{amount:R})}),w=0;y>0;)v[w]>0&&(b[w]=b[w].add(u.call(this,{amount:1})),y=$r.subtract(y,1)),w+=1;return b},convert:function(v){var m=this,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=x.endpoint,b=y===void 0?h.endpoint:y,w=x.propertyPath,E=w===void 0?h.propertyPath||"rates.{{to}}":w,R=x.headers,T=R===void 0?h.headers:R,N=x.roundingMode,A=N===void 0?c:N,D=Object.assign({},{endpoint:b,propertyPath:E,headers:T,roundingMode:A});return VFe(D).getExchangeRate(this.getCurrency(),v).then(function(O){return IC(!h1(O),'No rate was found for the destination currency "'.concat(v,'".'),TypeError),u.call(m,{amount:$r.round($r.multiply(m.getAmount(),parseFloat(O)),D.roundingMode),currency:v})})},equalsTo:function(v){return this.hasSameAmount(v)&&this.hasSameCurrency(v)},lessThan:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return m[0].getAmount()m[1].getAmount()},greaterThanOrEqual:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return m[0].getAmount()>=m[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return $r.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return $r.modulo(this.getAmount(),Math.pow(10,i))!==0},hasSameCurrency:function(v){return this.getCurrency()===v.getCurrency()},hasSameAmount:function(v){var m=e.normalizePrecision([this,v]);return m[0].getAmount()===m[1].getAmount()},toFormat:function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,x=UFe(v);return this.toRoundedUnit(x.getMinimumFractionDigits(),m).toLocaleString(this.getLocale(),{currencyDisplay:x.getCurrencyDisplay(),useGrouping:x.getUseGrouping(),minimumFractionDigits:x.getMinimumFractionDigits(),style:x.getStyle(),currency:this.getCurrency()})},toUnit:function(){return $r.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,x=Math.pow(10,v);return $r.divide($r.round($r.multiply(this.toUnit(),x),m),x)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},bP=Object.assign(qFe,PFe,NFe,MFe),YT={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */YT.exports;(function(e,t){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",d=500,h="__lodash_placeholder__",u=1,f=2,g=4,v=1,m=2,x=1,y=2,b=4,w=8,E=16,R=32,T=64,N=128,A=256,D=512,O=30,I="...",$=800,F=16,B=1,W=2,Z=3,Y=1/0,H=9007199254740991,se=17976931348623157e292,he=NaN,re=4294967295,J=re-1,te=re>>>1,ae=[["ary",N],["bind",x],["bindKey",y],["curry",w],["curryRight",E],["flip",D],["partial",R],["partialRight",T],["rearg",A]],be="[object Arguments]",xe="[object Array]",ve="[object AsyncFunction]",Pe="[object Boolean]",Oe="[object Date]",ke="[object DOMException]",ze="[object Error]",$e="[object Function]",Te="[object GeneratorFunction]",Ue="[object Map]",wt="[object Number]",ut="[object Null]",St="[object Object]",Nn="[object Promise]",cn="[object Proxy]",hn="[object RegExp]",It="[object Set]",U="[object String]",ee="[object Symbol]",ie="[object Undefined]",_e="[object WeakMap]",we="[object WeakSet]",pe="[object ArrayBuffer]",Se="[object DataView]",Fe="[object Float32Array]",ft="[object Float64Array]",ht="[object Int8Array]",hs="[object Int16Array]",Mn="[object Int32Array]",Hr="[object Uint8Array]",Yt="[object Uint8ClampedArray]",un="[object Uint16Array]",xn="[object Uint32Array]",Ze=/\b__p \+= '';/g,Rt=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ut=/&(?:amp|lt|gt|quot|#39);/g,yt=/[&<>"']/g,dn=RegExp(Ut.source),Gt=RegExp(yt.source),Hn=/<%-([\s\S]+?)%>/g,In=/<%([\s\S]+?)%>/g,Tn=/<%=([\s\S]+?)%>/g,sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kr=/^\w*$/,ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,de=/[\\^$.*+?()[\]{}|]/g,ye=RegExp(de.source),Ce=/^\s+/,Me=/\s/,Ge=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dt=/[()=,{}\[\]\/\s]/,ot=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,Jt=/^[-+]0x[0-9a-f]+$/i,ps=/^0b[01]+$/i,Wn=/^\[object .+?Constructor\]$/,pn=/^0o[0-7]+$/i,wr=/^(?:0|[1-9]\d*)$/,Lc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,oo=/($^)/,fa=/['\n\r\u2028\u2029\\]/g,As="\\ud800-\\udfff",$p="\\u0300-\\u036f",Bu="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",jc=$p+Bu+Tl,$c="\\u2700-\\u27bf",en="a-z\\xdf-\\xf6\\xf8-\\xff",Sr="\\xac\\xb1\\xd7\\xf7",Fc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Uu="\\u2000-\\u206f",Wr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",nl="A-Z\\xc0-\\xd6\\xd8-\\xde",Kf="\\ufe0e\\ufe0f",Fp=Sr+Fc+Uu+Wr,zp="['’]",dM="["+As+"]",o_="["+Fp+"]",Vu="["+jc+"]",a_="\\d+",fM="["+$c+"]",l_="["+en+"]",c_="[^"+As+Fp+a_+$c+en+nl+"]",Bp="\\ud83c[\\udffb-\\udfff]",hM="(?:"+Vu+"|"+Bp+")",u_="[^"+As+"]",Up="(?:\\ud83c[\\udde6-\\uddff]){2}",Vp="[\\ud800-\\udbff][\\udc00-\\udfff]",ha="["+nl+"]",d_="\\u200d",f_="(?:"+l_+"|"+c_+")",pM="(?:"+ha+"|"+c_+")",h_="(?:"+zp+"(?:d|ll|m|re|s|t|ve))?",p_="(?:"+zp+"(?:D|LL|M|RE|S|T|VE))?",m_=hM+"?",g_="["+Kf+"]?",mM="(?:"+d_+"(?:"+[u_,Up,Vp].join("|")+")"+g_+m_+")*",gM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",v_=g_+m_+mM,yM="(?:"+[fM,Up,Vp].join("|")+")"+v_,bM="(?:"+[u_+Vu+"?",Vu,Up,Vp,dM].join("|")+")",xM=RegExp(zp,"g"),_M=RegExp(Vu,"g"),Hp=RegExp(Bp+"(?="+Bp+")|"+bM+v_,"g"),wM=RegExp([ha+"?"+l_+"+"+h_+"(?="+[o_,ha,"$"].join("|")+")",pM+"+"+p_+"(?="+[o_,ha+f_,"$"].join("|")+")",ha+"?"+f_+"+"+h_,ha+"+"+p_,vM,gM,a_,yM].join("|"),"g"),SM=RegExp("["+d_+As+jc+Kf+"]"),CM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,EM=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],AM=-1,Tt={};Tt[Fe]=Tt[ft]=Tt[ht]=Tt[hs]=Tt[Mn]=Tt[Hr]=Tt[Yt]=Tt[un]=Tt[xn]=!0,Tt[be]=Tt[xe]=Tt[pe]=Tt[Pe]=Tt[Se]=Tt[Oe]=Tt[ze]=Tt[$e]=Tt[Ue]=Tt[wt]=Tt[St]=Tt[hn]=Tt[It]=Tt[U]=Tt[_e]=!1;var Nt={};Nt[be]=Nt[xe]=Nt[pe]=Nt[Se]=Nt[Pe]=Nt[Oe]=Nt[Fe]=Nt[ft]=Nt[ht]=Nt[hs]=Nt[Mn]=Nt[Ue]=Nt[wt]=Nt[St]=Nt[hn]=Nt[It]=Nt[U]=Nt[ee]=Nt[Hr]=Nt[Yt]=Nt[un]=Nt[xn]=!0,Nt[ze]=Nt[$e]=Nt[_e]=!1;var RM={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},PM={"&":"&","<":"<",">":">",'"':""","'":"'"},NM={"&":"&","<":"<",">":">",""":'"',"'":"'"},TM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kM=parseFloat,DM=parseInt,y_=typeof xr=="object"&&xr&&xr.Object===Object&&xr,OM=typeof self=="object"&&self&&self.Object===Object&&self,mn=y_||OM||Function("return this")(),Wp=t&&!t.nodeType&&t,ao=Wp&&!0&&e&&!e.nodeType&&e,b_=ao&&ao.exports===Wp,qp=b_&&y_.process,Nr=function(){try{var X=ao&&ao.require&&ao.require("util").types;return X||qp&&qp.binding&&qp.binding("util")}catch{}}(),x_=Nr&&Nr.isArrayBuffer,__=Nr&&Nr.isDate,w_=Nr&&Nr.isMap,S_=Nr&&Nr.isRegExp,C_=Nr&&Nr.isSet,E_=Nr&&Nr.isTypedArray;function dr(X,oe,ne){switch(ne.length){case 0:return X.call(oe);case 1:return X.call(oe,ne[0]);case 2:return X.call(oe,ne[0],ne[1]);case 3:return X.call(oe,ne[0],ne[1],ne[2])}return X.apply(oe,ne)}function MM(X,oe,ne,Re){for(var We=-1,pt=X==null?0:X.length;++We-1}function Gp(X,oe,ne){for(var Re=-1,We=X==null?0:X.length;++Re-1;);return ne}function O_(X,oe){for(var ne=X.length;ne--&&pa(oe,X[ne],0)>-1;);return ne}function VM(X,oe){for(var ne=X.length,Re=0;ne--;)X[ne]===oe&&++Re;return Re}var HM=Qp(RM),WM=Qp(PM);function qM(X){return"\\"+TM[X]}function GM(X,oe){return X==null?n:X[oe]}function ma(X){return SM.test(X)}function KM(X){return CM.test(X)}function YM(X){for(var oe,ne=[];!(oe=X.next()).done;)ne.push(oe.value);return ne}function tm(X){var oe=-1,ne=Array(X.size);return X.forEach(function(Re,We){ne[++oe]=[We,Re]}),ne}function M_(X,oe){return function(ne){return X(oe(ne))}}function mi(X,oe){for(var ne=-1,Re=X.length,We=0,pt=[];++ne-1}function LI(l,p){var S=this.__data__,k=ad(S,l);return k<0?(++this.size,S.push([l,p])):S[k][1]=p,this}Ms.prototype.clear=DI,Ms.prototype.delete=OI,Ms.prototype.get=MI,Ms.prototype.has=II,Ms.prototype.set=LI;function Is(l){var p=-1,S=l==null?0:l.length;for(this.clear();++p=p?l:p)),l}function Or(l,p,S,k,M,j){var z,q=p&u,Q=p&f,le=p&g;if(S&&(z=M?S(l,k,M,j):S(l)),z!==n)return z;if(!jt(l))return l;var ce=qe(l);if(ce){if(z=zL(l),!q)return Gn(l,z)}else{var me=Cn(l),Ee=me==$e||me==Te;if(_i(l))return gw(l,q);if(me==St||me==be||Ee&&!M){if(z=Q||Ee?{}:Iw(l),!q)return Q?NL(l,ZI(z,l)):PL(l,q_(z,l))}else{if(!Nt[me])return M?l:{};z=BL(l,me,q)}}j||(j=new Xr);var De=j.get(l);if(De)return De;j.set(l,z),uS(l)?l.forEach(function(je){z.add(Or(je,p,S,je,l,j))}):lS(l)&&l.forEach(function(je,Je){z.set(Je,Or(je,p,S,Je,l,j))});var Le=le?Q?Rm:Am:Q?Yn:rn,Xe=ce?n:Le(l);return Tr(Xe||l,function(je,Je){Xe&&(Je=je,je=l[Je]),jl(z,Je,Or(je,p,S,Je,l,j))}),z}function JI(l){var p=rn(l);return function(S){return G_(S,l,p)}}function G_(l,p,S){var k=S.length;if(l==null)return!k;for(l=Et(l);k--;){var M=S[k],j=p[M],z=l[M];if(z===n&&!(M in l)||!j(z))return!1}return!0}function K_(l,p,S){if(typeof l!="function")throw new kr(o);return Hl(function(){l.apply(n,S)},p)}function $l(l,p,S,k){var M=-1,j=Hu,z=!0,q=l.length,Q=[],le=p.length;if(!q)return Q;S&&(p=Ot(p,fr(S))),k?(j=Gp,z=!1):p.length>=s&&(j=kl,z=!1,p=new uo(p));e:for(;++MM?0:M+S),k=k===n||k>M?M:Ke(k),k<0&&(k+=M),k=S>k?0:fS(k);S0&&S(q)?p>1?gn(q,p-1,S,k,M):pi(M,q):k||(M[M.length]=q)}return M}var lm=ww(),Q_=ww(!0);function ms(l,p){return l&&lm(l,p,rn)}function cm(l,p){return l&&Q_(l,p,rn)}function cd(l,p){return hi(p,function(S){return zs(l[S])})}function ho(l,p){p=bi(p,l);for(var S=0,k=p.length;l!=null&&Sp}function nL(l,p){return l!=null&&bt.call(l,p)}function rL(l,p){return l!=null&&p in Et(l)}function sL(l,p,S){return l>=Sn(p,S)&&l=120&&ce.length>=120)?new uo(z&&ce):n}ce=l[0];var me=-1,Ee=q[0];e:for(;++me-1;)q!==l&&ed.call(q,Q,1),ed.call(l,Q,1);return l}function lw(l,p){for(var S=l?p.length:0,k=S-1;S--;){var M=p[S];if(S==k||M!==j){var j=M;Fs(M)?ed.call(l,M,1):bm(l,M)}}return l}function gm(l,p){return l+rd(U_()*(p-l+1))}function vL(l,p,S,k){for(var M=-1,j=Qt(nd((p-l)/(S||1)),0),z=ne(j);j--;)z[k?j:++M]=l,l+=S;return z}function vm(l,p){var S="";if(!l||p<1||p>H)return S;do p%2&&(S+=l),p=rd(p/2),p&&(l+=l);while(p);return S}function Qe(l,p){return Mm($w(l,p,Xn),l+"")}function yL(l){return W_(Aa(l))}function bL(l,p){var S=Aa(l);return xd(S,fo(p,0,S.length))}function Bl(l,p,S,k){if(!jt(l))return l;p=bi(p,l);for(var M=-1,j=p.length,z=j-1,q=l;q!=null&&++MM?0:M+p),S=S>M?M:S,S<0&&(S+=M),M=p>S?0:S-p>>>0,p>>>=0;for(var j=ne(M);++k>>1,z=l[j];z!==null&&!pr(z)&&(S?z<=p:z=s){var le=p?null:OL(l);if(le)return qu(le);z=!1,M=kl,Q=new uo}else Q=p?[]:q;e:for(;++k=k?l:Mr(l,p,S)}var mw=uI||function(l){return mn.clearTimeout(l)};function gw(l,p){if(p)return l.slice();var S=l.length,k=j_?j_(S):new l.constructor(S);return l.copy(k),k}function Sm(l){var p=new l.constructor(l.byteLength);return new Zu(p).set(new Zu(l)),p}function CL(l,p){var S=p?Sm(l.buffer):l.buffer;return new l.constructor(S,l.byteOffset,l.byteLength)}function EL(l){var p=new l.constructor(l.source,Lt.exec(l));return p.lastIndex=l.lastIndex,p}function AL(l){return Ll?Et(Ll.call(l)):{}}function vw(l,p){var S=p?Sm(l.buffer):l.buffer;return new l.constructor(S,l.byteOffset,l.length)}function yw(l,p){if(l!==p){var S=l!==n,k=l===null,M=l===l,j=pr(l),z=p!==n,q=p===null,Q=p===p,le=pr(p);if(!q&&!le&&!j&&l>p||j&&z&&Q&&!q&&!le||k&&z&&Q||!S&&Q||!M)return 1;if(!k&&!j&&!le&&l=q)return Q;var le=S[k];return Q*(le=="desc"?-1:1)}}return l.index-p.index}function bw(l,p,S,k){for(var M=-1,j=l.length,z=S.length,q=-1,Q=p.length,le=Qt(j-z,0),ce=ne(Q+le),me=!k;++q1?S[M-1]:n,z=M>2?S[2]:n;for(j=l.length>3&&typeof j=="function"?(M--,j):n,z&&jn(S[0],S[1],z)&&(j=M<3?n:j,M=1),p=Et(p);++k-1?M[j?p[z]:z]:n}}function Ew(l){return $s(function(p){var S=p.length,k=S,M=Dr.prototype.thru;for(l&&p.reverse();k--;){var j=p[k];if(typeof j!="function")throw new kr(o);if(M&&!z&&yd(j)=="wrapper")var z=new Dr([],!0)}for(k=z?k:S;++k1&&rt.reverse(),ce&&Qq))return!1;var le=j.get(l),ce=j.get(p);if(le&&ce)return le==p&&ce==l;var me=-1,Ee=!0,De=S&m?new uo:n;for(j.set(l,p),j.set(p,l);++me1?"& ":"")+p[k],p=p.join(S>2?", ":" "),l.replace(Ge,`{ /* [wrapped with `+p+`] */ `)}function VL(l){return qe(l)||go(l)||!!(z_&&l&&l[z_])}function Fs(l,p){var S=typeof l;return p=p??H,!!p&&(S=="number"||S!="symbol"&&wr.test(l))&&l>-1&&l%1==0&&l0){if(++p>=$)return arguments[0]}else p=0;return l.apply(n,arguments)}}function xd(l,p){var S=-1,k=l.length,M=k-1;for(p=p===n?k:p;++S1?l[p-1]:n;return S=typeof S=="function"?(l.pop(),S):n,Xw(l,S)});function Qw(l){var p=L(l);return p.__chain__=!0,p}function e2(l,p){return p(l),l}function _d(l,p){return p(l)}var t2=$s(function(l){var p=l.length,S=p?l[0]:0,k=this.__wrapped__,M=function(j){return am(j,l)};return p>1||this.__actions__.length||!(k instanceof et)||!Fs(S)?this.thru(M):(k=k.slice(S,+S+(p?1:0)),k.__actions__.push({func:_d,args:[M],thisArg:n}),new Dr(k,this.__chain__).thru(function(j){return p&&!j.length&&j.push(n),j}))});function n2(){return Qw(this)}function r2(){return new Dr(this.value(),this.__chain__)}function s2(){this.__values__===n&&(this.__values__=dS(this.value()));var l=this.__index__>=this.__values__.length,p=l?n:this.__values__[this.__index__++];return{done:l,value:p}}function i2(){return this}function o2(l){for(var p,S=this;S instanceof od;){var k=Hw(S);k.__index__=0,k.__values__=n,p?M.__wrapped__=k:p=k;var M=k;S=S.__wrapped__}return M.__wrapped__=l,p}function a2(){var l=this.__wrapped__;if(l instanceof et){var p=l;return this.__actions__.length&&(p=new et(this)),p=p.reverse(),p.__actions__.push({func:_d,args:[Im],thisArg:n}),new Dr(p,this.__chain__)}return this.thru(Im)}function l2(){return hw(this.__wrapped__,this.__actions__)}var c2=hd(function(l,p,S){bt.call(l,S)?++l[S]:Ls(l,S,1)});function u2(l,p,S){var k=qe(l)?A_:eL;return S&&jn(l,p,S)&&(p=n),k(l,Ie(p,3))}function d2(l,p){var S=qe(l)?hi:X_;return S(l,Ie(p,3))}var f2=Cw(Ww),h2=Cw(qw);function p2(l,p){return gn(wd(l,p),1)}function m2(l,p){return gn(wd(l,p),Y)}function g2(l,p,S){return S=S===n?1:Ke(S),gn(wd(l,p),S)}function Zw(l,p){var S=qe(l)?Tr:vi;return S(l,Ie(p,3))}function Jw(l,p){var S=qe(l)?IM:Y_;return S(l,Ie(p,3))}var v2=hd(function(l,p,S){bt.call(l,S)?l[S].push(p):Ls(l,S,[p])});function y2(l,p,S,k){l=Kn(l)?l:Aa(l),S=S&&!k?Ke(S):0;var M=l.length;return S<0&&(S=Qt(M+S,0)),Rd(l)?S<=M&&l.indexOf(p,S)>-1:!!M&&pa(l,p,S)>-1}var b2=Qe(function(l,p,S){var k=-1,M=typeof p=="function",j=Kn(l)?ne(l.length):[];return vi(l,function(z){j[++k]=M?dr(p,z,S):Fl(z,p,S)}),j}),x2=hd(function(l,p,S){Ls(l,S,p)});function wd(l,p){var S=qe(l)?Ot:nw;return S(l,Ie(p,3))}function _2(l,p,S,k){return l==null?[]:(qe(p)||(p=p==null?[]:[p]),S=k?n:S,qe(S)||(S=S==null?[]:[S]),ow(l,p,S))}var w2=hd(function(l,p,S){l[S?0:1].push(p)},function(){return[[],[]]});function S2(l,p,S){var k=qe(l)?Kp:T_,M=arguments.length<3;return k(l,Ie(p,4),S,M,vi)}function C2(l,p,S){var k=qe(l)?LM:T_,M=arguments.length<3;return k(l,Ie(p,4),S,M,Y_)}function E2(l,p){var S=qe(l)?hi:X_;return S(l,Ed(Ie(p,3)))}function A2(l){var p=qe(l)?W_:yL;return p(l)}function R2(l,p,S){(S?jn(l,p,S):p===n)?p=1:p=Ke(p);var k=qe(l)?YI:bL;return k(l,p)}function P2(l){var p=qe(l)?XI:_L;return p(l)}function N2(l){if(l==null)return 0;if(Kn(l))return Rd(l)?ga(l):l.length;var p=Cn(l);return p==Ue||p==It?l.size:hm(l).length}function T2(l,p,S){var k=qe(l)?Yp:wL;return S&&jn(l,p,S)&&(p=n),k(l,Ie(p,3))}var k2=Qe(function(l,p){if(l==null)return[];var S=p.length;return S>1&&jn(l,p[0],p[1])?p=[]:S>2&&jn(p[0],p[1],p[2])&&(p=[p[0]]),ow(l,gn(p,1),[])}),Sd=dI||function(){return mn.Date.now()};function D2(l,p){if(typeof p!="function")throw new kr(o);return l=Ke(l),function(){if(--l<1)return p.apply(this,arguments)}}function eS(l,p,S){return p=S?n:p,p=l&&p==null?l.length:p,js(l,N,n,n,n,n,p)}function tS(l,p){var S;if(typeof p!="function")throw new kr(o);return l=Ke(l),function(){return--l>0&&(S=p.apply(this,arguments)),l<=1&&(p=n),S}}var jm=Qe(function(l,p,S){var k=x;if(S.length){var M=mi(S,Ca(jm));k|=R}return js(l,k,p,S,M)}),nS=Qe(function(l,p,S){var k=x|y;if(S.length){var M=mi(S,Ca(nS));k|=R}return js(p,k,l,S,M)});function rS(l,p,S){p=S?n:p;var k=js(l,w,n,n,n,n,n,p);return k.placeholder=rS.placeholder,k}function sS(l,p,S){p=S?n:p;var k=js(l,E,n,n,n,n,n,p);return k.placeholder=sS.placeholder,k}function iS(l,p,S){var k,M,j,z,q,Q,le=0,ce=!1,me=!1,Ee=!0;if(typeof l!="function")throw new kr(o);p=Lr(p)||0,jt(S)&&(ce=!!S.leading,me="maxWait"in S,j=me?Qt(Lr(S.maxWait)||0,p):j,Ee="trailing"in S?!!S.trailing:Ee);function De(Ht){var Zr=k,Us=M;return k=M=n,le=Ht,z=l.apply(Us,Zr),z}function Le(Ht){return le=Ht,q=Hl(Je,p),ce?De(Ht):z}function Xe(Ht){var Zr=Ht-Q,Us=Ht-le,CS=p-Zr;return me?Sn(CS,j-Us):CS}function je(Ht){var Zr=Ht-Q,Us=Ht-le;return Q===n||Zr>=p||Zr<0||me&&Us>=j}function Je(){var Ht=Sd();if(je(Ht))return rt(Ht);q=Hl(Je,Xe(Ht))}function rt(Ht){return q=n,Ee&&k?De(Ht):(k=M=n,z)}function mr(){q!==n&&mw(q),le=0,k=Q=M=q=n}function $n(){return q===n?z:rt(Sd())}function gr(){var Ht=Sd(),Zr=je(Ht);if(k=arguments,M=this,Q=Ht,Zr){if(q===n)return Le(Q);if(me)return mw(q),q=Hl(Je,p),De(Q)}return q===n&&(q=Hl(Je,p)),z}return gr.cancel=mr,gr.flush=$n,gr}var O2=Qe(function(l,p){return K_(l,1,p)}),M2=Qe(function(l,p,S){return K_(l,Lr(p)||0,S)});function I2(l){return js(l,D)}function Cd(l,p){if(typeof l!="function"||p!=null&&typeof p!="function")throw new kr(o);var S=function(){var k=arguments,M=p?p.apply(this,k):k[0],j=S.cache;if(j.has(M))return j.get(M);var z=l.apply(this,k);return S.cache=j.set(M,z)||j,z};return S.cache=new(Cd.Cache||Is),S}Cd.Cache=Is;function Ed(l){if(typeof l!="function")throw new kr(o);return function(){var p=arguments;switch(p.length){case 0:return!l.call(this);case 1:return!l.call(this,p[0]);case 2:return!l.call(this,p[0],p[1]);case 3:return!l.call(this,p[0],p[1],p[2])}return!l.apply(this,p)}}function L2(l){return tS(2,l)}var j2=SL(function(l,p){p=p.length==1&&qe(p[0])?Ot(p[0],fr(Ie())):Ot(gn(p,1),fr(Ie()));var S=p.length;return Qe(function(k){for(var M=-1,j=Sn(k.length,S);++M=p}),go=J_(function(){return arguments}())?J_:function(l){return Ft(l)&&bt.call(l,"callee")&&!F_.call(l,"callee")},qe=ne.isArray,Z2=x_?fr(x_):oL;function Kn(l){return l!=null&&Ad(l.length)&&!zs(l)}function Vt(l){return Ft(l)&&Kn(l)}function J2(l){return l===!0||l===!1||Ft(l)&&Ln(l)==Pe}var _i=hI||Ym,e$=__?fr(__):aL;function t$(l){return Ft(l)&&l.nodeType===1&&!Wl(l)}function n$(l){if(l==null)return!0;if(Kn(l)&&(qe(l)||typeof l=="string"||typeof l.splice=="function"||_i(l)||Ea(l)||go(l)))return!l.length;var p=Cn(l);if(p==Ue||p==It)return!l.size;if(Vl(l))return!hm(l).length;for(var S in l)if(bt.call(l,S))return!1;return!0}function r$(l,p){return zl(l,p)}function s$(l,p,S){S=typeof S=="function"?S:n;var k=S?S(l,p):n;return k===n?zl(l,p,n,S):!!k}function Fm(l){if(!Ft(l))return!1;var p=Ln(l);return p==ze||p==ke||typeof l.message=="string"&&typeof l.name=="string"&&!Wl(l)}function i$(l){return typeof l=="number"&&B_(l)}function zs(l){if(!jt(l))return!1;var p=Ln(l);return p==$e||p==Te||p==ve||p==cn}function aS(l){return typeof l=="number"&&l==Ke(l)}function Ad(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=H}function jt(l){var p=typeof l;return l!=null&&(p=="object"||p=="function")}function Ft(l){return l!=null&&typeof l=="object"}var lS=w_?fr(w_):cL;function o$(l,p){return l===p||fm(l,p,Nm(p))}function a$(l,p,S){return S=typeof S=="function"?S:n,fm(l,p,Nm(p),S)}function l$(l){return cS(l)&&l!=+l}function c$(l){if(qL(l))throw new We(i);return ew(l)}function u$(l){return l===null}function d$(l){return l==null}function cS(l){return typeof l=="number"||Ft(l)&&Ln(l)==wt}function Wl(l){if(!Ft(l)||Ln(l)!=St)return!1;var p=Ju(l);if(p===null)return!0;var S=bt.call(p,"constructor")&&p.constructor;return typeof S=="function"&&S instanceof S&&Yu.call(S)==aI}var zm=S_?fr(S_):uL;function f$(l){return aS(l)&&l>=-9007199254740991&&l<=H}var uS=C_?fr(C_):dL;function Rd(l){return typeof l=="string"||!qe(l)&&Ft(l)&&Ln(l)==U}function pr(l){return typeof l=="symbol"||Ft(l)&&Ln(l)==ee}var Ea=E_?fr(E_):fL;function h$(l){return l===n}function p$(l){return Ft(l)&&Cn(l)==_e}function m$(l){return Ft(l)&&Ln(l)==we}var g$=vd(pm),v$=vd(function(l,p){return l<=p});function dS(l){if(!l)return[];if(Kn(l))return Rd(l)?Yr(l):Gn(l);if(Dl&&l[Dl])return YM(l[Dl]());var p=Cn(l),S=p==Ue?tm:p==It?qu:Aa;return S(l)}function Bs(l){if(!l)return l===0?l:0;if(l=Lr(l),l===Y||l===-1/0){var p=l<0?-1:1;return p*se}return l===l?l:0}function Ke(l){var p=Bs(l),S=p%1;return p===p?S?p-S:p:0}function fS(l){return l?fo(Ke(l),0,re):0}function Lr(l){if(typeof l=="number")return l;if(pr(l))return he;if(jt(l)){var p=typeof l.valueOf=="function"?l.valueOf():l;l=jt(p)?p+"":p}if(typeof l!="string")return l===0?l:+l;l=k_(l);var S=ps.test(l);return S||pn.test(l)?DM(l.slice(2),S?2:8):Jt.test(l)?he:+l}function hS(l){return gs(l,Yn(l))}function y$(l){return l?fo(Ke(l),-9007199254740991,H):l===0?l:0}function vt(l){return l==null?"":hr(l)}var b$=wa(function(l,p){if(Vl(p)||Kn(p)){gs(p,rn(p),l);return}for(var S in p)bt.call(p,S)&&jl(l,S,p[S])}),pS=wa(function(l,p){gs(p,Yn(p),l)}),Pd=wa(function(l,p,S,k){gs(p,Yn(p),l,k)}),x$=wa(function(l,p,S,k){gs(p,rn(p),l,k)}),_$=$s(am);function w$(l,p){var S=_a(l);return p==null?S:q_(S,p)}var S$=Qe(function(l,p){l=Et(l);var S=-1,k=p.length,M=k>2?p[2]:n;for(M&&jn(p[0],p[1],M)&&(k=1);++S1),j}),gs(l,Rm(l),S),k&&(S=Or(S,u|f|g,ML));for(var M=p.length;M--;)bm(S,p[M]);return S});function B$(l,p){return gS(l,Ed(Ie(p)))}var U$=$s(function(l,p){return l==null?{}:mL(l,p)});function gS(l,p){if(l==null)return{};var S=Ot(Rm(l),function(k){return[k]});return p=Ie(p),aw(l,S,function(k,M){return p(k,M[0])})}function V$(l,p,S){p=bi(p,l);var k=-1,M=p.length;for(M||(M=1,l=n);++kp){var k=l;l=p,p=k}if(S||l%1||p%1){var M=U_();return Sn(l+M*(p-l+kM("1e-"+((M+"").length-1))),p)}return gm(l,p)}var eF=Sa(function(l,p,S){return p=p.toLowerCase(),l+(S?bS(p):p)});function bS(l){return Vm(vt(l).toLowerCase())}function xS(l){return l=vt(l),l&&l.replace(Lc,HM).replace(_M,"")}function tF(l,p,S){l=vt(l),p=hr(p);var k=l.length;S=S===n?k:fo(Ke(S),0,k);var M=S;return S-=p.length,S>=0&&l.slice(S,M)==p}function nF(l){return l=vt(l),l&&Gt.test(l)?l.replace(yt,WM):l}function rF(l){return l=vt(l),l&&ye.test(l)?l.replace(de,"\\$&"):l}var sF=Sa(function(l,p,S){return l+(S?"-":"")+p.toLowerCase()}),iF=Sa(function(l,p,S){return l+(S?" ":"")+p.toLowerCase()}),oF=Sw("toLowerCase");function aF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;if(!p||k>=p)return l;var M=(p-k)/2;return gd(rd(M),S)+l+gd(nd(M),S)}function lF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;return p&&k>>0,S?(l=vt(l),l&&(typeof p=="string"||p!=null&&!zm(p))&&(p=hr(p),!p&&ma(l))?xi(Yr(l),0,S):l.split(p,S)):[]}var mF=Sa(function(l,p,S){return l+(S?" ":"")+Vm(p)});function gF(l,p,S){return l=vt(l),S=S==null?0:fo(Ke(S),0,l.length),p=hr(p),l.slice(S,S+p.length)==p}function vF(l,p,S){var k=L.templateSettings;S&&jn(l,p,S)&&(p=n),l=vt(l),p=Pd({},p,k,Tw);var M=Pd({},p.imports,k.imports,Tw),j=rn(M),z=em(M,j),q,Q,le=0,ce=p.interpolate||oo,me="__p += '",Ee=nm((p.escape||oo).source+"|"+ce.source+"|"+(ce===Tn?gt:oo).source+"|"+(p.evaluate||oo).source+"|$","g"),De="//# sourceURL="+(bt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++AM+"]")+` `;l.replace(Ee,function(je,Je,rt,mr,$n,gr){return rt||(rt=mr),me+=l.slice(le,gr).replace(fa,qM),Je&&(q=!0,me+=`' + __e(`+Je+`) + '`),$n&&(Q=!0,me+=`'; `+$n+`; __p += '`),rt&&(me+=`' + ((__t = (`+rt+`)) == null ? '' : __t) + '`),le=gr+je.length,je}),me+=`'; `;var Le=bt.call(p,"variable")&&p.variable;if(!Le)me=`with (obj) { `+me+` } `;else if(dt.test(Le))throw new We(a);me=(Q?me.replace(Ze,""):me).replace(Rt,"$1").replace(Pt,"$1;"),me="function("+(Le||"obj")+`) { `+(Le?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(q?", __e = _.escape":"")+(Q?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+me+`return __p }`;var Xe=wS(function(){return pt(j,De+"return "+me).apply(n,z)});if(Xe.source=me,Fm(Xe))throw Xe;return Xe}function yF(l){return vt(l).toLowerCase()}function bF(l){return vt(l).toUpperCase()}function xF(l,p,S){if(l=vt(l),l&&(S||p===n))return k_(l);if(!l||!(p=hr(p)))return l;var k=Yr(l),M=Yr(p),j=D_(k,M),z=O_(k,M)+1;return xi(k,j,z).join("")}function _F(l,p,S){if(l=vt(l),l&&(S||p===n))return l.slice(0,I_(l)+1);if(!l||!(p=hr(p)))return l;var k=Yr(l),M=O_(k,Yr(p))+1;return xi(k,0,M).join("")}function wF(l,p,S){if(l=vt(l),l&&(S||p===n))return l.replace(Ce,"");if(!l||!(p=hr(p)))return l;var k=Yr(l),M=D_(k,Yr(p));return xi(k,M).join("")}function SF(l,p){var S=O,k=I;if(jt(p)){var M="separator"in p?p.separator:M;S="length"in p?Ke(p.length):S,k="omission"in p?hr(p.omission):k}l=vt(l);var j=l.length;if(ma(l)){var z=Yr(l);j=z.length}if(S>=j)return l;var q=S-ga(k);if(q<1)return k;var Q=z?xi(z,0,q).join(""):l.slice(0,q);if(M===n)return Q+k;if(z&&(q+=Q.length-q),zm(M)){if(l.slice(q).search(M)){var le,ce=Q;for(M.global||(M=nm(M.source,vt(Lt.exec(M))+"g")),M.lastIndex=0;le=M.exec(ce);)var me=le.index;Q=Q.slice(0,me===n?q:me)}}else if(l.indexOf(hr(M),q)!=q){var Ee=Q.lastIndexOf(M);Ee>-1&&(Q=Q.slice(0,Ee))}return Q+k}function CF(l){return l=vt(l),l&&dn.test(l)?l.replace(Ut,JM):l}var EF=Sa(function(l,p,S){return l+(S?" ":"")+p.toUpperCase()}),Vm=Sw("toUpperCase");function _S(l,p,S){return l=vt(l),p=S?n:p,p===n?KM(l)?nI(l):FM(l):l.match(p)||[]}var wS=Qe(function(l,p){try{return dr(l,n,p)}catch(S){return Fm(S)?S:new We(S)}}),AF=$s(function(l,p){return Tr(p,function(S){S=vs(S),Ls(l,S,jm(l[S],l))}),l});function RF(l){var p=l==null?0:l.length,S=Ie();return l=p?Ot(l,function(k){if(typeof k[1]!="function")throw new kr(o);return[S(k[0]),k[1]]}):[],Qe(function(k){for(var M=-1;++MH)return[];var S=re,k=Sn(l,re);p=Ie(p),l-=re;for(var M=Jp(k,p);++S0||p<0)?new et(S):(l<0?S=S.takeRight(-l):l&&(S=S.drop(l)),p!==n&&(p=Ke(p),S=p<0?S.dropRight(-p):S.take(p-l)),S)},et.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},et.prototype.toArray=function(){return this.take(re)},ms(et.prototype,function(l,p){var S=/^(?:filter|find|map|reject)|While$/.test(p),k=/^(?:head|last)$/.test(p),M=L[k?"take"+(p=="last"?"Right":""):p],j=k||/^find/.test(p);M&&(L.prototype[p]=function(){var z=this.__wrapped__,q=k?[1]:arguments,Q=z instanceof et,le=q[0],ce=Q||qe(z),me=function(Je){var rt=M.apply(L,pi([Je],q));return k&&Ee?rt[0]:rt};ce&&S&&typeof le=="function"&&le.length!=1&&(Q=ce=!1);var Ee=this.__chain__,De=!!this.__actions__.length,Le=j&&!Ee,Xe=Q&&!De;if(!j&&ce){z=Xe?z:new et(this);var je=l.apply(z,q);return je.__actions__.push({func:_d,args:[me],thisArg:n}),new Dr(je,Ee)}return Le&&Xe?l.apply(this,q):(je=this.thru(me),Le?k?je.value()[0]:je.value():je)})}),Tr(["pop","push","shift","sort","splice","unshift"],function(l){var p=Gu[l],S=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",k=/^(?:pop|shift)$/.test(l);L.prototype[l]=function(){var M=arguments;if(k&&!this.__chain__){var j=this.value();return p.apply(qe(j)?j:[],M)}return this[S](function(z){return p.apply(qe(z)?z:[],M)})}}),ms(et.prototype,function(l,p){var S=L[p];if(S){var k=S.name+"";bt.call(xa,k)||(xa[k]=[]),xa[k].push({name:p,func:S})}}),xa[pd(n,y).name]=[{name:"wrapper",func:n}],et.prototype.clone=CI,et.prototype.reverse=EI,et.prototype.value=AI,L.prototype.at=t2,L.prototype.chain=n2,L.prototype.commit=r2,L.prototype.next=s2,L.prototype.plant=o2,L.prototype.reverse=a2,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=l2,L.prototype.first=L.prototype.head,Dl&&(L.prototype[Dl]=i2),L},va=rI();ao?((ao.exports=va)._=va,Wp._=va):mn._=va}).call(xr)})(YT,YT.exports);var rN=YT.exports;const IU=({amount:e,scale:t})=>{const n=10**t;return Number(e)/n},GFe=e=>{const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`},V4={locale:"es-ES"},Vy={amount:null,currencyCode:Rv.DEFAULT_CURRENCY_CODE,scale:2},ls=class ls extends oW{constructor(n,r,s){super(n);Be(this,"_isNull");Be(this,"_options");Be(this,"isEmpty",()=>this.isNull());Be(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=wn.any().optional().valid(null),i=wn.number().label(r.label?r.label:"amount"),o=wn.alternatives(s,i);return nr.validate(o,n)}static getMonetaryValueInfo(n){const[r,s]=n.split("."),i=s?s.length:0;return[(r+s).replace(/[^0-9]/g,""),i]}static create(n=Vy,r=V4){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Vy.amount,currencyCode:i=Vy.currencyCode,scale:o=Vy.scale}=n||{},a=ls.validate(s,r);if(a.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,a.error.message,r));const c=ls.sanitize(a.object),d=i,h=bP({amount:Number(c),currency:d,precision:o}).setLocale(r.locale);return Vn.ok(new this(h,rN.isNull(c),r))}static createFromFormattedValue(n,r,s=ls.DEFAULT_SCALE,i={locale:V4.locale}){if(n===null||n==="")return ls.create({amount:null,scale:s,currencyCode:r});const o=String(n),[a,c]=o.split(",");let d=a,h=2;return c===void 0?h=0:(c===""&&(d=a+c.padEnd(1,"0"),h=1),c.length===1?(d=a+c.padEnd(1,"0"),h=1):c.length===2?(d=a+c.padEnd(2,"0"),h=2):c.length===3?(d=a+c.padEnd(3,"0"),h=3):c.length===4&&(d=a+c.padEnd(4,"0"),h=4)),ls.create({amount:d,scale:h,currencyCode:r},i)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return Vn.ok(new ls(n,!1,V4))}static normalizeScale(n){return bP.normalizePrecision(n.map(r=>r.props)).map(r=>ls.createFromDinero(r).object)}static minimum(n){return ls.createFromDinero(bP.minimum(n.map(r=>r.props))).object}static maximum(n){return ls.createFromDinero(bP.maximum(n.map(r=>r.props))).object}static _toString(n,r,s){if(n===null)return"";new Intl.NumberFormat(s,{useGrouping:!0}).format(n===null?0:IU({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return ls._toString(this.isNull()?null:this.getAmount(),this.getScale(),this._options.locale)}toJSON(){var n;return this._isNull?{}:(n=this.props)==null?void 0:n.toJSON()}toPrimitive(){var n;return this._isNull?null:Number((n=this.props)==null?void 0:n.getAmount())}toPrimitives(){return this.toObject()}getAmount(){return this.props.getAmount()}getScale(){return this.props.getPrecision()}convertScale(n,r="HALF_UP"){return this._isNull?ls.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:ls.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return Rv.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return ls.createFromDinero(this.props.add(n.props)).object}subtract(n){return ls.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return ls.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return ls.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return ls.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>ls.createFromDinero(r).object)}equalsTo(n){return this.props.equalsTo(n.props)}lessThan(n){return this.props.lessThan(n.props)}lessThanOrEqual(n){return this.props.lessThanOrEqual(n.props)}greaterThan(n){return this.props.greaterThan(n.props)}greaterThanOrEqual(n){return this.props.greaterThanOrEqual(n.props)}isZero(){return this.props.isZero()}isPositive(){return this.props.isPositive()}isNegative(){return this.props.isNegative()}hasSameCurrency(n){return this.props.hasSameCurrency(n.props)}hasSameAmount(n){return this.props.hasSameAmount(n.props)}toFormat(n,r){return this._isNull?"":this.props.toFormat(n,r)}toUnit(){return this.props.toUnit()}toRoundedUnit(n,r){return this.props.toRoundedUnit(n,r)}toObject(){const n=this.props.toObject();return{amount:this._isNull?null:n.amount,scale:n.precision,currency_code:String(n.currency)}}toNumber(){return this.toUnit()}};Be(ls,"DEFAULT_SCALE",Vy.scale),Be(ls,"DEFAULT_CURRENCY_CODE",Vy.currencyCode);let No=ls;class z7e extends wn.ValidationError{}class Xce{constructor(t){Be(this,"_collection",[]);this._collection=t??[]}add(t){this._collection.push(t)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(t=>t.isFailure)}getFirstFaultyResult(){return this._collection.find(t=>t.isFailure)}getAllFaultyResults(){return this._collection.filter(t=>t.isFailure)}get objects(){return this._collection.filter(t=>t.isSuccess).map(t=>t.object)}get errors(){return this._collection.filter(t=>t.isFailure).map(t=>t.error)}}const Qce=2,H4={amount:0,scale:Qce},Qn=class Qn extends hR{constructor(n,r,s){super(n);Be(this,"_isNull");Be(this,"_options");Be(this,"isEmpty",()=>this.isNull());Be(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s){const i=nr.RULE_ALLOW_NULL_OR_UNDEFINED,o=nr.RULE_ALLOW_EMPTY,a=nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=nr.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),d=wn.number().min(Qn.MIN_SCALE).max(Qn.MAX_SCALE).label(s.label?s.label:"scale"),h=new Xce([nr.validate(wn.alternatives(i,o,a,c),n),nr.validate(wn.alternatives(nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),d),r)]);if(h.hasSomeFaultyResult())return h.getFirstFaultyResult();let u=typeof n=="string"?parseInt(n,10):Number(n),f=rN.isNull(r)?Qn.DEFAULT_SCALE:Number(r);const g=u/Math.pow(10,f);return gQn.MAX_VALUE?Vn.fail(new Error(`Value with scale is out of range: ${g}`)):Vn.ok()}static create(n=H4,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=H4.amount,scale:i=H4.scale}=n,o={label:"percentage",...r},a=Qn.validate(s,i,o);if(a.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,a.error.message,o));let c=Qn._sanitize(s);const d={amount:rN.isNull(c)?0:c,scale:i};return Vn.ok(new this(d,rN.isNull(c),r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return Qn.create({amount:null,scale:Qn.DEFAULT_SCALE});const s=String(n),[i,o]=s.split(",");let a=i,c=2;return o===void 0?c=0:(o===""&&(a=i+o.padEnd(1,"0"),c=1),o.length===1?(a=i+o.padEnd(1,"0"),c=1):o.length===2&&(a=i+o.padEnd(2,"0"),c=2)),Qn.create({amount:a,scale:c},r)}static _sanitize(n){let r=null;return typeof n=="string"?r=parseInt(n,10):r=n,r}static _toString(n,r){if(n===null)return"";const s=Math.pow(10,r);return(Number(n)/s).toFixed(r)}static _isWithinRange(n,r){const s=Number(Qn._toString(n,r));return s>=Qn.MIN_VALUE&&s<=Qn.MAX_VALUE}get amount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}get scale(){var n;return Number((n=this.props)==null?void 0:n.scale)}getAmount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}getScale(){var n;return this.isNull()?0:Number((n=this.props)==null?void 0:n.scale)}toString(){return Qn._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==Qn.DEFAULT_SCALE?this.convertScale(Qn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nQn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new Qn({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),o=Math.round(s*i);if(!Qn._isWithinRange(o,n))throw new Error(`Value out of range after conversion: ${o} ${n}`);return new Qn({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}isWithinRange(){return Qn._isWithinRange(this.amount,this.scale)}};Be(Qn,"DEFAULT_SCALE",Qce),Be(Qn,"MIN_VALUE",0),Be(Qn,"MAX_VALUE",100),Be(Qn,"MIN_SCALE",0),Be(Qn,"MAX_SCALE",2);let Tu=Qn;class B7e extends wn.ValidationError{}const Zce=2,W4={amount:0,scale:Zce},or=class or extends hR{constructor(n,r,s){super(n);Be(this,"_isNull");Be(this,"_options");Be(this,"isEmpty",()=>this.isNull());Be(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s={}){const i=nr.RULE_ALLOW_NULL_OR_UNDEFINED,o=nr.RULE_ALLOW_EMPTY,a=nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=nr.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),d=wn.number().min(or.MIN_SCALE).max(or.MAX_SCALE).label(s.label?s.label:"scale"),h=new Xce([nr.validate(wn.alternatives(i,o,a,c),n),nr.validate(wn.alternatives(nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),d),r)]);return h.hasSomeFaultyResult()?h.getFirstFaultyResult():Vn.ok()}static create(n=W4,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=W4.amount,scale:i=W4.scale}=n,o={label:"quantity",...r},a=or.validate(s,i,o);if(a.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,a.error.message,o));let c=or._sanitize(s);const d={amount:c===null?0:c,scale:i};return Vn.ok(new or(d,c===null,r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return or.create({amount:null,scale:or.DEFAULT_SCALE});const s=String(n),[i,o]=s.split(",");let a=i,c=2;return o===void 0?c=0:(o===""&&(a=i+o.padEnd(1,"0"),c=1),o.length===1?(a=i+o.padEnd(1,"0"),c=1):o.length===2&&(a=i+o.padEnd(2,"0"),c=2)),or.create({amount:a,scale:c},r)}static _sanitize(n){let r=null;return typeof n=="string"?r=parseInt(n,10):r=n,r}static _toString(n,r){if(n===null)return"";const s=Math.pow(10,r);return(Number(n)/s).toFixed(r)}get amount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}get scale(){var n;return Number((n=this.props)==null?void 0:n.scale)}getAmount(){var n;return this.isNull()?null:Number((n=this.props)==null?void 0:n.amount)}getScale(){var n;return this.isNull()?0:Number((n=this.props)==null?void 0:n.scale)}toString(){return or._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==or.DEFAULT_SCALE?this.convertScale(or.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(nor.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new or({amount:null,scale:n},!0,this._options);const r=Math.pow(10,this.scale),s=Number(this.amount)/r,i=Math.pow(10,n),o=Math.round(s*i);return new or({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}increment(n){return this.isNull()?n?or.create(n.toObject()):or.create():n?this.hasSameScale(n)?or.create({amount:Number(this.amount)+Number(n.amount),scale:this.scale},this._options):Vn.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):or.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(n){return this.isNull()?n?or.create(n.toObject()):or.create():n?this.hasSameScale(n)?or.create({amount:Number(this.amount)-Number(n.amount),scale:this.scale},this._options):Vn.fail(Error("No se pueden restar cantidades con diferentes escalas.")):or.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Be(or,"DEFAULT_SCALE",Zce),Be(or,"MIN_SCALE",0),Be(or,"MAX_SCALE",2);let xp=or;const mK=2;class KFe extends No{static create(t){const{amount:n,currencyCode:r,scale:s=mK}=t,i=No.create({amount:n,currencyCode:r,scale:s});if(i.isFailure)return i;const o=i.object.convertScale(mK);return Vn.ok(o)}}class Lb extends oW{constructor(){super(...arguments);Be(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Be(this,"isEmpty",()=>!this.isValid());Be(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Be(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Be(this,"toLocaleDateString",(n,r)=>this.isValid()?this.props.toLocaleDateString(n,r):"");Be(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(n,r){const s=nr.RULE_ALLOW_EMPTY.default(0),i=wn.date().label(String(r.label)),o=wn.alternatives(s,i);return nr.validate(o,n)}static createCurrentDate(){return Vn.ok(new Lb(new Date))}static create(n,r={}){const s={...r,dateFormat:r.dateFormat?r.dateFormat:"YYYY-MM-DD",label:r.label?r.label:"date"},i=Lb.validate(n,s);return i.isFailure?Vn.fail(bp(Pc.INVALID_INPUT_DATA,i.error.message,s)):Vn.ok(new Lb(new Date(i.object)))}toString(){if(!this.isEmpty()){const n=this.props.getFullYear(),r=String(this.props.getMonth()+1).padStart(2,"0"),s=String(this.props.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}return""}toPrimitive(){return this.toISO8601()}}const jb=0,aW=10,LU=1,Jce=9999,YFe=({isPending:e,interval:t=1e3,onInterval:n})=>{const[r,s]=C.useState(void 0);return C.useEffect(()=>{let i;return e&&(i=setInterval(()=>{s(o=>o===void 0?t:o+t)},t)),()=>{clearInterval(i),s(void 0)}},[e,t]),C.useEffect(()=>{n&&r&&n(r)},[r]),{elapsedTime:r}},XFe=2*60*1e3,QFe=60*1e3,lW=({queryKey:e,queryFn:t,enabled:n,select:r,queryOptions:s={},overtimeOptions:i})=>{const[o,a]=C.useState(!1),c=iD({queryKey:e,queryFn:t,placeholderData:UZ,staleTime:QFe,refetchInterval:XFe,refetchOnWindowFocus:!0,enabled:n&&!!t,select:r,...s});C.useEffect(()=>{c.isSuccess&&_Fe(c.data)&&a(c.data.total_items===0)},[c]);const{elapsedTime:d}=YFe({isPending:c.isFetching,interval:i==null?void 0:i.interval,onInterval:i==null?void 0:i.onInterval});return{...c,overtime:{elapsedTime:d},isEmpty:o}},eue=e=>iD({placeholderData:UZ,...e});function ZFe(e){return mu({...e})}const tue=C.createContext(void 0),JFe=({dataSource:e,children:t})=>_.jsx(tue.Provider,{value:e,children:t}),e3e=[5,10,15,30,50,75,100],EO=(e=jb,t=aW)=>{const[n,r]=C.useState({pageIndex:e,pageSize:t});return[n,i=>{const o=i;return o.pageIndexJce)&&(o.pageSize=LU),r(a=>({...a,pageIndex:i.pageIndex,pageSize:i.pageSize})),o}]},t3e=(e=jb,t=aW)=>{const[n,r]=Y$e(),s=n.get("page_index"),i=n.get("page_size"),o=C.useMemo(()=>{const u=parseInt(s??"",10);let f=isNaN(u)?e:u;return f{const u=parseInt(i??"",10);let f=isNaN(u)?t:u;return(fJce)&&(f=t),f},[i,t]),[c,d]=EO(o,a);return[c,u=>{const f=d(u);r({page_index:String(f.pageIndex),page_size:String(f.pageSize)})}]},n3e=({syncWithLocation:e=!0,initialPageIndex:t,initialPageSize:n})=>{const[r,s]=t3e(),[i,o]=EO(t,n);return e?[r,s]:[i,o]},nue=C.createContext(null),mx=({syncWithLocation:e=!0,initialGlobalFilter:t=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,o]=n3e({syncWithLocation:e,initialPageIndex:n,initialPageSize:r}),[a,c]=C.useState(t||[]),[d,h]=C.useState([]),u=C.useMemo(()=>!!(a&&a.length),[a]),f=C.useCallback(()=>c([]),[]);return _.jsx(nue.Provider,{value:{pagination:i,setPagination:o,sorting:d,setSorting:h,globalFilter:a,setGlobalFilter:c,resetGlobalFilter:f,isFiltered:u},children:s})};/** * table-core * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function r3e(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Jh(e,t){return typeof e=="function"?e(t):e}function Ja(e,t){return n=>{t.setState(r=>({...r,[e]:Jh(n,r[e])}))}}function AO(e){return e instanceof Function}function s3e(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function i3e(e,t){const n=[],r=s=>{s.forEach(i=>{n.push(i);const o=t(i);o!=null&&o.length&&r(o)})};return r(e),n}function kt(e,t,n){let r=[],s;return i=>{let o;n.key&&n.debug&&(o=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((h,u)=>r[u]!==h)))return s;r=a;let d;if(n.key&&n.debug&&(d=Date.now()),s=t(...a),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-o)*100)/100,u=Math.round((Date.now()-d)*100)/100,f=u/16,g=(v,m)=>{for(v=String(v);v.length{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function o3e(e,t,n,r){const s=()=>{var o;return(o=i.getValue())!=null?o:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:kt(()=>[e,n,t,i],(o,a,c,d)=>({table:o,column:a,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),Dt(e.options,"debugCells"))};return e._features.forEach(o=>{o.createCell==null||o.createCell(i,n,t,e)},{}),i}function a3e(e,t,n,r){var s,i;const a={...e._getDefaultColumnDef(),...t},c=a.accessorKey;let d=(s=(i=a.id)!=null?i:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?s:typeof a.header=="string"?a.header:void 0,h;if(a.accessorFn?h=a.accessorFn:c&&(c.includes(".")?h=f=>{let g=f;for(const m of c.split(".")){var v;g=(v=g)==null?void 0:v[m]}return g}:h=f=>f[a.accessorKey]),!d)throw new Error;let u={id:`${String(d)}`,accessorFn:h,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:kt(()=>[!0],()=>{var f;return[u,...(f=u.columns)==null?void 0:f.flatMap(g=>g.getFlatColumns())]},Dt(e.options,"debugColumns")),getLeafColumns:kt(()=>[e._getOrderColumnsFn()],f=>{var g;if((g=u.columns)!=null&&g.length){let v=u.columns.flatMap(m=>m.getLeafColumns());return f(v)}return[u]},Dt(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(u,e);return u}const Wi="debugHeaders";function gK(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),o.push(c)};return a(i),o},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(o=>{o.createHeader==null||o.createHeader(i,e)}),i}const l3e={createTable:e=>{e.getHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var i,o;const a=(i=r==null?void 0:r.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?i:[],c=(o=s==null?void 0:s.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?o:[],d=n.filter(u=>!(r!=null&&r.includes(u.id))&&!(s!=null&&s.includes(u.id)));return xP(t,[...a,...d,...c],e)},Dt(e.options,Wi)),e.getCenterHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),xP(t,n,e,"center")),Dt(e.options,Wi)),e.getLeftHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return xP(t,i,e,"left")},Dt(e.options,Wi)),e.getRightHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return xP(t,i,e,"right")},Dt(e.options,Wi)),e.getFooterGroups=kt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getLeftFooterGroups=kt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getCenterFooterGroups=kt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getRightFooterGroups=kt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getFlatHeaders=kt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getLeftFlatHeaders=kt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getCenterFlatHeaders=kt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getRightFlatHeaders=kt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getCenterLeafHeaders=kt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Dt(e.options,Wi)),e.getLeftLeafHeaders=kt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Dt(e.options,Wi)),e.getRightLeafHeaders=kt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Dt(e.options,Wi)),e.getLeafHeaders=kt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,i,o,a,c,d;return[...(s=(i=t[0])==null?void 0:i.headers)!=null?s:[],...(o=(a=n[0])==null?void 0:a.headers)!=null?o:[],...(c=(d=r[0])==null?void 0:d.headers)!=null?c:[]].map(h=>h.getLeafHeaders()).flat()},Dt(e.options,Wi))}};function xP(e,t,n,r){var s,i;let o=0;const a=function(f,g){g===void 0&&(g=1),o=Math.max(o,g),f.filter(v=>v.getIsVisible()).forEach(v=>{var m;(m=v.columns)!=null&&m.length&&a(v.columns,g+1)},0)};a(e);let c=[];const d=(f,g)=>{const v={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(x=>{const y=[...m].reverse()[0],b=x.column.depth===v.depth;let w,E=!1;if(b&&x.column.parent?w=x.column.parent:(w=x.column,E=!0),y&&(y==null?void 0:y.column)===w)y.subHeaders.push(x);else{const R=gK(n,w,{id:[r,g,w.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${m.filter(T=>T.column===w).length}`:void 0,depth:g,index:m.length});R.subHeaders.push(x),m.push(R)}v.headers.push(x),x.headerGroup=v}),c.push(v),g>0&&d(m,g-1)},h=t.map((f,g)=>gK(n,f,{depth:o,index:g}));d(h,o-1),c.reverse();const u=f=>f.filter(v=>v.column.getIsVisible()).map(v=>{let m=0,x=0,y=[0];v.subHeaders&&v.subHeaders.length?(y=[],u(v.subHeaders).forEach(w=>{let{colSpan:E,rowSpan:R}=w;m+=E,y.push(R)})):m=1;const b=Math.min(...y);return x=x+b,v.colSpan=m,v.rowSpan=x,{colSpan:m,rowSpan:x}});return u((s=(i=c[0])==null?void 0:i.headers)!=null?s:[]),c}const cW=(e,t,n,r,s,i,o)=>{let a={id:t,index:r,original:n,depth:s,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return a._valuesCache[c]=d.accessorFn(a.original,r),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=d.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=a.getValue(c))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>i3e(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],d=a;for(;;){const h=d.getParentRow();if(!h)break;c.push(h),d=h}return c.reverse()},getAllCells:kt(()=>[e.getAllLeafColumns()],c=>c.map(d=>o3e(e,a,d,d.id)),Dt(e.options,"debugRows")),_getAllCellsByColumnId:kt(()=>[a.getAllCells()],c=>c.reduce((d,h)=>(d[h.column.id]=h,d),{}),Dt(e.options,"debugRows"))};for(let c=0;c{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},rue=(e,t,n)=>{var r,s;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(i))};rue.autoRemove=e=>wc(e);const sue=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};sue.autoRemove=e=>wc(e);const iue=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};iue.autoRemove=e=>wc(e);const oue=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};oue.autoRemove=e=>wc(e);const aue=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});aue.autoRemove=e=>wc(e)||!(e!=null&&e.length);const lue=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});lue.autoRemove=e=>wc(e)||!(e!=null&&e.length);const cue=(e,t,n)=>e.getValue(t)===n;cue.autoRemove=e=>wc(e);const uue=(e,t,n)=>e.getValue(t)==n;uue.autoRemove=e=>wc(e);const uW=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};uW.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(s)?1/0:s;if(i>o){const a=i;i=o,o=a}return[i,o]};uW.autoRemove=e=>wc(e)||wc(e[0])&&wc(e[1]);const Fd={includesString:rue,includesStringSensitive:sue,equalsString:iue,arrIncludes:oue,arrIncludesAll:aue,arrIncludesSome:lue,equals:cue,weakEquals:uue,inNumberRange:uW};function wc(e){return e==null||e===""}const u3e={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ja("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Fd.includesString:typeof r=="number"?Fd.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Fd.equals:Array.isArray(r)?Fd.arrIncludes:Fd.weakEquals},e.getFilterFn=()=>{var n,r;return AO(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Fd[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),i=r==null?void 0:r.find(h=>h.id===e.id),o=Jh(n,i?i.value:void 0);if(vK(s,o,e)){var a;return(a=r==null?void 0:r.filter(h=>h.id!==e.id))!=null?a:[]}const c={id:e.id,value:o};if(i){var d;return(d=r==null?void 0:r.map(h=>h.id===e.id?c:h))!=null?d:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var i;return(i=Jh(t,s))==null?void 0:i.filter(o=>{const a=n.find(c=>c.id===o.id);if(a){const c=a.getFilterFn();if(vK(c,o.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function vK(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const d3e=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),f3e=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},h3e=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r=i)&&(r=i)}),r},p3e=(e,t,n)=>{let r,s;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r===void 0?o>=o&&(r=s=o):(r>o&&(r=o),s{let n=0,r=0;if(t.forEach(s=>{let i=s.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},g3e=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!s3e(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((i,o)=>i-o);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},v3e=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),y3e=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,b3e=(e,t)=>t.length,q4={sum:d3e,min:f3e,max:h3e,extent:p3e,mean:m3e,median:g3e,unique:v3e,uniqueCount:y3e,count:b3e},x3e={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ja("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return q4.sum;if(Object.prototype.toString.call(r)==="[object Date]")return q4.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return AO(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:q4[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function _3e(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(o=>o.id===i)).filter(Boolean),...r]}const w3e={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ja("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=kt(n=>[H1(t,n)],n=>n.findIndex(r=>r.id===e.id),Dt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=H1(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=H1(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=kt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let i=[];if(!(t!=null&&t.length))i=s;else{const o=[...t],a=[...s];for(;a.length&&o.length;){const c=o.shift(),d=a.findIndex(h=>h.id===c);d>-1&&i.push(a.splice(d,1)[0])}i=[...i,...a]}return _3e(i,n,r)},Dt(e.options,"debugTable"))}},G4=()=>({left:[],right:[]}),S3e={getInitialState:e=>({columnPinning:G4(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ja("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var i,o;if(n==="right"){var a,c;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(u=>!(r!=null&&r.includes(u))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(u=>!(r!=null&&r.includes(u))),...r]}}if(n==="left"){var d,h;return{left:[...((d=s==null?void 0:s.left)!=null?d:[]).filter(u=>!(r!=null&&r.includes(u))),...r],right:((h=s==null?void 0:s.right)!=null?h:[]).filter(u=>!(r!=null&&r.includes(u)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(u=>!(r!=null&&r.includes(u))),right:((o=s==null?void 0:s.right)!=null?o:[]).filter(u=>!(r!=null&&r.includes(u)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,i,o;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(o=t.options.enableColumnPinning)!=null?o:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:s}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),o=n.some(a=>s==null?void 0:s.includes(a));return i?"left":o?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=kt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(o=>!i.includes(o.column.id))},Dt(t.options,"debugRows")),e.getLeftVisibleCells=kt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Dt(t.options,"debugRows")),e.getRightVisibleCells=kt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Dt(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?G4():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:G4())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=kt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Dt(e.options,"debugColumns")),e.getRightLeafColumns=kt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Dt(e.options,"debugColumns")),e.getCenterLeafColumns=kt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(i=>!s.includes(i.id))},Dt(e.options,"debugColumns"))}},_P={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},K4=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),C3e={getDefaultColumnDef:()=>_P,getInitialState:e=>({columnSizing:{},columnSizingInfo:K4(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ja("columnSizing",e),onColumnSizingInfoChange:Ja("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:_P.minSize,(r=i??e.columnDef.size)!=null?r:_P.size),(s=e.columnDef.maxSize)!=null?s:_P.maxSize)},e.getStart=kt(n=>[n,H1(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),Dt(t.options,"debugColumns")),e.getAfter=kt(n=>[n,H1(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),Dt(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var i;n+=(i=s.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return i=>{if(!r||!s||(i.persist==null||i.persist(),Y4(i)&&i.touches&&i.touches.length>1))return;const o=e.getSize(),a=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],c=Y4(i)?Math.round(i.touches[0].clientX):i.clientX,d={},h=(y,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(w=>{var E,R;const T=t.options.columnResizeDirection==="rtl"?-1:1,N=(b-((E=w==null?void 0:w.startOffset)!=null?E:0))*T,A=Math.max(N/((R=w==null?void 0:w.startSize)!=null?R:0),-.999999);return w.columnSizingStart.forEach(D=>{let[O,I]=D;d[O]=Math.round(Math.max(I+I*A,0)*100)/100}),{...w,deltaOffset:N,deltaPercentage:A}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(w=>({...w,...d})))},u=y=>h("move",y),f=y=>{h("end",y),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,v={moveHandler:y=>u(y.clientX),upHandler:y=>{g==null||g.removeEventListener("mousemove",v.moveHandler),g==null||g.removeEventListener("mouseup",v.upHandler),f(y.clientX)}},m={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),u(y.touches[0].clientX),!1),upHandler:y=>{var b;g==null||g.removeEventListener("touchmove",m.moveHandler),g==null||g.removeEventListener("touchend",m.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((b=y.touches[0])==null?void 0:b.clientX)}},x=E3e()?{passive:!1}:!1;Y4(i)?(g==null||g.addEventListener("touchmove",m.moveHandler,x),g==null||g.addEventListener("touchend",m.upHandler,x)):(g==null||g.addEventListener("mousemove",v.moveHandler,x),g==null||g.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(y=>({...y,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?K4():(n=e.initialState.columnSizingInfo)!=null?n:K4())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let wP=null;function E3e(){if(typeof wP=="boolean")return wP;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return wP=e,wP}function Y4(e){return e.type==="touchstart"}const A3e={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ja("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=kt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Dt(t.options,"debugRows")),e.getVisibleCells=kt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],Dt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>kt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Dt(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function H1(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const R3e={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},P3e={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ja("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Fd.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return AO(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Fd[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},N3e={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ja("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,i;e.setExpanded(r?{}:(s=(i=e.initialState)==null?void 0:i.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const o=i.split(".");r=Math.max(r,o.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const i=r===!0?!0:!!(r!=null&&r[e.id]);let o={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{o[a]=!0}):o=r,n=(s=n)!=null?s:!i,!i&&n)return{...o,[e.id]:!0};if(i&&!n){const{[e.id]:a,...c}=o;return c}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},jU=0,$U=10,X4=()=>({pageIndex:jU,pageSize:$U}),T3e={getInitialState:e=>({...e,pagination:{...X4(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ja("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=i=>Jh(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?X4():(s=e.initialState.pagination)!=null?s:X4())},e.setPageIndex=r=>{e.setPagination(s=>{let i=Jh(r,s.pageIndex);const o=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,o)),{...s,pageIndex:i}})},e.resetPageIndex=r=>{var s,i;e.setPageIndex(r?jU:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:jU)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?$U:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:$U)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,Jh(r,s.pageSize)),o=s.pageSize*s.pageIndex,a=Math.floor(o/i);return{...s,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(s=>{var i;let o=Jh(r,(i=e.options.pageCount)!=null?i:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...s,pageCount:o}}),e.getPageOptions=kt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,o)=>o)),s},Dt(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Q4=()=>({top:[],bottom:[]}),k3e={getInitialState:e=>({rowPinning:Q4(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ja("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const i=r?e.getLeafRows().map(c=>{let{id:d}=c;return d}):[],o=s?e.getParentRows().map(c=>{let{id:d}=c;return d}):[],a=new Set([...o,e.id,...i]);t.setRowPinning(c=>{var d,h;if(n==="bottom"){var u,f;return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((f=c==null?void 0:c.bottom)!=null?f:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var g,v;return{top:[...((g=c==null?void 0:c.top)!=null?g:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((v=c==null?void 0:c.bottom)!=null?v:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(m=>!(a!=null&&a.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),o=n.some(a=>s==null?void 0:s.includes(a));return i?"top":o?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const i=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(o=>{let{id:a}=o;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Q4():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Q4())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(o=>{const a=e.getRow(o,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(o=>t.find(a=>a.id===o))).filter(Boolean).map(o=>({...o,position:r}))},e.getTopRows=kt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Dt(e.options,"debugRows")),e.getBottomRows=kt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Dt(e.options,"debugRows")),e.getCenterRows=kt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(i=>!s.has(i.id))},Dt(e.options,"debugRows"))}},D3e={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ja("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(i=>{FU(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=kt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Z4(e,n):{rows:[],flatRows:[],rowsById:{}},Dt(e.options,"debugTable")),e.getFilteredSelectedRowModel=kt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Z4(e,n):{rows:[],flatRows:[],rowsById:{}},Dt(e.options,"debugTable")),e.getGroupedSelectedRowModel=kt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Z4(e,n):{rows:[],flatRows:[],rowsById:{}},Dt(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(i=>{var o;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return i;const a={...i};return FU(a,e.id,n,(o=r==null?void 0:r.selectChildren)!=null?o:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return dW(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return zU(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return zU(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},FU=(e,t,n,r,s)=>{var i;const o=s.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=o.subRows)!=null&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(a=>FU(e,a.id,n,r,s))};function Z4(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(o,a){return o.map(c=>{var d;const h=dW(c,n);if(h&&(r.push(c),s[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:i(c.subRows)}),h)return c}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function dW(e,t){var n;return(n=t[e.id])!=null?n:!1}function zU(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return e.subRows.forEach(o=>{if(!(i&&!s)&&(o.getCanSelect()&&(dW(o,t)?i=!0:s=!1),o.subRows&&o.subRows.length)){const a=zU(o,t);a==="all"?i=!0:(a==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const BU=/([0-9]+)/gm,O3e=(e,t,n)=>due(_p(e.getValue(n)).toLowerCase(),_p(t.getValue(n)).toLowerCase()),M3e=(e,t,n)=>due(_p(e.getValue(n)),_p(t.getValue(n))),I3e=(e,t,n)=>fW(_p(e.getValue(n)).toLowerCase(),_p(t.getValue(n)).toLowerCase()),L3e=(e,t,n)=>fW(_p(e.getValue(n)),_p(t.getValue(n))),j3e=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:rfW(e.getValue(n),t.getValue(n));function fW(e,t){return e===t?0:e>t?1:-1}function _p(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function due(e,t){const n=e.split(BU).filter(Boolean),r=t.split(BU).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),i=r.shift(),o=parseInt(s,10),a=parseInt(i,10),c=[o,a].sort();if(isNaN(c[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(c[1]))return isNaN(o)?-1:1;if(o>a)return 1;if(a>o)return-1}return n.length-r.length}const KS={alphanumeric:O3e,alphanumericCaseSensitive:M3e,text:I3e,textCaseSensitive:L3e,datetime:j3e,basic:$3e},F3e={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ja("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const i=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return KS.datetime;if(typeof i=="string"&&(r=!0,i.split(BU).length>1))return KS.alphanumeric}return r?KS.text:KS.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return AO(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:KS[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(o=>{const a=o==null?void 0:o.find(g=>g.id===e.id),c=o==null?void 0:o.findIndex(g=>g.id===e.id);let d=[],h,u=i?n:s==="desc";if(o!=null&&o.length&&e.getCanMultiSort()&&r?a?h="toggle":h="add":o!=null&&o.length&&c!==o.length-1?h="replace":a?h="toggle":h="replace",h==="toggle"&&(i||s||(h="remove")),h==="add"){var f;d=[...o,{id:e.id,desc:u}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else h==="toggle"?d=o.map(g=>g.id===e.id?{...g,desc:u}:g):h==="remove"?d=o.filter(g=>g.id!==e.id):d=[{id:e.id,desc:u}];return d})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const i=e.getFirstSortDir(),o=e.getIsSorted();return o?o!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:o==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},z3e=[l3e,A3e,w3e,S3e,c3e,u3e,R3e,P3e,F3e,x3e,N3e,T3e,k3e,D3e,C3e];function B3e(e){var t,n;const r=[...z3e,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((f,g)=>Object.assign(f,g.getDefaultOptions==null?void 0:g.getDefaultOptions(s)),{}),o=f=>s.options.mergeOptions?s.options.mergeOptions(i,f):{...i,...f};let c={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(f=>{var g;c=(g=f.getInitialState==null?void 0:f.getInitialState(c))!=null?g:c});const d=[];let h=!1;const u={_features:r,options:{...i,...e},initialState:c,_queue:f=>{d.push(f),h||(h=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();h=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const g=Jh(f,s.options);s.options=o(g)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,g,v)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(f,g,v))!=null?m:`${v?[v.id,g].join("."):g}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,g)=>{let v=(g?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!v&&(v=s.getCoreRowModel().rowsById[f],!v))throw new Error;return v},_getDefaultColumnDef:kt(()=>[s.options.defaultColumn],f=>{var g;return f=(g=f)!=null?g:{},{header:v=>{const m=v.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:v=>{var m,x;return(m=(x=v.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...s._features.reduce((v,m)=>Object.assign(v,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Dt(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:kt(()=>[s._getColumnDefs()],f=>{const g=function(v,m,x){return x===void 0&&(x=0),v.map(y=>{const b=a3e(s,y,x,m),w=y;return b.columns=w.columns?g(w.columns,b,x+1):[],b})};return g(f)},Dt(e,"debugColumns")),getAllFlatColumns:kt(()=>[s.getAllColumns()],f=>f.flatMap(g=>g.getFlatColumns()),Dt(e,"debugColumns")),_getAllFlatColumnsById:kt(()=>[s.getAllFlatColumns()],f=>f.reduce((g,v)=>(g[v.id]=v,g),{}),Dt(e,"debugColumns")),getAllLeafColumns:kt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,g)=>{let v=f.flatMap(m=>m.getLeafColumns());return g(v)},Dt(e,"debugColumns")),getColumn:f=>s._getAllFlatColumnsById()[f]};Object.assign(s,u);for(let f=0;fkt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,o){i===void 0&&(i=0);const a=[];for(let d=0;de._autoResetPageIndex()))}function hue(e,t,n){return n.options.filterFromLeafRows?U3e(e,t,n):V3e(e,t,n)}function U3e(e,t,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,d){d===void 0&&(d=0);const h=[];for(let f=0;fkt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,s)=>{if(!n.rows.length||!(r!=null&&r.length)&&!s)return n;const i=[...r.map(a=>a.id).filter(a=>a!==t),s?"__global__":void 0].filter(Boolean),o=a=>{for(let c=0;ckt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let i=0;ikt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f{var g;const v=e.getColumn(f.id);if(!v)return;const m=v.getFilterFn();m&&s.push({id:f.id,filterFn:m,resolvedValue:(g=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?g:f.value})});const o=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&c.length&&(o.push("__global__"),c.forEach(f=>{var g;i.push({id:f.id,filterFn:a,resolvedValue:(g=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?g:r})}));let d,h;for(let f=0;f{g.columnFiltersMeta[m]=x})}if(i.length){for(let v=0;v{g.columnFiltersMeta[m]=x})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const u=f=>{for(let g=0;ge._autoResetPageIndex()))}function G3e(){return e=>kt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],i=r.filter(c=>{var d;return(d=e.getColumn(c.id))==null?void 0:d.getCanSort()}),o={};i.forEach(c=>{const d=e.getColumn(c.id);d&&(o[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const a=c=>{const d=c.map(h=>({...h}));return d.sort((h,u)=>{for(let g=0;g{var u;s.push(h),(u=h.subRows)!=null&&u.length&&(h.subRows=a(h.subRows))}),d};return{rows:a(n.rows),flatRows:s,rowsById:n.rowsById}},Dt(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** * react-table * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function XT(e,t){return e?K3e(e)?C.createElement(e,t):e:null}function K3e(e){return Y3e(e)||typeof e=="function"||X3e(e)}function Y3e(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function X3e(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function pue(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=C.useState(()=>({current:B3e(t)})),[r,s]=C.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:o=>{s(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const Yv=fe.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("flex items-center gap-2",e),...t}));Yv.displayName="ButtonGroup";const mue=({label:e="Cancelar",...t})=>_.jsx(at,{type:"button",variant:"secondary",...t,children:e});mue.displayName="CancelButton";const Q3e=({buttonText:e,title:t="",content:n,className:r=""})=>_.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${r}`,children:_.jsxs(Fx,{children:[_.jsx(E6,{asChild:!0,children:_.jsxs(at,{variant:"link",className:"inline-flex items-center font-medium group",children:[_.jsx("span",{className:"underline-offset-4 group-hover:underline",children:e}),_.jsx(_J,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),_.jsxs(cy,{className:"sm:max-w-[425px]",children:[_.jsx(uy,{children:_.jsx(fy,{children:t})}),_.jsxs(sO,{className:"grid gap-4 py-2",children:[n,_.jsx(dy,{children:_.jsx(bT,{asChild:!0,children:_.jsx(at,{type:"button",children:ue("common.close")})})})]})]})]})}),Z3e=Io("",{variants:{size:{default:"w-4 h-4",sm:"h-3.5 w-3.5",lg:"h-6 w-6",icon:"w-7 h-7"}},defaultVariants:{size:"default"}}),gue=fe.forwardRef(({className:e,label:t,size:n,icon:r,children:s,...i},o)=>{const a=!!r;return _.jsxs(at,{ref:o,size:n,className:ge(a?"gap-1":"",e),...i,children:[a&&_.jsx(r,{className:ge(Z3e({size:n}))}),_.jsx(_.Fragment,{children:t||s})]})});gue.displayName="CustomButton";const RO=({label:e="Enviar",...t})=>_.jsx(gue,{type:"submit",label:e,variant:"default",...t});RO.displayName="SubmitButton";function J3e(e){let r=0;for(let h=0;h>h*8&255;s+=("00"+u.toString(16)).substr(-2)}const i=parseInt(s.substr(1,2),16),o=parseInt(s.substr(3,2),16),a=parseInt(s.substr(5,2),16),c=`#${(i*.7|0).toString(16).padStart(2,"0")}${(o*.7|0).toString(16).padStart(2,"0")}${(a*.7|0).toString(16).padStart(2,"0")}`,d=`#${Math.min(255,Math.floor(i+(255-i)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(o+(255-o)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(a+(255-a)*.7)).toString(16).padStart(2,"0")}`;return[c,d]}const vue=({label:e,className:t})=>{const[n,r]=J3e(e);return _.jsx(_D,{className:t,style:t?{}:{backgroundColor:r,color:n},children:e})},e4e=Io("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),yue=({className:e,as:t="article",variant:n,...r})=>_.jsx(t,{className:ge(e4e({variant:n,className:e})),...r});yue.displayName="Container";const hW=()=>{const e=io();return _.jsxs(at,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>e(-1),children:[_.jsx(lD,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:ue("common.back")})]})};function bue({table:e,header:t,className:n}){return t.column.getCanSort()?_.jsx("div",{className:ge("flex items-center space-x-2",n),children:_.jsxs(rR,{children:[_.jsx(sR,{asChild:!0,children:_.jsxs(at,{"aria-label":t.column.getIsSorted()==="desc"?ue("common.sort_desc_description"):t.column.getIsSorted()==="asc"?ue("common.sort_asc_description"):ue("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[XT(t.column.columnDef.header,t.getContext()),t.column.getIsSorted()==="desc"?_.jsx(PG,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):t.column.getIsSorted()==="asc"?_.jsx(NG,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):_.jsx(Kye,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),_.jsxs(Vx,{align:"start",children:[t.column.getCanSort()&&_.jsxs(_.Fragment,{children:[_.jsxs(up,{onClick:()=>t.column.toggleSorting(!1),"aria-label":ue("common.sort_asc"),children:[_.jsx(NG,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ue("common.sort_asc")]}),_.jsxs(up,{onClick:()=>t.column.toggleSorting(!0),"aria-label":ue("common.sort_desc"),children:[_.jsx(PG,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ue("common.sort_desc")]})]}),t.column.getCanSort()&&t.column.getCanHide()&&_.jsx(ax,{}),t.column.getCanHide()&&_.jsxs(up,{onClick:()=>t.column.toggleVisibility(!1),"aria-label":ue("Hide"),children:[_.jsx(SJ,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ue("Hide")]})]})]})}):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ge("data-[state=open]:bg-accent tracking-wide text-ellipsis",n),children:t.isPlaceholder?null:XT(t.column.columnDef.header,t.getContext())}),!1]})}function t4e({table:e,className:t,enablePageSizeSelector:n=!0,visible:r="auto"}){const s=C.useMemo(()=>r===!0,[r]),i=C.useMemo(()=>r==="auto",[r]);return!s||i&&e.getPageCount()<1?null:_.jsxs("div",{className:t,children:[_.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:e.getSelectedRowModel().rows.length>0&&_.jsx(_.Fragment,{children:ue("common.rows_selected_of_total",{count:e.getFilteredSelectedRowModel().rows.length,total:e.getFilteredRowModel().rows.length})})}),_.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[n&&_.jsxs("div",{className:"flex items-center space-x-2 grow",children:[_.jsx("p",{className:"text-sm font-medium",children:ue("common.rows_per_page")}),_.jsxs(U8,{value:`${e.getState().pagination.pageSize}`,onValueChange:o=>{e.setPageSize(Number(o))},children:[_.jsx(lO,{className:"h-8 w-[70px]",children:_.jsx(V8,{placeholder:e.getState().pagination.pageSize})}),_.jsx(cO,{side:"top",children:e3e.map(o=>_.jsx(Ib,{value:`${o}`,children:o},o))})]})]}),_.jsxs("div",{className:ge("flex space-x-2 flex-1",n?"justify-end":"justify-between"),children:[_.jsx("div",{className:"flex w-[150px] items-center justify-start",children:_.jsx("p",{className:"text-sm font-medium ",children:ue("common.num_page_of_total",{count:e.getState().pagination.pageIndex+1,total:e.getPageCount()})})}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsxs(at,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>e.setPageIndex(jb),disabled:!e.getCanPreviousPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_first_page")}),_.jsx(Xye,{className:"w-4 h-4"})]}),_.jsxs(at,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_prev_page")}),_.jsx(lD,{className:"w-4 h-4"})]}),_.jsxs(at,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_next_page")}),_.jsx(Tx,{className:"w-4 h-4"})]}),_.jsxs(at,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>e.setPageIndex(e.getPageCount()+1),disabled:!e.getCanNextPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_last_page")}),_.jsx(Qye,{className:"w-4 h-4"})]})]})]})]})]})}function PO({table:e,title:t,description:n,caption:r,paginationOptions:s,headerOptions:i={visible:!0},children:o,className:a,contentClassName:c,footerClassName:d,rowClassName:h,cellClassName:u,onRowClick:f,activeRowIndex:g}){var m;const v=i==null?void 0:i.visible;return _.jsxs(bs,{className:a,children:[(t||n)&&_.jsxs(Go,{className:"pb-0",children:[_.jsx(ui,{children:t}),_.jsx(Di,{children:n})]}),_.jsxs(xs,{className:ge("pt-6",c),children:[o&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"flex space-x-2",children:o}),_.jsx(Ef,{className:"my-4"})]}),_.jsxs(dO,{children:[typeof r<"u"&&_.jsx(mle,{children:r}),v&&e.getHeaderGroups().length&&_.jsx(fO,{children:e.getHeaderGroups().map(x=>_.jsx(dp,{className:h,children:x.headers.map(y=>_.jsx(pO,{colSpan:y.colSpan,style:{width:y.getSize()===Number.MAX_SAFE_INTEGER?"auto":y.getSize()},children:_.jsx(bue,{table:e,header:y})},y.id))},x.id))}),_.jsx(hO,{children:(m=e.getRowModel().rows)!=null&&m.length?e.getRowModel().rows.map(x=>_.jsx(dp,{onClick:()=>{f&&f(x)},tabIndex:0,"data-state":x.getIsSelected()&&"selected",className:ge(x.getIsSelected()||g===x.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",h),children:x.getVisibleCells().map(y=>_.jsx(TC,{className:u,style:{width:y.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":y.column.getSize()},children:XT(y.column.columnDef.cell,y.getContext())},y.id))},x.id)):_.jsx(dp,{className:h,children:_.jsx(TC,{className:ge("h-24 text-center",u),colSpan:e.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),_.jsx(fl,{className:d,children:_.jsx(t4e,{className:"flex-1",table:e,...s})})]})}function n4e({actions:e,rowContext:t}){return _.jsxs(rR,{children:[_.jsx(sR,{asChild:!0,children:_.jsxs(at,{size:"icon",variant:"outline",className:"w-8 h-8",children:[_.jsx(nbe,{className:"h-3.5 w-3.5"}),_.jsx("span",{className:"sr-only",children:ue("common.open_menu")})]})}),_.jsxs(Vx,{align:"end",children:[_.jsxs(XD,{children:[ue("common.actions")," "]}),e&&e(t).map((n,r)=>n.label==="-"?_.jsx(ax,{},r):_.jsxs(up,{onClick:s=>n.onClick?n.onClick(t,s):null,children:[n.icon&&_.jsx(_.Fragment,{children:n.icon}),n.label,n.shortcut&&_.jsx(_se,{children:n.shortcut})]},r))]})]})}function r4e(){for(var e=arguments.length,t=new Array(e),n=0;nr=>{t.forEach(s=>s(r))},t)}const NO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qx(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pW(e){return"nodeType"in e}function jo(e){var t,n;return e?Qx(e)?e:pW(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mW(e){const{Document:t}=jo(e);return e instanceof t}function pR(e){return Qx(e)?!1:e instanceof jo(e).HTMLElement}function xue(e){return e instanceof jo(e).SVGElement}function Zx(e){return e?Qx(e)?e.document:pW(e)?mW(e)?e:pR(e)||xue(e)?e.ownerDocument:document:document:document}const Nc=NO?C.useLayoutEffect:C.useEffect;function TO(e){const t=C.useRef(e);return Nc(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{e.current=setInterval(r,s)},[]),n=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function LC(e,t){t===void 0&&(t=[e]);const n=C.useRef(e);return Nc(()=>{n.current!==e&&(n.current=e)},t),n}function mR(e,t){const n=C.useRef();return C.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function QT(e){const t=TO(e),n=C.useRef(null),r=C.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function ZT(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let J4={};function gR(e,t){return C.useMemo(()=>{if(t)return t;const n=J4[e]==null?0:J4[e]+1;return J4[e]=n,e+"-"+n},[e,t])}function _ue(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const a=Object.entries(o);for(const[c,d]of a){const h=i[c];h!=null&&(i[c]=h+e*d)}return i},{...t})}}const $b=_ue(1),JT=_ue(-1);function i4e(e){return"clientX"in e&&"clientY"in e}function kO(e){if(!e)return!1;const{KeyboardEvent:t}=jo(e.target);return t&&e instanceof t}function o4e(e){if(!e)return!1;const{TouchEvent:t}=jo(e.target);return t&&e instanceof t}function ek(e){if(o4e(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return i4e(e)?{x:e.clientX,y:e.clientY}:null}const ku=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ku.Translate.toString(e),ku.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),yK="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function a4e(e){return e.matches(yK)?e:e.querySelector(yK)}const l4e={display:"none"};function c4e(e){let{id:t,value:n}=e;return fe.createElement("div",{id:t,style:l4e},n)}function u4e(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return fe.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function d4e(){const[e,t]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const wue=C.createContext(null);function f4e(e){const t=C.useContext(wue);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function h4e(){const[e]=C.useState(()=>new Set),t=C.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[C.useCallback(r=>{let{type:s,event:i}=r;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const p4e={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. `},m4e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function g4e(e){let{announcements:t=m4e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=p4e}=e;const{announce:i,announcement:o}=d4e(),a=gR("DndLiveRegion"),[c,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),f4e(C.useMemo(()=>({onDragStart(u){let{active:f}=u;i(t.onDragStart({active:f}))},onDragMove(u){let{active:f,over:g}=u;t.onDragMove&&i(t.onDragMove({active:f,over:g}))},onDragOver(u){let{active:f,over:g}=u;i(t.onDragOver({active:f,over:g}))},onDragEnd(u){let{active:f,over:g}=u;i(t.onDragEnd({active:f,over:g}))},onDragCancel(u){let{active:f,over:g}=u;i(t.onDragCancel({active:f,over:g}))}}),[i,t])),!c)return null;const h=fe.createElement(fe.Fragment,null,fe.createElement(c4e,{id:r,value:s.draggable}),fe.createElement(u4e,{id:a,announcement:o}));return n?Li.createPortal(h,n):h}var ei;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ei||(ei={}));function tk(){}function SP(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function v4e(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter(r=>r!=null),[...t])}const Tc=Object.freeze({x:0,y:0});function y4e(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function b4e(e,t){const n=ek(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function x4e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _4e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function w4e(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function bK(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const S4e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=bK(t,t.left,t.top),i=[];for(const o of r){const{id:a}=o,c=n.get(a);if(c){const d=y4e(bK(c),s);i.push({id:a,data:{droppableContainer:o,value:d}})}}return i.sort(x4e)};function C4e(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-r,a=i-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const c=C4e(a,t);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(_4e)};function A4e(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Sue(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Tc}function R4e(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const P4e=R4e(1);function Cue(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function N4e(e,t,n){const r=Cue(t);if(!r)return e;const{scaleX:s,scaleY:i,x:o,y:a}=r,c=e.left-o-(1-s)*parseFloat(n),d=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?e.width/s:e.width,u=i?e.height/i:e.height;return{width:h,height:u,top:d,right:c+h,bottom:d+u,left:c}}const T4e={ignoreTransform:!1};function Jx(e,t){t===void 0&&(t=T4e);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=jo(e).getComputedStyle(e);d&&(n=N4e(n,d,h))}const{top:r,left:s,width:i,height:o,bottom:a,right:c}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:c}}function xK(e){return Jx(e,{ignoreTransform:!0})}function k4e(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function D4e(e,t){return t===void 0&&(t=jo(e).getComputedStyle(e)),t.position==="fixed"}function O4e(e,t){t===void 0&&(t=jo(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function gW(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(mW(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!pR(s)||xue(s)||n.includes(s))return n;const i=jo(e).getComputedStyle(s);return s!==e&&O4e(s,i)&&n.push(s),D4e(s,i)?n:r(s.parentNode)}return e?r(e):n}function Eue(e){const[t]=gW(e,1);return t??null}function ez(e){return!NO||!e?null:Qx(e)?e:pW(e)?mW(e)||e===Zx(e).scrollingElement?window:pR(e)?e:null:null}function Aue(e){return Qx(e)?e.scrollX:e.scrollLeft}function Rue(e){return Qx(e)?e.scrollY:e.scrollTop}function UU(e){return{x:Aue(e),y:Rue(e)}}var ci;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ci||(ci={}));function Pue(e){return!NO||!e?!1:e===document.scrollingElement}function Nue(e){const t={x:0,y:0},n=Pue(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const M4e={x:.2,y:.2};function I4e(e,t,n,r,s){let{top:i,left:o,right:a,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=M4e);const{isTop:d,isBottom:h,isLeft:u,isRight:f}=Nue(e),g={x:0,y:0},v={x:0,y:0},m={height:t.height*s.y,width:t.width*s.x};return!d&&i<=t.top+m.height?(g.y=ci.Backward,v.y=r*Math.abs((t.top+m.height-i)/m.height)):!h&&c>=t.bottom-m.height&&(g.y=ci.Forward,v.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!f&&a>=t.right-m.width?(g.x=ci.Forward,v.x=r*Math.abs((t.right-m.width-a)/m.width)):!u&&o<=t.left+m.width&&(g.x=ci.Backward,v.x=r*Math.abs((t.left+m.width-o)/m.width)),{direction:g,speed:v}}function L4e(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Tue(e){return e.reduce((t,n)=>$b(t,UU(n)),Tc)}function j4e(e){return e.reduce((t,n)=>t+Aue(n),0)}function $4e(e){return e.reduce((t,n)=>t+Rue(n),0)}function kue(e,t){if(t===void 0&&(t=Jx),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);Eue(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const F4e=[["x",["left","right"],j4e],["y",["top","bottom"],$4e]];class vW{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=gW(n),s=Tue(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,a]of F4e)for(const c of o)Object.defineProperty(this,c,{get:()=>{const d=a(r),h=s[i]-d;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class W1{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function z4e(e){const{EventTarget:t}=jo(e);return e instanceof t?e:Zx(e)}function tz(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var hl;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(hl||(hl={}));function _K(e){e.preventDefault()}function B4e(e){e.stopPropagation()}var Un;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Un||(Un={}));const Due={start:[Un.Space,Un.Enter],cancel:[Un.Esc],end:[Un.Space,Un.Enter,Un.Tab]},U4e=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Un.Right:return{...n,x:n.x+25};case Un.Left:return{...n,x:n.x-25};case Un.Down:return{...n,y:n.y+25};case Un.Up:return{...n,y:n.y-25}}};class yW{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new W1(Zx(n)),this.windowListeners=new W1(jo(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(hl.Resize,this.handleCancel),this.windowListeners.add(hl.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(hl.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&kue(r),n(Tc)}handleKeyDown(t){if(kO(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=Due,coordinateGetter:o=U4e,scrollBehavior:a="smooth"}=s,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Tc;this.referenceCoordinates||(this.referenceCoordinates=h);const u=o(t,{active:n,context:r.current,currentCoordinates:h});if(u){const f=JT(u,h),g={x:0,y:0},{scrollableAncestors:v}=r.current;for(const m of v){const x=t.code,{isTop:y,isRight:b,isLeft:w,isBottom:E,maxScroll:R,minScroll:T}=Nue(m),N=L4e(m),A={x:Math.min(x===Un.Right?N.right-N.width/2:N.right,Math.max(x===Un.Right?N.left:N.left+N.width/2,u.x)),y:Math.min(x===Un.Down?N.bottom-N.height/2:N.bottom,Math.max(x===Un.Down?N.top:N.top+N.height/2,u.y))},D=x===Un.Right&&!b||x===Un.Left&&!w,O=x===Un.Down&&!E||x===Un.Up&&!y;if(D&&A.x!==u.x){const I=m.scrollLeft+f.x,$=x===Un.Right&&I<=R.x||x===Un.Left&&I>=T.x;if($&&!f.y){m.scrollTo({left:I,behavior:a});return}$?g.x=m.scrollLeft-I:g.x=x===Un.Right?m.scrollLeft-R.x:m.scrollLeft-T.x,g.x&&m.scrollBy({left:-g.x,behavior:a});break}else if(O&&A.y!==u.y){const I=m.scrollTop+f.y,$=x===Un.Down&&I<=R.y||x===Un.Up&&I>=T.y;if($&&!f.x){m.scrollTo({top:I,behavior:a});return}$?g.y=m.scrollTop-I:g.y=x===Un.Down?m.scrollTop-R.y:m.scrollTop-T.y,g.y&&m.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,$b(JT(u,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}yW.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Due,onActivation:s}=t,{active:i}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function wK(e){return!!(e&&"distance"in e)}function SK(e){return!!(e&&"delay"in e)}class bW{constructor(t,n,r){var s;r===void 0&&(r=z4e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:o}=i;this.props=t,this.events=n,this.document=Zx(o),this.documentListeners=new W1(this.document),this.listeners=new W1(r),this.windowListeners=new W1(jo(o)),this.initialCoordinates=(s=ek(i))!=null?s:Tc,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(hl.Resize,this.handleCancel),this.windowListeners.add(hl.DragStart,_K),this.windowListeners.add(hl.VisibilityChange,this.handleCancel),this.windowListeners.add(hl.ContextMenu,_K),this.documentListeners.add(hl.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(SK(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(wK(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(hl.Click,B4e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(hl.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(n=ek(t))!=null?n:Tc,d=JT(s,c);if(!r&&a){if(wK(a)){if(a.tolerance!=null&&tz(d,a.tolerance))return this.handleCancel();if(tz(d,a.distance))return this.handleStart()}if(SK(a)&&tz(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),o(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Un.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const V4e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class xW extends bW{constructor(t){const{event:n}=t,r=Zx(n.target);super(t,V4e,r)}}xW.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const H4e={move:{name:"mousemove"},end:{name:"mouseup"}};var VU;(function(e){e[e.RightClick=2]="RightClick"})(VU||(VU={}));class Oue extends bW{constructor(t){super(t,H4e,Zx(t.event.target))}}Oue.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===VU.RightClick?!1:(r==null||r({event:n}),!0)}}];const nz={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Mue extends bW{constructor(t){super(t,nz)}static setup(){return window.addEventListener(nz.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(nz.move.name,t)};function t(){}}}Mue.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var q1;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(q1||(q1={}));var nk;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nk||(nk={}));function W4e(e){let{acceleration:t,activator:n=q1.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=nk.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:h,delta:u,threshold:f}=e;const g=G4e({delta:u,disabled:!i}),[v,m]=s4e(),x=C.useRef({x:0,y:0}),y=C.useRef({x:0,y:0}),b=C.useMemo(()=>{switch(n){case q1.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case q1.DraggableRect:return s}},[n,s,c]),w=C.useRef(null),E=C.useCallback(()=>{const T=w.current;if(!T)return;const N=x.current.x*y.current.x,A=x.current.y*y.current.y;T.scrollBy(N,A)},[]),R=C.useMemo(()=>a===nk.TreeOrder?[...d].reverse():d,[a,d]);C.useEffect(()=>{if(!i||!d.length||!b){m();return}for(const T of R){if((r==null?void 0:r(T))===!1)continue;const N=d.indexOf(T),A=h[N];if(!A)continue;const{direction:D,speed:O}=I4e(T,A,b,t,f);for(const I of["x","y"])g[I][D[I]]||(O[I]=0,D[I]=0);if(O.x>0||O.y>0){m(),w.current=T,v(E,o),x.current=O,y.current=D;return}}x.current={x:0,y:0},y.current={x:0,y:0},m()},[t,E,r,m,i,o,JSON.stringify(b),JSON.stringify(g),v,d,R,h,JSON.stringify(f)])}const q4e={x:{[ci.Backward]:!1,[ci.Forward]:!1},y:{[ci.Backward]:!1,[ci.Forward]:!1}};function G4e(e){let{delta:t,disabled:n}=e;const r=ZT(t);return mR(s=>{if(n||!r||!s)return q4e;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ci.Backward]:s.x[ci.Backward]||i.x===-1,[ci.Forward]:s.x[ci.Forward]||i.x===1},y:{[ci.Backward]:s.y[ci.Backward]||i.y===-1,[ci.Forward]:s.y[ci.Forward]||i.y===1}}},[n,t,r])}function K4e(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return mR(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function Y4e(e,t){return C.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...i]},[]),[e,t])}var gx;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(gx||(gx={}));var HU;(function(e){e.Optimized="optimized"})(HU||(HU={}));const CK=new Map;function X4e(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,o]=C.useState(null),{frequency:a,measure:c,strategy:d}=s,h=C.useRef(e),u=x(),f=LC(u),g=C.useCallback(function(y){y===void 0&&(y=[]),!f.current&&o(b=>b===null?y:b.concat(y.filter(w=>!b.includes(w))))},[f]),v=C.useRef(null),m=mR(y=>{if(u&&!n)return CK;if(!y||y===CK||h.current!==e||i!=null){const b=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){b.set(w.id,w.rect.current);continue}const E=w.node.current,R=E?new vW(c(E),E):null;w.rect.current=R,R&&b.set(w.id,R)}return b}return y},[e,i,n,u,c]);return C.useEffect(()=>{h.current=e},[e]),C.useEffect(()=>{u||g()},[n,u]),C.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),C.useEffect(()=>{u||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{g(),v.current=null},a))},[a,u,g,...r]),{droppableRects:m,measureDroppableContainers:g,measuringScheduled:i!=null};function x(){switch(d){case gx.Always:return!1;case gx.BeforeDragging:return n;default:return!n}}}function _W(e,t){return mR(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Q4e(e,t){return _W(e,t)}function Z4e(e){let{callback:t,disabled:n}=e;const r=TO(t),s=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return C.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function DO(e){let{callback:t,disabled:n}=e;const r=TO(t),s=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return C.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function J4e(e){return new vW(Jx(e),e)}function EK(e,t,n){t===void 0&&(t=J4e);const[r,s]=C.useState(null);function i(){s(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??n)!=null?d:null}const h=t(e);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const o=Z4e({callback(c){if(e)for(const d of c){const{type:h,target:u}=d;if(h==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),a=DO({callback:i});return Nc(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function eze(e){const t=_W(e);return Sue(e,t)}const AK=[];function tze(e){const t=C.useRef(e),n=mR(r=>e?r&&r!==AK&&e&&t.current&&e.parentNode===t.current.parentNode?r:gW(e):AK,[e]);return C.useEffect(()=>{t.current=e},[e]),n}function nze(e){const[t,n]=C.useState(null),r=C.useRef(e),s=C.useCallback(i=>{const o=ez(i.target);o&&n(a=>a?(a.set(o,UU(o)),new Map(a)):null)},[]);return C.useEffect(()=>{const i=r.current;if(e!==i){o(i);const a=e.map(c=>{const d=ez(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,UU(d)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(i)};function o(a){a.forEach(c=>{const d=ez(c);d==null||d.removeEventListener("scroll",s)})}},[s,e]),C.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>$b(i,o),Tc):Tue(e):Tc,[e,t])}function RK(e,t){t===void 0&&(t=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},t),C.useEffect(()=>{const r=e!==Tc;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?JT(e,n.current):Tc}function rze(e){C.useEffect(()=>{if(!NO)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function sze(e,t){return C.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,t)},n},{}),[e,t])}function Iue(e){return C.useMemo(()=>e?k4e(e):null,[e])}const PK=[];function ize(e,t){t===void 0&&(t=Jx);const[n]=e,r=Iue(n?jo(n):null),[s,i]=C.useState(PK);function o(){i(()=>e.length?e.map(c=>Pue(c)?r:new vW(t(c),c)):PK)}const a=DO({callback:o});return Nc(()=>{a==null||a.disconnect(),o(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),s}function Lue(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return pR(t)?t:e}function oze(e){let{measure:t}=e;const[n,r]=C.useState(null),s=C.useCallback(d=>{for(const{target:h}of d)if(pR(h)){r(u=>{const f=t(h);return u?{...u,width:f.width,height:f.height}:f});break}},[t]),i=DO({callback:s}),o=C.useCallback(d=>{const h=Lue(d);i==null||i.disconnect(),h&&(i==null||i.observe(h)),r(h?t(h):null)},[t,i]),[a,c]=QT(o);return C.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const aze=[{sensor:xW,options:{}},{sensor:yW,options:{}}],lze={current:{}},sN={draggable:{measure:xK},droppable:{measure:xK,strategy:gx.WhileDragging,frequency:HU.Optimized},dragOverlay:{measure:Jx}};class G1 extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const cze={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new G1,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tk},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sN,measureDroppableContainers:tk,windowRect:null,measuringScheduled:!1},jue={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tk,draggableNodes:new Map,over:null,measureDroppableContainers:tk},vR=C.createContext(jue),$ue=C.createContext(cze);function uze(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new G1}}}function dze(e,t){switch(t.type){case ei.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ei.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ei.DragEnd:case ei.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ei.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new G1(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case ei.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new G1(e.droppable.containers);return o.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case ei.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new G1(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function fze(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=C.useContext(vR),i=ZT(r),o=ZT(n==null?void 0:n.id);return C.useEffect(()=>{if(!t&&!r&&i&&o!=null){if(!kO(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:d}=a;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[c.current,d.current]){if(!h)continue;const u=a4e(h);if(u){u.focus();break}}})}},[r,t,s,o,i]),null}function Fue(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function hze(e){return C.useMemo(()=>({draggable:{...sN.draggable,...e==null?void 0:e.draggable},droppable:{...sN.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sN.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function pze(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=C.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;Nc(()=>{if(!o&&!a||!t){i.current=!1;return}if(i.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const h=n(d),u=Sue(h,r);if(o||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=Eue(d);f&&f.scrollBy({top:u.y,left:u.x})}},[t,o,a,r,n])}const OO=C.createContext({...Tc,scaleX:1,scaleY:1});var dh;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dh||(dh={}));const mze=C.memo(function(t){var n,r,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:d,sensors:h=aze,collisionDetection:u=E4e,measuring:f,modifiers:g,...v}=t;const m=C.useReducer(dze,void 0,uze),[x,y]=m,[b,w]=h4e(),[E,R]=C.useState(dh.Uninitialized),T=E===dh.Initialized,{draggable:{active:N,nodes:A,translate:D},droppable:{containers:O}}=x,I=N!=null?A.get(N):null,$=C.useRef({initial:null,translated:null}),F=C.useMemo(()=>{var yt;return N!=null?{id:N,data:(yt=I==null?void 0:I.data)!=null?yt:lze,rect:$}:null},[N,I]),B=C.useRef(null),[W,Z]=C.useState(null),[Y,H]=C.useState(null),se=LC(v,Object.values(v)),he=gR("DndDescribedBy",o),re=C.useMemo(()=>O.getEnabled(),[O]),J=hze(f),{droppableRects:te,measureDroppableContainers:ae,measuringScheduled:be}=X4e(re,{dragging:T,dependencies:[D.x,D.y],config:J.droppable}),xe=K4e(A,N),ve=C.useMemo(()=>Y?ek(Y):null,[Y]),Pe=Ut(),Oe=Q4e(xe,J.draggable.measure);pze({activeNode:N!=null?A.get(N):null,config:Pe.layoutShiftCompensation,initialRect:Oe,measure:J.draggable.measure});const ke=EK(xe,J.draggable.measure,Oe),ze=EK(xe?xe.parentElement:null),$e=C.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=O.getNodeFor((n=$e.current.over)==null?void 0:n.id),Ue=oze({measure:J.dragOverlay.measure}),wt=(r=Ue.nodeRef.current)!=null?r:xe,ut=T?(s=Ue.rect)!=null?s:ke:null,St=!!(Ue.nodeRef.current&&Ue.rect),Nn=eze(St?null:ke),cn=Iue(wt?jo(wt):null),hn=tze(T?Te??xe:null),It=ize(hn),U=Fue(g,{transform:{x:D.x-Nn.x,y:D.y-Nn.y,scaleX:1,scaleY:1},activatorEvent:Y,active:F,activeNodeRect:ke,containerNodeRect:ze,draggingNodeRect:ut,over:$e.current.over,overlayNodeRect:Ue.rect,scrollableAncestors:hn,scrollableAncestorRects:It,windowRect:cn}),ee=ve?$b(ve,D):null,ie=nze(hn),_e=RK(ie),we=RK(ie,[ke]),pe=$b(U,_e),Se=ut?P4e(ut,U):null,Fe=F&&Se?u({active:F,collisionRect:Se,droppableRects:te,droppableContainers:re,pointerCoordinates:ee}):null,ft=w4e(Fe,"id"),[ht,hs]=C.useState(null),Mn=St?U:$b(U,we),Hr=A4e(Mn,(i=ht==null?void 0:ht.rect)!=null?i:null,ke),Yt=C.useRef(null),un=C.useCallback((yt,dn)=>{let{sensor:Gt,options:Hn}=dn;if(B.current==null)return;const In=A.get(B.current);if(!In)return;const Tn=yt.nativeEvent,sr=new Gt({active:B.current,activeNode:In,event:Tn,options:Hn,context:$e,onAbort(ir){if(!A.get(ir))return;const{onDragAbort:ye}=se.current,Ce={id:ir};ye==null||ye(Ce),b({type:"onDragAbort",event:Ce})},onPending(ir,de,ye,Ce){if(!A.get(ir))return;const{onDragPending:Ge}=se.current,lt={id:ir,constraint:de,initialCoordinates:ye,offset:Ce};Ge==null||Ge(lt),b({type:"onDragPending",event:lt})},onStart(ir){const de=B.current;if(de==null)return;const ye=A.get(de);if(!ye)return;const{onDragStart:Ce}=se.current,Me={activatorEvent:Tn,active:{id:de,data:ye.data,rect:$}};Li.unstable_batchedUpdates(()=>{Ce==null||Ce(Me),R(dh.Initializing),y({type:ei.DragStart,initialCoordinates:ir,active:de}),b({type:"onDragStart",event:Me}),Z(Yt.current),H(Tn)})},onMove(ir){y({type:ei.DragMove,coordinates:ir})},onEnd:Kr(ei.DragEnd),onCancel:Kr(ei.DragCancel)});Yt.current=sr;function Kr(ir){return async function(){const{active:ye,collisions:Ce,over:Me,scrollAdjustedTranslate:Ge}=$e.current;let lt=null;if(ye&&Ge){const{cancelDrop:Ct}=se.current;lt={activatorEvent:Tn,active:ye,collisions:Ce,delta:Ge,over:Me},ir===ei.DragEnd&&typeof Ct=="function"&&await Promise.resolve(Ct(lt))&&(ir=ei.DragCancel)}B.current=null,Li.unstable_batchedUpdates(()=>{y({type:ir}),R(dh.Uninitialized),hs(null),Z(null),H(null),Yt.current=null;const Ct=ir===ei.DragEnd?"onDragEnd":"onDragCancel";if(lt){const st=se.current[Ct];st==null||st(lt),b({type:Ct,event:lt})}})}}},[A]),xn=C.useCallback((yt,dn)=>(Gt,Hn)=>{const In=Gt.nativeEvent,Tn=A.get(Hn);if(B.current!==null||!Tn||In.dndKit||In.defaultPrevented)return;const sr={active:Tn};yt(Gt,dn.options,sr)===!0&&(In.dndKit={capturedBy:dn.sensor},B.current=Hn,un(Gt,dn))},[A,un]),Ze=Y4e(h,xn);rze(h),Nc(()=>{ke&&E===dh.Initializing&&R(dh.Initialized)},[ke,E]),C.useEffect(()=>{const{onDragMove:yt}=se.current,{active:dn,activatorEvent:Gt,collisions:Hn,over:In}=$e.current;if(!dn||!Gt)return;const Tn={active:dn,activatorEvent:Gt,collisions:Hn,delta:{x:pe.x,y:pe.y},over:In};Li.unstable_batchedUpdates(()=>{yt==null||yt(Tn),b({type:"onDragMove",event:Tn})})},[pe.x,pe.y]),C.useEffect(()=>{const{active:yt,activatorEvent:dn,collisions:Gt,droppableContainers:Hn,scrollAdjustedTranslate:In}=$e.current;if(!yt||B.current==null||!dn||!In)return;const{onDragOver:Tn}=se.current,sr=Hn.get(ft),Kr=sr&&sr.rect.current?{id:sr.id,rect:sr.rect.current,data:sr.data,disabled:sr.disabled}:null,ir={active:yt,activatorEvent:dn,collisions:Gt,delta:{x:In.x,y:In.y},over:Kr};Li.unstable_batchedUpdates(()=>{hs(Kr),Tn==null||Tn(ir),b({type:"onDragOver",event:ir})})},[ft]),Nc(()=>{$e.current={activatorEvent:Y,active:F,activeNode:xe,collisionRect:Se,collisions:Fe,droppableRects:te,draggableNodes:A,draggingNode:wt,draggingNodeRect:ut,droppableContainers:O,over:ht,scrollableAncestors:hn,scrollAdjustedTranslate:pe},$.current={initial:ut,translated:Se}},[F,xe,Fe,Se,A,wt,ut,te,O,ht,hn,pe]),W4e({...Pe,delta:D,draggingRect:Se,pointerCoordinates:ee,scrollableAncestors:hn,scrollableAncestorRects:It});const Rt=C.useMemo(()=>({active:F,activeNode:xe,activeNodeRect:ke,activatorEvent:Y,collisions:Fe,containerNodeRect:ze,dragOverlay:Ue,draggableNodes:A,droppableContainers:O,droppableRects:te,over:ht,measureDroppableContainers:ae,scrollableAncestors:hn,scrollableAncestorRects:It,measuringConfiguration:J,measuringScheduled:be,windowRect:cn}),[F,xe,ke,Y,Fe,ze,Ue,A,O,te,ht,ae,hn,It,J,be,cn]),Pt=C.useMemo(()=>({activatorEvent:Y,activators:Ze,active:F,activeNodeRect:ke,ariaDescribedById:{draggable:he},dispatch:y,draggableNodes:A,over:ht,measureDroppableContainers:ae}),[Y,Ze,F,ke,y,he,A,ht,ae]);return fe.createElement(wue.Provider,{value:w},fe.createElement(vR.Provider,{value:Pt},fe.createElement($ue.Provider,{value:Rt},fe.createElement(OO.Provider,{value:Hr},d)),fe.createElement(fze,{disabled:(a==null?void 0:a.restoreFocus)===!1})),fe.createElement(g4e,{...a,hiddenTextDescribedById:he}));function Ut(){const yt=(W==null?void 0:W.autoScrollEnabled)===!1,dn=typeof c=="object"?c.enabled===!1:c===!1,Gt=T&&!yt&&!dn;return typeof c=="object"?{...c,enabled:Gt}:{enabled:Gt}}}),gze=C.createContext(null),NK="button",vze="Draggable";function yze(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=gR(vze),{activators:o,activatorEvent:a,active:c,activeNodeRect:d,ariaDescribedById:h,draggableNodes:u,over:f}=C.useContext(vR),{role:g=NK,roleDescription:v="draggable",tabIndex:m=0}=s??{},x=(c==null?void 0:c.id)===t,y=C.useContext(x?OO:gze),[b,w]=QT(),[E,R]=QT(),T=sze(o,t),N=LC(n);Nc(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:E,data:N}),()=>{const D=u.get(t);D&&D.key===i&&u.delete(t)}),[u,t]);const A=C.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&g===NK?!0:void 0,"aria-roledescription":v,"aria-describedby":h.draggable}),[r,g,m,x,v,h.draggable]);return{active:c,activatorEvent:a,activeNodeRect:d,attributes:A,isDragging:x,listeners:r?void 0:T,node:b,over:f,setNodeRef:w,setActivatorNodeRef:R,transform:y}}function zue(){return C.useContext($ue)}const bze="Droppable",xze={timeout:25};function _ze(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=gR(bze),{active:o,dispatch:a,over:c,measureDroppableContainers:d}=C.useContext(vR),h=C.useRef({disabled:n}),u=C.useRef(!1),f=C.useRef(null),g=C.useRef(null),{disabled:v,updateMeasurementsFor:m,timeout:x}={...xze,...s},y=LC(m??r),b=C.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),g.current=null},x)},[x]),w=DO({callback:b,disabled:v||!o}),E=C.useCallback((A,D)=>{w&&(D&&(w.unobserve(D),u.current=!1),A&&w.observe(A))},[w]),[R,T]=QT(E),N=LC(t);return C.useEffect(()=>{!w||!R.current||(w.disconnect(),u.current=!1,w.observe(R.current))},[R,w]),C.useEffect(()=>(a({type:ei.RegisterDroppable,element:{id:r,key:i,disabled:n,node:R,rect:f,data:N}}),()=>a({type:ei.UnregisterDroppable,key:i,id:r})),[r]),C.useEffect(()=>{n!==h.current.disabled&&(a({type:ei.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)},[r,i,n,a]),{active:o,rect:f,isOver:(c==null?void 0:c.id)===r,node:R,over:c,setNodeRef:T}}function wze(e){let{animation:t,children:n}=e;const[r,s]=C.useState(null),[i,o]=C.useState(null),a=ZT(n);return!n&&!r&&a&&s(a),Nc(()=>{if(!i)return;const c=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(c==null||d==null){s(null);return}Promise.resolve(t(d,i)).then(()=>{s(null)})},[t,r,i]),fe.createElement(fe.Fragment,null,n,r?C.cloneElement(r,{ref:o}):null)}const Sze={x:0,y:0,scaleX:1,scaleY:1};function Cze(e){let{children:t}=e;return fe.createElement(vR.Provider,{value:jue},fe.createElement(OO.Provider,{value:Sze},t))}const Eze={position:"fixed",touchAction:"none"},Aze=e=>kO(e)?"transform 250ms ease":void 0,Rze=C.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:c,transform:d,transition:h=Aze}=e;if(!a)return null;const u=s?d:{...d,scaleX:1,scaleY:1},f={...Eze,width:a.width,height:a.height,top:a.top,left:a.left,transform:ku.Transform.toString(u),transformOrigin:s&&r?b4e(r,a):void 0,transition:typeof h=="function"?h(r):h,...c};return fe.createElement(n,{className:o,style:f,ref:t},i)}),Pze=e=>t=>{let{active:n,dragOverlay:r}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[c,d]of Object.entries(s))n.node.style.setProperty(c,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},Nze=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ku.Transform.toString(t)},{transform:ku.Transform.toString(n)}]},WU={duration:250,easing:"ease",keyframes:Nze,sideEffects:Pze({styles:{active:{opacity:"0"}}})};function Tze(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=e;return TO((i,o)=>{if(t===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const d=Lue(o);if(!d)return;const{transform:h}=jo(o).getComputedStyle(o),u=Cue(h);if(!u)return;const f=typeof t=="function"?t:kze(t);return kue(c,s.draggable.measure),f({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function kze(e){const{duration:t,easing:n,sideEffects:r,keyframes:s}={...WU,...e};return i=>{let{active:o,dragOverlay:a,transform:c,...d}=i;if(!t)return;const h={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},u={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/a.rect.height:1},f={x:c.x-h.x,y:c.y-h.y,...u},g=s({...d,active:o,dragOverlay:a,transform:{initial:c,final:f}}),[v]=g,m=g[g.length-1];if(JSON.stringify(v)===JSON.stringify(m))return;const x=r==null?void 0:r({active:o,dragOverlay:a,...d}),y=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(b=>{y.onfinish=()=>{x==null||x(),b()}})}}let TK=0;function Dze(e){return C.useMemo(()=>{if(e!=null)return TK++,TK},[e])}const Oze=fe.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:d=999}=e;const{activatorEvent:h,active:u,activeNodeRect:f,containerNodeRect:g,draggableNodes:v,droppableContainers:m,dragOverlay:x,over:y,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:E,windowRect:R}=zue(),T=C.useContext(OO),N=Dze(u==null?void 0:u.id),A=Fue(o,{activatorEvent:h,active:u,activeNodeRect:f,containerNodeRect:g,draggingNodeRect:x.rect,over:y,overlayNodeRect:x.rect,scrollableAncestors:w,scrollableAncestorRects:E,transform:T,windowRect:R}),D=_W(f),O=Tze({config:r,draggableNodes:v,droppableContainers:m,measuringConfiguration:b}),I=D?x.setRef:void 0;return fe.createElement(Cze,null,fe.createElement(wze,{animation:O},u&&N?fe.createElement(Rze,{key:N,id:u.id,ref:I,as:a,activatorEvent:h,adjustScale:t,className:c,transition:i,rect:D,style:{zIndex:d,...s},transform:A},n):null))});function Bue(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Mze(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function CP(e){return e!==null&&e>=0}function Ize(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=Bue(t,r,n),o=t[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},EP={scaleX:1,scaleY:1},jze=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(s===n){const d=i[o];return d?{x:0,y:nn&&s<=o?{x:0,y:-a.height-c,...EP}:s=o?{x:0,y:a.height+c,...EP}:{x:0,y:0,...EP}};function $ze(e,t,n){const r=e[t],s=e[t-1],i=e[t+1];return r?nr.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),v=o!=null,m=o?g.indexOf(o.id):-1,x=d?g.indexOf(d.id):-1,y=C.useRef(g),b=!Ize(g,y.current),w=x!==-1&&m===-1||b,E=Lze(i);Nc(()=>{b&&v&&h(g)},[b,g,v,h]),C.useEffect(()=>{y.current=g},[g]);const R=C.useMemo(()=>({activeIndex:m,containerId:u,disabled:E,disableTransforms:w,items:g,overIndex:x,useDragOverlay:f,sortedRects:Mze(g,c),strategy:s}),[m,u,E.draggable,E.droppable,w,g,x,c,f,s]);return fe.createElement(Hue.Provider,{value:R},t)}const zze=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Bue(n,r,s).indexOf(t)},Wue=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:d}=e;return!d||!r||a!==i&&s===o?!1:n?!0:o!==s&&t===c},Bze={duration:200,easing:"ease"},que="transform",Uze=ku.Transition.toString({property:que,duration:0,easing:"linear"}),Vze={roleDescription:"sortable"};function Hze(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,o]=C.useState(null),a=C.useRef(n);return Nc(()=>{if(!t&&n!==a.current&&r.current){const c=s.current;if(c){const d=Jx(r.current,{ignoreTransform:!0}),h={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(h.x||h.y)&&o(h)}}n!==a.current&&(a.current=n)},[t,n,r,s]),C.useEffect(()=>{i&&o(null)},[i]),i}function Gue(e){let{animateLayoutChanges:t=Wue,attributes:n,disabled:r,data:s,getNewIndex:i=zze,id:o,strategy:a,resizeObserverConfig:c,transition:d=Bze}=e;const{items:h,containerId:u,activeIndex:f,disabled:g,disableTransforms:v,sortedRects:m,overIndex:x,useDragOverlay:y,strategy:b}=C.useContext(Hue),w=Wze(r,g),E=h.indexOf(o),R=C.useMemo(()=>({sortable:{containerId:u,index:E,items:h},...s}),[u,s,E,h]),T=C.useMemo(()=>h.slice(h.indexOf(o)),[h,o]),{rect:N,node:A,isOver:D,setNodeRef:O}=_ze({id:o,data:R,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:I,activatorEvent:$,activeNodeRect:F,attributes:B,setNodeRef:W,listeners:Z,isDragging:Y,over:H,setActivatorNodeRef:se,transform:he}=yze({id:o,data:R,attributes:{...Vze,...n},disabled:w.draggable}),re=r4e(O,W),J=!!I,te=J&&!v&&CP(f)&&CP(x),ae=!y&&Y,be=ae&&te?he:null,ve=te?be??(a??b)({rects:m,activeNodeRect:F,activeIndex:f,overIndex:x,index:E}):null,Pe=CP(f)&&CP(x)?i({id:o,items:h,activeIndex:f,overIndex:x}):E,Oe=I==null?void 0:I.id,ke=C.useRef({activeId:Oe,items:h,newIndex:Pe,containerId:u}),ze=h!==ke.current.items,$e=t({active:I,containerId:u,isDragging:Y,isSorting:J,id:o,index:E,items:h,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:d,wasDragging:ke.current.activeId!=null}),Te=Hze({disabled:!$e,index:E,node:A,rect:N});return C.useEffect(()=>{J&&ke.current.newIndex!==Pe&&(ke.current.newIndex=Pe),u!==ke.current.containerId&&(ke.current.containerId=u),h!==ke.current.items&&(ke.current.items=h)},[J,Pe,u,h]),C.useEffect(()=>{if(Oe===ke.current.activeId)return;if(Oe&&!ke.current.activeId){ke.current.activeId=Oe;return}const wt=setTimeout(()=>{ke.current.activeId=Oe},50);return()=>clearTimeout(wt)},[Oe]),{active:I,activeIndex:f,attributes:B,data:R,rect:N,index:E,newIndex:Pe,items:h,isOver:D,isSorting:J,isDragging:Y,listeners:Z,node:A,overIndex:x,over:H,setNodeRef:re,setActivatorNodeRef:se,setDroppableNodeRef:O,setDraggableNodeRef:W,transform:Te??ve,transition:Ue()};function Ue(){if(Te||ze&&ke.current.newIndex===E)return Uze;if(!(ae&&!kO($)||!d)&&(J||$e))return ku.Transition.toString({...d,property:que})}}function Wze(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}Un.Down,Un.Right,Un.Up,Un.Left;const qze=({rowId:e,className:t})=>{const{attributes:n,listeners:r,isDragging:s}=Gue({id:e});return _.jsxs(at,{onClick:i=>{i.preventDefault()},size:"icon",variant:"link",className:ge(s?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",t),...n,...r,children:[_.jsx(CJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:ue("common.move_row")})]})};function Gze(){return{id:"select",header:({table:e})=>_.jsx(_C,{id:"select-all",checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:e})=>_.jsx(_C,{id:`select-row-${e.id}`,checked:e.getIsSelected(),onCheckedChange:t=>{e.toggleSelected(!!t)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function MO({columnCount:e,rowCount:t=10,searchableColumnCount:n=0,filterableColumnCount:r=0,showViewOptions:s=!0,cellWidths:i=["auto"],withPagination:o=!0,shrinkZero:a=!1,className:c,...d}){return _.jsxs("div",{className:ge("w-full space-y-2.5 overflow-auto",c),...d,children:[_.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[_.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[n>0?Array.from({length:n}).map((h,u)=>_.jsx(zo,{className:"w-40 h-7 lg:w-60"},u)):null,r>0?Array.from({length:r}).map((h,u)=>_.jsx(zo,{className:"h-7 w-[4.5rem] border-dashed"},u)):null]}),s?_.jsx(zo,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),_.jsx("div",{className:"border rounded-md",children:_.jsxs(dO,{children:[_.jsx(fO,{children:Array.from({length:1}).map((h,u)=>_.jsx(dp,{className:"hover:bg-transparent",children:Array.from({length:e}).map((f,g)=>_.jsx(pO,{style:{width:i[g],minWidth:a?i[g]:"auto"},children:_.jsx(zo,{className:"w-full h-6"})},g))},u))}),_.jsx(hO,{children:Array.from({length:t}).map((h,u)=>_.jsx(dp,{className:"hover:bg-transparent",children:Array.from({length:e}).map((f,g)=>_.jsx(TC,{style:{width:i[g],minWidth:a?i[g]:"auto"},children:_.jsx(zo,{className:"w-full h-6"})},g))},u))})]})}),o?_.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[_.jsx(zo,{className:"w-40 h-7 shrink-0"}),_.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(zo,{className:"w-24 h-7"}),_.jsx(zo,{className:"h-7 w-[4.5rem]"})]}),_.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:_.jsx(zo,{className:"w-20 h-7"})}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(zo,{className:"hidden size-7 lg:block"}),_.jsx(zo,{className:"size-7"}),_.jsx(zo,{className:"size-7"}),_.jsx(zo,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const IO=({title:e="Esto está muy vacío",subtitle:t="Empieza dando de alta un item",buttonText:n="Nuevo item",onButtonClick:r=()=>{},actions:s=void 0})=>_.jsxs("div",{className:"text-center",children:[_.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:_.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),_.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:e}),_.jsx("p",{className:"mt-1 text-base text-slate-500",children:t}),_.jsxs("div",{className:"items-center mt-6",children:[s&&_.jsx(_.Fragment,{children:s}),!s&&_.jsxs(at,{className:"my-4",onClick:r,children:[_.jsx(MH,{}),n]})]})]}),Ip=({title:e="Se ha producido un error",subtitle:t=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=io();return _.jsx("div",{className:"grid h-screen place-items-center ",children:_.jsxs("div",{className:"text-center",children:[_.jsx("h2",{className:"mt-2 text-xl font-semibold text-center text-slate-900",children:e}),_.jsxs("p",{className:"mt-1 font-medium text-slate-500",children:[t||r,_.jsx("br",{}),n]}),_.jsxs("div",{className:"mt-6 space-x-8 md:ml-4",children:[_.jsx(hW,{}),_.jsxs(at,{onClick:()=>s("/"),children:[_.jsx(ibe,{className:"w-4 h-4 mr-2"})," Ir al inicio"]})]})]})})};Ip.displayName="ErrorOverlay";var Dn=function(){return Dn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r1){if(n===0)return e.replace(t,"");if(e.includes(t)){var r=e.split(t),s=r[0],i=r[1];if(i.length===n)return e;if(i.length>n)return"".concat(s).concat(t).concat(i.slice(0,n))}var o=e.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),a=e.match(o);if(a){var s=a[1],i=a[2];return"".concat(s).concat(t).concat(i)}}return e},Kue=function(e,t){var n=t.groupSeparator,r=n===void 0?",":n,s=t.decimalSeparator,i=s===void 0?".":s,o=new RegExp("\\d([^".concat(Du(r)).concat(Du(i),"0-9]+)")),a=e.match(o);return a?a[1]:void 0},YS=function(e){var t=e.value,n=e.decimalSeparator,r=e.intlConfig,s=e.decimalScale,i=e.prefix,o=i===void 0?"":i,a=e.suffix,c=a===void 0?"":a;if(t===""||t===void 0)return"";if(t==="-")return"-";var d=new RegExp("^\\d?-".concat(o?"".concat(Du(o),"?"):"","\\d")).test(t),h=n!=="."?Jze(t,n,d):t;n&&n!=="-"&&h.startsWith(n)&&(h="0"+h);var u=r||{},f=u.locale,g=u.currency,v=wW(u,["locale","currency"]),m=Dn(Dn({},v),{minimumFractionDigits:s||0,maximumFractionDigits:20}),x=r?new Intl.NumberFormat(f,Dn(Dn({},m),g&&{style:"currency",currency:g})):new Intl.NumberFormat(void 0,m),y=x.formatToParts(Number(h)),b=eBe(y,e),w=Kue(b,Dn({},e)),E=t.slice(-1)===n?n:"",R=h.match(RegExp("\\d+\\.(\\d+)"))||[],T=R[1];return s===void 0&&T&&n&&(b.includes(n)?b=b.replace(RegExp("(\\d+)(".concat(Du(n),")(\\d+)"),"g"),"$1$2".concat(T)):w&&!c?b=b.replace(w,"".concat(n).concat(T).concat(w)):b="".concat(b).concat(n).concat(T)),c&&E?"".concat(b).concat(E).concat(c):w&&E?b.replace(w,"".concat(E).concat(w)):w&&c?b.replace(w,"".concat(E).concat(c)):[b,E,c].join("")},Jze=function(e,t,n){var r=e;return t&&t!=="."&&(r=r.replace(RegExp(Du(t),"g"),"."),n&&t==="-"&&(r="-".concat(r.slice(1)))),r},eBe=function(e,t){var n=t.prefix,r=t.groupSeparator,s=t.decimalSeparator,i=t.decimalScale,o=t.disableGroupSeparators,a=o===void 0?!1:o;return e.reduce(function(c,d,h){var u=d.type,f=d.value;return h===0&&n?u==="minusSign"?[f,n]:u==="currency"?Na(Na([],c,!0),[n],!1):[n,f]:u==="currency"?n?c:Na(Na([],c,!0),[f],!1):u==="group"?a?c:Na(Na([],c,!0),[r!==void 0?r:f],!1):u==="decimal"?i!==void 0&&i===0?c:Na(Na([],c,!0),[s!==void 0?s:f],!1):u==="fraction"?Na(Na([],c,!0),[i!==void 0?f.slice(0,i):f],!1):Na(Na([],c,!0),[f],!1)},[""]).join("")},tBe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},nBe=function(e){var t=e||{},n=t.locale,r=t.currency,s=wW(t,["locale","currency"]),i=n?new Intl.NumberFormat(n,Dn(Dn({},s),r&&{currency:r,style:"currency"})):new Intl.NumberFormat;return i.formatToParts(1000.1).reduce(function(o,a,c){return a.type==="currency"?c===0?Dn(Dn({},o),{currencySymbol:a.value,prefix:a.value}):Dn(Dn({},o),{currencySymbol:a.value,suffix:a.value}):a.type==="group"?Dn(Dn({},o),{groupSeparator:a.value}):a.type==="decimal"?Dn(Dn({},o),{decimalSeparator:a.value}):o},tBe)},kK=function(e){return RegExp(/\d/,"gi").test(e)},rBe=function(e,t,n){if(n===void 0||t===""||t===void 0||e===""||e===void 0)return e;if(!e.match(/\d/g))return"";var r=e.split(t),s=r[0],i=r[1];if(n===0)return s;var o=i||"";if(o.lengthv)){if(Pt===""||Pt==="-"||Pt===xe){x&&x(void 0,a,{float:null,formatted:"",value:""}),$e(Pt),Nn(1);return}var Ut=xe?Pt.replace(xe,"."):Pt,yt=parseFloat(Ut),dn=YS(Dn({value:Pt},Pe));if(Rt!=null){var Gt=Rt+(dn.length-Yt.length);Gt=Gt<=0?E?E.length:0:Gt,Nn(Gt),It(hn+1)}if($e(dn),x){var Hn={float:yt,formatted:dn,value:Pt};x(Pt,a,Hn)}}},pe=function(Yt){var un=Yt.target,xn=un.value,Ze=un.selectionStart;we(xn,Ze),Z&&Z(Yt)},Se=function(Yt){return Y&&Y(Yt),ze?ze.length:0},Fe=function(Yt){var un=Yt.target.value,xn=rz(Dn({value:un},Oe));if(xn==="-"||xn===xe||!xn){$e(""),H&&H(Yt);return}var Ze=Zze(xn,xe,y),Rt=rBe(Ze,xe,w!==void 0?w:y),Pt=xe?Rt.replace(xe,"."):Rt,Ut=parseFloat(Pt),yt=YS(Dn(Dn({},Pe),{value:Rt}));x&&te&&x(Rt,a,{float:Ut,formatted:yt,value:Rt}),$e(yt),H&&H(Yt)},ft=function(Yt){var un=Yt.key;if(ie(un),N&&(un==="ArrowUp"||un==="ArrowDown")){Yt.preventDefault(),Nn(ze.length);var xn=m!=null?String(m):void 0,Ze=xe&&xn?xn.replace(xe,"."):xn,Rt=parseFloat(Ze??rz(Dn({value:ze},Oe)))||0,Pt=un==="ArrowUp"?Rt+N:Rt-N;if(A!==void 0&&PtNumber(D))return;var Ut=String(N).includes(".")?Number(String(N).split(".")[1].length):void 0;we(String(Ut?Pt.toFixed(Ut):Pt).replace(".",xe))}se&&se(Yt)},ht=function(Yt){var un=Yt.key,xn=Yt.currentTarget.selectionStart;if(un!=="ArrowUp"&&un!=="ArrowDown"&&ze!=="-"){var Ze=Kue(ze,{groupSeparator:ve,decimalSeparator:xe});if(Ze&&xn&&xn>ze.length-Ze.length&&_e.current){var Rt=ze.length-Ze.length;_e.current.setSelectionRange(Rt,Rt)}}he&&he(Yt)};C.useEffect(function(){m==null&&u==null&&$e("")},[u,m]),C.useEffect(function(){Ue&&ze!=="-"&&_e.current&&document.activeElement===_e.current&&_e.current.setSelectionRange(St,St)},[ze,St,_e,Ue,hn]);var hs=function(){return m!=null&&ze!=="-"&&(!xe||ze!==xe)?YS(Dn(Dn({},Pe),{decimalScale:Ue?void 0:w,value:String(m)})):ze},Mn=Dn({type:"text",inputMode:"decimal",id:o,name:a,className:c,onChange:pe,onBlur:Fe,onFocus:Se,onKeyDown:ft,onKeyUp:ht,placeholder:b,disabled:g,value:hs(),ref:_e},ae);if(d){var Hr=d;return fe.createElement(Hr,Dn({},Mn))}return fe.createElement("input",Dn({},Mn))});LO.displayName="CurrencyInput";const xy=C.forwardRef(({children:e,...t},n)=>{var i;const{error:r}=Wx();let s=e;return r&&(r.message?s=String((r==null?void 0:r.message)||((i=r.root)==null?void 0:i.message)):r.type==="required"&&(s=ue("common.required_field"))),_.jsx(Hse,{ref:n,...t,children:s})});xy.displayName="FormErrorMessage";const _y=fe.forwardRef(({label:e,hint:t,required:n,...r},s)=>{const{error:i}=Wx(),o=t||(n?ue("common.required"):""),a=i?"text-destructive font-semibold":"";return _.jsxs(Vse,{ref:s,className:"flex justify-between text-sm",...r,children:[_.jsx("span",{className:`block font-semibold ${a}`,children:e}),o&&_.jsx("span",{className:`text-xs font-medium text-primary ${a} `,children:o})]})});_y.displayName="FormLabel";const iBe=Io("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),iN=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,defaultValue:c,rules:d,readOnly:h,scale:u,currency:f,language:g,variant:v}=e,{control:m}=ua(),[x,y]=C.useState(""),b={input:w=>{if(w==null||typeof w!="object")return w;const E=No.create(w);if(E.isFailure)throw console.error(E.error),E.error;const R=E.object.toString();return x.endsWith(",")?R.replace(/.0$/,","):R},output:(w,E,R)=>{const{value:T}=R??{value:null};y(T??"");const N=No.createFromFormattedValue(T,f.code,u);if(N.isFailure)throw N.error;return N.object.toObject()}};return _.jsx(Hx,{defaultValue:c,control:m,name:t,disabled:a,rules:d,render:({field:w})=>{const E=b.input(w.value),R=a||w.disabled,T=!!((d==null?void 0:d.required)??!1);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:T}),_.jsx(yy,{children:_.jsx(LO,{intlConfig:{locale:g.code,useGrouping:!0},name:w.name,ref:w.ref,onBlur:w.onBlur,disabled:R,readOnly:h,className:ge(iBe({variant:v,className:o})),suffix:` ${f==null?void 0:f.symbol}`,groupSeparator:".",decimalSeparator:",",placeholder:i,decimalsLimit:u,decimalScale:u,step:1,value:E,onValueChange:(N,A,D)=>w.onChange(b.output(N,A,D))})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})});iN.displayName="FormCurrencyField";const Yue=C.forwardRef((e,t)=>{const{label:n,placeholder:r,hint:s,description:i,required:o,disabled:a,className:c,name:d}=e,{control:h}=ua(),[u,f]=C.useState(!1);return _.jsx(Hx,{control:h,disabled:a,name:d,rules:{required:o},render:({field:g})=>_.jsxs(vy,{ref:t,className:ge(c,"flex flex-col space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:s,required:o}),_.jsxs(YMe,{open:u,onOpenChange:f,children:[_.jsx(XMe,{asChild:!0,children:_.jsx(yy,{children:_.jsxs(at,{disabled:a,variant:"ghost",className:ge("pl-3 text-left font-normal","border border-input ",!g.value&&"text-muted-foreground"),children:[g.value?new Date(g.value).toLocaleDateString():r||_.jsx("span",{children:ue("common.pick_date")}),_.jsx(Yye,{className:ge("w-4 h-4 ml-auto disabled:opacity-50 ",a?"text-foreground":"text-ring")})]})})}),_.jsx(loe,{className:"w-auto p-0",align:"start",children:_.jsx(nte,{className:"bg-background",mode:"single",captionLayout:"buttons",defaultMonth:g.value,selected:new Date(g.value),onSelect:v=>{g.onChange(v),f(!1)},disabled:v=>v{const a=fe.useId(),c=C.useMemo(()=>t||n||r,[t,n,r]);return _.jsxs(bs,{id:a,className:ge(c?"":"pt-6",e),ref:o,children:[c&&_.jsxs(Go,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[_.jsxs("div",{children:[t&&_.jsx(ui,{className:"text-lg leading-normal",children:t}),n&&_.jsx(Di,{className:"leading-loose",children:n})]}),r&&_.jsx("div",{className:"flex-shrink-0",children:r})]}),_.jsx(xs,{className:"grid items-start gap-6",children:i}),s&&_.jsx(fl,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});rk.displayName="FormGroup";const oBe=Io("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),sk=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,defaultValue:c,rules:d,readOnly:h,scale:u,variant:f}=e,{control:g}=ua(),[v,m]=C.useState(""),x={input:y=>{if(typeof y!="object")return y;const b=Tu.create(y);if(b.isFailure)throw b.error;const w=b.object.toString();return v.endsWith(",")?w.replace(/.0$/,","):w},output:(y,b,w)=>{const{value:E}=w??{value:null};m(E??"");const R=Tu.createFromFormattedValue(E);if(R.isFailure)throw R.error;return R.object.toObject()}};return _.jsx(Hx,{defaultValue:c,control:g,name:t,disabled:a,rules:{max:100,min:0,...d},render:({field:y})=>{const b=x.input(y.value),w=a||y.disabled,E=!!((d==null?void 0:d.required)??!1);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:E}),_.jsx(yy,{children:_.jsx(LO,{name:y.name,ref:y.ref,onBlur:y.onBlur,disabled:w,readOnly:h,className:ge(oBe({variant:f,className:o})),groupSeparator:".",decimalSeparator:",",placeholder:i,allowDecimals:u!==0,decimalsLimit:u,decimalScale:u,step:1,value:b,onValueChange:(R,T,N)=>y.onChange(x.output(R,T,N))})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})}),aBe=Io("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),lBe=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,defaultValue:c,rules:d,readOnly:h,scale:u,variant:f}=e,{control:g}=ua(),[v,m]=C.useState(""),x={input:y=>{if(typeof y!="object")return y;const b=xp.create(y);if(b.isFailure)throw b.error;const w=b.object.toString();return v.endsWith(",")?w.replace(/.0$/,","):w},output:(y,b,w)=>{const{value:E}=w??{value:null};m(E??"");const R=xp.createFromFormattedValue(E);if(R.isFailure)throw R.error;return R.object.toObject()}};return _.jsx(Hx,{defaultValue:c,control:g,name:t,disabled:a,rules:d,render:({field:y})=>{const b=x.input(y.value),w=a||y.disabled,E=!!((d==null?void 0:d.required)??!1);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:E}),_.jsx(yy,{children:_.jsx(LO,{name:y.name,ref:y.ref,onBlur:y.onBlur,disabled:w,readOnly:h,className:ge(aBe({variant:f,className:o})),groupSeparator:".",decimalSeparator:",",placeholder:i,allowDecimals:u!==0,decimalsLimit:u,decimalScale:u,step:1,value:b,onValueChange:(R,T,N)=>y.onChange(x.output(R,T,N))})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})}),DK=Io("",{variants:{variant:{default:"",outline:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),gc=C.forwardRef(({name:e,label:t,hint:n,placeholder:r,description:s,required:i,className:o,autoSize:a,variant:c,...d})=>{const{control:h}=ua();return _.jsx(Hx,{control:h,name:e,rules:{required:i},render:({field:u,fieldState:f})=>_.jsxs(vy,{className:ge(o,"flex flex-col space-y-3"),children:[t&&_.jsx(_y,{label:t,hint:n,required:i}),_.jsx(yy,{className:"grow",children:a?_.jsx(Ree,{placeholder:r,className:ge(f.error?"border-destructive focus-visible:ring-destructive":"","resize-y",DK({variant:c,className:o})),...d,...u}):_.jsx(Tle,{placeholder:r,className:ge(f.error?"border-destructive focus-visible:ring-destructive":"","resize-y",DK({variant:c,className:o})),...d,...u})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})})}),cBe=Io("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),mg=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,rules:c,required:d,type:h,variant:u}=e,{control:f}=ua();return _.jsx(Hx,{control:f,name:t,disabled:a,rules:{required:d,...c},render:({field:g,fieldState:v})=>{const m=!!((c==null?void 0:c.required)??d);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:m}),_.jsx(yy,{className:"block",children:_.jsx(cR,{type:h,placeholder:i,className:ge(v.error?"border-destructive focus-visible:ring-destructive":"",cBe({variant:u,className:o})),...g})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})}),e_=({className:e,children:t})=>_.jsx(Nhe,{children:_.jsx("div",{className:ge("flex flex-col w-full min-h-screen",e),children:t})});e_.displayName="Layout";const t_=({className:e,children:t})=>_.jsxs(_.Fragment,{children:[_.jsx("main",{className:ge("flex min-h-[calc(100vh_-_theme(spacing.36))] flex-1 flex-col gap-4 bg-muted/40 p-4 md:gap-8 md:p-10",e),children:t}),_.jsx(tce,{})]});t_.displayName="LayoutContent";const OK=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ye(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Xue=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?OK(r.ref,n,e):r.refs&&r.refs.forEach(s=>OK(s,n,e))}},uBe=(e,t)=>{t.shouldUseNativeValidation&&Xue(e,t);const n={};for(const r in e){const s=Ye(t.fields,r),i=Object.assign(e[r]||{},{ref:s&&s.ref});if(dBe(t.names||Object.keys(e),r)){const o=Object.assign({},Ye(n,r));kn(o,"root",i),kn(n,r,o)}else kn(n,r,i)}return n},dBe=(e,t)=>e.some(n=>n.startsWith(t+"."));var SW=function(e,t,n){return t===void 0&&(t={abortEarly:!1}),n===void 0&&(n={}),function(r,s,i){try{var o=function(){return c.error?{values:{},errors:uBe((h=c.error,u=!i.shouldUseNativeValidation&&i.criteriaMode==="all",h.details.length?h.details.reduce(function(f,g){var v=g.path.join(".");if(f[v]||(f[v]={message:g.message,type:g.type}),u){var m=f[v].types,x=m&&m[g.type];f[v]=kse(v,u,f,g.type,x?[].concat(x,g.message):g.message)}return f},{}):{}),i)}:(i.shouldUseNativeValidation&&Xue({},i),{errors:{},values:c.value});var h,u},a=Object.assign({},t,{context:s}),c={},d=function(){if(n.mode==="sync")c=e.validate(r,a);else{var h=function(u,f){try{var g=u()}catch(v){return f(v)}return g&&g.then?g.then(void 0,f):g}(function(){return Promise.resolve(e.validateAsync(r,a)).then(function(u){c.value=u})},function(u){c.error=u});if(h&&h.then)return h.then(function(){})}}();return Promise.resolve(d&&d.then?d.then(o):o())}catch(h){return Promise.reject(h)}}},Que={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9474),h=o(1687),u=o(8652),f=o(8160),g=o(3292),v=o(6354),m=o(8901),x=o(9708),y=o(6914),b=o(2294),w=o(6133),E=o(1152),R=o(8863),T=o(2036),N={Base:class{constructor(A){this.type=A,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new b.Ids,this._preferences=null,this._refs=new w.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof x.describe=="function","Manifest functionality disabled"),x.describe(this)}allow(...A){return f.verifyFlat(A,"allow"),this._values(A,"_valids")}alter(A){a(A&&typeof A=="object"&&!Array.isArray(A),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const D=this.clone();D.$_terms.alterations=D.$_terms.alterations||[];for(const O in A){const I=A[O];a(typeof I=="function","Alteration adjuster for",O,"must be a function"),D.$_terms.alterations.push({target:O,adjuster:I})}return D.$_temp.ruleset=!1,D}artifact(A){return a(A!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",A)}cast(A){return a(A===!1||typeof A=="string","Invalid to value"),a(A===!1||this._definition.cast[A],"Type",this.type,"does not support casting to",A),this.$_setFlag("cast",A===!1?void 0:A)}default(A,D){return this._default("default",A,D)}description(A){return a(A&&typeof A=="string","Description must be a non-empty string"),this.$_setFlag("description",A)}empty(A){const D=this.clone();return A!==void 0&&(A=D.$_compile(A,{override:!1})),D.$_setFlag("empty",A,{clone:!1})}error(A){return a(A,"Missing error"),a(A instanceof Error||typeof A=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",A)}example(A,D={}){return a(A!==void 0,"Missing example"),f.assertOptions(D,["override"]),this._inner("examples",A,{single:!0,override:D.override})}external(A,D){return typeof A=="object"&&(a(!D,"Cannot combine options with description"),D=A.description,A=A.method),a(typeof A=="function","Method must be a function"),a(D===void 0||D&&typeof D=="string","Description must be a non-empty string"),this._inner("externals",{method:A,description:D},{single:!0})}failover(A,D){return this._default("failover",A,D)}forbidden(){return this.presence("forbidden")}id(A){return A?(a(typeof A=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(A),"id cannot contain period character"),this.$_setFlag("id",A)):this.$_setFlag("id",void 0)}invalid(...A){return this._values(A,"_invalids")}label(A){return a(A&&typeof A=="string","Label name must be a non-empty string"),this.$_setFlag("label",A)}meta(A){return a(A!==void 0,"Meta cannot be undefined"),this._inner("metas",A,{single:!0})}note(...A){a(A.length,"Missing notes");for(const D of A)a(D&&typeof D=="string","Notes must be non-empty strings");return this._inner("notes",A)}only(A=!0){return a(typeof A=="boolean","Invalid mode:",A),this.$_setFlag("only",A)}optional(){return this.presence("optional")}prefs(A){a(A,"Missing preferences"),a(A.context===void 0,"Cannot override context"),a(A.externals===void 0,"Cannot override externals"),a(A.warnings===void 0,"Cannot override warnings"),a(A.debug===void 0,"Cannot override debug"),f.checkPreferences(A);const D=this.clone();return D._preferences=f.preferences(D._preferences,A),D}presence(A){return a(["optional","required","forbidden"].includes(A),"Unknown presence mode",A),this.$_setFlag("presence",A)}raw(A=!0){return this.$_setFlag("result",A?"raw":void 0)}result(A){return a(["raw","strip"].includes(A),"Unknown result mode",A),this.$_setFlag("result",A)}required(){return this.presence("required")}strict(A){const D=this.clone(),O=A!==void 0&&!A;return D._preferences=f.preferences(D._preferences,{convert:O}),D}strip(A=!0){return this.$_setFlag("result",A?"strip":void 0)}tag(...A){a(A.length,"Missing tags");for(const D of A)a(D&&typeof D=="string","Tags must be non-empty strings");return this._inner("tags",A)}unit(A){return a(A&&typeof A=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",A)}valid(...A){f.verifyFlat(A,"valid");const D=this.allow(...A);return D.$_setFlag("only",!!D._valids,{clone:!1}),D}when(A,D){const O=this.clone();O.$_terms.whens||(O.$_terms.whens=[]);const I=g.when(O,A,D);if(!["any","link"].includes(O.type)){const $=I.is?[I]:I.switch;for(const F of $)a(!F.then||F.then.type==="any"||F.then.type===O.type,"Cannot combine",O.type,"with",F.then&&F.then.type),a(!F.otherwise||F.otherwise.type==="any"||F.otherwise.type===O.type,"Cannot combine",O.type,"with",F.otherwise&&F.otherwise.type)}return O.$_terms.whens.push(I),O.$_mutateRebuild()}cache(A){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const D=this.clone();return D._cache=A||u.provider.provision(),D.$_temp.ruleset=!1,D}clone(){const A=Object.create(Object.getPrototypeOf(this));return this._assign(A)}concat(A){a(f.isSchema(A),"Invalid schema object"),a(this.type==="any"||A.type==="any"||A.type===this.type,"Cannot merge type",this.type,"with another type:",A.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!A._inRuleset(),"Cannot concatenate a schema with open ruleset");let D=this.clone();if(this.type==="any"&&A.type!=="any"){const O=A.clone();for(const I of Object.keys(D))I!=="type"&&(O[I]=D[I]);D=O}D._ids.concat(A._ids),D._refs.register(A,w.toSibling),D._preferences=D._preferences?f.preferences(D._preferences,A._preferences):A._preferences,D._valids=T.merge(D._valids,A._valids,A._invalids),D._invalids=T.merge(D._invalids,A._invalids,A._valids);for(const O of A._singleRules.keys())D._singleRules.has(O)&&(D._rules=D._rules.filter(I=>I.keep||I.name!==O),D._singleRules.delete(O));for(const O of A._rules)A._definition.rules[O.method].multi||D._singleRules.set(O.name,O),D._rules.push(O);if(D._flags.empty&&A._flags.empty){D._flags.empty=D._flags.empty.concat(A._flags.empty);const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else if(A._flags.empty){D._flags.empty=A._flags.empty;const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else h(D._flags,A._flags);for(const O in A.$_terms){const I=A.$_terms[O];I?D.$_terms[O]?D.$_terms[O]=D.$_terms[O].concat(I):D.$_terms[O]=I.slice():D.$_terms[O]||(D.$_terms[O]=I)}return this.$_root._tracer&&this.$_root._tracer._combine(D,[this,A]),D.$_mutateRebuild()}extend(A){return a(!A.base,"Cannot extend type with another base"),m.type(this,A)}extract(A){return A=Array.isArray(A)?A:A.split("."),this._ids.reach(A)}fork(A,D){a(!this._inRuleset(),"Cannot fork inside a ruleset");let O=this;for(let I of[].concat(A))I=Array.isArray(I)?I:I.split("."),O=O._ids.fork(I,D,O);return O.$_temp.ruleset=!1,O}rule(A){const D=this._definition;f.assertOptions(A,Object.keys(D.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const O=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(O>=0&&OO.tailor(A),ref:!1}),D.$_temp.ruleset=!1,D.$_mutateRebuild()}tracer(){return E.location?E.location(this):this}validate(A,D){return R.entry(A,this,D)}validateAsync(A,D){return R.entryAsync(A,this,D)}$_addRule(A){typeof A=="string"&&(A={name:A}),a(A&&typeof A=="object","Invalid options"),a(A.name&&typeof A.name=="string","Invalid rule name");for(const F in A)a(F[0]!=="_","Cannot set private rule properties");const D=Object.assign({},A);D._resolve=[],D.method=D.method||D.name;const O=this._definition.rules[D.method],I=D.args;a(O,"Unknown rule",D.method);const $=this.clone();if(I){a(Object.keys(I).length===1||Object.keys(I).length===this._definition.rules[D.name].args.length,"Invalid rule definition for",this.type,D.name);for(const F in I){let B=I[F];if(O.argsByName){const W=O.argsByName.get(F);if(W.ref&&f.isResolvable(B))D._resolve.push(F),$.$_mutateRegister(B);else if(W.normalize&&(B=W.normalize(B),I[F]=B),W.assert){const Z=f.validateArg(B,F,W);a(!Z,Z,"or reference")}}B!==void 0?I[F]=B:delete I[F]}}return O.multi||($._ruleRemove(D.name,{clone:!1}),$._singleRules.set(D.name,D)),$.$_temp.ruleset===!1&&($.$_temp.ruleset=null),O.priority?$._rules.unshift(D):$._rules.push(D),$}$_compile(A,D){return g.schema(this.$_root,A,D)}$_createError(A,D,O,I,$,F={}){const B=F.flags!==!1?this._flags:{},W=F.messages?y.merge(this._definition.messages,F.messages):this._definition.messages;return new v.Report(A,D,O,B,W,I,$)}$_getFlag(A){return this._flags[A]}$_getRule(A){return this._singleRules.get(A)}$_mapLabels(A){return A=Array.isArray(A)?A:A.split("."),this._ids.labels(A)}$_match(A,D,O,I){(O=Object.assign({},O)).abortEarly=!0,O._externals=!1,D.snapshot();const $=!R.validate(A,this,D,O,I).errors;return D.restore(),$}$_modify(A){return f.assertOptions(A,["each","once","ref","schema"]),b.schema(this,A)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(A,{source:D,name:O,path:I,key:$})=>{const F=this._definition[D][O]&&this._definition[D][O].register;F!==!1&&this.$_mutateRegister(A,{family:F,key:$})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(A,{family:D,key:O}={}){this._refs.register(A,D),this._ids.register(A,{key:O})}$_property(A){return this._definition.properties[A]}$_reach(A){return this._ids.reach(A)}$_rootReferences(){return this._refs.roots()}$_setFlag(A,D,O={}){a(A[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const I=this._definition.flags[A]||{};if(d(D,I.default)&&(D=void 0),d(D,this._flags[A]))return this;const $=O.clone!==!1?this.clone():this;return D!==void 0?($._flags[A]=D,$.$_mutateRegister(D)):delete $._flags[A],A[0]!=="_"&&($.$_temp.ruleset=!1),$}$_parent(A,...D){return this[A][f.symbols.parent].call(this,...D)}$_validate(A,D,O){return R.validate(A,this,D,O)}_assign(A){A.type=this.type,A.$_root=this.$_root,A.$_temp=Object.assign({},this.$_temp),A.$_temp.whens={},A._ids=this._ids.clone(),A._preferences=this._preferences,A._valids=this._valids&&this._valids.clone(),A._invalids=this._invalids&&this._invalids.clone(),A._rules=this._rules.slice(),A._singleRules=c(this._singleRules,{shallow:!0}),A._refs=this._refs.clone(),A._flags=Object.assign({},this._flags),A._cache=null,A.$_terms={};for(const D in this.$_terms)A.$_terms[D]=this.$_terms[D]?this.$_terms[D].slice():null;A.$_super={};for(const D in this.$_super)A.$_super[D]=this._super[D].bind(A);return A}_bare(){const A=this.clone();A._reset();const D=A._definition.terms;for(const O in D){const I=D[O];A.$_terms[O]=I.init}return A.$_mutateRebuild()}_default(A,D,O={}){return f.assertOptions(O,"literal"),a(D!==void 0,"Missing",A,"value"),a(typeof D=="function"||!O.literal,"Only function value supports literal option"),typeof D=="function"&&O.literal&&(D={[f.symbols.literal]:!0,literal:D}),this.$_setFlag(A,D)}_generate(A,D,O){if(!this.$_terms.whens)return{schema:this};const I=[],$=[];for(let W=0;Wse)break}const F=$.join(", ");if(D.mainstay.tracer.debug(D,"rule","when",F),!F)return{schema:this};if(!D.mainstay.tracer.active&&this.$_temp.whens[F])return{schema:this.$_temp.whens[F],id:F};let B=this;this._definition.generate&&(B=this._definition.generate(this,A,D,O));for(const W of I)B=B.concat(W);return this.$_root._tracer&&this.$_root._tracer._combine(B,[this,...I]),this.$_temp.whens[F]=B,{schema:B,id:F}}_inner(A,D,O={}){a(!this._inRuleset(),`Cannot set ${A} inside a ruleset`);const I=this.clone();return I.$_terms[A]&&!O.override||(I.$_terms[A]=[]),O.single?I.$_terms[A].push(D):I.$_terms[A].push(...D),I.$_temp.ruleset=!1,I}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(A,D={}){if(!this._singleRules.has(A))return this;const O=D.clone!==!1?this.clone():this;O._singleRules.delete(A);const I=[];for(let $=0;${const a=o(375),c=o(8571),d=o(8160),h={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:u=>new h.Cache(u)},h.Cache=class{constructor(u={}){d.assertOptions(u,["max"]),a(u.max===void 0||u.max&&u.max>0&&isFinite(u.max),"Invalid max cache size"),this._max=u.max||h.max,this._map=new Map,this._list=new h.List}get length(){return this._map.size}set(u,f){if(u!==null&&!h.supported.has(typeof u))return;let g=this._map.get(u);if(g)return g.value=f,void this._list.first(g);g=this._list.unshift({key:u,value:f}),this._map.set(u,g),this._compact()}get(u){const f=this._map.get(u);if(f)return this._list.first(f),c(f.value)}_compact(){if(this._map.size>this._max){const u=this._list.pop();this._map.delete(u.key)}}},h.List=class{constructor(){this.tail=null,this.head=null}unshift(u){return u.next=null,u.prev=this.head,this.head&&(this.head.next=u),this.head=u,this.tail||(this.tail=u),u}first(u){u!==this.head&&(this._remove(u),this.unshift(u))}pop(){return this._remove(this.tail)}_remove(u){const{next:f,prev:g}=u;return f.prev=g,g&&(g.next=f),u===this.tail&&(this.tail=f),u.prev=null,u.next=null,u}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),d=o(5934);let h,u;const f={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=d.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(g,v,m="Options"){a(g&&typeof g=="object"&&!Array.isArray(g),"Options must be of type object");const x=Object.keys(g).filter(y=>!v.includes(y));a(x.length===0,`${m} contain unknown keys: ${x}`)},i.checkPreferences=function(g){u=u||o(3378);const v=u.preferences.validate(g);if(v.error)throw new c([v.error.details[0].message])},i.compare=function(g,v,m){switch(m){case"=":return g===v;case">":return g>v;case"<":return g=":return g>=v;case"<=":return g<=v}},i.default=function(g,v){return g===void 0?v:g},i.isIsoDate=function(g){return f.isoDate.test(g)},i.isNumber=function(g){return typeof g=="number"&&!isNaN(g)},i.isResolvable=function(g){return!!g&&(g[i.symbols.ref]||g[i.symbols.template])},i.isSchema=function(g,v={}){const m=g&&g[i.symbols.any];return!!m&&(a(v.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(g){return g[i.symbols.values]},i.limit=function(g){return Number.isSafeInteger(g)&&g>=0},i.preferences=function(g,v){h=h||o(6914),g=g||{},v=v||{};const m=Object.assign({},g,v);return v.errors&&g.errors&&(m.errors=Object.assign({},g.errors,v.errors),m.errors.wrap=Object.assign({},g.errors.wrap,v.errors.wrap)),v.messages&&(m.messages=h.compile(v.messages,g.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(g,v,m={}){try{return g()}catch(x){throw x.path!==void 0?x.path=v+"."+x.path:x.path=v,m.append&&(x.message=`${x.message} (${x.path})`),x}},i.validateArg=function(g,v,{assert:m,message:x}){if(i.isSchema(m)){const y=m.validate(g);return y.error?y.error.message:void 0}if(!m(g))return v?`${v} ${x}`:x},i.verifyFlat=function(g,v){for(const m of g)a(!Array.isArray(m),"Method no longer accepts array arguments:",v)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.schema=function(u,f,g={}){c.assertOptions(g,["appendPath","override"]);try{return h.schema(u,f,g)}catch(v){throw g.appendPath&&v.path!==void 0&&(v.message=`${v.message} (${v.path})`),v}},h.schema=function(u,f,g){a(f!==void 0,"Invalid undefined schema"),Array.isArray(f)&&(a(f.length,"Invalid empty array schema"),f.length===1&&(f=f[0]));const v=(m,...x)=>g.override!==!1?m.valid(u.override,...x):m.valid(...x);if(h.simple(f))return v(u,f);if(typeof f=="function")return u.custom(f);if(a(typeof f=="object","Invalid schema content:",typeof f),c.isResolvable(f))return v(u,f);if(c.isSchema(f))return f;if(Array.isArray(f)){for(const m of f)if(!h.simple(m))return u.alternatives().try(...f);return v(u,...f)}return f instanceof RegExp?u.string().regex(f):f instanceof Date?v(u.date(),f):(a(Object.getPrototypeOf(f)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),u.object().keys(f))},i.ref=function(u,f){return d.isRef(u)?u:d.create(u,f)},i.compile=function(u,f,g={}){c.assertOptions(g,["legacy"]);const v=f&&f[c.symbols.any];if(v)return a(g.legacy||v.version===c.version,"Cannot mix different versions of joi schemas:",v.version,c.version),f;if(typeof f!="object"||!g.legacy)return i.schema(u,f,{appendPath:!0});const m=h.walk(f);return m?m.compile(m.root,f):i.schema(u,f,{appendPath:!0})},h.walk=function(u){if(typeof u!="object")return null;if(Array.isArray(u)){for(const g of u){const v=h.walk(g);if(v)return v}return null}const f=u[c.symbols.any];if(f)return{root:u[f.root],compile:f.compile};a(Object.getPrototypeOf(u)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const g in u){const v=h.walk(u[g]);if(v)return v}return null},h.simple=function(u){return u===null||["boolean","string","number"].includes(typeof u)},i.when=function(u,f,g){if(g===void 0&&(a(f&&typeof f=="object","Missing options"),g=f,f=d.create(".")),Array.isArray(g)&&(g={switch:g}),c.assertOptions(g,["is","not","then","otherwise","switch","break"]),c.isSchema(f))return a(g.is===void 0,'"is" can not be used with a schema condition'),a(g.not===void 0,'"not" can not be used with a schema condition'),a(g.switch===void 0,'"switch" can not be used with a schema condition'),h.condition(u,{is:f,then:g.then,otherwise:g.otherwise,break:g.break});if(a(d.isRef(f)||typeof f=="string","Invalid condition:",f),a(g.not===void 0||g.is===void 0,'Cannot combine "is" with "not"'),g.switch===void 0){let m=g;g.not!==void 0&&(m={is:g.not,then:g.otherwise,otherwise:g.then,break:g.break});let x=m.is!==void 0?u.$_compile(m.is):u.$_root.invalid(null,!1,0,"").required();return a(m.then!==void 0||m.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(m.break===void 0||m.then===void 0||m.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),g.is===void 0||d.isRef(g.is)||c.isSchema(g.is)||(x=x.required()),h.condition(u,{ref:i.ref(f),is:x,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(g.switch),'"switch" must be an array'),a(g.is===void 0,'Cannot combine "switch" with "is"'),a(g.not===void 0,'Cannot combine "switch" with "not"'),a(g.then===void 0,'Cannot combine "switch" with "then"');const v={ref:i.ref(f),switch:[],break:g.break};for(let m=0;m{const a=o(5688),c=o(8160),d=o(3328);i.Report=class{constructor(h,u,f,g,v,m,x){if(this.code=h,this.flags=g,this.messages=v,this.path=m.path,this.prefs=x,this.state=m,this.value=u,this.message=null,this.template=null,this.local=f||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const y=this.path[this.path.length-1];typeof y!="object"&&(this.local.key=y)}}_setTemplate(h){if(this.template=h,!this.flags.label&&this.path.length===0){const u=this._template(this.template,"root");u&&(this.local.label=u)}}toString(){if(this.message)return this.message;const h=this.code;if(!this.prefs.errors.render)return this.code;const u=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return u===void 0?`Error code "${h}" is not defined, your custom type is missing the correct messages definition`:(this.message=u.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(h,u){return i.template(this.value,h,u||this.code,this.state,this.prefs)}},i.path=function(h){let u="";for(const f of h)typeof f!="object"&&(typeof f=="string"?(u&&(u+="."),u+=f):u+=`[${f}]`);return u},i.template=function(h,u,f,g,v){if(!u)return;if(d.isTemplate(u))return f!=="root"?u:null;let m=v.errors.language;if(c.isResolvable(m)&&(m=m.resolve(h,g,v)),m&&u[m]){if(u[m][f]!==void 0)return u[m][f];if(u[m]["*"]!==void 0)return u[m]["*"]}return u[f]?u[f]:u["*"]},i.label=function(h,u,f,g){if(!f.errors.label)return"";if(h.label)return h.label;let v=u.path;return f.errors.label==="key"&&u.path.length>1&&(v=u.path.slice(-1)),i.path(v)||i.template(null,f.messages,"root",u,f)||g&&i.template(null,g,"root",u,f)||"value"},i.process=function(h,u,f){if(!h)return null;const{override:g,message:v,details:m}=i.details(h);if(g)return g;if(f.errors.stack)return new i.ValidationError(v,m,u);const x=Error.stackTraceLimit;Error.stackTraceLimit=0;const y=new i.ValidationError(v,m,u);return Error.stackTraceLimit=x,y},i.details=function(h,u={}){let f=[];const g=[];for(const v of h){if(v instanceof Error){if(u.override!==!1)return{override:v};const x=v.toString();f.push(x),g.push({message:x,type:"override",context:{error:v}});continue}const m=v.toString();f.push(m),g.push({message:m,path:v.path.filter(x=>typeof x!="object"),type:v.code,context:v.local})}return f.length>1&&(f=[...new Set(f)]),{message:f.join(". "),details:g}},i.ValidationError=class extends Error{constructor(h,u,f){super(h),this._original=f,this.details=u}static isError(h){return h instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),h=o(6914),u={};i.type=function(f,g){const v=Object.getPrototypeOf(f),m=c(v),x=f._assign(Object.create(m)),y=Object.assign({},g);delete y.base,m._definition=y;const b=v._definition||{};y.messages=h.merge(b.messages,y.messages),y.properties=Object.assign({},b.properties,y.properties),x.type=y.type,y.flags=Object.assign({},b.flags,y.flags);const w=Object.assign({},b.terms);if(y.terms)for(const N in y.terms){const A=y.terms[N];a(x.$_terms[N]===void 0,"Invalid term override for",y.type,N),x.$_terms[N]=A.init,w[N]=A}y.terms=w,y.args||(y.args=b.args),y.prepare=u.prepare(y.prepare,b.prepare),y.coerce&&(typeof y.coerce=="function"&&(y.coerce={method:y.coerce}),y.coerce.from&&!Array.isArray(y.coerce.from)&&(y.coerce={method:y.coerce.method,from:[].concat(y.coerce.from)})),y.coerce=u.coerce(y.coerce,b.coerce),y.validate=u.validate(y.validate,b.validate);const E=Object.assign({},b.rules);if(y.rules)for(const N in y.rules){const A=y.rules[N];a(typeof A=="object","Invalid rule definition for",y.type,N);let D=A.method;if(D===void 0&&(D=function(){return this.$_addRule(N)}),D&&(a(!m[N],"Rule conflict in",y.type,N),m[N]=D),a(!E[N],"Rule conflict in",y.type,N),E[N]=A,A.alias){const O=[].concat(A.alias);for(const I of O)m[I]=A.method}A.args&&(A.argsByName=new Map,A.args=A.args.map(O=>(typeof O=="string"&&(O={name:O}),a(!A.argsByName.has(O.name),"Duplicated argument name",O.name),d.isSchema(O.assert)&&(O.assert=O.assert.strict().label(O.name)),A.argsByName.set(O.name,O),O)))}y.rules=E;const R=Object.assign({},b.modifiers);if(y.modifiers)for(const N in y.modifiers){a(!m[N],"Rule conflict in",y.type,N);const A=y.modifiers[N];a(typeof A=="function","Invalid modifier definition for",y.type,N);const D=function(O){return this.rule({[N]:O})};m[N]=D,R[N]=A}if(y.modifiers=R,y.overrides){m._super=v,x.$_super={};for(const N in y.overrides)a(v[N],"Cannot override missing",N),y.overrides[N][d.symbols.parent]=v[N],x.$_super[N]=v[N].bind(x);Object.assign(m,y.overrides)}y.cast=Object.assign({},b.cast,y.cast);const T=Object.assign({},b.manifest,y.manifest);return T.build=u.build(y.manifest&&y.manifest.build,b.manifest&&b.manifest.build),y.manifest=T,y.rebuild=u.rebuild(y.rebuild,b.rebuild),x},u.build=function(f,g){return f&&g?function(v,m){return g(f(v,m),m)}:f||g},u.coerce=function(f,g){return f&&g?{from:f.from&&g.from?[...new Set([...f.from,...g.from])]:null,method(v,m){let x;if((!g.from||g.from.includes(typeof v))&&(x=g.method(v,m),x)){if(x.errors||x.value===void 0)return x;v=x.value}if(!f.from||f.from.includes(typeof v)){const y=f.method(v,m);if(y)return y}return x}}:f||g},u.prepare=function(f,g){return f&&g?function(v,m){const x=f(v,m);if(x){if(x.errors||x.value===void 0)return x;v=x.value}return g(v,m)||x}:f||g},u.rebuild=function(f,g){return f&&g?function(v){g(v),f(v)}:f||g},u.validate=function(f,g){return f&&g?function(v,m){const x=g(v,m);if(x){if(x.errors&&(!Array.isArray(x.errors)||x.errors.length))return x;v=x.value}return f(v,m)||x}:f||g}},5107:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8652),h=o(8160),u=o(3292),f=o(6354),g=o(8901),v=o(9708),m=o(6133),x=o(3328),y=o(1152);let b;const w={types:{alternatives:o(4946),any:o(8068),array:o(546),boolean:o(4937),date:o(7500),function:o(390),link:o(8785),number:o(3832),object:o(8966),string:o(7417),symbol:o(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const E={_types:new Set(Object.keys(w.types))};for(const R of E._types)E[R]=function(...T){return a(!T.length||["alternatives","link","object"].includes(R),"The",R,"type does not allow arguments"),w.generate(this,w.types[R],T)};for(const R of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])E[R]=function(...T){return this.any()[R](...T)};Object.assign(E,w.methods);for(const R in w.aliases){const T=w.aliases[R];E[R]=E[T]}return E.x=E.expression,y.setup&&y.setup(E),E}};w.methods={ValidationError:f.ValidationError,version:h.version,cache:d.provider,assert(E,R,...T){w.assert(E,R,!0,T)},attempt:(E,R,...T)=>w.assert(E,R,!1,T),build(E){return a(typeof v.build=="function","Manifest functionality disabled"),v.build(this,E)},checkPreferences(E){h.checkPreferences(E)},compile(E,R){return u.compile(this,E,R)},defaults(E){a(typeof E=="function","modifier must be a function");const R=Object.assign({},this);for(const T of R._types){const N=E(R[T]());a(h.isSchema(N),"modifier must return a valid schema object"),R[T]=function(...A){return w.generate(this,N,A)}}return R},expression:(...E)=>new x(...E),extend(...E){h.verifyFlat(E,"extend"),b=b||o(3378),a(E.length,"You need to provide at least one extension"),this.assert(E,b.extensions);const R=Object.assign({},this);R._types=new Set(R._types);for(let T of E){typeof T=="function"&&(T=T(R)),this.assert(T,b.extension);const N=w.expandExtension(T,R);for(const A of N){a(R[A.type]===void 0||R._types.has(A.type),"Cannot override name",A.type);const D=A.base||this.any(),O=g.type(D,A);R._types.add(A.type),R[A.type]=function(...I){return w.generate(this,O,I)}}}return R},isError:f.ValidationError.isError,isExpression:x.isTemplate,isRef:m.isRef,isSchema:h.isSchema,in:(...E)=>m.in(...E),override:h.symbols.override,ref:(...E)=>m.create(...E),types(){const E={};for(const R of this._types)E[R]=this[R]();for(const R in w.aliases)E[R]=this[R]();return E}},w.assert=function(E,R,T,N){const A=N[0]instanceof Error||typeof N[0]=="string"?N[0]:null,D=A!==null?N[1]:N[0],O=R.validate(E,h.preferences({errors:{stack:!0}},D||{}));let I=O.error;if(!I)return O.value;if(A instanceof Error)throw A;const $=T&&typeof I.annotate=="function"?I.annotate():I.message;throw I instanceof f.ValidationError==0&&(I=c(I)),I.message=A?`${A} ${$}`:$,I},w.generate=function(E,R,T){return a(E,"Must be invoked on a Joi instance."),R.$_root=E,R._definition.args&&T.length?R._definition.args(R,...T):R},w.expandExtension=function(E,R){if(typeof E.type=="string")return[E];const T=[];for(const N of R._types)if(E.type.test(N)){const A=Object.assign({},E);A.type=N,A.base=R[N](),T.push(A)}return T},s.exports=w.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),d=o(3328);i.compile=function(h,u){if(typeof h=="string")return a(!u,"Cannot set single message string"),new d(h);if(d.isTemplate(h))return a(!u,"Cannot set single message template"),h;a(typeof h=="object"&&!Array.isArray(h),"Invalid message options"),u=u?c(u):{};for(let f in h){const g=h[f];if(f==="root"||d.isTemplate(g)){u[f]=g;continue}if(typeof g=="string"){u[f]=new d(g);continue}a(typeof g=="object"&&!Array.isArray(g),"Invalid message for",f);const v=f;for(f in u[v]=u[v]||{},g){const m=g[f];f==="root"||d.isTemplate(m)?u[v][f]=m:(a(typeof m=="string","Invalid message for",f,"in",v),u[v][f]=new d(m))}}return u},i.decompile=function(h){const u={};for(let f in h){const g=h[f];if(f==="root"){u.root=g;continue}if(d.isTemplate(g)){u[f]=g.describe({compact:!0});continue}const v=f;for(f in u[v]={},g){const m=g[f];f!=="root"?u[v][f]=m.describe({compact:!0}):u[v].root=m}}return u},i.merge=function(h,u){if(!h)return i.compile(u);if(!u)return h;if(typeof u=="string")return new d(u);if(d.isTemplate(u))return u;const f=c(h);for(let g in u){const v=u[g];if(g==="root"||d.isTemplate(v)){f[g]=v;continue}if(typeof v=="string"){f[g]=new d(v);continue}a(typeof v=="object"&&!Array.isArray(v),"Invalid message for",g);const m=g;for(g in f[m]=f[m]||{},v){const x=v[g];g==="root"||d.isTemplate(x)?f[m][g]=x:(a(typeof x=="string","Invalid message for",g,"in",m),f[m][g]=new d(x))}}return f}},2294:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.Ids=h.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const u=new h.Ids;return u._byId=new Map(this._byId),u._byKey=new Map(this._byKey),u._schemaChain=this._schemaChain,u}concat(u){u._schemaChain&&(this._schemaChain=!0);for(const[f,g]of u._byId.entries())a(!this._byKey.has(f),"Schema id conflicts with existing key:",f),this._byId.set(f,g);for(const[f,g]of u._byKey.entries())a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,g)}fork(u,f,g){const v=this._collect(u);v.push({schema:g});const m=v.shift();let x={id:m.id,schema:f(m.schema)};a(c.isSchema(x.schema),"adjuster function failed to return a joi schema type");for(const y of v)x={id:y.id,schema:h.fork(y.schema,x.id,x.schema)};return x.schema}labels(u,f=[]){const g=u[0],v=this._get(g);if(!v)return[...f,...u].join(".");const m=u.slice(1);return f=[...f,v.schema._flags.label||g],m.length?v.schema._ids.labels(m,f):f.join(".")}reach(u,f=[]){const g=u[0],v=this._get(g);a(v,"Schema does not contain path",[...f,...u].join("."));const m=u.slice(1);return m.length?v.schema._ids.reach(m,[...f,g]):v.schema}register(u,{key:f}={}){if(!u||!c.isSchema(u))return;(u.$_property("schemaChain")||u._ids._schemaChain)&&(this._schemaChain=!0);const g=u._flags.id;if(g){const v=this._byId.get(g);a(!v||v.schema===u,"Cannot add different schemas with the same id:",g),a(!this._byKey.has(g),"Schema id conflicts with existing key:",g),this._byId.set(g,{schema:u,id:g})}f&&(a(!this._byKey.has(f),"Schema already contains key:",f),a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,{schema:u,id:f}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(u,f=[],g=[]){const v=u[0],m=this._get(v);a(m,"Schema does not contain path",[...f,...u].join(".")),g=[m,...g];const x=u.slice(1);return x.length?m.schema._ids._collect(x,[...f,v],g):g}_get(u){return this._byId.get(u)||this._byKey.get(u)}},h.fork=function(u,f,g){const v=i.schema(u,{each:(m,{key:x})=>{if(f===(m._flags.id||x))return g},ref:!1});return v?v.$_mutateRebuild():u},i.schema=function(u,f){let g;for(const v in u._flags){if(v[0]==="_")continue;const m=h.scan(u._flags[v],{source:"flags",name:v},f);m!==void 0&&(g=g||u.clone(),g._flags[v]=m)}for(let v=0;v{const a=o(375),c=o(8571),d=o(9621),h=o(8160);let u;const f={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(g,v={}){a(typeof g=="string","Invalid reference key:",g),h.assertOptions(v,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!v.prefix||typeof v.prefix=="object","options.prefix must be of type object");const m=Object.assign({},f.defaults,v);delete m.prefix;const x=m.separator,y=f.context(g,x,v.prefix);if(m.type=y.type,g=y.key,m.type==="value")if(y.root&&(a(!x||g[0]!==x,"Cannot specify relative path with root prefix"),m.ancestor="root",g||(g=null)),x&&x===g)g=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!x||!g||g[0]!==x,"Cannot combine prefix with ancestor option");else{const[b,w]=f.ancestor(g,x);w&&(g=g.slice(w))===""&&(g=null),m.ancestor=b}return m.path=x?g===null?[]:g.split(x):[g],new f.Ref(m)},i.in=function(g,v={}){return i.create(g,{...v,in:!0})},i.isRef=function(g){return!!g&&!!g[h.symbols.ref]},f.Ref=class{constructor(g){a(typeof g=="object","Invalid reference construction"),h.assertOptions(g,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(g.separator)||typeof g.separator=="string"&&g.separator.length===1,"Invalid separator"),a(!g.adjust||typeof g.adjust=="function","options.adjust must be a function"),a(!g.map||Array.isArray(g.map),"options.map must be an array"),a(!g.map||!g.adjust,"Cannot set both map and adjust options"),Object.assign(this,f.defaults,g),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(g,v,m,x,y={}){return a(!this.in||y.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,v,y):this.type==="local"?this._resolve(x,v,y):this.ancestor?this.ancestor==="root"?this._resolve(v.ancestors[v.ancestors.length-1],v,y):(a(this.ancestor<=v.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(v.ancestors[this.ancestor-1],v,y)):this._resolve(g,v,y)}_resolve(g,v,m){let x;if(this.type==="value"&&v.mainstay.shadow&&m.shadow!==!1&&(x=v.mainstay.shadow.get(this.absolute(v))),x===void 0&&(x=d(g,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(x=this.adjust(x)),this.map){const y=this.map.get(x);y!==void 0&&(x=y)}return v.mainstay&&v.mainstay.tracer.resolve(v,this,x),x}toString(){return this.display}absolute(g){return[...g.path.slice(0,-this.ancestor),...this.path]}clone(){return new f.Ref(this)}describe(){const g={path:this.path};this.type!=="value"&&(g.type=this.type),this.separator!=="."&&(g.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(g.ancestor=this.ancestor),this.map&&(g.map=[...this.map]);for(const v of["adjust","iterables","render"])this[v]!==null&&this[v]!==void 0&&(g[v]=this[v]);return this.in!==!1&&(g.in=!0),{ref:g}}updateDisplay(){const g=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${g}`);if(!this.separator)return void(this.display=`ref:${g}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${g}`);if(this.ancestor==="root")return void(this.display=`ref:root:${g}`);if(this.ancestor===1)return void(this.display=`ref:${g||".."}`);const v=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${v}${g||""}`}},f.Ref.prototype[h.symbols.ref]=!0,i.build=function(g){return(g=Object.assign({},f.defaults,g)).type==="value"&&g.ancestor===void 0&&(g.ancestor=1),new f.Ref(g)},f.context=function(g,v,m={}){if(g=g.trim(),m){const x=m.global===void 0?"$":m.global;if(x!==v&&g.startsWith(x))return{key:g.slice(x.length),type:"global"};const y=m.local===void 0?"#":m.local;if(y!==v&&g.startsWith(y))return{key:g.slice(y.length),type:"local"};const b=m.root===void 0?"/":m.root;if(b!==v&&g.startsWith(b))return{key:g.slice(b.length),type:"value",root:!0}}return{key:g,type:"value"}},f.ancestor=function(g,v){if(!v)return[1,0];if(g[0]!==v)return[1,0];if(g[1]!==v)return[0,1];let m=2;for(;g[m]===v;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(g,v){if(g)if(v=v===void 0?i.toParent:v,Array.isArray(g))for(const m of g)this.register(m,v);else if(h.isSchema(g))for(const m of g._refs.refs)m.ancestor-v>=0&&this.refs.push({ancestor:m.ancestor-v,root:m.root});else i.isRef(g)&&g.type==="value"&&g.ancestor-v>=0&&this.refs.push({ancestor:g.ancestor-v,root:g.root}),u=u||o(3328),u.isTemplate(g)&&this.register(g.refs(),v)}get length(){return this.refs.length}clone(){const g=new i.Manager;return g.refs=c(this.refs),g}reset(){this.refs=[]}roots(){return this.refs.filter(g=>!g.ancestor).map(g=>g.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),d=o(8160),h={value:Symbol("value")};s.exports=h.State=class{constructor(u,f,g){this.path=u,this.ancestors=f,this.mainstay=g.mainstay,this.schemas=g.schemas,this.debug=null}localize(u,f=null,g=null){const v=new h.State(u,f,this);return g&&v.schemas&&(v.schemas=[h.schemas(g),...v.schemas]),v}nest(u,f){const g=new h.State(this.path,this.ancestors,this);return g.schemas=g.schemas&&[h.schemas(u),...g.schemas],g.debug=f,g}shadow(u,f){this.mainstay.shadow=this.mainstay.shadow||new h.Shadow,this.mainstay.shadow.set(this.path,u,f)}snapshot(){this.mainstay.shadow&&(this._snapshot=a(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},h.schemas=function(u){return d.isSchema(u)?{schema:u}:u},h.Shadow=class{constructor(){this._values=null}set(u,f,g){if(!u.length||g==="strip"&&typeof u[u.length-1]=="number")return;this._values=this._values||new Map;let v=this._values;for(let m=0;m{const a=o(375),c=o(8571),d=o(5277),h=o(1447),u=o(8160),f=o(6354),g=o(6133),v={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=v.Template=class{constructor(m,x){if(a(typeof m=="string","Template source must be a string"),a(!m.includes("\0")&&!m.includes(""),"Template source cannot contain reserved control characters"),this.source=m,this.rendered=m,this._template=null,x){const{functions:y,...b}=x;this._settings=Object.keys(b).length?c(b):void 0,this._functions=y,this._functions&&(a(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=v.encode(this.source),x=v.split(m);let y=!1;const b=[],w=x.shift();w&&b.push(w);for(const E of x){const R=E[0]!=="{",T=R?"}":"}}",N=E.indexOf(T);if(N===-1||E[1]==="{"){b.push(`{${v.decode(E)}`);continue}let A=E.slice(R?0:1,N);const D=A[0]===":";D&&(A=A.slice(1));const O=this._ref(v.decode(A),{raw:R,wrapped:D});b.push(O),typeof O!="string"&&(y=!0);const I=E.slice(N+T.length);I&&b.push(v.decode(I))}y?this._template=b:this.rendered=b.join("")}static date(m,x){return v.dateFormat[x.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const x={template:this.source};return this._settings&&(x.options=this._settings),this._functions&&(x.functions=this._functions),x}static build(m){return new v.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[u.symbols.template]}refs(){if(!this._template)return;const m=[];for(const x of this._template)typeof x!="string"&&m.push(...x.refs);return m}resolve(m,x,y,b){return this._template&&this._template.length===1?this._part(this._template[0],m,x,y,b,{}):this.render(m,x,y,b)}_part(m,...x){return m.ref?m.ref.resolve(...x):m.formula.evaluate(x)}render(m,x,y,b,w={}){if(!this.isDynamic())return this.rendered;const E=[];for(const R of this._template)if(typeof R=="string")E.push(R);else{const T=this._part(R,m,x,y,b,w),N=v.stringify(T,m,x,y,b,w);if(N!==void 0){const A=R.raw||(w.errors&&w.errors.escapeHtml)===!1?N:d(N);E.push(v.wrap(A,R.wrapped&&y.errors.wrap.label))}}return E.join("")}_ref(m,{raw:x,wrapped:y}){const b=[],w=R=>{const T=g.create(R,this._settings);return b.push(T),N=>{const A=T.resolve(...N);return A!==void 0?A:null}};try{const R=this._functions?{...v.functions,...this._functions}:v.functions;var E=new h.Parser(m,{reference:w,functions:R,constants:v.constants})}catch(R){throw R.message=`Invalid template variable "${m}" fails due to: ${R.message}`,R}if(E.single){if(E.single.type==="reference"){const R=b[0];return{ref:R,raw:x,refs:b,wrapped:y||R.type==="local"&&R.key==="label"}}return v.stringify(E.single.value)}return{formula:E,raw:x,refs:b}}toString(){return this.source}},v.Template.prototype[u.symbols.template]=!0,v.Template.prototype.isImmutable=!0,v.encode=function(m){return m.replace(/\\(\{+)/g,(x,y)=>v.opens.slice(0,y.length)).replace(/\\(\}+)/g,(x,y)=>v.closes.slice(0,y.length))},v.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},v.split=function(m){const x=[];let y="";for(let b=0;b ${I.toString()}`);m=D}if(!Array.isArray(m))return m.toString();const A=[];for(const D of m)A.push(v.stringify(D,x,y,b,w,{arrayItems:!0,...E}));return v.wrap(A.join(", "),!N&&T.array)},v.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},v.functions={if:(m,x,y)=>m?x:y,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[x,y,b,w,E]=this,R=E.messages;if(!R)return"";const T=f.template(x,R[0],m,y,b)||f.template(x,R[1],m,y,b);return T?T.render(x,y,b,w,E):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),d=o(8068),h=o(8160),u=o(3292),f=o(6354),g=o(6133),v={};s.exports=d.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:g.toSibling}},args:(m,...x)=>x.length===1&&Array.isArray(x[0])?m.try(...x[0]):m.try(...x),validate(m,x){const{schema:y,error:b,state:w,prefs:E}=x;if(y._flags.match){const T=[],N=[];for(let D=0;Df.details(D,{override:!1}))})};if(y._flags.match==="one")return T.length===1?{value:T[0]}:{errors:b("alternatives.one")};if(T.length!==y.$_terms.matches.length)return{errors:b("alternatives.all",{details:N.map(D=>f.details(D,{override:!1}))})};const A=D=>D.$_terms.matches.some(O=>O.schema.type==="object"||O.schema.type==="alternatives"&&A(O.schema));return A(y)?{value:T.reduce((D,O)=>c(D,O,{mergeArrays:!1}))}:{value:T[T.length-1]}}const R=[];for(let T=0;Ty.path[0]!=="is"&&typeof x._flags.label!="string"?x.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:x=>{h.isSchema(x)&&x.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,x){if(x.matches)for(const y of x.matches){const{schema:b,ref:w,is:E,not:R,then:T,otherwise:N}=y;m=b?m.try(b):w?m.conditional(w,{is:E,then:T,not:R,otherwise:N,switch:y.switch}):m.conditional(E,{then:T,otherwise:N})}return m}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),v.errors=function(m,{error:x,state:y}){if(!m.length)return{errors:x("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const b=new Set,w=[];for(const{reports:E,schema:R}of m){if(E.length>1)return v.unmatched(m,x);const T=E[0];if(T instanceof f.Report==0)return v.unmatched(m,x);if(T.state.path.length!==y.path.length){w.push({type:R.type,report:T});continue}if(T.code==="any.only"){for(const D of T.local.valids)b.add(D);continue}const[N,A]=T.code.split(".");A!=="base"?w.push({type:R.type,report:T}):T.code==="object.base"?b.add(T.local.type):b.add(N)}return w.length?w.length===1?{errors:w[0].report}:v.unmatched(m,x):{errors:x("alternatives.types",{types:[...b]})}},v.unmatched=function(m,x){const y=[];for(const b of m)y.push(...b.reports);return{errors:x("alternatives.match",f.details(y,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),d=o(8160),h=o(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(u,f){return a(typeof u=="function","Method must be a function"),a(f===void 0||f&&typeof f=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:u,description:f}})},validate(u,f,{method:g}){try{return g(u,f)}catch(v){return f.error("any.custom",{error:v})}},args:["method","description"],multi:!0},messages:{method(u){return this.prefs({messages:u})}},shared:{method(u){a(d.isSchema(u)&&u._flags.id,"Schema must be a schema with an id");const f=this.clone();return f.$_terms.shared=f.$_terms.shared||[],f.$_terms.shared.push(u),f.$_mutateRegister(u),f}},warning:{method(u,f){return a(u&&typeof u=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:u,local:f},warn:!0})},validate:(u,f,{code:g,local:v})=>f.error(g,v),args:["code","local"],multi:!0}},modifiers:{keep(u,f=!0){u.keep=f},message(u,f){u.message=h.compile(f)},warn(u,f=!0){u.warn=f}},manifest:{build(u,f){for(const g in f){const v=f[g];if(["examples","externals","metas","notes","tags"].includes(g))for(const m of v)u=u[g.slice(0,-1)](m);else if(g!=="alterations")if(g!=="whens"){if(g==="shared")for(const m of v)u=u.shared(m)}else for(const m of v){const{ref:x,is:y,not:b,then:w,otherwise:E,concat:R}=m;u=R?u.concat(R):x?u.when(x,{is:y,not:b,then:w,otherwise:E,switch:m.switch,break:m.break}):u.when(y,{then:w,otherwise:E,break:m.break})}else{const m={};for(const{target:x,adjuster:y}of v)m[x]=y;u=u.alter(m)}}return u}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),d=o(9621),h=o(8068),u=o(8160),f=o(3292),g={};s.exports=h.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(v,{schema:m,state:x,prefs:y}){if(!Array.isArray(v))return;const b=m.$_getRule("sort");return b?g.sort(m,v,b.args.options,x,y):void 0}},validate(v,{schema:m,error:x}){if(!Array.isArray(v)){if(m._flags.single){const y=[v];return y[u.symbols.arraySingle]=!0,{value:y}}return{errors:x("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:v.slice()}},rules:{has:{method(v){v=this.$_compile(v,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:v}});return m.$_mutateRegister(v),m},validate(v,{state:m,prefs:x,error:y},{schema:b}){const w=[v,...m.ancestors];for(let R=0;Rthis.$_compile(v[x]),x,{append:!0});m.$_terms.items.push(y)}return m.$_mutateRebuild()},validate(v,{schema:m,error:x,state:y,prefs:b,errorsArray:w}){const E=m.$_terms._requireds.slice(),R=m.$_terms.ordered.slice(),T=[...m.$_terms._inclusions,...E],N=!v[u.symbols.arraySingle];delete v[u.symbols.arraySingle];const A=w();let D=v.length;for(let O=0;O="})}},ordered:{method(...v){u.verifyFlat(v,"ordered");const m=this.$_addRule("items");for(let x=0;xthis.$_compile(v[x]),x,{append:!0});g.validateSingle(y,m),m.$_mutateRegister(y),m.$_terms.ordered.push(y)}return m.$_mutateRebuild()}},single:{method(v){const m=v===void 0||!!v;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(v={}){u.assertOptions(v,["by","order"]);const m={order:v.order||"ascending"};return v.by&&(m.by=f.ref(v.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(v,{error:m,state:x,prefs:y,schema:b},{options:w}){const{value:E,errors:R}=g.sort(b,v,w,x,y);if(R)return R;for(let T=0;Tnew Set(v)}},rebuild(v){v.$_terms._inclusions=[],v.$_terms._exclusions=[],v.$_terms._requireds=[];for(const m of v.$_terms.items)g.validateSingle(m,v),m._flags.presence==="required"?v.$_terms._requireds.push(m):m._flags.presence==="forbidden"?v.$_terms._exclusions.push(m):v.$_terms._inclusions.push(m);for(const m of v.$_terms.ordered)g.validateSingle(m,v)},manifest:{build:(v,m)=>(m.items&&(v=v.items(...m.items)),m.ordered&&(v=v.ordered(...m.ordered)),v)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),g.fillMissedErrors=function(v,m,x,y,b,w){const E=[];let R=0;for(const T of x){const N=T._flags.label;N?E.push(N):++R}E.length?R?m.push(v.$_createError("array.includesRequiredBoth",y,{knownMisses:E,unknownMisses:R},b,w)):m.push(v.$_createError("array.includesRequiredKnowns",y,{knownMisses:E},b,w)):m.push(v.$_createError("array.includesRequiredUnknowns",y,{unknownMisses:R},b,w))},g.fillOrderedErrors=function(v,m,x,y,b,w){const E=[];for(const R of x)R._flags.presence==="required"&&E.push(R);E.length&&g.fillMissedErrors(v,m,E,y,b,w)},g.fillDefault=function(v,m,x,y){const b=[];let w=!0;for(let E=v.length-1;E>=0;--E){const R=v[E],T=[m,...x.ancestors],N=R.$_validate(void 0,x.localize(x.path,T,R),y).value;if(w){if(N===void 0)continue;w=!1}b.unshift(N)}b.length&&m.push(...b)},g.fastSplice=function(v,m){let x=m;for(;x{let D=g.compare(N,A,E,R);if(D!==null||(x.by&&(N=x.by.resolve(N,y,b),A=x.by.resolve(A,y,b)),D=g.compare(N,A,E,R),D!==null))return D;const O=typeof N;if(O!==typeof A)throw v.$_createError("array.sort.mismatching",m,null,y,b);if(O!=="number"&&O!=="string")throw v.$_createError("array.sort.unsupported",m,{type:O},y,b);return O==="number"?(N-A)*w:N{const a=o(375),c=o(8068),d=o(8160),h=o(2036),u={isBool:function(f){return typeof f=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(f,{schema:g}){if(typeof f!="boolean"){if(typeof f=="string"){const v=g._flags.sensitive?f:f.toLowerCase();f=v==="true"||v!=="false"&&f}return typeof f!="boolean"&&(f=g.$_terms.truthy&&g.$_terms.truthy.has(f,null,null,!g._flags.sensitive)||(!g.$_terms.falsy||!g.$_terms.falsy.has(f,null,null,!g._flags.sensitive))&&f),{value:f}}},validate(f,{error:g}){if(typeof f!="boolean")return{value:f,errors:g("boolean.base")}},rules:{truthy:{method(...f){d.verifyFlat(f,"truthy");const g=this.clone();g.$_terms.truthy=g.$_terms.truthy||new h;for(let v=0;vf?1:0},string:{from:u.isBool,to:(f,g)=>f?"true":"false"}},manifest:{build:(f,g)=>(g.truthy&&(f=f.truthy(...g.truthy)),g.falsy&&(f=f.falsy(...g.falsy)),f)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(3328),u={isDate:function(f){return f instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(f,{schema:g})=>({value:u.parse(f,g._flags.format)||f})},validate(f,{schema:g,error:v,prefs:m}){if(f instanceof Date&&!isNaN(f.getTime()))return;const x=g._flags.format;return m.convert&&x&&typeof f=="string"?{value:f,errors:v("date.format",{format:x})}:{value:f,errors:v("date.base")}},rules:{compare:{method:!1,validate(f,g,{date:v},{name:m,operator:x,args:y}){const b=v==="now"?Date.now():v.getTime();return d.compare(f.getTime(),b,x)?f:g.error("date."+m,{limit:y.date,value:f})},args:[{name:"date",ref:!0,normalize:f=>f==="now"?f:u.parse(f),assert:f=>f!==null,message:"must have a valid date format"}]},format:{method(f){return a(["iso","javascript","unix"].includes(f),"Unknown date format",f),this.$_setFlag("format",f)}},greater:{method(f){return this.$_addRule({name:"greater",method:"compare",args:{date:f},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(f){return this.$_addRule({name:"less",method:"compare",args:{date:f},operator:"<"})}},max:{method(f){return this.$_addRule({name:"max",method:"compare",args:{date:f},operator:"<="})}},min:{method(f){return this.$_addRule({name:"min",method:"compare",args:{date:f},operator:">="})}},timestamp:{method(f="javascript"){return a(["javascript","unix"].includes(f),'"type" must be one of "javascript, unix"'),this.format(f)}}},cast:{number:{from:u.isDate,to:(f,g)=>f.getTime()},string:{from:u.isDate,to:(f,{prefs:g})=>h.date(f,g)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),u.parse=function(f,g){if(f instanceof Date)return f;if(typeof f!="string"&&(isNaN(f)||!isFinite(f))||/^\s*$/.test(f))return null;if(g==="iso")return d.isIsoDate(f)?u.date(f.toString()):null;const v=f;if(typeof f=="string"&&/^[+-]?\d+(\.\d+)?$/.test(f)&&(f=parseFloat(f)),g){if(g==="javascript")return u.date(1*f);if(g==="unix")return u.date(1e3*f);if(typeof v=="string")return null}return u.date(f)},u.date=function(f){const g=new Date(f);return isNaN(g.getTime())?null:g}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:d}})},validate:(d,h,{n:u})=>d.length===u?d:h.error("function.arity",{n:u})},class:{method(){return this.$_addRule("class")},validate:(d,h)=>/^\s*class\s/.test(d.toString())?d:h.error("function.class",{value:d})},minArity:{method(d){return a(Number.isSafeInteger(d)&&d>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length>=u?d:h.error("function.minArity",{n:u})},maxArity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length<=u?d:h.error("function.maxArity",{n:u})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,o)=>{const a=o(978),c=o(375),d=o(8571),h=o(3652),u=o(8068),f=o(8160),g=o(3292),v=o(6354),m=o(6133),x=o(3328),y={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=u.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(b,w)=>b.keys(w),validate(b,{schema:w,error:E,state:R,prefs:T}){if(!b||typeof b!==w.$_property("typeof")||Array.isArray(b))return{value:b,errors:E("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;b=y.clone(b,T);const N=[];if(w.$_terms.renames&&!y.rename(w,b,R,T,N))return{value:b,errors:N};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:b,errors:N};const A=new Set(Object.keys(b));if(w.$_terms.keys){const D=[b,...R.ancestors];for(const O of w.$_terms.keys){const I=O.key,$=b[I];A.delete(I);const F=R.localize([...R.path,I],D,O),B=O.schema.$_validate($,F,T);if(B.errors){if(T.abortEarly)return{value:b,errors:B.errors};B.value!==void 0&&(b[I]=B.value),N.push(...B.errors)}else O.schema._flags.result==="strip"||B.value===void 0&&$!==void 0?delete b[I]:B.value!==void 0&&(b[I]=B.value)}}if(A.size||w._flags._hasPatternMatch){const D=y.unknown(w,b,A,N,R,T);if(D)return D}if(w.$_terms.dependencies)for(const D of w.$_terms.dependencies){if(D.key!==null&&y.isPresent(D.options)(D.key.resolve(b,R,T,null,{shadow:!1}))===!1)continue;const O=y.dependencies[D.rel](w,D,b,R,T);if(O){const I=w.$_createError(O.code,b,O.context,R,T);if(T.abortEarly)return{value:b,errors:I};N.push(I)}}return{value:b,errors:N}},rules:{and:{method(...b){return f.verifyFlat(b,"and"),y.dependency(this,"and",null,b)}},append:{method(b){return b==null||Object.keys(b).length===0?this:this.keys(b)}},assert:{method(b,w,E){x.isTemplate(b)||(b=g.ref(b)),c(E===void 0||typeof E=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const R=this.$_addRule({name:"assert",args:{subject:b,schema:w,message:E}});return R.$_mutateRegister(b),R.$_mutateRegister(w),R},validate(b,{error:w,prefs:E,state:R},{subject:T,schema:N,message:A}){const D=T.resolve(b,R,E),O=m.isRef(T)?T.absolute(R):[];return N.$_match(D,R.localize(O,[b,...R.ancestors],N),E)?b:w("object.assert",{subject:T,message:A})},args:["subject","schema","message"],multi:!0},instance:{method(b,w){return c(typeof b=="function","constructor must be a function"),w=w||b.name,this.$_addRule({name:"instance",args:{constructor:b,name:w}})},validate:(b,w,{constructor:E,name:R})=>b instanceof E?b:w.error("object.instance",{type:R,value:b}),args:["constructor","name"]},keys:{method(b){c(b===void 0||typeof b=="object","Object schema must be a valid object"),c(!f.isSchema(b),"Object schema cannot be a joi schema");const w=this.clone();if(b)if(Object.keys(b).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(E=>!b.hasOwnProperty(E.key)):new y.Keys;for(const E in b)f.tryWithPath(()=>w.$_terms.keys.push({key:E,schema:this.$_compile(b[E])}),E)}else w.$_terms.keys=new y.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(b){return this.$_addRule({name:"length",args:{limit:b},operator:"="})},validate:(b,w,{limit:E},{name:R,operator:T,args:N})=>f.compare(Object.keys(b).length,E,T)?b:w.error("object."+R,{limit:N.limit,value:b}),args:[{name:"limit",ref:!0,assert:f.limit,message:"must be a positive integer"}]},max:{method(b){return this.$_addRule({name:"max",method:"length",args:{limit:b},operator:"<="})}},min:{method(b){return this.$_addRule({name:"min",method:"length",args:{limit:b},operator:">="})}},nand:{method(...b){return f.verifyFlat(b,"nand"),y.dependency(this,"nand",null,b)}},or:{method(...b){return f.verifyFlat(b,"or"),y.dependency(this,"or",null,b)}},oxor:{method(...b){return y.dependency(this,"oxor",null,b)}},pattern:{method(b,w,E={}){const R=b instanceof RegExp;R||(b=this.$_compile(b,{appendPath:!0})),c(w!==void 0,"Invalid rule"),f.assertOptions(E,["fallthrough","matches"]),R&&c(!b.flags.includes("g")&&!b.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const T=this.clone();T.$_terms.patterns=T.$_terms.patterns||[];const N={[R?"regex":"schema"]:b,rule:w};return E.matches&&(N.matches=this.$_compile(E.matches),N.matches.type!=="array"&&(N.matches=N.matches.$_root.array().items(N.matches)),T.$_mutateRegister(N.matches),T.$_setFlag("_hasPatternMatch",!0,{clone:!1})),E.fallthrough&&(N.fallthrough=!0),T.$_terms.patterns.push(N),T.$_mutateRegister(w),T}},ref:{method(){return this.$_addRule("ref")},validate:(b,w)=>m.isRef(b)?b:w.error("object.refType",{value:b})},regex:{method(){return this.$_addRule("regex")},validate:(b,w)=>b instanceof RegExp?b:w.error("object.regex",{value:b})},rename:{method(b,w,E={}){c(typeof b=="string"||b instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof x,"Invalid rename to argument"),c(w!==b,"Cannot rename key to same name:",b),f.assertOptions(E,["alias","ignoreUndefined","override","multiple"]);const R=this.clone();R.$_terms.renames=R.$_terms.renames||[];for(const T of R.$_terms.renames)c(T.from!==b,"Cannot rename the same key multiple times");return w instanceof x&&R.$_mutateRegister(w),R.$_terms.renames.push({from:b,to:w,options:a(y.renameDefaults,E)}),R}},schema:{method(b="any"){return this.$_addRule({name:"schema",args:{type:b}})},validate:(b,w,{type:E})=>!f.isSchema(b)||E!=="any"&&b.type!==E?w.error("object.schema",{type:E}):b},unknown:{method(b){return this.$_setFlag("unknown",b!==!1)}},with:{method(b,w,E={}){return y.dependency(this,"with",b,w,E)}},without:{method(b,w,E={}){return y.dependency(this,"without",b,w,E)}},xor:{method(...b){return f.verifyFlat(b,"xor"),y.dependency(this,"xor",null,b)}}},overrides:{default(b,w){return b===void 0&&(b=f.symbols.deepDefault),this.$_parent("default",b,w)}},rebuild(b){if(b.$_terms.keys){const w=new h.Sorter;for(const E of b.$_terms.keys)f.tryWithPath(()=>w.add(E,{after:E.schema.$_rootReferences(),group:E.key}),E.key);b.$_terms.keys=new y.Keys(...w.nodes)}},manifest:{build(b,w){if(w.keys&&(b=b.keys(w.keys)),w.dependencies)for(const{rel:E,key:R=null,peers:T,options:N}of w.dependencies)b=y.dependency(b,E,R,T,N);if(w.patterns)for(const{regex:E,schema:R,rule:T,fallthrough:N,matches:A}of w.patterns)b=b.pattern(E||R,T,{fallthrough:N,matches:A});if(w.renames)for(const{from:E,to:R,options:T}of w.renames)b=b.rename(E,R,T);return b}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),y.clone=function(b,w){if(typeof b=="object"){if(w.nonEnumerables)return d(b,{shallow:!0});const R=Object.create(Object.getPrototypeOf(b));return Object.assign(R,b),R}const E=function(...R){return b.apply(this,R)};return E.prototype=d(b.prototype),Object.defineProperty(E,"name",{value:b.name,writable:!1}),Object.defineProperty(E,"length",{value:b.length,writable:!1}),Object.assign(E,b),E},y.dependency=function(b,w,E,R,T){c(E===null||typeof E=="string",w,"key must be a strings"),T||(T=R.length>1&&typeof R[R.length-1]=="object"?R.pop():{}),f.assertOptions(T,["separator","isPresent"]),R=[].concat(R);const N=f.default(T.separator,"."),A=[];for(const O of R)c(typeof O=="string",w,"peers must be strings"),A.push(g.ref(O,{separator:N,ancestor:0,prefix:!1}));E!==null&&(E=g.ref(E,{separator:N,ancestor:0,prefix:!1}));const D=b.clone();return D.$_terms.dependencies=D.$_terms.dependencies||[],D.$_terms.dependencies.push(new y.Dependency(w,E,A,R,T)),D},y.dependencies={and(b,w,E,R,T){const N=[],A=[],D=w.peers.length,O=y.isPresent(w.options);for(const I of w.peers)O(I.resolve(E,R,T,null,{shadow:!1}))===!1?N.push(I.key):A.push(I.key);if(N.length!==D&&A.length!==D)return{code:"object.and",context:{present:A,presentWithLabels:y.keysToLabels(b,A),missing:N,missingWithLabels:y.keysToLabels(b,N)}}},nand(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const I of w.peers)A(I.resolve(E,R,T,null,{shadow:!1}))&&N.push(I.key);if(N.length!==w.peers.length)return;const D=w.paths[0],O=w.paths.slice(1);return{code:"object.nand",context:{main:D,mainWithLabel:y.keysToLabels(b,D),peers:O,peersWithLabels:y.keysToLabels(b,O)}}},or(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)}}},oxor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(!N.length||N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.oxor",context:D}},with(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},without(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},xor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return N.length===0?{code:"object.missing",context:D}:(D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.xor",context:D})}},y.keysToLabels=function(b,w){return Array.isArray(w)?w.map(E=>b.$_mapLabels(E)):b.$_mapLabels(w)},y.isPresent=function(b){return typeof b.isPresent=="function"?b.isPresent:w=>w!==void 0},y.rename=function(b,w,E,R,T){const N={};for(const A of b.$_terms.renames){const D=[],O=typeof A.from!="string";if(O)for(const I in w){if(w[I]===void 0&&A.options.ignoreUndefined||I===A.to)continue;const $=A.from.exec(I);$&&D.push({from:I,to:A.to,match:$})}else!Object.prototype.hasOwnProperty.call(w,A.from)||w[A.from]===void 0&&A.options.ignoreUndefined||D.push(A);for(const I of D){const $=I.from;let F=I.to;if(F instanceof x&&(F=F.render(w,E,R,I.match)),$!==F){if(!A.options.multiple&&N[F]&&(T.push(b.$_createError("object.rename.multiple",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly)||Object.prototype.hasOwnProperty.call(w,F)&&!A.options.override&&!N[F]&&(T.push(b.$_createError("object.rename.override",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly))return!1;w[$]===void 0?delete w[F]:w[F]=w[$],N[F]=!0,A.options.alias||delete w[$]}}}return!0},y.unknown=function(b,w,E,R,T,N){if(b.$_terms.patterns){let A=!1;const D=b.$_terms.patterns.map(I=>{if(I.matches)return A=!0,[]}),O=[w,...T.ancestors];for(const I of E){const $=w[I],F=[...T.path,I];for(let B=0;B{const a=o(375),c=o(8068),d=o(8160),h=o(3292),u=o(6354),f={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(g,v)=>g.ref(v),validate(g,{schema:v,state:m,prefs:x}){a(v.$_terms.link,"Uninitialized link schema");const y=f.generate(v,g,m,x),b=v.$_terms.link[0].ref;return y.$_validate(g,m.nest(y,`link:${b.display}:${y.type}`),x)},generate:(g,v,m,x)=>f.generate(g,v,m,x),rules:{ref:{method(g){a(!this.$_terms.link,"Cannot reinitialize schema"),g=h.ref(g),a(g.type==="value"||g.type==="local","Invalid reference type:",g.type),a(g.type==="local"||g.ancestor==="root"||g.ancestor>0,"Link cannot reference itself");const v=this.clone();return v.$_terms.link=[{ref:g}],v}},relative:{method(g=!0){return this.$_setFlag("relative",g)}}},overrides:{concat(g){a(this.$_terms.link,"Uninitialized link schema"),a(d.isSchema(g),"Invalid schema object"),a(g.type!=="link","Cannot merge type link with another link");const v=this.clone();return v.$_terms.whens||(v.$_terms.whens=[]),v.$_terms.whens.push({concat:g}),v.$_mutateRebuild()}},manifest:{build:(g,v)=>(a(v.link,"Invalid link description missing link"),g.ref(v.link))}}),f.generate=function(g,v,m,x){let y=m.mainstay.links.get(g);if(y)return y._generate(v,m,x).schema;const b=g.$_terms.link[0].ref,{perspective:w,path:E}=f.perspective(b,m);f.assert(w,"which is outside of schema boundaries",b,g,m,x);try{y=E.length?w.$_reach(E):w}catch{f.assert(!1,"to non-existing schema",b,g,m,x)}return f.assert(y.type!=="link","which is another link",b,g,m,x),g._flags.relative||m.mainstay.links.set(g,y),y._generate(v,m,x).schema},f.perspective=function(g,v){if(g.type==="local"){for(const{schema:m,key:x}of v.schemas){if((m._flags.id||x)===g.path[0])return{perspective:m,path:g.path.slice(1)};if(m.$_terms.shared){for(const y of m.$_terms.shared)if(y._flags.id===g.path[0])return{perspective:y,path:g.path.slice(1)}}}return{perspective:null,path:null}}return g.ancestor==="root"?{perspective:v.schemas[v.schemas.length-1].schema,path:g.path}:{perspective:v.schemas[g.ancestor]&&v.schemas[g.ancestor].schema,path:g.path}},f.assert=function(g,v,m,x,y,b){g||a(!1,`"${u.label(x._flags,y,b)}" contains link reference "${m.display}" ${v}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(u){const f=u.toString(),g=f.indexOf("."),v=f.indexOf("e");return(g<0?0:(v<0?f.length:v)-g-1)+(v<0?0:Math.max(0,-parseInt(f.slice(v+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(u,{schema:f,error:g}){if(!u.match(h.numberRx))return;u=u.trim();const v={value:parseFloat(u)};if(v.value===0&&(v.value=0),!f._flags.unsafe)if(u.match(/e/i)){if(h.extractSignificantDigits(u)!==h.extractSignificantDigits(String(v.value)))return v.errors=g("number.unsafe"),v}else{const m=v.value.toString();if(m.match(/e/i))return v;if(m!==h.normalizeDecimal(u))return v.errors=g("number.unsafe"),v}return v}},validate(u,{schema:f,error:g,prefs:v}){if(u===1/0||u===-1/0)return{value:u,errors:g("number.infinity")};if(!d.isNumber(u))return{value:u,errors:g("number.base")};const m={value:u};if(v.convert){const x=f.$_getRule("precision");if(x){const y=Math.pow(10,x.args.limit);m.value=Math.round(m.value*y)/y}}return m.value===0&&(m.value=0),!f._flags.unsafe&&(u>Number.MAX_SAFE_INTEGER||ud.compare(u,g,m)?u:f.error("number."+v,{limit:x.limit,value:u}),args:[{name:"limit",ref:!0,assert:d.isNumber,message:"must be a number"}]},greater:{method(u){return this.$_addRule({name:"greater",method:"compare",args:{limit:u},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(u,f)=>Math.trunc(u)-u==0?u:f.error("number.integer")},less:{method(u){return this.$_addRule({name:"less",method:"compare",args:{limit:u},operator:"<"})}},max:{method(u){return this.$_addRule({name:"max",method:"compare",args:{limit:u},operator:"<="})}},min:{method(u){return this.$_addRule({name:"min",method:"compare",args:{limit:u},operator:">="})}},multiple:{method(u){const f=typeof u=="number"?h.decimalPlaces(u):null,g=Math.pow(10,f);return this.$_addRule({name:"multiple",args:{base:u,baseDecimalPlace:f,pfactor:g}})},validate:(u,f,{base:g,baseDecimalPlace:v,pfactor:m},x)=>h.decimalPlaces(u)>v?f.error("number.multiple",{multiple:x.args.base,value:u}):Math.round(m*u)%Math.round(m*g)==0?u:f.error("number.multiple",{multiple:x.args.base,value:u}),args:[{name:"base",ref:!0,assert:u=>typeof u=="number"&&isFinite(u)&&u>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(u,f)=>Number.isSafeInteger(u)&&u>=0&&u<=65535?u:f.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(u){return a(Number.isSafeInteger(u),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:u}})},validate(u,f,{limit:g}){const v=u.toString().match(h.precisionRx);return Math.max((v[1]?v[1].length:0)-(v[2]?parseInt(v[2],10):0),0)<=g?u:f.error("number.precision",{limit:g,value:u})},convert:!0},sign:{method(u){return a(["negative","positive"].includes(u),"Invalid sign",u),this.$_addRule({name:"sign",args:{sign:u}})},validate:(u,f,{sign:g})=>g==="negative"&&u<0||g==="positive"&&u>0?u:f.error(`number.${g}`)},unsafe:{method(u=!0){return a(typeof u=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",u)}}},cast:{string:{from:u=>typeof u=="number",to:(u,f)=>u.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),h.extractSignificantDigits=function(u){return u.replace(h.exponentialPartRegex,"").replace(h.dotRegex,"").replace(h.trailingZerosRegex,"").replace(h.leadingSignAndZerosRegex,"")},h.normalizeDecimal=function(u){return(u=u.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&u.endsWith("0")&&(u=u.replace(/0+$/,"")),u==="-0"?"0":u}},8966:(s,i,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,d)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),d=o(1745),h=o(9959),u=o(6064),f=o(9926),g=o(5752),v=o(8068),m=o(8160),x={tlds:f instanceof Set&&{tlds:{allow:f,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:h.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=v.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(y,{schema:b,state:w,prefs:E}){const R=b.$_getRule("normalize");R&&(y=y.normalize(R.args.form));const T=b.$_getRule("case");T&&(y=T.args.direction==="upper"?y.toLocaleUpperCase():y.toLocaleLowerCase());const N=b.$_getRule("trim");if(N&&N.args.enabled&&(y=y.trim()),b.$_terms.replacements)for(const D of b.$_terms.replacements)y=y.replace(D.pattern,D.replacement);const A=b.$_getRule("hex");if(A&&A.args.options.byteAligned&&y.length%2!=0&&(y=`0${y}`),b.$_getRule("isoDate")){const D=x.isoDate(y);D&&(y=D)}if(b._flags.truncate){const D=b.$_getRule("max");if(D){let O=D.args.limit;if(m.isResolvable(O)&&(O=O.resolve(y,w,E),!m.limit(O)))return{value:y,errors:b.$_createError("any.ref",O,{ref:D.args.limit,arg:"limit",reason:"must be a positive integer"},w,E)};y=y.slice(0,O)}}return{value:y}}},validate(y,{schema:b,error:w}){if(typeof y!="string")return{value:y,errors:w("string.base")};if(y===""){const E=b.$_getRule("min");return E&&E.args.limit===0?void 0:{value:y,errors:w("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(y,b)=>/^[a-zA-Z0-9]+$/.test(y)?y:b.error("string.alphanum")},base64:{method(y={}){return m.assertOptions(y,["paddingRequired","urlSafe"]),y={urlSafe:!1,paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof y.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:y}})},validate:(y,b,{options:w})=>x.base64Regex[w.paddingRequired][w.urlSafe].test(y)?y:b.error("string.base64")},case:{method(y){return a(["lower","upper"].includes(y),"Invalid case:",y),this.$_addRule({name:"case",args:{direction:y}})},validate:(y,b,{direction:w})=>w==="lower"&&y===y.toLocaleLowerCase()||w==="upper"&&y===y.toLocaleUpperCase()?y:b.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(y,b){let w=y.length,E=0,R=1;for(;w--;){const T=y.charAt(w)*R;E+=T-9*(T>9),R^=3}return E>0&&E%10==0?y:b.error("string.creditCard")}},dataUri:{method(y={}){return m.assertOptions(y,["paddingRequired"]),y={paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:y}})},validate(y,b,{options:w}){const E=y.match(x.dataUriRegex);return E&&(!E[2]||E[2]!=="base64"||x.base64Regex[w.paddingRequired].false.test(E[3]))?y:b.error("string.dataUri")}},domain:{method(y){y&&m.assertOptions(y,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const b=x.addressOptions(y);return this.$_addRule({name:"domain",args:{options:y},address:b})},validate:(y,b,w,{address:E})=>c.isValid(y,E)?y:b.error("string.domain")},email:{method(y={}){m.assertOptions(y,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(y.multiple===void 0||typeof y.multiple=="boolean","multiple option must be an boolean");const b=x.addressOptions(y),w=new RegExp(`\\s*[${y.separator?u(y.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:y},regex:w,address:b})},validate(y,b,{options:w},{regex:E,address:R}){const T=w.multiple?y.split(E):[y],N=[];for(const A of T)d.isValid(A,R)||N.push(A);return N.length?b.error("string.email",{value:y,invalids:N}):y}},guid:{alias:"uuid",method(y={}){m.assertOptions(y,["version","separator"]);let b="";if(y.version){const R=[].concat(y.version);a(R.length>=1,"version must have at least 1 valid version specified");const T=new Set;for(let N=0;N(w.prefix==="optional"?x.hexRegex.withOptionalPrefix:w.prefix===!0?x.hexRegex.withPrefix:x.hexRegex.withoutPrefix).test(y)?w.byteAligned&&y.length%2!=0?b.error("string.hexAlign"):y:b.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(y,b)=>c.isValid(y,{minDomainSegments:1})||x.ipRegex.test(y)?y:b.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(y={}){m.assertOptions(y,["cidr","version"]);const{cidr:b,versions:w,regex:E}=h.regex(y),R=y.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:b,version:R}},regex:E})},validate:(y,b,{options:w},{regex:E})=>E.test(y)?y:w.version?b.error("string.ipVersion",{value:y,cidr:w.cidr,version:w.version}):b.error("string.ip",{value:y,cidr:w.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(y,{error:b})=>x.isoDate(y)?y:b("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(y,b)=>x.isoDurationRegex.test(y)?y:b.error("string.isoDuration")},length:{method(y,b){return x.length(this,"length",y,"=",b)},validate(y,b,{limit:w,encoding:E},{name:R,operator:T,args:N}){const A=!E&&y.length;return m.compare(A,w,T)?y:b.error("string."+R,{limit:N.limit,value:y,encoding:E})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(y,b){return x.length(this,"max",y,"<=",b)},args:["limit","encoding"]},min:{method(y,b){return x.length(this,"min",y,">=",b)},args:["limit","encoding"]},normalize:{method(y="NFC"){return a(x.normalizationForms.includes(y),"normalization form must be one of "+x.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:y}})},validate:(y,{error:b},{form:w})=>y===y.normalize(w)?y:b("string.normalize",{value:y,form:w}),convert:!0},pattern:{alias:"regex",method(y,b={}){a(y instanceof RegExp,"regex must be a RegExp"),a(!y.flags.includes("g")&&!y.flags.includes("y"),"regex should not use global or sticky mode"),typeof b=="string"&&(b={name:b}),m.assertOptions(b,["invert","name"]);const w=["string.pattern",b.invert?".invert":"",b.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:y,options:b},errorCode:w})},validate:(y,b,{regex:w,options:E},{errorCode:R})=>w.test(y)^E.invert?y:b.error(R,{name:E.name,regex:w,value:y}),args:["regex","options"],multi:!0},replace:{method(y,b){typeof y=="string"&&(y=new RegExp(u(y),"g")),a(y instanceof RegExp,"pattern must be a RegExp"),a(typeof b=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:y,replacement:b}),w}},token:{method(){return this.$_addRule("token")},validate:(y,b)=>/^\w+$/.test(y)?y:b.error("string.token")},trim:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:y}})},validate:(y,b,{enabled:w})=>w&&y!==y.trim()?b.error("string.trim"):y,convert:!0},truncate:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",y)}},uppercase:{method(){return this.case("upper")}},uri:{method(y={}){m.assertOptions(y,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),y.domain&&m.assertOptions(y.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:b,scheme:w}=g.regex(y),E=y.domain?x.addressOptions(y.domain):null;return this.$_addRule({name:"uri",args:{options:y},regex:b,domain:E,scheme:w})},validate(y,b,{options:w},{regex:E,domain:R,scheme:T}){if(["http:/","https:/"].includes(y))return b.error("string.uri");let N=E.exec(y);if(!N&&b.prefs.convert&&w.encodeUri){const A=encodeURI(y);N=E.exec(A),N&&(y=A)}if(N){const A=N[1]||N[2];return!R||w.allowRelative&&!A||c.isValid(A,R)?y:b.error("string.domain",{value:A})}return w.relativeOnly?b.error("string.uriRelativeOnly"):w.scheme?b.error("string.uriCustomScheme",{scheme:T,value:y}):b.error("string.uri")}}},manifest:{build(y,b){if(b.replacements)for(const{pattern:w,replacement:E}of b.replacements)y=y.replace(w,E);return y}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),x.addressOptions=function(y){if(!y)return x.tlds||y;if(a(y.minDomainSegments===void 0||Number.isSafeInteger(y.minDomainSegments)&&y.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(y.maxDomainSegments===void 0||Number.isSafeInteger(y.maxDomainSegments)&&y.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),y.tlds===!1)return y;if(y.tlds===!0||y.tlds===void 0)return a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds);a(typeof y.tlds=="object","tlds must be true, false, or an object");const b=y.tlds.deny;if(b)return Array.isArray(b)&&(y=Object.assign({},y,{tlds:{deny:new Set(b)}})),a(y.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!y.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),x.validateTlds(y.tlds.deny,"tlds.deny"),y;const w=y.tlds.allow;return w?w===!0?(a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds)):(Array.isArray(w)&&(y=Object.assign({},y,{tlds:{allow:new Set(w)}})),a(y.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),x.validateTlds(y.tlds.allow,"tlds.allow"),y):y},x.validateTlds=function(y,b){for(const w of y)a(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${b} must contain valid top level domain names`)},x.isoDate=function(y){if(!m.isIsoDate(y))return null;/.*T.*[+-]\d\d$/.test(y)&&(y+="00");const b=new Date(y);return isNaN(b.getTime())?null:b.toISOString()},x.length=function(y,b,w,E,R){return a(!R||!1,"Invalid encoding:",R),y.$_addRule({name:b,method:"length",args:{limit:w,encoding:R},operator:E})}},8826:(s,i,o)=>{const a=o(375),c=o(8068),d={};d.Map=class extends Map{slice(){return new d.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new d.Map}},coerce:{method(h,{schema:u,error:f}){const g=u.$_terms.map.get(h);return g&&(h=g),u._flags.only&&typeof h!="symbol"?{value:h,errors:f("symbol.map",{map:u.$_terms.map})}:{value:h}}},validate(h,{error:u}){if(typeof h!="symbol")return{value:h,errors:u("symbol.base")}},rules:{map:{method(h){h&&!h[Symbol.iterator]&&typeof h=="object"&&(h=Object.entries(h)),a(h&&h[Symbol.iterator],"Iterable must be an iterable or object");const u=this.clone(),f=[];for(const g of h){a(g&&g[Symbol.iterator],"Entry must be an iterable");const[v,m]=g;a(typeof v!="object"&&typeof v!="function"&&typeof v!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),u.$_terms.map.set(v,m),f.push(m)}return u.valid(...f)}}},manifest:{build:(h,u)=>(u.map&&(h=h.map(u.map)),h)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,o)=>{const a=o(375),c=o(8571),d=o(738),h=o(9621),u=o(8160),f=o(6354),g=o(493),v={result:Symbol("result")};i.entry=function(m,x,y){let b=u.defaults;y&&(a(y.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(y.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),b=u.preferences(u.defaults,y));const w=v.entry(m,x,b);a(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const E={value:w.value};return w.error&&(E.error=w.error),w.mainstay.warnings.length&&(E.warning=f.details(w.mainstay.warnings)),w.mainstay.debug&&(E.debug=w.mainstay.debug),w.mainstay.artifacts&&(E.artifacts=w.mainstay.artifacts),E},i.entryAsync=async function(m,x,y){let b=u.defaults;y&&(b=u.preferences(u.defaults,y));const w=v.entry(m,x,b),E=w.mainstay;if(w.error)throw E.debug&&(w.error.debug=E.debug),w.error;if(E.externals.length){let T=w.value;const N=[];for(const A of E.externals){const D=A.state.path,O=A.schema.type==="link"?E.links.get(A.schema):null;let I,$,F=T;const B=D.length?[T]:[],W=D.length?h(m,D):m;if(D.length){I=D[D.length-1];let Z=T;for(const Y of D.slice(0,-1))Z=Z[Y],B.unshift(Z);$=B[0],F=$[I]}try{const Z=(H,se)=>(O||A.schema).$_createError(H,F,se,A.state,b),Y=await A.method(F,{schema:A.schema,linked:O,state:A.state,prefs:y,original:W,error:Z,errorsArray:v.errorsArray,warn:(H,se)=>E.warnings.push((O||A.schema).$_createError(H,F,se,A.state,b)),message:(H,se)=>(O||A.schema).$_createError("external",F,se,A.state,b,{messages:H})});if(Y===void 0||Y===F)continue;if(Y instanceof f.Report){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(Y),b.abortEarly)break;continue}if(Array.isArray(Y)&&Y[u.symbols.errors]){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(...Y),b.abortEarly)break;continue}$?(E.tracer.value(A.state,"rule",F,Y,"external"),$[I]=Y):(E.tracer.value(A.state,"rule",T,Y,"external"),T=Y)}catch(Z){throw b.errors.label&&(Z.message+=` (${A.label})`),Z}}if(w.value=T,N.length)throw w.error=f.process(N,m,b),E.debug&&(w.error.debug=E.debug),w.error}if(!b.warnings&&!b.debug&&!b.artifacts)return w.value;const R={value:w.value};return E.warnings.length&&(R.warning=f.details(E.warnings)),E.debug&&(R.debug=E.debug),E.artifacts&&(R.artifacts=E.artifacts),R},v.Mainstay=class{constructor(m,x,y){this.externals=[],this.warnings=[],this.tracer=m,this.debug=x,this.links=y,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const m=this._snapshots.pop();this.externals=m.externals,this.warnings=m.warnings}commit(){this._snapshots.pop()}},v.entry=function(m,x,y){const{tracer:b,cleanup:w}=v.tracer(x,y),E=y.debug?[]:null,R=x._ids._schemaChain?new Map:null,T=new v.Mainstay(b,E,R),N=x._ids._schemaChain?[{schema:x}]:null,A=new g([],[],{mainstay:T,schemas:N}),D=i.validate(m,x,A,y);w&&x.$_root.untrace();const O=f.process(D.errors,m,y);return{value:D.value,error:O,mainstay:T}},v.tracer=function(m,x){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:x.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:v.ignore}},i.validate=function(m,x,y,b,w={}){if(x.$_terms.whens&&(x=x._generate(m,y,b).schema),x._preferences&&(b=v.prefs(x,b)),x._cache&&b.cache){const O=x._cache.get(m);if(y.mainstay.tracer.debug(y,"validate","cached",!!O),O)return O}const E=(O,I,$)=>x.$_createError(O,m,I,$||y,b),R={original:m,prefs:b,schema:x,state:y,error:E,errorsArray:v.errorsArray,warn:(O,I,$)=>y.mainstay.warnings.push(E(O,I,$)),message:(O,I)=>x.$_createError("custom",m,I,y,b,{messages:O})};y.mainstay.tracer.entry(x,y);const T=x._definition;if(T.prepare&&m!==void 0&&b.convert){const O=T.prepare(m,R);if(O){if(y.mainstay.tracer.value(y,"prepare",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}if(T.coerce&&m!==void 0&&b.convert&&(!T.coerce.from||T.coerce.from.includes(typeof m))){const O=T.coerce.method(m,R);if(O){if(y.mainstay.tracer.value(y,"coerced",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}const N=x._flags.empty;N&&N.$_match(v.trim(m,x),y.nest(N),u.defaults)&&(y.mainstay.tracer.value(y,"empty",m,void 0),m=void 0);const A=w.presence||x._flags.presence||(x._flags._endedSwitch?null:b.presence);if(m===void 0){if(A==="forbidden")return v.finalize(m,null,R);if(A==="required")return v.finalize(m,[x.$_createError("any.required",m,null,y,b)],R);if(A==="optional"){if(x._flags.default!==u.symbols.deepDefault)return v.finalize(m,null,R);y.mainstay.tracer.value(y,"default",m,{}),m={}}}else if(A==="forbidden")return v.finalize(m,[x.$_createError("any.unknown",m,null,y,b)],R);const D=[];if(x._valids){const O=x._valids.get(m,y,b,x._flags.insensitive);if(O)return b.convert&&(y.mainstay.tracer.value(y,"valids",m,O.value),m=O.value),y.mainstay.tracer.filter(x,y,"valid",O),v.finalize(m,null,R);if(x._flags.only){const I=x.$_createError("any.only",m,{valids:x._valids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(x._invalids){const O=x._invalids.get(m,y,b,x._flags.insensitive);if(O){y.mainstay.tracer.filter(x,y,"invalid",O);const I=x.$_createError("any.invalid",m,{invalids:x._invalids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(T.validate){const O=T.validate(m,R);if(O&&(y.mainstay.tracer.value(y,"base",m,O.value),m=O.value,O.errors)){if(!Array.isArray(O.errors))return D.push(O.errors),v.finalize(m,D,R);if(O.errors.length)return D.push(...O.errors),v.finalize(m,D,R)}}return x._rules.length?v.rules(m,D,R):v.finalize(m,D,R)},v.rules=function(m,x,y){const{schema:b,state:w,prefs:E}=y;for(const R of b._rules){const T=b._definition.rules[R.method];if(T.convert&&E.convert){w.mainstay.tracer.log(b,w,"rule",R.name,"full");continue}let N,A=R.args;if(R._resolve.length){A=Object.assign({},A);for(const O of R._resolve){const I=T.argsByName.get(O),$=A[O].resolve(m,w,E),F=I.normalize?I.normalize($):$,B=u.validateArg(F,null,I);if(B){N=b.$_createError("any.ref",$,{arg:O,ref:A[O],reason:B},w,E);break}A[O]=F}}N=N||T.validate(m,y,A,R);const D=v.rule(N,R);if(D.errors){if(w.mainstay.tracer.log(b,w,"rule",R.name,"error"),R.warn){w.mainstay.warnings.push(...D.errors);continue}if(E.abortEarly)return v.finalize(m,D.errors,y);x.push(...D.errors)}else w.mainstay.tracer.log(b,w,"rule",R.name,"pass"),w.mainstay.tracer.value(w,"rule",m,D.value,R.name),m=D.value}return v.finalize(m,x,y)},v.rule=function(m,x){return m instanceof f.Report?(v.error(m,x),{errors:[m],value:null}):Array.isArray(m)&&m[u.symbols.errors]?(m.forEach(y=>v.error(y,x)),{errors:m,value:null}):{errors:null,value:m}},v.error=function(m,x){return x.message&&m._setTemplate(x.message),m},v.finalize=function(m,x,y){x=x||[];const{schema:b,state:w,prefs:E}=y;if(x.length){const T=v.default("failover",void 0,x,y);T!==void 0&&(w.mainstay.tracer.value(w,"failover",m,T),m=T,x=[])}if(x.length&&b._flags.error)if(typeof b._flags.error=="function"){x=b._flags.error(x),Array.isArray(x)||(x=[x]);for(const T of x)a(T instanceof Error||T instanceof f.Report,"error() must return an Error object")}else x=[b._flags.error];if(m===void 0){const T=v.default("default",m,x,y);w.mainstay.tracer.value(w,"default",m,T),m=T}if(b._flags.cast&&m!==void 0){const T=b._definition.cast[b._flags.cast];if(T.from(m)){const N=T.to(m,y);w.mainstay.tracer.value(w,"cast",m,N,b._flags.cast),m=N}}if(b.$_terms.externals&&E.externals&&E._externals!==!1)for(const{method:T}of b.$_terms.externals)w.mainstay.externals.push({method:T,schema:b,state:w,label:f.label(b._flags,w,E)});const R={value:m,errors:x.length?x:null};return b._flags.result&&(R.value=b._flags.result==="strip"?void 0:y.original,w.mainstay.tracer.value(w,b._flags.result,m,R.value),w.shadow(m,b._flags.result)),b._cache&&E.cache!==!1&&!b._refs.length&&b._cache.set(y.original,R),m===void 0||R.errors||b._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(b._flags.artifact)||w.mainstay.artifacts.set(b._flags.artifact,[]),w.mainstay.artifacts.get(b._flags.artifact).push(w.path)),R},v.prefs=function(m,x){const y=x===u.defaults;return y&&m._preferences[u.symbols.prefs]?m._preferences[u.symbols.prefs]:(x=u.preferences(x,m._preferences),y&&(m._preferences[u.symbols.prefs]=x),x)},v.default=function(m,x,y,b){const{schema:w,state:E,prefs:R}=b,T=w._flags[m];if(R.noDefaults||T===void 0)return x;if(E.mainstay.tracer.log(w,E,"rule",m,"full"),!T)return T;if(typeof T=="function"){const N=T.length?[c(E.ancestors[0]),b]:[];try{return T(...N)}catch(A){return void y.push(w.$_createError(`any.${m}`,null,{error:A},E,R))}}return typeof T!="object"?T:T[u.symbols.literal]?T.literal:u.isResolvable(T)?T.resolve(x,E,R):c(T)},v.trim=function(m,x){if(typeof m!="string")return m;const y=x.$_getRule("trim");return y&&y.args.enabled?m.trim():m},v.ignore={active:!1,debug:d,entry:d,filter:d,log:d,resolve:d,value:d},v.errorsArray=function(){const m=[];return m[u.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),d=o(8160),h={};s.exports=h.Values=class{constructor(u,f){this._values=new Set(u),this._refs=new Set(f),this._lowercase=h.lowercases(u),this._override=!1}get length(){return this._values.size+this._refs.size}add(u,f){d.isResolvable(u)?this._refs.has(u)||(this._refs.add(u),f&&f.register(u)):this.has(u,null,null,!1)||(this._values.add(u),typeof u=="string"&&this._lowercase.set(u.toLowerCase(),u))}static merge(u,f,g){if(u=u||new h.Values,f){if(f._override)return f.clone();for(const v of[...f._values,...f._refs])u.add(v)}if(g)for(const v of[...g._values,...g._refs])u.remove(v);return u.length?u:null}remove(u){d.isResolvable(u)?this._refs.delete(u):(this._values.delete(u),typeof u=="string"&&this._lowercase.delete(u.toLowerCase()))}has(u,f,g,v){return!!this.get(u,f,g,v)}get(u,f,g,v){if(!this.length)return!1;if(this._values.has(u))return{value:u};if(typeof u=="string"&&u&&v){const m=this._lowercase.get(u.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof u!="object")return!1;if(typeof u=="object"){for(const m of this._values)if(c(m,u))return{value:m}}if(f)for(const m of this._refs){const x=m.resolve(u,f,g,null,{in:!0});if(x===void 0)continue;const y=m.in&&typeof x=="object"?Array.isArray(x)?x:Object.keys(x):[x];for(const b of y)if(typeof b==typeof u){if(v&&u&&typeof u=="string"){if(b.toLowerCase()===u.toLowerCase())return{value:b,ref:m}}else if(c(b,u))return{value:b,ref:m}}}return!1}override(){this._override=!0}values(u){if(u&&u.display){const f=[];for(const g of[...this._values,...this._refs])g!==void 0&&f.push(g);return f}return Array.from([...this._values,...this._refs])}clone(){const u=new h.Values(this._values,this._refs);return u._override=this._override,u}concat(u){a(!u._override,"Cannot concat override set of values");const f=new h.Values([...this._values,...u._values],[...this._refs,...u._refs]);return f._override=this._override,f}describe(){const u=[];this._override&&u.push({override:!0});for(const f of this._values.values())u.push(f&&typeof f=="object"?{value:f}:f);for(const f of this._refs.values())u.push(f.describe());return u}},h.Values.prototype[d.symbols.values]=!0,h.Values.prototype.slice=h.Values.prototype.clone,h.lowercases=function(u){const f=new Map;if(u)for(const g of u)typeof g=="string"&&f.set(g.toLowerCase(),g);return f}},978:(s,i,o)=>{const a=o(375),c=o(8571),d=o(1687),h=o(9621),u={};s.exports=function(f,g,v={}){if(a(f&&typeof f=="object","Invalid defaults value: must be an object"),a(!g||g===!0||typeof g=="object","Invalid source value: must be true, falsy or an object"),a(typeof v=="object","Invalid options: must be an object"),!g)return null;if(v.shallow)return u.applyToDefaultsWithShallow(f,g,v);const m=c(f);if(g===!0)return m;const x=v.nullOverride!==void 0&&v.nullOverride;return d(m,g,{nullOverride:x,mergeArrays:!1})},u.applyToDefaultsWithShallow=function(f,g,v){const m=v.shallow;a(Array.isArray(m),"Invalid keys");const x=new Map,y=g===!0?null:new Set;for(let E of m){E=Array.isArray(E)?E:E.split(".");const R=h(f,E);R&&typeof R=="object"?x.set(R,y&&h(g,E)||R):y&&y.add(E)}const b=c(f,{},x);if(!y)return b;for(const E of y)u.reachCopy(b,g,E);const w=v.nullOverride!==void 0&&v.nullOverride;return d(b,g,{nullOverride:w,mergeArrays:!1})},u.reachCopy=function(f,g,v){for(const y of v){if(!(y in g))return;const b=g[y];if(typeof b!="object"||b===null)return;g=b}const m=g;let x=f;for(let y=0;y{const a=o(7916);s.exports=function(c,...d){if(!c)throw d.length===1&&d[0]instanceof Error?d[0]:new a(d)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),d=o(7043),h={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=h.clone=function(u,f={},g=null){if(typeof u!="object"||u===null)return u;let v=h.clone,m=g;if(f.shallow){if(f.shallow!==!0)return h.cloneWithShallow(u,f);v=w=>w}else if(m){const w=m.get(u);if(w)return w}else m=new Map;const x=c.getInternalProto(u);if(x===c.buffer)return!1;if(x===c.date)return new Date(u.getTime());if(x===c.regex)return new RegExp(u);const y=h.base(u,x,f);if(y===u)return u;if(m&&m.set(u,y),x===c.set)for(const w of u)y.add(v(w,f,m));else if(x===c.map)for(const[w,E]of u)y.set(w,v(E,f,m));const b=d.keys(u,f);for(const w of b){if(w==="__proto__")continue;if(x===c.array&&w==="length"){y.length=u.length;continue}const E=Object.getOwnPropertyDescriptor(u,w);E?E.get||E.set?Object.defineProperty(y,w,E):E.enumerable?y[w]=v(u[w],f,m):Object.defineProperty(y,w,{enumerable:!1,writable:!0,configurable:!0,value:v(u[w],f,m)}):Object.defineProperty(y,w,{enumerable:!0,writable:!0,configurable:!0,value:v(u[w],f,m)})}return y},h.cloneWithShallow=function(u,f){const g=f.shallow;(f=Object.assign({},f)).shallow=!1;const v=new Map;for(const m of g){const x=a(u,m);typeof x!="object"&&typeof x!="function"||v.set(x,x)}return h.clone(u,f,v)},h.base=function(u,f,g){if(g.prototype===!1)return h.needsProtoHack.has(f)?new f.constructor:f===c.array?[]:{};const v=Object.getPrototypeOf(u);if(v&&v.isImmutable)return u;if(f===c.array){const m=[];return v!==f&&Object.setPrototypeOf(m,v),m}if(h.needsProtoHack.has(f)){const m=new v.constructor;return v!==f&&Object.setPrototypeOf(m,v),m}return Object.create(v)}},9474:(s,i,o)=>{const a=o(4277),c={mismatched:null};s.exports=function(d,h,u){return u=Object.assign({prototype:!0},u),!!c.isDeepEqual(d,h,u,[])},c.isDeepEqual=function(d,h,u,f){if(d===h)return d!==0||1/d==1/h;const g=typeof d;if(g!==typeof h||d===null||h===null)return!1;if(g==="function"){if(!u.deepFunction||d.toString()!==h.toString())return!1}else if(g!=="object")return d!=d&&h!=h;const v=c.getSharedType(d,h,!!u.prototype);switch(v){case a.buffer:return!1;case a.promise:return d===h;case a.regex:return d.toString()===h.toString();case c.mismatched:return!1}for(let m=f.length-1;m>=0;--m)if(f[m].isSame(d,h))return!0;f.push(new c.SeenEntry(d,h));try{return!!c.isDeepEqualObj(v,d,h,u,f)}finally{f.pop()}},c.getSharedType=function(d,h,u){if(u)return Object.getPrototypeOf(d)!==Object.getPrototypeOf(h)?c.mismatched:a.getInternalProto(d);const f=a.getInternalProto(d);return f!==a.getInternalProto(h)?c.mismatched:f},c.valueOf=function(d){const h=d.valueOf;if(h===void 0)return d;try{return h.call(d)}catch(u){return u}},c.hasOwnEnumerableProperty=function(d,h){return Object.prototype.propertyIsEnumerable.call(d,h)},c.isSetSimpleEqual=function(d,h){for(const u of Set.prototype.values.call(d))if(!Set.prototype.has.call(h,u))return!1;return!0},c.isDeepEqualObj=function(d,h,u,f,g){const{isDeepEqual:v,valueOf:m,hasOwnEnumerableProperty:x}=c,{keys:y,getOwnPropertySymbols:b}=Object;if(d===a.array){if(!f.part){if(h.length!==u.length)return!1;for(let N=0;N{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(d=>d!=="").map(d=>typeof d=="string"?d:d instanceof Error?d.message:a(d)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c=256?"&#"+o+";":`&#x${o.toString(16).padStart(2,"0")};`)},i.isSafe=function(o){return i.safeCharCodes.has(o)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const o=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&o.add(a);return o}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,o)=>{const a=o(375),c=o(8571),d=o(7043),h={};s.exports=h.merge=function(u,f,g){if(a(u&&typeof u=="object","Invalid target value: must be an object"),a(f==null||typeof f=="object","Invalid source value: must be null, undefined, or an object"),!f)return u;if(g=Object.assign({nullOverride:!0,mergeArrays:!0},g),Array.isArray(f)){a(Array.isArray(u),"Cannot merge array onto an object"),g.mergeArrays||(u.length=0);for(let m=0;m{const a=o(375),c={};s.exports=function(d,h,u){if(h===!1||h==null)return d;typeof(u=u||{})=="string"&&(u={separator:u});const f=Array.isArray(h);a(!f||!u.separator,"Separator option is not valid for array-based chain");const g=f?h:h.split(u.separator||".");let v=d;for(let m=0;m{s.exports=function(...i){try{return JSON.stringify(...i)}catch(o){return"[Cannot display object: "+o.message+"]"}}},4277:(s,i)=>{const o={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},o.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(a){if(Array.isArray(a))return i.array;if(a instanceof Date)return i.date;if(a instanceof RegExp)return i.regex;if(a instanceof Error)return i.error;const c=Object.prototype.toString.call(a);return o.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(o,a={}){return a.symbols!==!1?Reflect.ownKeys(o):Object.getOwnPropertyNames(o)}},3652:(s,i,o)=>{const a=o(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(d,h){const u=[].concat((h=h||{}).before||[]),f=[].concat(h.after||[]),g=h.group||"?",v=h.sort||0;a(!u.includes(g),`Item cannot come before itself: ${g}`),a(!u.includes("?"),"Item cannot come before unassociated items"),a(!f.includes(g),`Item cannot come after itself: ${g}`),a(!f.includes("?"),"Item cannot come after unassociated items"),Array.isArray(d)||(d=[d]);for(const m of d){const x={seq:this._items.length,sort:v,before:u,after:f,group:g,node:m};this._items.push(x)}if(!h.manual){const m=this._sort();a(m,"item",g!=="?"?`added into group ${g}`:"","created a dependencies error")}return this.nodes}merge(d){Array.isArray(d)||(d=[d]);for(const u of d)if(u)for(const f of u._items)this._items.push(Object.assign({},f));this._items.sort(c.mergeSort);for(let u=0;ud.sort===h.sort?0:d.sort{const a=o(443),c=o(2178),d={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:a.URL||URL};i.analyze=function(h,u={}){if(!h)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof h!="string")throw new Error("Invalid input: domain must be a string");if(h.length>256)return c.code("DOMAIN_TOO_LONG");if(d.nonAsciiRx.test(h)){if(u.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");h=h.normalize("NFC")}if(d.domainControlRx.test(h))return c.code("DOMAIN_INVALID_CHARS");h=d.punycode(h),u.allowFullyQualified&&h[h.length-1]==="."&&(h=h.slice(0,-1));const f=u.minDomainSegments||d.minDomainSegments,g=h.split(".");if(g.lengthu.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const v=u.tlds;if(v){const m=g[g.length-1].toLowerCase();if(v.deny&&v.deny.has(m)||v.allow&&!v.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m63)return c.code("DOMAIN_LONG_SEGMENT");if(m{const a=o(9848),c=o(5380),d=o(2178),h={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};i.analyze=function(u,f){return h.email(u,f)},i.isValid=function(u,f){return!h.email(u,f)},h.email=function(u,f={}){if(typeof u!="string")throw new Error("Invalid input: email must be a string");if(!u)return d.code("EMPTY_STRING");const g=!h.nonAsciiRx.test(u);if(!g){if(f.allowUnicode===!1)return d.code("FORBIDDEN_UNICODE");u=u.normalize("NFC")}const v=u.split("@");if(v.length!==2)return v.length>2?d.code("MULTIPLE_AT_CHAR"):d.code("MISSING_AT_CHAR");const[m,x]=v;if(!m)return d.code("EMPTY_LOCAL");if(!f.ignoreLength){if(u.length>254)return d.code("ADDRESS_TOO_LONG");if(h.encoder.encode(m).length>64)return d.code("LOCAL_TOO_LONG")}return h.local(m,g)||c.analyze(x,f)},h.local=function(u,f){const g=u.split(".");for(const v of g){if(!v.length)return d.code("EMPTY_LOCAL_SEGMENT");if(f){if(!h.atextRx.test(v))return d.code("INVALID_LOCAL_CHARS")}else for(const m of v){if(h.atextRx.test(m))continue;const x=h.binary(m);if(!h.atomRx.test(x))return d.code("INVALID_LOCAL_CHARS")}}},h.binary=function(u){return Array.from(h.encoder.encode(u)).map(f=>String.fromCharCode(f)).join("")},h.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,h.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(d={}){a(d.cidr===void 0||typeof d.cidr=="string","options.cidr must be a string");const h=d.cidr?d.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(h),"options.cidr must be one of required, optional, forbidden"),a(d.version===void 0||typeof d.version=="string"||Array.isArray(d.version),"options.version must be a string or an array of string");let u=d.version||["ipv4","ipv6","ipvfuture"];Array.isArray(u)||(u=[u]),a(u.length>=1,"options.version must have at least 1 version specified");for(let v=0;v{if(h==="forbidden")return c.ip[v];const m=`\\/${v==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return h==="required"?`${c.ip[v]}${m}`:`${c.ip[v]}(?:${m})?`}).join("|")})`,g=new RegExp(`^${f}$`);return{cidr:h,versions:u,regex:g,raw:f}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),d={generate:function(){const h={},u="\\dA-Fa-f",f="["+u+"]",g="\\w-\\.~",v="!\\$&'\\(\\)\\*\\+,;=",m="%"+u,x=g+m+v+":@",y="["+x+"]",b="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";h.ipv4address="(?:"+b+"\\.){3}"+b;const w=f+"{1,4}",E="(?:"+w+":"+w+"|"+h.ipv4address+")",R="(?:"+w+":){6}"+E,T="::(?:"+w+":){5}"+E,N="(?:"+w+")?::(?:"+w+":){4}"+E,A="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+E,D="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+E,O="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+E,I="(?:(?:"+w+":){0,4}"+w+")?::"+E,$="(?:(?:"+w+":){0,5}"+w+")?::"+w,F="(?:(?:"+w+":){0,6}"+w+")?::";h.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",h.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",h.ipv6address="(?:"+R+"|"+T+"|"+N+"|"+A+"|"+D+"|"+O+"|"+I+"|"+$+"|"+F+")",h.ipvFuture="v"+f+"+\\.["+g+v+":]+",h.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",h.schemeRegex=new RegExp(h.scheme);const B="["+g+m+v+":]*",W="["+g+m+v+"]{1,255}",Z="(?:\\[(?:"+h.ipv6address+"|"+h.ipvFuture+")\\]|"+h.ipv4address+"|"+W+")",Y="(?:"+B+"@)?"+Z+"(?::\\d*)?",H="(?:"+B+"@)?("+Z+")(?::\\d*)?",se=y+"*",he=y+"+",re="(?:\\/"+se+")*",J="\\/(?:"+he+re+")?",te=he+re,ae="["+g+m+v+"@]+"+re,be="(?:\\/\\/\\/"+se+re+")";return h.hierPart="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+te+"|"+be+")",h.hierPartCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+te+")",h.relativeRef="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+ae+"|)",h.relativeRefCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+ae+"|)",h.query="["+x+"\\/\\?]*(?=#|$)",h.queryWithSquareBrackets="["+x+"\\[\\]\\/\\?]*(?=#|$)",h.fragment="["+x+"\\/\\?]*",h}};d.rfc3986=d.generate(),i.ip={v4Cidr:d.rfc3986.ipv4Cidr,v6Cidr:d.rfc3986.ipv6Cidr,ipv4:d.rfc3986.ipv4address,ipv6:d.rfc3986.ipv6address,ipvfuture:d.rfc3986.ipvFuture},d.createRegex=function(h){const u=d.rfc3986,f="(?:\\?"+(h.allowQuerySquareBrackets?u.queryWithSquareBrackets:u.query)+")?(?:#"+u.fragment+")?",g=h.domain?u.relativeRefCapture:u.relativeRef;if(h.relativeOnly)return d.wrap(g+f);let v="";if(h.scheme){a(h.scheme instanceof RegExp||typeof h.scheme=="string"||Array.isArray(h.scheme),"scheme must be a RegExp, String, or Array");const y=[].concat(h.scheme);a(y.length>=1,"scheme must have at least 1 scheme specified");const b=[];for(let w=0;w{const o={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(a,c={}){if(!c[o.settings]&&c.constants)for(const d in c.constants){const h=c.constants[d];if(h!==null&&!["boolean","number","string"].includes(typeof h))throw new Error(`Formula constant ${d} contains invalid ${typeof h} value type`)}this.settings=c[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],d="",h=0,u=!1;const f=v=>{if(h)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(u||d||v){if(m&&m.type==="reference"&&v===")")return m.type="function",m.value=this._subFormula(d,m.value),void(d="");if(v===")"){const x=new i.Parser(d,this.settings);c.push({type:"segment",value:x})}else if(u){if(u==="]")return c.push({type:"reference",value:d}),void(d="");c.push({type:"literal",value:d})}else if(o.operatorCharacters.includes(d))m&&m.type==="operator"&&o.operators.includes(m.value+d)?m.value+=d:c.push({type:"operator",value:d});else if(d.match(o.numberRx))c.push({type:"constant",value:parseFloat(d)});else if(this.settings.constants[d]!==void 0)c.push({type:"constant",value:this.settings.constants[d]});else{if(!d.match(o.tokenRx))throw new Error(`Formula contains invalid token: ${d}`);c.push({type:"reference",value:d})}d=""}};for(const v of a)u?v===u?(f(),u=!1):d+=v:h?v==="("?(d+=v,++h):v===")"?(--h,h?d+=v:f(v)):d+=v:v in o.literals?u=o.literals[v]:v==="("?(f(),++h):o.operatorCharacters.includes(v)?(f(),d=v,f()):v!==" "?d+=v:f();f(),c=c.map((v,m)=>v.type!=="operator"||v.value!=="-"||m&&c[m-1].type!=="operator"?v:{type:"operator",value:"n"});let g=!1;for(const v of c){if(v.type==="operator"){if(o.operatorsPrefix.includes(v.value))continue;if(!g)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(v.value))throw new Error(`Formula contains an unknown operator ${v.value}`)}else if(g)throw new Error("Formula missing expected operator");g=!g}if(!g)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(v=>{if(v.type==="operator")return o.operatorsPrefix.includes(v.value)?v:v.value;if(v.type!=="reference")return v.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(v.value))throw new Error(`Formula contains invalid reference ${v.value}`);return this.settings.reference?this.settings.reference(v.value):o.reference(v.value)})}_subFormula(a,c){const d=this.settings.functions[c];if(typeof d!="function")throw new Error(`Formula contains unknown function ${c}`);let h=[];if(a){let u="",f=0,g=!1;const v=()=>{if(!u)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);h.push(u),u=""};for(let m=0;mnew i.Parser(u,this.settings)),function(u){const f=[];for(const g of h)f.push(g.evaluate(u));return d.call(u,...f)}}evaluate(a){const c=this._parts.slice();for(let d=c.length-2;d>=0;--d){const h=c[d];if(h&&h.type==="operator"){const u=c[d+1];c.splice(d+1,1);const f=o.evaluate(u,a);c[d]=o.single(h.value,f)}}return o.operatorsOrder.forEach(d=>{for(let h=1;h":return c>d;case">=":return c>=d;case"==":return c===d;case"!=":return c!==d;case"&&":return c&&d;case"||":return c||d}return null},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(Que);var fBe=Que.exports;const wf=Al(fBe),vx=()=>{const e=C.useContext(tue);if(e===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return e},hBe=()=>{const e=vx();return{useSubmitIncidence:t=>{const{mutateOptions:n={}}=t||{};return mu({mutationFn:r=>e.createOne({resource:"support",data:r}),...n})}}},pBe=wf.object({incidence:wf.string().min(10).required().messages({"string.empty":"Debe escribir algo antes de enviar","string.min":"El texto es demasiado corto. Debe tener al menos 10 caracteres","string.max":"El texto es demasiado largo.","any.required":"La descripción es requerida"})});function mBe(){const[e,t]=C.useState(!1),[n,r]=C.useState(!1),{toast:s}=Fu(),{useSubmitIncidence:i}=hBe(),o=aR({mode:"onBlur",resolver:SW(pBe),defaultValues:{incidence:""}}),{handleSubmit:a,watch:c,reset:d}=o,h=c("incidence"),{mutate:u}=i({mutateOptions:{onSuccess:()=>{s({title:"Incidencia enviada",description:"La incidencia se ha enviado correctamente",variant:"success"}),t(!1),d()},onError:()=>{s({title:"Error en el envío",description:"No se ha podido enviar la incidencia correctamente. Por favor, inténtalo de nuevo.",variant:"destructive"})}}}),f=async m=>{u(m)},g=()=>{h.trim()?r(!0):(t(!1),d())},v=()=>{r(!1),t(!1),d()};return _.jsxs(_.Fragment,{children:[_.jsxs(Fx,{open:e,onOpenChange:t,children:[_.jsx(E6,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>t(!0),children:[_.jsx(_J,{className:"w-5 h-5"}),_.jsx("span",{className:"sr-only",children:"Abrir ventana de soporte"})]})}),_.jsxs(cy,{className:"sm:max-w-xl",children:[_.jsxs(uy,{className:"mb-2",children:[_.jsx(fy,{children:ue("support.modal.title")}),_.jsx(GA,{children:ue("support.modal.subtitle")})]}),_.jsx(lR,{...o,children:_.jsxs("form",{onSubmit:a(f),className:"space-y-4",children:[_.jsx(gc,{name:"incidence",placeholder:"Describe la incidencia aquí...",className:"min-h-96"}),_.jsxs(dy,{children:[_.jsx(at,{type:"button",variant:"outline",onClick:g,children:"Cancelar"}),_.jsx(at,{type:"submit",children:"Enviar incidencia"})]})]})})]})]}),_.jsx(JH,{open:n,onOpenChange:r,children:_.jsxs(pD,{children:[_.jsxs(mD,{children:[_.jsx(vD,{children:"¿Estás seguro de que quieres cancelar?"}),_.jsx(yD,{children:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados."})]}),_.jsxs(gD,{children:[_.jsx(xD,{onClick:()=>r(!1),children:"Volver al formulario"}),_.jsx(bD,{onClick:v,children:"Sí, cerrar"})]})]})})]})}var gBe={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const vBe=Al(gBe);var yBe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function MK(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(vBe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var s=new RegExp(yBe),i=null;(i=s.exec(e))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),t.attrs[a[0]]=a[1],s.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var bBe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,xBe=/^\s*$/,_Be=Object.create(null);function Zue(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(Zue,"")+"";case"comment":return e+""}}var wBe={parse:function(e,t){t||(t={}),t.components||(t.components=_Be);var n,r=[],s=[],i=-1,o=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");r.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(bBe,function(c,d){if(o){if(c!=="")return;o=!1}var h,u=c.charAt(1)!=="/",f=c.startsWith("