moadim 1.3.0

Loop engine for AI agents — routines over REST, MCP, and a built-in web UI
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>MOADIM</title>
    <script>
      (function () {
        if (localStorage.getItem("moadim.client.theme") === "light") {
          document.documentElement.classList.add("theme-light");
        }
      })();
    </script>
    <script type="module" crossorigin>var Cp=t=>{throw TypeError(t)};var Tf=(t,n,s)=>n.has(t)||Cp("Cannot "+s);var L=(t,n,s)=>(Tf(t,n,"read from private field"),s?s.call(t):n.get(t)),Ie=(t,n,s)=>n.has(t)?Cp("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,s),xe=(t,n,s,a)=>(Tf(t,n,"write to private field"),a?a.call(t,s):n.set(t,s),s),Je=(t,n,s)=>(Tf(t,n,"access private method"),s);var fc=(t,n,s,a)=>({set _(l){xe(t,n,l,s)},get _(){return L(t,n,a)}});function u0(t,n){for(var s=0;s<n.length;s++){const a=n[s];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in t)){const c=Object.getOwnPropertyDescriptor(a,l);c&&Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&a(h)}).observe(document,{childList:!0,subtree:!0});function s(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=s(l);fetch(l.href,c)}})();function c0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function d0(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var n=t.default;if(typeof n=="function"){var s=function a(){return this instanceof a?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};s.prototype=n.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,l.get?l:{enumerable:!0,get:function(){return t[a]}})}),s}var Cf={exports:{}},Ml={},Of={exports:{}},nt={};/**
 * @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 Op;function f0(){if(Op)return nt;Op=1;var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),h=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),O=Symbol.iterator;function _(B){return B===null||typeof B!="object"?null:(B=O&&B[O]||B["@@iterator"],typeof B=="function"?B:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function b(B,ne,ze){this.props=B,this.context=ne,this.refs=T,this.updater=ze||S}b.prototype.isReactComponent={},b.prototype.setState=function(B,ne){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,ne,"setState")},b.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function I(){}I.prototype=b.prototype;function j(B,ne,ze){this.props=B,this.context=ne,this.refs=T,this.updater=ze||S}var F=j.prototype=new I;F.constructor=j,C(F,b.prototype),F.isPureReactComponent=!0;var U=Array.isArray,$=Object.prototype.hasOwnProperty,J={current:null},se={key:!0,ref:!0,__self:!0,__source:!0};function me(B,ne,ze){var Ce,je={},Le=null,Qe=null;if(ne!=null)for(Ce in ne.ref!==void 0&&(Qe=ne.ref),ne.key!==void 0&&(Le=""+ne.key),ne)$.call(ne,Ce)&&!se.hasOwnProperty(Ce)&&(je[Ce]=ne[Ce]);var Be=arguments.length-2;if(Be===1)je.children=ze;else if(1<Be){for(var lt=Array(Be),Ct=0;Ct<Be;Ct++)lt[Ct]=arguments[Ct+2];je.children=lt}if(B&&B.defaultProps)for(Ce in Be=B.defaultProps,Be)je[Ce]===void 0&&(je[Ce]=Be[Ce]);return{$$typeof:t,type:B,key:Le,ref:Qe,props:je,_owner:J.current}}function ye(B,ne){return{$$typeof:t,type:B.type,key:ne,ref:B.ref,props:B.props,_owner:B._owner}}function ke(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function pe(B){var ne={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ze){return ne[ze]})}var ve=/\/+/g;function he(B,ne){return typeof B=="object"&&B!==null&&B.key!=null?pe(""+B.key):ne.toString(36)}function Me(B,ne,ze,Ce,je){var Le=typeof B;(Le==="undefined"||Le==="boolean")&&(B=null);var Qe=!1;if(B===null)Qe=!0;else switch(Le){case"string":case"number":Qe=!0;break;case"object":switch(B.$$typeof){case t:case n:Qe=!0}}if(Qe)return Qe=B,je=je(Qe),B=Ce===""?"."+he(Qe,0):Ce,U(je)?(ze="",B!=null&&(ze=B.replace(ve,"$&/")+"/"),Me(je,ne,ze,"",function(Ct){return Ct})):je!=null&&(ke(je)&&(je=ye(je,ze+(!je.key||Qe&&Qe.key===je.key?"":(""+je.key).replace(ve,"$&/")+"/")+B)),ne.push(je)),1;if(Qe=0,Ce=Ce===""?".":Ce+":",U(B))for(var Be=0;Be<B.length;Be++){Le=B[Be];var lt=Ce+he(Le,Be);Qe+=Me(Le,ne,ze,lt,je)}else if(lt=_(B),typeof lt=="function")for(B=lt.call(B),Be=0;!(Le=B.next()).done;)Le=Le.value,lt=Ce+he(Le,Be++),Qe+=Me(Le,ne,ze,lt,je);else if(Le==="object")throw ne=String(B),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.");return Qe}function Pe(B,ne,ze){if(B==null)return B;var Ce=[],je=0;return Me(B,Ce,"","",function(Le){return ne.call(ze,Le,je++)}),Ce}function Xe(B){if(B._status===-1){var ne=B._result;ne=ne(),ne.then(function(ze){(B._status===0||B._status===-1)&&(B._status=1,B._result=ze)},function(ze){(B._status===0||B._status===-1)&&(B._status=2,B._result=ze)}),B._status===-1&&(B._status=0,B._result=ne)}if(B._status===1)return B._result.default;throw B._result}var $e={current:null},te={transition:null},ge={ReactCurrentDispatcher:$e,ReactCurrentBatchConfig:te,ReactCurrentOwner:J};function ue(){throw Error("act(...) is not supported in production builds of React.")}return nt.Children={map:Pe,forEach:function(B,ne,ze){Pe(B,function(){ne.apply(this,arguments)},ze)},count:function(B){var ne=0;return Pe(B,function(){ne++}),ne},toArray:function(B){return Pe(B,function(ne){return ne})||[]},only:function(B){if(!ke(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},nt.Component=b,nt.Fragment=s,nt.Profiler=l,nt.PureComponent=j,nt.StrictMode=a,nt.Suspense=x,nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ge,nt.act=ue,nt.cloneElement=function(B,ne,ze){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var Ce=C({},B.props),je=B.key,Le=B.ref,Qe=B._owner;if(ne!=null){if(ne.ref!==void 0&&(Le=ne.ref,Qe=J.current),ne.key!==void 0&&(je=""+ne.key),B.type&&B.type.defaultProps)var Be=B.type.defaultProps;for(lt in ne)$.call(ne,lt)&&!se.hasOwnProperty(lt)&&(Ce[lt]=ne[lt]===void 0&&Be!==void 0?Be[lt]:ne[lt])}var lt=arguments.length-2;if(lt===1)Ce.children=ze;else if(1<lt){Be=Array(lt);for(var Ct=0;Ct<lt;Ct++)Be[Ct]=arguments[Ct+2];Ce.children=Be}return{$$typeof:t,type:B.type,key:je,ref:Le,props:Ce,_owner:Qe}},nt.createContext=function(B){return B={$$typeof:h,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:c,_context:B},B.Consumer=B},nt.createElement=me,nt.createFactory=function(B){var ne=me.bind(null,B);return ne.type=B,ne},nt.createRef=function(){return{current:null}},nt.forwardRef=function(B){return{$$typeof:y,render:B}},nt.isValidElement=ke,nt.lazy=function(B){return{$$typeof:E,_payload:{_status:-1,_result:B},_init:Xe}},nt.memo=function(B,ne){return{$$typeof:w,type:B,compare:ne===void 0?null:ne}},nt.startTransition=function(B){var ne=te.transition;te.transition={};try{B()}finally{te.transition=ne}},nt.unstable_act=ue,nt.useCallback=function(B,ne){return $e.current.useCallback(B,ne)},nt.useContext=function(B){return $e.current.useContext(B)},nt.useDebugValue=function(){},nt.useDeferredValue=function(B){return $e.current.useDeferredValue(B)},nt.useEffect=function(B,ne){return $e.current.useEffect(B,ne)},nt.useId=function(){return $e.current.useId()},nt.useImperativeHandle=function(B,ne,ze){return $e.current.useImperativeHandle(B,ne,ze)},nt.useInsertionEffect=function(B,ne){return $e.current.useInsertionEffect(B,ne)},nt.useLayoutEffect=function(B,ne){return $e.current.useLayoutEffect(B,ne)},nt.useMemo=function(B,ne){return $e.current.useMemo(B,ne)},nt.useReducer=function(B,ne,ze){return $e.current.useReducer(B,ne,ze)},nt.useRef=function(B){return $e.current.useRef(B)},nt.useState=function(B){return $e.current.useState(B)},nt.useSyncExternalStore=function(B,ne,ze){return $e.current.useSyncExternalStore(B,ne,ze)},nt.useTransition=function(){return $e.current.useTransition()},nt.version="18.3.1",nt}var bp;function Ch(){return bp||(bp=1,Of.exports=f0()),Of.exports}/**
 * @license React
 * react-jsx-runtime.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 jp;function h0(){if(jp)return Ml;jp=1;var t=Ch(),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(y,x,w){var E,O={},_=null,S=null;w!==void 0&&(_=""+w),x.key!==void 0&&(_=""+x.key),x.ref!==void 0&&(S=x.ref);for(E in x)a.call(x,E)&&!c.hasOwnProperty(E)&&(O[E]=x[E]);if(y&&y.defaultProps)for(E in x=y.defaultProps,x)O[E]===void 0&&(O[E]=x[E]);return{$$typeof:n,type:y,key:_,ref:S,props:O,_owner:l.current}}return Ml.Fragment=s,Ml.jsx=h,Ml.jsxs=h,Ml}var Rp;function m0(){return Rp||(Rp=1,Cf.exports=h0()),Cf.exports}var d=m0(),Z=Ch();const sn=c0(Z),p0=u0({__proto__:null,default:sn},[Z]);var hc={},bf={exports:{}},En={},jf={exports:{}},Rf={};/**
 * @license React
 * scheduler.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 Dp;function y0(){return Dp||(Dp=1,(function(t){function n(te,ge){var ue=te.length;te.push(ge);e:for(;0<ue;){var B=ue-1>>>1,ne=te[B];if(0<l(ne,ge))te[B]=ge,te[ue]=ne,ue=B;else break e}}function s(te){return te.length===0?null:te[0]}function a(te){if(te.length===0)return null;var ge=te[0],ue=te.pop();if(ue!==ge){te[0]=ue;e:for(var B=0,ne=te.length,ze=ne>>>1;B<ze;){var Ce=2*(B+1)-1,je=te[Ce],Le=Ce+1,Qe=te[Le];if(0>l(je,ue))Le<ne&&0>l(Qe,je)?(te[B]=Qe,te[Le]=ue,B=Le):(te[B]=je,te[Ce]=ue,B=Ce);else if(Le<ne&&0>l(Qe,ue))te[B]=Qe,te[Le]=ue,B=Le;else break e}}return ge}function l(te,ge){var ue=te.sortIndex-ge.sortIndex;return ue!==0?ue:te.id-ge.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var h=Date,y=h.now();t.unstable_now=function(){return h.now()-y}}var x=[],w=[],E=1,O=null,_=3,S=!1,C=!1,T=!1,b=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function F(te){for(var ge=s(w);ge!==null;){if(ge.callback===null)a(w);else if(ge.startTime<=te)a(w),ge.sortIndex=ge.expirationTime,n(x,ge);else break;ge=s(w)}}function U(te){if(T=!1,F(te),!C)if(s(x)!==null)C=!0,Xe($);else{var ge=s(w);ge!==null&&$e(U,ge.startTime-te)}}function $(te,ge){C=!1,T&&(T=!1,I(me),me=-1),S=!0;var ue=_;try{for(F(ge),O=s(x);O!==null&&(!(O.expirationTime>ge)||te&&!pe());){var B=O.callback;if(typeof B=="function"){O.callback=null,_=O.priorityLevel;var ne=B(O.expirationTime<=ge);ge=t.unstable_now(),typeof ne=="function"?O.callback=ne:O===s(x)&&a(x),F(ge)}else a(x);O=s(x)}if(O!==null)var ze=!0;else{var Ce=s(w);Ce!==null&&$e(U,Ce.startTime-ge),ze=!1}return ze}finally{O=null,_=ue,S=!1}}var J=!1,se=null,me=-1,ye=5,ke=-1;function pe(){return!(t.unstable_now()-ke<ye)}function ve(){if(se!==null){var te=t.unstable_now();ke=te;var ge=!0;try{ge=se(!0,te)}finally{ge?he():(J=!1,se=null)}}else J=!1}var he;if(typeof j=="function")he=function(){j(ve)};else if(typeof MessageChannel<"u"){var Me=new MessageChannel,Pe=Me.port2;Me.port1.onmessage=ve,he=function(){Pe.postMessage(null)}}else he=function(){b(ve,0)};function Xe(te){se=te,J||(J=!0,he())}function $e(te,ge){me=b(function(){te(t.unstable_now())},ge)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(te){te.callback=null},t.unstable_continueExecution=function(){C||S||(C=!0,Xe($))},t.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ye=0<te?Math.floor(1e3/te):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_getFirstCallbackNode=function(){return s(x)},t.unstable_next=function(te){switch(_){case 1:case 2:case 3:var ge=3;break;default:ge=_}var ue=_;_=ge;try{return te()}finally{_=ue}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(te,ge){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var ue=_;_=te;try{return ge()}finally{_=ue}},t.unstable_scheduleCallback=function(te,ge,ue){var B=t.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?B+ue:B):ue=B,te){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=ue+ne,te={id:E++,callback:ge,priorityLevel:te,startTime:ue,expirationTime:ne,sortIndex:-1},ue>B?(te.sortIndex=ue,n(w,te),s(x)===null&&te===s(w)&&(T?(I(me),me=-1):T=!0,$e(U,ue-B))):(te.sortIndex=ne,n(x,te),C||S||(C=!0,Xe($))),te},t.unstable_shouldYield=pe,t.unstable_wrapCallback=function(te){var ge=_;return function(){var ue=_;_=ge;try{return te.apply(this,arguments)}finally{_=ue}}}})(Rf)),Rf}var Mp;function g0(){return Mp||(Mp=1,jf.exports=y0()),jf.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 Ip;function v0(){if(Ip)return En;Ip=1;var t=Ch(),n=g0();function s(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,l={};function c(e,r){h(e,r),h(e+"Capture",r)}function h(e,r){for(l[e]=r,e=0;e<r.length;e++)a.add(r[e])}var y=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,w=/^[: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]*$/,E={},O={};function _(e){return x.call(O,e)?!0:x.call(E,e)?!1:w.test(e)?O[e]=!0:(E[e]=!0,!1)}function S(e,r,i,u){if(i!==null&&i.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return u?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,r,i,u){if(r===null||typeof r>"u"||S(e,r,i,u))return!0;if(u)return!1;if(i!==null)switch(i.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function T(e,r,i,u,f,p,k){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=u,this.attributeNamespace=f,this.mustUseProperty=i,this.propertyName=e,this.type=r,this.sanitizeURL=p,this.removeEmptyString=k}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new T(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];b[r]=new T(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new T(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new T(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){b[e]=new T(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new T(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new T(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new T(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new T(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function j(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 r=e.replace(I,j);b[r]=new T(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(I,j);b[r]=new T(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(I,j);b[r]=new T(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new T(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new T(e,1,!1,e.toLowerCase(),null,!0,!0)});function F(e,r,i,u){var f=b.hasOwnProperty(r)?b[r]:null;(f!==null?f.type!==0:u||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(C(r,i,f,u)&&(i=null),u||f===null?_(r)&&(i===null?e.removeAttribute(r):e.setAttribute(r,""+i)):f.mustUseProperty?e[f.propertyName]=i===null?f.type===3?!1:"":i:(r=f.attributeName,u=f.attributeNamespace,i===null?e.removeAttribute(r):(f=f.type,i=f===3||f===4&&i===!0?"":""+i,u?e.setAttributeNS(u,r,i):e.setAttribute(r,i))))}var U=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),J=Symbol.for("react.portal"),se=Symbol.for("react.fragment"),me=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),ke=Symbol.for("react.provider"),pe=Symbol.for("react.context"),ve=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),Me=Symbol.for("react.suspense_list"),Pe=Symbol.for("react.memo"),Xe=Symbol.for("react.lazy"),$e=Symbol.for("react.offscreen"),te=Symbol.iterator;function ge(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Object.assign,B;function ne(e){if(B===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);B=r&&r[1]||""}return`
`+B+e}var ze=!1;function Ce(e,r){if(!e||ze)return"";ze=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(X){var u=X}Reflect.construct(e,[],r)}else{try{r.call()}catch(X){u=X}e.call(r.prototype)}else{try{throw Error()}catch(X){u=X}e()}}catch(X){if(X&&u&&typeof X.stack=="string"){for(var f=X.stack.split(`
`),p=u.stack.split(`
`),k=f.length-1,R=p.length-1;1<=k&&0<=R&&f[k]!==p[R];)R--;for(;1<=k&&0<=R;k--,R--)if(f[k]!==p[R]){if(k!==1||R!==1)do if(k--,R--,0>R||f[k]!==p[R]){var P=`
`+f[k].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=k&&0<=R);break}}}finally{ze=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?ne(e):""}function je(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return e=Ce(e.type,!1),e;case 11:return e=Ce(e.type.render,!1),e;case 1:return e=Ce(e.type,!0),e;default:return""}}function Le(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 se:return"Fragment";case J:return"Portal";case ye:return"Profiler";case me:return"StrictMode";case he:return"Suspense";case Me:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pe:return(e.displayName||"Context")+".Consumer";case ke:return(e._context.displayName||"Context")+".Provider";case ve:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pe:return r=e.displayName||null,r!==null?r:Le(e.type)||"Memo";case Xe:r=e._payload,e=e._init;try{return Le(e(r))}catch{}}return null}function Qe(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Le(r);case 8:return r===me?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function Be(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lt(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ct(e){var r=lt(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),u=""+e[r];if(!e.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,p=i.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return f.call(this)},set:function(k){u=""+k,p.call(this,k)}}),Object.defineProperty(e,r,{enumerable:i.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function jn(e){e._valueTracker||(e._valueTracker=Ct(e))}function sr(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var i=r.getValue(),u="";return e&&(u=lt(e)?e.checked?"true":"false":e.value),e=u,e!==i?(r.setValue(e),!0):!1}function $n(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 Nr(e,r){var i=r.checked;return ue({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function Wn(e,r){var i=r.defaultValue==null?"":r.defaultValue,u=r.checked!=null?r.checked:r.defaultChecked;i=Be(r.value!=null?r.value:i),e._wrapperState={initialChecked:u,initialValue:i,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function ir(e,r){r=r.checked,r!=null&&F(e,"checked",r,!1)}function Hn(e,r){ir(e,r);var i=Be(r.value),u=r.type;if(i!=null)u==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?Rn(e,r.type,i):r.hasOwnProperty("defaultValue")&&Rn(e,r.type,Be(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function ar(e,r,i){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var u=r.type;if(!(u!=="submit"&&u!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,i||r===e.value||(e.value=r),e.defaultValue=r}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Rn(e,r,i){(r!=="number"||$n(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var or=Array.isArray;function Dn(e,r,i,u){if(e=e.options,r){r={};for(var f=0;f<i.length;f++)r["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=r.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&u&&(e[i].defaultSelected=!0)}else{for(i=""+Be(i),r=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,u&&(e[f].defaultSelected=!0);return}r!==null||e[f].disabled||(r=e[f])}r!==null&&(r.selected=!0)}}function qr(e,r){if(r.dangerouslySetInnerHTML!=null)throw Error(s(91));return ue({},r,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qr(e,r){var i=r.value;if(i==null){if(i=r.children,r=r.defaultValue,i!=null){if(r!=null)throw Error(s(92));if(or(i)){if(1<i.length)throw Error(s(93));i=i[0]}r=i}r==null&&(r=""),i=r}e._wrapperState={initialValue:Be(i)}}function Yr(e,r){var i=Be(r.value),u=Be(r.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),r.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),u!=null&&(e.defaultValue=""+u)}function lr(e){var r=e.textContent;r===e._wrapperState.initialValue&&r!==""&&r!==null&&(e.value=r)}function Bn(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Gr(e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?Bn(r):e==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var At,Kr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,i,u,f){MSApp.execUnsafeLocalFunction(function(){return e(r,i,u,f)})}:e})(function(e,r){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=r;else{for(At=At||document.createElement("div"),At.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=At.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function D(e,r){if(r){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=r;return}}e.textContent=r}var A={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},q=["Webkit","ms","Moz","O"];Object.keys(A).forEach(function(e){q.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),A[r]=A[e]})});function ee(e,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||A.hasOwnProperty(e)&&A[e]?(""+r).trim():r+"px"}function le(e,r){e=e.style;for(var i in r)if(r.hasOwnProperty(i)){var u=i.indexOf("--")===0,f=ee(i,r[i],u);i==="float"&&(i="cssFloat"),u?e.setProperty(i,f):e[i]=f}}var W=ue({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 Q(e,r){if(r){if(W[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(s(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(s(61))}if(r.style!=null&&typeof r.style!="object")throw Error(s(62))}}function re(e,r){if(e.indexOf("-")===-1)return typeof r.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 _e=null;function Ke(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xt=null,Kt=null,yt=null;function ur(e){if(e=Xs(e)){if(typeof xt!="function")throw Error(s(280));var r=e.stateNode;r&&(r=Gi(r),xt(e.stateNode,e.type,r))}}function ji(e){Kt?yt?yt.push(e):yt=[e]:Kt=e}function Ts(){if(Kt){var e=Kt,r=yt;if(yt=Kt=null,ur(e),r)for(e=0;e<r.length;e++)ur(r[e])}}function Ri(e,r){return e(r)}function Cs(){}var Ea=!1;function Po(e,r,i){if(Ea)return e(r,i);Ea=!0;try{return Ri(e,r,i)}finally{Ea=!1,(Kt!==null||yt!==null)&&(Cs(),Ts())}}function Os(e,r){var i=e.stateNode;if(i===null)return null;var u=Gi(i);if(u===null)return null;i=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var gt=!1;if(y)try{var Xt={};Object.defineProperty(Xt,"passive",{get:function(){gt=!0}}),window.addEventListener("test",Xt,Xt),window.removeEventListener("test",Xt,Xt)}catch{gt=!1}function tu(e,r,i,u,f,p,k,R,P){var X=Array.prototype.slice.call(arguments,3);try{r.apply(i,X)}catch(oe){this.onError(oe)}}var bs=!1,Jt=null,js=!1,Ta=null,nu={onError:function(e){bs=!0,Jt=e}};function Uo(e,r,i,u,f,p,k,R,P){bs=!1,Jt=null,tu.apply(nu,arguments)}function Ca(e,r,i,u,f,p,k,R,P){if(Uo.apply(this,arguments),bs){if(bs){var X=Jt;bs=!1,Jt=null}else throw Error(s(198));js||(js=!0,Ta=X)}}function Er(e){var r=e,i=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(i=r.return),e=r.return;while(e)}return r.tag===3?i:null}function Oa(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function Vo(e){if(Er(e)!==e)throw Error(s(188))}function ru(e){var r=e.alternate;if(!r){if(r=Er(e),r===null)throw Error(s(188));return r!==e?null:e}for(var i=e,u=r;;){var f=i.return;if(f===null)break;var p=f.alternate;if(p===null){if(u=f.return,u!==null){i=u;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===i)return Vo(f),e;if(p===u)return Vo(f),r;p=p.sibling}throw Error(s(188))}if(i.return!==u.return)i=f,u=p;else{for(var k=!1,R=f.child;R;){if(R===i){k=!0,i=f,u=p;break}if(R===u){k=!0,u=f,i=p;break}R=R.sibling}if(!k){for(R=p.child;R;){if(R===i){k=!0,i=p,u=f;break}if(R===u){k=!0,u=p,i=f;break}R=R.sibling}if(!k)throw Error(s(189))}}if(i.alternate!==u)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:r}function su(e){return e=ru(e),e!==null?iu(e):null}function iu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var r=iu(e);if(r!==null)return r;e=e.sibling}return null}var zo=n.unstable_scheduleCallback,$o=n.unstable_cancelCallback,We=n.unstable_shouldYield,Tr=n.unstable_requestPaint,wt=n.unstable_now,Zc=n.unstable_getCurrentPriorityLevel,Wo=n.unstable_ImmediatePriority,Ho=n.unstable_UserBlockingPriority,Di=n.unstable_NormalPriority,qc=n.unstable_LowPriority,Bo=n.unstable_IdlePriority,ba=null,en=null;function Zo(e){if(en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(ba,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:Cr,Qc=Math.log,Mt=Math.LN2;function Cr(e){return e>>>=0,e===0?32:31-(Qc(e)/Mt|0)|0}var Zn=64,Rs=4194304;function Xr(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 Or(e,r){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,p=e.pingedLanes,k=i&268435455;if(k!==0){var R=k&~f;R!==0?u=Xr(R):(p&=k,p!==0&&(u=Xr(p)))}else k=i&~f,k!==0?u=Xr(k):p!==0&&(u=Xr(p));if(u===0)return 0;if(r!==0&&r!==u&&(r&f)===0&&(f=u&-u,p=r&-r,f>=p||f===16&&(p&4194240)!==0))return r;if((u&4)!==0&&(u|=i&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=u;0<r;)i=31-Nt(r),f=1<<i,u|=e[i],r&=~f;return u}function Ds(e,r){switch(e){case 1:case 2:case 4:return r+250;case 8:case 16:case 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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ja(e,r){for(var i=e.suspendedLanes,u=e.pingedLanes,f=e.expirationTimes,p=e.pendingLanes;0<p;){var k=31-Nt(p),R=1<<k,P=f[k];P===-1?((R&i)===0||(R&u)!==0)&&(f[k]=Ds(R,r)):P<=r&&(e.expiredLanes|=R),p&=~R}}function Ms(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function qo(){var e=Zn;return Zn<<=1,(Zn&4194240)===0&&(Zn=64),e}function Jr(e){for(var r=[],i=0;31>i;i++)r.push(e);return r}function es(e,r,i){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-Nt(r),e[r]=i}function au(e,r){var i=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var u=e.eventTimes;for(e=e.expirationTimes;0<i;){var f=31-Nt(i),p=1<<f;r[f]=0,u[f]=-1,e[f]=-1,i&=~p}}function Is(e,r){var i=e.entangledLanes|=r;for(e=e.entanglements;i;){var u=31-Nt(i),f=1<<u;f&r|e[u]&r&&(e[u]|=r),i&=~f}}var ut=0;function Mi(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ls,Fs,ou,Qo,lu,Ra=!1,Ii=[],cr=null,br=null,dr=null,As=new Map,Li=new Map,jr=[],Yc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Yo(e,r){switch(e){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":br=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":As.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(r.pointerId)}}function Fi(e,r,i,u,f,p){return e===null||e.nativeEvent!==p?(e={blockedOn:r,domEventName:i,eventSystemFlags:u,nativeEvent:p,targetContainers:[f]},r!==null&&(r=Xs(r),r!==null&&Fs(r)),e):(e.eventSystemFlags|=u,r=e.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),e)}function Gc(e,r,i,u,f){switch(r){case"focusin":return cr=Fi(cr,e,r,i,u,f),!0;case"dragenter":return br=Fi(br,e,r,i,u,f),!0;case"mouseover":return dr=Fi(dr,e,r,i,u,f),!0;case"pointerover":var p=f.pointerId;return As.set(p,Fi(As.get(p)||null,e,r,i,u,f)),!0;case"gotpointercapture":return p=f.pointerId,Li.set(p,Fi(Li.get(p)||null,e,r,i,u,f)),!0}return!1}function uu(e){var r=In(e.target);if(r!==null){var i=Er(r);if(i!==null){if(r=i.tag,r===13){if(r=Oa(i),r!==null){e.blockedOn=r,lu(e.priority,function(){ou(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Da(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var i=Go(e.domEventName,e.eventSystemFlags,r[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var u=new i.constructor(i.type,i);_e=u,i.target.dispatchEvent(u),_e=null}else return r=Xs(i),r!==null&&Fs(r),e.blockedOn=i,!1;r.shift()}return!0}function cu(e,r,i){Da(e)&&i.delete(r)}function du(){Ra=!1,cr!==null&&Da(cr)&&(cr=null),br!==null&&Da(br)&&(br=null),dr!==null&&Da(dr)&&(dr=null),As.forEach(cu),Li.forEach(cu)}function Ai(e,r){e.blockedOn===r&&(e.blockedOn=null,Ra||(Ra=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,du)))}function It(e){function r(f){return Ai(f,e)}if(0<Ii.length){Ai(Ii[0],e);for(var i=1;i<Ii.length;i++){var u=Ii[i];u.blockedOn===e&&(u.blockedOn=null)}}for(cr!==null&&Ai(cr,e),br!==null&&Ai(br,e),dr!==null&&Ai(dr,e),As.forEach(r),Li.forEach(r),i=0;i<jr.length;i++)u=jr[i],u.blockedOn===e&&(u.blockedOn=null);for(;0<jr.length&&(i=jr[0],i.blockedOn===null);)uu(i),i.blockedOn===null&&jr.shift()}var ts=U.ReactCurrentBatchConfig,fr=!0;function Ps(e,r,i,u){var f=ut,p=ts.transition;ts.transition=null;try{ut=1,Ma(e,r,i,u)}finally{ut=f,ts.transition=p}}function Us(e,r,i,u){var f=ut,p=ts.transition;ts.transition=null;try{ut=4,Ma(e,r,i,u)}finally{ut=f,ts.transition=p}}function Ma(e,r,i,u){if(fr){var f=Go(e,r,i,u);if(f===null)Za(e,r,u,Pi,i),Yo(e,u);else if(Gc(f,e,r,i,u))u.stopPropagation();else if(Yo(e,u),r&4&&-1<Yc.indexOf(e)){for(;f!==null;){var p=Xs(f);if(p!==null&&Ls(p),p=Go(e,r,i,u),p===null&&Za(e,r,u,Pi,i),p===f)break;f=p}f!==null&&u.stopPropagation()}else Za(e,r,u,null,i)}}var Pi=null;function Go(e,r,i,u){if(Pi=null,e=Ke(u),e=In(e),e!==null)if(r=Er(e),r===null)e=null;else if(i=r.tag,i===13){if(e=Oa(r),e!==null)return e;e=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null);return Pi=e,null}function Ia(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Zc()){case Wo:return 1;case Ho:return 4;case Di:case qc:return 16;case Bo:return 536870912;default:return 16}default:return 16}}var hr=null,Ui=null,La=null;function fu(){if(La)return La;var e,r=Ui,i=r.length,u,f="value"in hr?hr.value:hr.textContent,p=f.length;for(e=0;e<i&&r[e]===f[e];e++);var k=i-e;for(u=1;u<=k&&r[i-u]===f[p-u];u++);return La=f.slice(e,1<u?1-u:void 0)}function Fa(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function Aa(){return!0}function hu(){return!1}function hn(e){function r(i,u,f,p,k){this._reactName=i,this._targetInst=f,this.type=u,this.nativeEvent=p,this.target=k,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(i=e[R],this[R]=i?i(p):p[R]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Aa:hu,this.isPropagationStopped=hu,this}return ue(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Aa)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Aa)},persist:function(){},isPersistent:Aa}),r}var ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ko=hn(ns),qn=ue({},ns,{view:0,detail:0}),Kc=hn(qn),Rr,rs,mr,Pa=ue({},qn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tl,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==mr&&(mr&&e.type==="mousemove"?(Rr=e.screenX-mr.screenX,rs=e.screenY-mr.screenY):rs=Rr=0,mr=e),Rr)},movementY:function(e){return"movementY"in e?e.movementY:rs}}),mu=hn(Pa),Xc=ue({},Pa,{dataTransfer:0}),Jc=hn(Xc),Xo=ue({},qn,{relatedTarget:0}),Jo=hn(Xo),ed=ue({},ns,{animationName:0,elapsedTime:0,pseudoElement:0}),td=hn(ed),nd=ue({},ns,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rd=hn(nd),sd=ue({},ns,{data:0}),el=hn(sd),id={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ad={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ld(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=od[e])?!!r[e]:!1}function tl(){return ld}var pu=ue({},qn,{key:function(e){if(e.key){var r=id[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=Fa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ad[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tl,charCode:function(e){return e.type==="keypress"?Fa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ud=hn(pu),cd=ue({},Pa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yu=hn(cd),dd=ue({},qn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tl}),fd=hn(dd),hd=ue({},ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),md=hn(hd),pd=ue({},Pa,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),yd=hn(pd),gd=[9,13,27,32],nl=y&&"CompositionEvent"in window,Vi=null;y&&"documentMode"in document&&(Vi=document.documentMode);var vd=y&&"TextEvent"in window&&!Vi,rl=y&&(!nl||Vi&&8<Vi&&11>=Vi),sl=" ",gu=!1;function mn(e,r){switch(e){case"keyup":return gd.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ss(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vs=!1;function is(e,r){switch(e){case"compositionend":return ss(r);case"keypress":return r.which!==32?null:(gu=!0,sl);case"textInput":return e=r.data,e===sl&&gu?null:e;default:return null}}function xd(e,r){if(Vs)return e==="compositionend"||!nl&&mn(e,r)?(e=fu(),La=Ui=hr=null,Vs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return rl&&r.locale!=="ko"?null:r.data;default:return null}}var pr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function il(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!pr[e.type]:r==="textarea"}function al(e,r,i,u){ji(u),r=Qi(r,"onChange"),0<r.length&&(i=new Ko("onChange","change",null,i,u),e.push({event:i,listeners:r}))}var zs=null,et=null;function $s(e){Cu(e,0)}function Ua(e){var r=Js(e);if(sr(r))return e}function St(e,r){if(e==="change")return r}var Ws=!1;if(y){var Va;if(y){var ol="oninput"in document;if(!ol){var vu=document.createElement("div");vu.setAttribute("oninput","return;"),ol=typeof vu.oninput=="function"}Va=ol}else Va=!1;Ws=Va&&(!document.documentMode||9<document.documentMode)}function xu(){zs&&(zs.detachEvent("onpropertychange",it),et=zs=null)}function it(e){if(e.propertyName==="value"&&Ua(et)){var r=[];al(r,et,e,Ke(e)),Po($s,r)}}function Qh(e,r,i){e==="focusin"?(xu(),zs=r,et=i,zs.attachEvent("onpropertychange",it)):e==="focusout"&&xu()}function wu(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ua(et)}function Su(e,r){if(e==="click")return Ua(r)}function wd(e,r){if(e==="input"||e==="change")return Ua(r)}function ku(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var Ot=typeof Object.is=="function"?Object.is:ku;function Hs(e,r){if(Ot(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var i=Object.keys(e),u=Object.keys(r);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var f=i[u];if(!x.call(r,f)||!Ot(e[f],r[f]))return!1}return!0}function zi(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _u(e,r){var i=zi(e);e=0;for(var u;i;){if(i.nodeType===3){if(u=e+i.textContent.length,e<=r&&u>=r)return{node:i,offset:r-e};e=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=zi(i)}}function Nu(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?Nu(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function Eu(){for(var e=window,r=$n();r instanceof e.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)e=r.contentWindow;else break;r=$n(e.document)}return r}function ll(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function Sd(e){var r=Eu(),i=e.focusedElem,u=e.selectionRange;if(r!==i&&i&&i.ownerDocument&&Nu(i.ownerDocument.documentElement,i)){if(u!==null&&ll(i)){if(r=u.start,e=u.end,e===void 0&&(e=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(e,i.value.length);else if(e=(r=i.ownerDocument||document)&&r.defaultView||window,e.getSelection){e=e.getSelection();var f=i.textContent.length,p=Math.min(u.start,f);u=u.end===void 0?p:Math.min(u.end,f),!e.extend&&p>u&&(f=u,u=p,p=f),f=_u(i,p);var k=_u(i,u);f&&k&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==k.node||e.focusOffset!==k.offset)&&(r=r.createRange(),r.setStart(f.node,f.offset),e.removeAllRanges(),p>u?(e.addRange(r),e.extend(k.node,k.offset)):(r.setEnd(k.node,k.offset),e.addRange(r)))}}for(r=[],e=i;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<r.length;i++)e=r[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kd=y&&"documentMode"in document&&11>=document.documentMode,Bs=null,$i=null,Wi=null,ul=!1;function cl(e,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ul||Bs==null||Bs!==$n(u)||(u=Bs,"selectionStart"in u&&ll(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Wi&&Hs(Wi,u)||(Wi=u,u=Qi($i,"onSelect"),0<u.length&&(r=new Ko("onSelect","select",null,r,i),e.push({event:r,listeners:u}),r.target=Bs)))}function Hi(e,r){var i={};return i[e.toLowerCase()]=r.toLowerCase(),i["Webkit"+e]="webkit"+r,i["Moz"+e]="moz"+r,i}var as={animationend:Hi("Animation","AnimationEnd"),animationiteration:Hi("Animation","AnimationIteration"),animationstart:Hi("Animation","AnimationStart"),transitionend:Hi("Transition","TransitionEnd")},dl={},fl={};y&&(fl=document.createElement("div").style,"AnimationEvent"in window||(delete as.animationend.animation,delete as.animationiteration.animation,delete as.animationstart.animation),"TransitionEvent"in window||delete as.transitionend.transition);function Zs(e){if(dl[e])return dl[e];if(!as[e])return e;var r=as[e],i;for(i in r)if(r.hasOwnProperty(i)&&i in fl)return dl[e]=r[i];return e}var hl=Zs("animationend"),qs=Zs("animationiteration"),za=Zs("animationstart"),$a=Zs("transitionend"),Dr=new Map,ml="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mn(e,r){Dr.set(e,r),c(r,[e])}for(var Qs=0;Qs<ml.length;Qs++){var Wa=ml[Qs],Ys=Wa.toLowerCase(),Ha=Wa[0].toUpperCase()+Wa.slice(1);Mn(Ys,"on"+Ha)}Mn(hl,"onAnimationEnd"),Mn(qs,"onAnimationIteration"),Mn(za,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn($a,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var os="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tu=new Set("cancel close invalid load scroll toggle".split(" ").concat(os));function pl(e,r,i){var u=e.type||"unknown-event";e.currentTarget=i,Ca(u,r,void 0,e),e.currentTarget=null}function Cu(e,r){r=(r&4)!==0;for(var i=0;i<e.length;i++){var u=e[i],f=u.event;u=u.listeners;e:{var p=void 0;if(r)for(var k=u.length-1;0<=k;k--){var R=u[k],P=R.instance,X=R.currentTarget;if(R=R.listener,P!==p&&f.isPropagationStopped())break e;pl(f,R,X),p=P}else for(k=0;k<u.length;k++){if(R=u[k],P=R.instance,X=R.currentTarget,R=R.listener,P!==p&&f.isPropagationStopped())break e;pl(f,R,X),p=P}}}if(js)throw e=Ta,js=!1,Ta=null,e}function vt(e,r){var i=r[pn];i===void 0&&(i=r[pn]=new Set);var u=e+"__bubble";i.has(u)||(Zi(r,e,2,!1),i.add(u))}function Gs(e,r,i){var u=0;r&&(u|=4),Zi(i,e,u,r)}var Ba="_reactListening"+Math.random().toString(36).slice(2);function Bi(e){if(!e[Ba]){e[Ba]=!0,a.forEach(function(i){i!=="selectionchange"&&(Tu.has(i)||Gs(i,!1,e),Gs(i,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[Ba]||(r[Ba]=!0,Gs("selectionchange",!1,r))}}function Zi(e,r,i,u){switch(Ia(r)){case 1:var f=Ps;break;case 4:f=Us;break;default:f=Ma}i=f.bind(null,r,i,e),f=void 0,!gt||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),u?f!==void 0?e.addEventListener(r,i,{capture:!0,passive:f}):e.addEventListener(r,i,!0):f!==void 0?e.addEventListener(r,i,{passive:f}):e.addEventListener(r,i,!1)}function Za(e,r,i,u,f){var p=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var k=u.tag;if(k===3||k===4){var R=u.stateNode.containerInfo;if(R===f||R.nodeType===8&&R.parentNode===f)break;if(k===4)for(k=u.return;k!==null;){var P=k.tag;if((P===3||P===4)&&(P=k.stateNode.containerInfo,P===f||P.nodeType===8&&P.parentNode===f))return;k=k.return}for(;R!==null;){if(k=In(R),k===null)return;if(P=k.tag,P===5||P===6){u=p=k;continue e}R=R.parentNode}}u=u.return}Po(function(){var X=p,oe=Ke(i),ce=[];e:{var ie=Dr.get(e);if(ie!==void 0){var we=Ko,Te=e;switch(e){case"keypress":if(Fa(i)===0)break e;case"keydown":case"keyup":we=ud;break;case"focusin":Te="focus",we=Jo;break;case"focusout":Te="blur",we=Jo;break;case"beforeblur":case"afterblur":we=Jo;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=mu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=Jc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=fd;break;case hl:case qs:case za:we=td;break;case $a:we=md;break;case"scroll":we=Kc;break;case"wheel":we=yd;break;case"copy":case"cut":case"paste":we=rd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=yu}var Oe=(r&4)!==0,Pt=!Oe&&e==="scroll",G=Oe?ie!==null?ie+"Capture":null:ie;Oe=[];for(var z=X,K;z!==null;){K=z;var de=K.stateNode;if(K.tag===5&&de!==null&&(K=de,G!==null&&(de=Os(z,G),de!=null&&Oe.push(qi(z,de,K)))),Pt)break;z=z.return}0<Oe.length&&(ie=new we(ie,Te,null,i,oe),ce.push({event:ie,listeners:Oe}))}}if((r&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",we=e==="mouseout"||e==="pointerout",ie&&i!==_e&&(Te=i.relatedTarget||i.fromElement)&&(In(Te)||Te[mt]))break e;if((we||ie)&&(ie=oe.window===oe?oe:(ie=oe.ownerDocument)?ie.defaultView||ie.parentWindow:window,we?(Te=i.relatedTarget||i.toElement,we=X,Te=Te?In(Te):null,Te!==null&&(Pt=Er(Te),Te!==Pt||Te.tag!==5&&Te.tag!==6)&&(Te=null)):(we=null,Te=X),we!==Te)){if(Oe=mu,de="onMouseLeave",G="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=yu,de="onPointerLeave",G="onPointerEnter",z="pointer"),Pt=we==null?ie:Js(we),K=Te==null?ie:Js(Te),ie=new Oe(de,z+"leave",we,i,oe),ie.target=Pt,ie.relatedTarget=K,de=null,In(oe)===X&&(Oe=new Oe(G,z+"enter",Te,i,oe),Oe.target=K,Oe.relatedTarget=Pt,de=Oe),Pt=de,we&&Te)t:{for(Oe=we,G=Te,z=0,K=Oe;K;K=ls(K))z++;for(K=0,de=G;de;de=ls(de))K++;for(;0<z-K;)Oe=ls(Oe),z--;for(;0<K-z;)G=ls(G),K--;for(;z--;){if(Oe===G||G!==null&&Oe===G.alternate)break t;Oe=ls(Oe),G=ls(G)}Oe=null}else Oe=null;we!==null&&yl(ce,ie,we,Oe,!1),Te!==null&&Pt!==null&&yl(ce,Pt,Te,Oe,!0)}}e:{if(ie=X?Js(X):window,we=ie.nodeName&&ie.nodeName.toLowerCase(),we==="select"||we==="input"&&ie.type==="file")var Re=St;else if(il(ie))if(Ws)Re=wd;else{Re=wu;var Ue=Qh}else(we=ie.nodeName)&&we.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(Re=Su);if(Re&&(Re=Re(e,X))){al(ce,Re,i,oe);break e}Ue&&Ue(e,ie,X),e==="focusout"&&(Ue=ie._wrapperState)&&Ue.controlled&&ie.type==="number"&&Rn(ie,"number",ie.value)}switch(Ue=X?Js(X):window,e){case"focusin":(il(Ue)||Ue.contentEditable==="true")&&(Bs=Ue,$i=X,Wi=null);break;case"focusout":Wi=$i=Bs=null;break;case"mousedown":ul=!0;break;case"contextmenu":case"mouseup":case"dragend":ul=!1,cl(ce,i,oe);break;case"selectionchange":if(kd)break;case"keydown":case"keyup":cl(ce,i,oe)}var Ve;if(nl)e:{switch(e){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Vs?mn(e,i)&&(qe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(qe="onCompositionStart");qe&&(rl&&i.locale!=="ko"&&(Vs||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Vs&&(Ve=fu()):(hr=oe,Ui="value"in hr?hr.value:hr.textContent,Vs=!0)),Ue=Qi(X,qe),0<Ue.length&&(qe=new el(qe,e,null,i,oe),ce.push({event:qe,listeners:Ue}),Ve?qe.data=Ve:(Ve=ss(i),Ve!==null&&(qe.data=Ve)))),(Ve=vd?is(e,i):xd(e,i))&&(X=Qi(X,"onBeforeInput"),0<X.length&&(oe=new el("onBeforeInput","beforeinput",null,i,oe),ce.push({event:oe,listeners:X}),oe.data=Ve))}Cu(ce,r)})}function qi(e,r,i){return{instance:e,listener:r,currentTarget:i}}function Qi(e,r){for(var i=r+"Capture",u=[];e!==null;){var f=e,p=f.stateNode;f.tag===5&&p!==null&&(f=p,p=Os(e,i),p!=null&&u.unshift(qi(e,p,f)),p=Os(e,r),p!=null&&u.push(qi(e,p,f))),e=e.return}return u}function ls(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yl(e,r,i,u,f){for(var p=r._reactName,k=[];i!==null&&i!==u;){var R=i,P=R.alternate,X=R.stateNode;if(P!==null&&P===u)break;R.tag===5&&X!==null&&(R=X,f?(P=Os(i,p),P!=null&&k.unshift(qi(i,P,R))):f||(P=Os(i,p),P!=null&&k.push(qi(i,P,R)))),i=i.return}k.length!==0&&e.push({event:r,listeners:k})}var Yi=/\r\n?/g,gl=/\u0000|\uFFFD/g;function He(e){return(typeof e=="string"?e:""+e).replace(Yi,`
`).replace(gl,"")}function Mr(e,r,i){if(r=He(r),He(e)!==r&&i)throw Error(s(425))}function qa(){}var g=null,o=null;function m(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var v=typeof setTimeout=="function"?setTimeout:void 0,N=typeof clearTimeout=="function"?clearTimeout:void 0,M=typeof Promise=="function"?Promise:void 0,V=typeof queueMicrotask=="function"?queueMicrotask:typeof M<"u"?function(e){return M.resolve(null).then(e).catch(H)}:v;function H(e){setTimeout(function(){throw e})}function Y(e,r){var i=r,u=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"){if(u===0){e.removeChild(f),It(r);return}u--}else i!=="$"&&i!=="$?"&&i!=="$!"||u++;i=f}while(i);It(r)}function ae(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function Fe(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return e;r--}else i==="/$"&&r++}e=e.previousSibling}return null}var Ze=Math.random().toString(36).slice(2),tt="__reactFiber$"+Ze,Ae="__reactProps$"+Ze,mt="__reactContainer$"+Ze,pn="__reactEvents$"+Ze,Qn="__reactListeners$"+Ze,Ks="__reactHandles$"+Ze;function In(e){var r=e[tt];if(r)return r;for(var i=e.parentNode;i;){if(r=i[mt]||i[tt]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(e=Fe(e);e!==null;){if(i=e[tt])return i;e=Fe(e)}return r}e=i,i=e.parentNode}return null}function Xs(e){return e=e[tt]||e[mt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Js(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Gi(e){return e[Ae]||null}var vl=[],ei=-1;function Ir(e){return{current:e}}function ht(e){0>ei||(e.current=vl[ei],vl[ei]=null,ei--)}function ct(e,r){ei++,vl[ei]=e.current,e.current=r}var Lr={},on=Ir(Lr),wn=Ir(!1),Ki=Lr;function Qa(e,r){var i=e.type.contextTypes;if(!i)return Lr;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===r)return u.__reactInternalMemoizedMaskedChildContext;var f={},p;for(p in i)f[p]=r[p];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=f),f}function Sn(e){return e=e.childContextTypes,e!=null}function Ou(){ht(wn),ht(on)}function Yh(e,r,i){if(on.current!==Lr)throw Error(s(168));ct(on,r),ct(wn,i)}function Gh(e,r,i){var u=e.stateNode;if(r=r.childContextTypes,typeof u.getChildContext!="function")return i;u=u.getChildContext();for(var f in u)if(!(f in r))throw Error(s(108,Qe(e)||"Unknown",f));return ue({},i,u)}function bu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lr,Ki=on.current,ct(on,e),ct(wn,wn.current),!0}function Kh(e,r,i){var u=e.stateNode;if(!u)throw Error(s(169));i?(e=Gh(e,r,Ki),u.__reactInternalMemoizedMergedChildContext=e,ht(wn),ht(on),ct(on,e)):ht(wn),ct(wn,i)}var us=null,ju=!1,_d=!1;function Xh(e){us===null?us=[e]:us.push(e)}function Ov(e){ju=!0,Xh(e)}function ti(){if(!_d&&us!==null){_d=!0;var e=0,r=ut;try{var i=us;for(ut=1;e<i.length;e++){var u=i[e];do u=u(!0);while(u!==null)}us=null,ju=!1}catch(f){throw us!==null&&(us=us.slice(e+1)),zo(Wo,ti),f}finally{ut=r,_d=!1}}return null}var Ya=[],Ga=0,Ru=null,Du=0,Yn=[],Gn=0,Xi=null,cs=1,ds="";function Ji(e,r){Ya[Ga++]=Du,Ya[Ga++]=Ru,Ru=e,Du=r}function Jh(e,r,i){Yn[Gn++]=cs,Yn[Gn++]=ds,Yn[Gn++]=Xi,Xi=e;var u=cs;e=ds;var f=32-Nt(u)-1;u&=~(1<<f),i+=1;var p=32-Nt(r)+f;if(30<p){var k=f-f%5;p=(u&(1<<k)-1).toString(32),u>>=k,f-=k,cs=1<<32-Nt(r)+f|i<<f|u,ds=p+e}else cs=1<<p|i<<f|u,ds=e}function Nd(e){e.return!==null&&(Ji(e,1),Jh(e,1,0))}function Ed(e){for(;e===Ru;)Ru=Ya[--Ga],Ya[Ga]=null,Du=Ya[--Ga],Ya[Ga]=null;for(;e===Xi;)Xi=Yn[--Gn],Yn[Gn]=null,ds=Yn[--Gn],Yn[Gn]=null,cs=Yn[--Gn],Yn[Gn]=null}var Ln=null,Fn=null,Et=!1,yr=null;function em(e,r){var i=er(5,null,null,0);i.elementType="DELETED",i.stateNode=r,i.return=e,r=e.deletions,r===null?(e.deletions=[i],e.flags|=16):r.push(i)}function tm(e,r){switch(e.tag){case 5:var i=e.type;return r=r.nodeType!==1||i.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,Ln=e,Fn=ae(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,Ln=e,Fn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(i=Xi!==null?{id:cs,overflow:ds}:null,e.memoizedState={dehydrated:r,treeContext:i,retryLane:1073741824},i=er(18,null,null,0),i.stateNode=r,i.return=e,e.child=i,Ln=e,Fn=null,!0):!1;default:return!1}}function Td(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Cd(e){if(Et){var r=Fn;if(r){var i=r;if(!tm(e,r)){if(Td(e))throw Error(s(418));r=ae(i.nextSibling);var u=Ln;r&&tm(e,r)?em(u,i):(e.flags=e.flags&-4097|2,Et=!1,Ln=e)}}else{if(Td(e))throw Error(s(418));e.flags=e.flags&-4097|2,Et=!1,Ln=e}}}function nm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ln=e}function Mu(e){if(e!==Ln)return!1;if(!Et)return nm(e),Et=!0,!1;var r;if((r=e.tag!==3)&&!(r=e.tag!==5)&&(r=e.type,r=r!=="head"&&r!=="body"&&!m(e.type,e.memoizedProps)),r&&(r=Fn)){if(Td(e))throw rm(),Error(s(418));for(;r;)em(e,r),r=ae(r.nextSibling)}if(nm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(r===0){Fn=ae(e.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++}e=e.nextSibling}Fn=null}}else Fn=Ln?ae(e.stateNode.nextSibling):null;return!0}function rm(){for(var e=Fn;e;)e=ae(e.nextSibling)}function Ka(){Fn=Ln=null,Et=!1}function Od(e){yr===null?yr=[e]:yr.push(e)}var bv=U.ReactCurrentBatchConfig;function xl(e,r,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var u=i.stateNode}if(!u)throw Error(s(147,e));var f=u,p=""+e;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===p?r.ref:(r=function(k){var R=f.refs;k===null?delete R[p]:R[p]=k},r._stringRef=p,r)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Iu(e,r){throw e=Object.prototype.toString.call(r),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}function sm(e){var r=e._init;return r(e._payload)}function im(e){function r(G,z){if(e){var K=G.deletions;K===null?(G.deletions=[z],G.flags|=16):K.push(z)}}function i(G,z){if(!e)return null;for(;z!==null;)r(G,z),z=z.sibling;return null}function u(G,z){for(G=new Map;z!==null;)z.key!==null?G.set(z.key,z):G.set(z.index,z),z=z.sibling;return G}function f(G,z){return G=ui(G,z),G.index=0,G.sibling=null,G}function p(G,z,K){return G.index=K,e?(K=G.alternate,K!==null?(K=K.index,K<z?(G.flags|=2,z):K):(G.flags|=2,z)):(G.flags|=1048576,z)}function k(G){return e&&G.alternate===null&&(G.flags|=2),G}function R(G,z,K,de){return z===null||z.tag!==6?(z=wf(K,G.mode,de),z.return=G,z):(z=f(z,K),z.return=G,z)}function P(G,z,K,de){var Re=K.type;return Re===se?oe(G,z,K.props.children,de,K.key):z!==null&&(z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===Xe&&sm(Re)===z.type)?(de=f(z,K.props),de.ref=xl(G,z,K),de.return=G,de):(de=sc(K.type,K.key,K.props,null,G.mode,de),de.ref=xl(G,z,K),de.return=G,de)}function X(G,z,K,de){return z===null||z.tag!==4||z.stateNode.containerInfo!==K.containerInfo||z.stateNode.implementation!==K.implementation?(z=Sf(K,G.mode,de),z.return=G,z):(z=f(z,K.children||[]),z.return=G,z)}function oe(G,z,K,de,Re){return z===null||z.tag!==7?(z=oa(K,G.mode,de,Re),z.return=G,z):(z=f(z,K),z.return=G,z)}function ce(G,z,K){if(typeof z=="string"&&z!==""||typeof z=="number")return z=wf(""+z,G.mode,K),z.return=G,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case $:return K=sc(z.type,z.key,z.props,null,G.mode,K),K.ref=xl(G,null,z),K.return=G,K;case J:return z=Sf(z,G.mode,K),z.return=G,z;case Xe:var de=z._init;return ce(G,de(z._payload),K)}if(or(z)||ge(z))return z=oa(z,G.mode,K,null),z.return=G,z;Iu(G,z)}return null}function ie(G,z,K,de){var Re=z!==null?z.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return Re!==null?null:R(G,z,""+K,de);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case $:return K.key===Re?P(G,z,K,de):null;case J:return K.key===Re?X(G,z,K,de):null;case Xe:return Re=K._init,ie(G,z,Re(K._payload),de)}if(or(K)||ge(K))return Re!==null?null:oe(G,z,K,de,null);Iu(G,K)}return null}function we(G,z,K,de,Re){if(typeof de=="string"&&de!==""||typeof de=="number")return G=G.get(K)||null,R(z,G,""+de,Re);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case $:return G=G.get(de.key===null?K:de.key)||null,P(z,G,de,Re);case J:return G=G.get(de.key===null?K:de.key)||null,X(z,G,de,Re);case Xe:var Ue=de._init;return we(G,z,K,Ue(de._payload),Re)}if(or(de)||ge(de))return G=G.get(K)||null,oe(z,G,de,Re,null);Iu(z,de)}return null}function Te(G,z,K,de){for(var Re=null,Ue=null,Ve=z,qe=z=0,Yt=null;Ve!==null&&qe<K.length;qe++){Ve.index>qe?(Yt=Ve,Ve=null):Yt=Ve.sibling;var dt=ie(G,Ve,K[qe],de);if(dt===null){Ve===null&&(Ve=Yt);break}e&&Ve&&dt.alternate===null&&r(G,Ve),z=p(dt,z,qe),Ue===null?Re=dt:Ue.sibling=dt,Ue=dt,Ve=Yt}if(qe===K.length)return i(G,Ve),Et&&Ji(G,qe),Re;if(Ve===null){for(;qe<K.length;qe++)Ve=ce(G,K[qe],de),Ve!==null&&(z=p(Ve,z,qe),Ue===null?Re=Ve:Ue.sibling=Ve,Ue=Ve);return Et&&Ji(G,qe),Re}for(Ve=u(G,Ve);qe<K.length;qe++)Yt=we(Ve,G,qe,K[qe],de),Yt!==null&&(e&&Yt.alternate!==null&&Ve.delete(Yt.key===null?qe:Yt.key),z=p(Yt,z,qe),Ue===null?Re=Yt:Ue.sibling=Yt,Ue=Yt);return e&&Ve.forEach(function(ci){return r(G,ci)}),Et&&Ji(G,qe),Re}function Oe(G,z,K,de){var Re=ge(K);if(typeof Re!="function")throw Error(s(150));if(K=Re.call(K),K==null)throw Error(s(151));for(var Ue=Re=null,Ve=z,qe=z=0,Yt=null,dt=K.next();Ve!==null&&!dt.done;qe++,dt=K.next()){Ve.index>qe?(Yt=Ve,Ve=null):Yt=Ve.sibling;var ci=ie(G,Ve,dt.value,de);if(ci===null){Ve===null&&(Ve=Yt);break}e&&Ve&&ci.alternate===null&&r(G,Ve),z=p(ci,z,qe),Ue===null?Re=ci:Ue.sibling=ci,Ue=ci,Ve=Yt}if(dt.done)return i(G,Ve),Et&&Ji(G,qe),Re;if(Ve===null){for(;!dt.done;qe++,dt=K.next())dt=ce(G,dt.value,de),dt!==null&&(z=p(dt,z,qe),Ue===null?Re=dt:Ue.sibling=dt,Ue=dt);return Et&&Ji(G,qe),Re}for(Ve=u(G,Ve);!dt.done;qe++,dt=K.next())dt=we(Ve,G,qe,dt.value,de),dt!==null&&(e&&dt.alternate!==null&&Ve.delete(dt.key===null?qe:dt.key),z=p(dt,z,qe),Ue===null?Re=dt:Ue.sibling=dt,Ue=dt);return e&&Ve.forEach(function(l0){return r(G,l0)}),Et&&Ji(G,qe),Re}function Pt(G,z,K,de){if(typeof K=="object"&&K!==null&&K.type===se&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case $:e:{for(var Re=K.key,Ue=z;Ue!==null;){if(Ue.key===Re){if(Re=K.type,Re===se){if(Ue.tag===7){i(G,Ue.sibling),z=f(Ue,K.props.children),z.return=G,G=z;break e}}else if(Ue.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===Xe&&sm(Re)===Ue.type){i(G,Ue.sibling),z=f(Ue,K.props),z.ref=xl(G,Ue,K),z.return=G,G=z;break e}i(G,Ue);break}else r(G,Ue);Ue=Ue.sibling}K.type===se?(z=oa(K.props.children,G.mode,de,K.key),z.return=G,G=z):(de=sc(K.type,K.key,K.props,null,G.mode,de),de.ref=xl(G,z,K),de.return=G,G=de)}return k(G);case J:e:{for(Ue=K.key;z!==null;){if(z.key===Ue)if(z.tag===4&&z.stateNode.containerInfo===K.containerInfo&&z.stateNode.implementation===K.implementation){i(G,z.sibling),z=f(z,K.children||[]),z.return=G,G=z;break e}else{i(G,z);break}else r(G,z);z=z.sibling}z=Sf(K,G.mode,de),z.return=G,G=z}return k(G);case Xe:return Ue=K._init,Pt(G,z,Ue(K._payload),de)}if(or(K))return Te(G,z,K,de);if(ge(K))return Oe(G,z,K,de);Iu(G,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,z!==null&&z.tag===6?(i(G,z.sibling),z=f(z,K),z.return=G,G=z):(i(G,z),z=wf(K,G.mode,de),z.return=G,G=z),k(G)):i(G,z)}return Pt}var Xa=im(!0),am=im(!1),Lu=Ir(null),Fu=null,Ja=null,bd=null;function jd(){bd=Ja=Fu=null}function Rd(e){var r=Lu.current;ht(Lu),e._currentValue=r}function Dd(e,r,i){for(;e!==null;){var u=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),e===i)break;e=e.return}}function eo(e,r){Fu=e,bd=Ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&r)!==0&&(kn=!0),e.firstContext=null)}function Kn(e){var r=e._currentValue;if(bd!==e)if(e={context:e,memoizedValue:r,next:null},Ja===null){if(Fu===null)throw Error(s(308));Ja=e,Fu.dependencies={lanes:0,firstContext:e}}else Ja=Ja.next=e;return r}var ea=null;function Md(e){ea===null?ea=[e]:ea.push(e)}function om(e,r,i,u){var f=r.interleaved;return f===null?(i.next=i,Md(r)):(i.next=f.next,f.next=i),r.interleaved=i,fs(e,u)}function fs(e,r){e.lanes|=r;var i=e.alternate;for(i!==null&&(i.lanes|=r),i=e,e=e.return;e!==null;)e.childLanes|=r,i=e.alternate,i!==null&&(i.childLanes|=r),i=e,e=e.return;return i.tag===3?i.stateNode:null}var ni=!1;function Id(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lm(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function hs(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function ri(e,r,i){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(at&2)!==0){var f=u.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),u.pending=r,fs(e,i)}return f=u.interleaved,f===null?(r.next=r,Md(u)):(r.next=f.next,f.next=r),u.interleaved=r,fs(e,i)}function Au(e,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194240)!==0)){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,Is(e,i)}}function um(e,r){var i=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var f=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var k={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?f=p=k:p=p.next=k,i=i.next}while(i!==null);p===null?f=p=r:p=p.next=r}else f=p=r;i={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:u.shared,effects:u.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=r:e.next=r,i.lastBaseUpdate=r}function Pu(e,r,i,u){var f=e.updateQueue;ni=!1;var p=f.firstBaseUpdate,k=f.lastBaseUpdate,R=f.shared.pending;if(R!==null){f.shared.pending=null;var P=R,X=P.next;P.next=null,k===null?p=X:k.next=X,k=P;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,R=oe.lastBaseUpdate,R!==k&&(R===null?oe.firstBaseUpdate=X:R.next=X,oe.lastBaseUpdate=P))}if(p!==null){var ce=f.baseState;k=0,oe=X=P=null,R=p;do{var ie=R.lane,we=R.eventTime;if((u&ie)===ie){oe!==null&&(oe=oe.next={eventTime:we,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});e:{var Te=e,Oe=R;switch(ie=r,we=i,Oe.tag){case 1:if(Te=Oe.payload,typeof Te=="function"){ce=Te.call(we,ce,ie);break e}ce=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Oe.payload,ie=typeof Te=="function"?Te.call(we,ce,ie):Te,ie==null)break e;ce=ue({},ce,ie);break e;case 2:ni=!0}}R.callback!==null&&R.lane!==0&&(e.flags|=64,ie=f.effects,ie===null?f.effects=[R]:ie.push(R))}else we={eventTime:we,lane:ie,tag:R.tag,payload:R.payload,callback:R.callback,next:null},oe===null?(X=oe=we,P=ce):oe=oe.next=we,k|=ie;if(R=R.next,R===null){if(R=f.shared.pending,R===null)break;ie=R,R=ie.next,ie.next=null,f.lastBaseUpdate=ie,f.shared.pending=null}}while(!0);if(oe===null&&(P=ce),f.baseState=P,f.firstBaseUpdate=X,f.lastBaseUpdate=oe,r=f.shared.interleaved,r!==null){f=r;do k|=f.lane,f=f.next;while(f!==r)}else p===null&&(f.shared.lanes=0);ra|=k,e.lanes=k,e.memoizedState=ce}}function cm(e,r,i){if(e=r.effects,r.effects=null,e!==null)for(r=0;r<e.length;r++){var u=e[r],f=u.callback;if(f!==null){if(u.callback=null,u=i,typeof f!="function")throw Error(s(191,f));f.call(u)}}}var wl={},Fr=Ir(wl),Sl=Ir(wl),kl=Ir(wl);function ta(e){if(e===wl)throw Error(s(174));return e}function Ld(e,r){switch(ct(kl,r),ct(Sl,e),ct(Fr,wl),e=r.nodeType,e){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:Gr(null,"");break;default:e=e===8?r.parentNode:r,r=e.namespaceURI||null,e=e.tagName,r=Gr(r,e)}ht(Fr),ct(Fr,r)}function to(){ht(Fr),ht(Sl),ht(kl)}function dm(e){ta(kl.current);var r=ta(Fr.current),i=Gr(r,e.type);r!==i&&(ct(Sl,e),ct(Fr,i))}function Fd(e){Sl.current===e&&(ht(Fr),ht(Sl))}var bt=Ir(0);function Uu(e){for(var r=e;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ad=[];function Pd(){for(var e=0;e<Ad.length;e++)Ad[e]._workInProgressVersionPrimary=null;Ad.length=0}var Vu=U.ReactCurrentDispatcher,Ud=U.ReactCurrentBatchConfig,na=0,jt=null,Wt=null,qt=null,zu=!1,_l=!1,Nl=0,jv=0;function ln(){throw Error(s(321))}function Vd(e,r){if(r===null)return!1;for(var i=0;i<r.length&&i<e.length;i++)if(!Ot(e[i],r[i]))return!1;return!0}function zd(e,r,i,u,f,p){if(na=p,jt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Vu.current=e===null||e.memoizedState===null?Iv:Lv,e=i(u,f),_l){p=0;do{if(_l=!1,Nl=0,25<=p)throw Error(s(301));p+=1,qt=Wt=null,r.updateQueue=null,Vu.current=Fv,e=i(u,f)}while(_l)}if(Vu.current=Hu,r=Wt!==null&&Wt.next!==null,na=0,qt=Wt=jt=null,zu=!1,r)throw Error(s(300));return e}function $d(){var e=Nl!==0;return Nl=0,e}function Ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?jt.memoizedState=qt=e:qt=qt.next=e,qt}function Xn(){if(Wt===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=Wt.next;var r=qt===null?jt.memoizedState:qt.next;if(r!==null)qt=r,Wt=e;else{if(e===null)throw Error(s(310));Wt=e,e={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},qt===null?jt.memoizedState=qt=e:qt=qt.next=e}return qt}function El(e,r){return typeof r=="function"?r(e):r}function Wd(e){var r=Xn(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var u=Wt,f=u.baseQueue,p=i.pending;if(p!==null){if(f!==null){var k=f.next;f.next=p.next,p.next=k}u.baseQueue=f=p,i.pending=null}if(f!==null){p=f.next,u=u.baseState;var R=k=null,P=null,X=p;do{var oe=X.lane;if((na&oe)===oe)P!==null&&(P=P.next={lane:0,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),u=X.hasEagerState?X.eagerState:e(u,X.action);else{var ce={lane:oe,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null};P===null?(R=P=ce,k=u):P=P.next=ce,jt.lanes|=oe,ra|=oe}X=X.next}while(X!==null&&X!==p);P===null?k=u:P.next=R,Ot(u,r.memoizedState)||(kn=!0),r.memoizedState=u,r.baseState=k,r.baseQueue=P,i.lastRenderedState=u}if(e=i.interleaved,e!==null){f=e;do p=f.lane,jt.lanes|=p,ra|=p,f=f.next;while(f!==e)}else f===null&&(i.lanes=0);return[r.memoizedState,i.dispatch]}function Hd(e){var r=Xn(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var u=i.dispatch,f=i.pending,p=r.memoizedState;if(f!==null){i.pending=null;var k=f=f.next;do p=e(p,k.action),k=k.next;while(k!==f);Ot(p,r.memoizedState)||(kn=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),i.lastRenderedState=p}return[p,u]}function fm(){}function hm(e,r){var i=jt,u=Xn(),f=r(),p=!Ot(u.memoizedState,f);if(p&&(u.memoizedState=f,kn=!0),u=u.queue,Bd(ym.bind(null,i,u,e),[e]),u.getSnapshot!==r||p||qt!==null&&qt.memoizedState.tag&1){if(i.flags|=2048,Tl(9,pm.bind(null,i,u,f,r),void 0,null),Qt===null)throw Error(s(349));(na&30)!==0||mm(i,r,f)}return f}function mm(e,r,i){e.flags|=16384,e={getSnapshot:r,value:i},r=jt.updateQueue,r===null?(r={lastEffect:null,stores:null},jt.updateQueue=r,r.stores=[e]):(i=r.stores,i===null?r.stores=[e]:i.push(e))}function pm(e,r,i,u){r.value=i,r.getSnapshot=u,gm(r)&&vm(e)}function ym(e,r,i){return i(function(){gm(r)&&vm(e)})}function gm(e){var r=e.getSnapshot;e=e.value;try{var i=r();return!Ot(e,i)}catch{return!0}}function vm(e){var r=fs(e,1);r!==null&&wr(r,e,1,-1)}function xm(e){var r=Ar();return typeof e=="function"&&(e=e()),r.memoizedState=r.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:e},r.queue=e,e=e.dispatch=Mv.bind(null,jt,e),[r.memoizedState,e]}function Tl(e,r,i,u){return e={tag:e,create:r,destroy:i,deps:u,next:null},r=jt.updateQueue,r===null?(r={lastEffect:null,stores:null},jt.updateQueue=r,r.lastEffect=e.next=e):(i=r.lastEffect,i===null?r.lastEffect=e.next=e:(u=i.next,i.next=e,e.next=u,r.lastEffect=e)),e}function wm(){return Xn().memoizedState}function $u(e,r,i,u){var f=Ar();jt.flags|=e,f.memoizedState=Tl(1|r,i,void 0,u===void 0?null:u)}function Wu(e,r,i,u){var f=Xn();u=u===void 0?null:u;var p=void 0;if(Wt!==null){var k=Wt.memoizedState;if(p=k.destroy,u!==null&&Vd(u,k.deps)){f.memoizedState=Tl(r,i,p,u);return}}jt.flags|=e,f.memoizedState=Tl(1|r,i,p,u)}function Sm(e,r){return $u(8390656,8,e,r)}function Bd(e,r){return Wu(2048,8,e,r)}function km(e,r){return Wu(4,2,e,r)}function _m(e,r){return Wu(4,4,e,r)}function Nm(e,r){if(typeof r=="function")return e=e(),r(e),function(){r(null)};if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function Em(e,r,i){return i=i!=null?i.concat([e]):null,Wu(4,4,Nm.bind(null,r,e),i)}function Zd(){}function Tm(e,r){var i=Xn();r=r===void 0?null:r;var u=i.memoizedState;return u!==null&&r!==null&&Vd(r,u[1])?u[0]:(i.memoizedState=[e,r],e)}function Cm(e,r){var i=Xn();r=r===void 0?null:r;var u=i.memoizedState;return u!==null&&r!==null&&Vd(r,u[1])?u[0]:(e=e(),i.memoizedState=[e,r],e)}function Om(e,r,i){return(na&21)===0?(e.baseState&&(e.baseState=!1,kn=!0),e.memoizedState=i):(Ot(i,r)||(i=qo(),jt.lanes|=i,ra|=i,e.baseState=!0),r)}function Rv(e,r){var i=ut;ut=i!==0&&4>i?i:4,e(!0);var u=Ud.transition;Ud.transition={};try{e(!1),r()}finally{ut=i,Ud.transition=u}}function bm(){return Xn().memoizedState}function Dv(e,r,i){var u=oi(e);if(i={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null},jm(e))Rm(r,i);else if(i=om(e,r,i,u),i!==null){var f=gn();wr(i,e,u,f),Dm(i,r,u)}}function Mv(e,r,i){var u=oi(e),f={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null};if(jm(e))Rm(r,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var k=r.lastRenderedState,R=p(k,i);if(f.hasEagerState=!0,f.eagerState=R,Ot(R,k)){var P=r.interleaved;P===null?(f.next=f,Md(r)):(f.next=P.next,P.next=f),r.interleaved=f;return}}catch{}finally{}i=om(e,r,f,u),i!==null&&(f=gn(),wr(i,e,u,f),Dm(i,r,u))}}function jm(e){var r=e.alternate;return e===jt||r!==null&&r===jt}function Rm(e,r){_l=zu=!0;var i=e.pending;i===null?r.next=r:(r.next=i.next,i.next=r),e.pending=r}function Dm(e,r,i){if((i&4194240)!==0){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,Is(e,i)}}var Hu={readContext:Kn,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},Iv={readContext:Kn,useCallback:function(e,r){return Ar().memoizedState=[e,r===void 0?null:r],e},useContext:Kn,useEffect:Sm,useImperativeHandle:function(e,r,i){return i=i!=null?i.concat([e]):null,$u(4194308,4,Nm.bind(null,r,e),i)},useLayoutEffect:function(e,r){return $u(4194308,4,e,r)},useInsertionEffect:function(e,r){return $u(4,2,e,r)},useMemo:function(e,r){var i=Ar();return r=r===void 0?null:r,e=e(),i.memoizedState=[e,r],e},useReducer:function(e,r,i){var u=Ar();return r=i!==void 0?i(r):r,u.memoizedState=u.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},u.queue=e,e=e.dispatch=Dv.bind(null,jt,e),[u.memoizedState,e]},useRef:function(e){var r=Ar();return e={current:e},r.memoizedState=e},useState:xm,useDebugValue:Zd,useDeferredValue:function(e){return Ar().memoizedState=e},useTransition:function(){var e=xm(!1),r=e[0];return e=Rv.bind(null,e[1]),Ar().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,i){var u=jt,f=Ar();if(Et){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),Qt===null)throw Error(s(349));(na&30)!==0||mm(u,r,i)}f.memoizedState=i;var p={value:i,getSnapshot:r};return f.queue=p,Sm(ym.bind(null,u,p,e),[e]),u.flags|=2048,Tl(9,pm.bind(null,u,p,i,r),void 0,null),i},useId:function(){var e=Ar(),r=Qt.identifierPrefix;if(Et){var i=ds,u=cs;i=(u&~(1<<32-Nt(u)-1)).toString(32)+i,r=":"+r+"R"+i,i=Nl++,0<i&&(r+="H"+i.toString(32)),r+=":"}else i=jv++,r=":"+r+"r"+i.toString(32)+":";return e.memoizedState=r},unstable_isNewReconciler:!1},Lv={readContext:Kn,useCallback:Tm,useContext:Kn,useEffect:Bd,useImperativeHandle:Em,useInsertionEffect:km,useLayoutEffect:_m,useMemo:Cm,useReducer:Wd,useRef:wm,useState:function(){return Wd(El)},useDebugValue:Zd,useDeferredValue:function(e){var r=Xn();return Om(r,Wt.memoizedState,e)},useTransition:function(){var e=Wd(El)[0],r=Xn().memoizedState;return[e,r]},useMutableSource:fm,useSyncExternalStore:hm,useId:bm,unstable_isNewReconciler:!1},Fv={readContext:Kn,useCallback:Tm,useContext:Kn,useEffect:Bd,useImperativeHandle:Em,useInsertionEffect:km,useLayoutEffect:_m,useMemo:Cm,useReducer:Hd,useRef:wm,useState:function(){return Hd(El)},useDebugValue:Zd,useDeferredValue:function(e){var r=Xn();return Wt===null?r.memoizedState=e:Om(r,Wt.memoizedState,e)},useTransition:function(){var e=Hd(El)[0],r=Xn().memoizedState;return[e,r]},useMutableSource:fm,useSyncExternalStore:hm,useId:bm,unstable_isNewReconciler:!1};function gr(e,r){if(e&&e.defaultProps){r=ue({},r),e=e.defaultProps;for(var i in e)r[i]===void 0&&(r[i]=e[i]);return r}return r}function qd(e,r,i,u){r=e.memoizedState,i=i(u,r),i=i==null?r:ue({},r,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Bu={isMounted:function(e){return(e=e._reactInternals)?Er(e)===e:!1},enqueueSetState:function(e,r,i){e=e._reactInternals;var u=gn(),f=oi(e),p=hs(u,f);p.payload=r,i!=null&&(p.callback=i),r=ri(e,p,f),r!==null&&(wr(r,e,f,u),Au(r,e,f))},enqueueReplaceState:function(e,r,i){e=e._reactInternals;var u=gn(),f=oi(e),p=hs(u,f);p.tag=1,p.payload=r,i!=null&&(p.callback=i),r=ri(e,p,f),r!==null&&(wr(r,e,f,u),Au(r,e,f))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var i=gn(),u=oi(e),f=hs(i,u);f.tag=2,r!=null&&(f.callback=r),r=ri(e,f,u),r!==null&&(wr(r,e,u,i),Au(r,e,u))}};function Mm(e,r,i,u,f,p,k){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,p,k):r.prototype&&r.prototype.isPureReactComponent?!Hs(i,u)||!Hs(f,p):!0}function Im(e,r,i){var u=!1,f=Lr,p=r.contextType;return typeof p=="object"&&p!==null?p=Kn(p):(f=Sn(r)?Ki:on.current,u=r.contextTypes,p=(u=u!=null)?Qa(e,f):Lr),r=new r(i,p),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Bu,e.stateNode=r,r._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=p),r}function Lm(e,r,i,u){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,u),r.state!==e&&Bu.enqueueReplaceState(r,r.state,null)}function Qd(e,r,i,u){var f=e.stateNode;f.props=i,f.state=e.memoizedState,f.refs={},Id(e);var p=r.contextType;typeof p=="object"&&p!==null?f.context=Kn(p):(p=Sn(r)?Ki:on.current,f.context=Qa(e,p)),f.state=e.memoizedState,p=r.getDerivedStateFromProps,typeof p=="function"&&(qd(e,r,p,i),f.state=e.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(r=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),r!==f.state&&Bu.enqueueReplaceState(f,f.state,null),Pu(e,i,f,u),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function no(e,r){try{var i="",u=r;do i+=je(u),u=u.return;while(u);var f=i}catch(p){f=`
Error generating stack: `+p.message+`
`+p.stack}return{value:e,source:r,stack:f,digest:null}}function Yd(e,r,i){return{value:e,source:null,stack:i??null,digest:r??null}}function Gd(e,r){try{console.error(r.value)}catch(i){setTimeout(function(){throw i})}}var Av=typeof WeakMap=="function"?WeakMap:Map;function Fm(e,r,i){i=hs(-1,i),i.tag=3,i.payload={element:null};var u=r.value;return i.callback=function(){Xu||(Xu=!0,ff=u),Gd(e,r)},i}function Am(e,r,i){i=hs(-1,i),i.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var f=r.value;i.payload=function(){return u(f)},i.callback=function(){Gd(e,r)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Gd(e,r),typeof u!="function"&&(ii===null?ii=new Set([this]):ii.add(this));var k=r.stack;this.componentDidCatch(r.value,{componentStack:k!==null?k:""})}),i}function Pm(e,r,i){var u=e.pingCache;if(u===null){u=e.pingCache=new Av;var f=new Set;u.set(r,f)}else f=u.get(r),f===void 0&&(f=new Set,u.set(r,f));f.has(i)||(f.add(i),e=Kv.bind(null,e,r,i),r.then(e,e))}function Um(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function Vm(e,r,i,u,f){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(r=hs(-1,1),r.tag=2,ri(i,r,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var Pv=U.ReactCurrentOwner,kn=!1;function yn(e,r,i,u){r.child=e===null?am(r,null,i,u):Xa(r,e.child,i,u)}function zm(e,r,i,u,f){i=i.render;var p=r.ref;return eo(r,f),u=zd(e,r,i,u,p,f),i=$d(),e!==null&&!kn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~f,ms(e,r,f)):(Et&&i&&Nd(r),r.flags|=1,yn(e,r,u,f),r.child)}function $m(e,r,i,u,f){if(e===null){var p=i.type;return typeof p=="function"&&!xf(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(r.tag=15,r.type=p,Wm(e,r,p,u,f)):(e=sc(i.type,null,u,r,r.mode,f),e.ref=r.ref,e.return=r,r.child=e)}if(p=e.child,(e.lanes&f)===0){var k=p.memoizedProps;if(i=i.compare,i=i!==null?i:Hs,i(k,u)&&e.ref===r.ref)return ms(e,r,f)}return r.flags|=1,e=ui(p,u),e.ref=r.ref,e.return=r,r.child=e}function Wm(e,r,i,u,f){if(e!==null){var p=e.memoizedProps;if(Hs(p,u)&&e.ref===r.ref)if(kn=!1,r.pendingProps=u=p,(e.lanes&f)!==0)(e.flags&131072)!==0&&(kn=!0);else return r.lanes=e.lanes,ms(e,r,f)}return Kd(e,r,i,u,f)}function Hm(e,r,i){var u=r.pendingProps,f=u.children,p=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(so,An),An|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,ct(so,An),An|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=p!==null?p.baseLanes:i,ct(so,An),An|=u}else p!==null?(u=p.baseLanes|i,r.memoizedState=null):u=i,ct(so,An),An|=u;return yn(e,r,f,i),r.child}function Bm(e,r){var i=r.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(r.flags|=512,r.flags|=2097152)}function Kd(e,r,i,u,f){var p=Sn(i)?Ki:on.current;return p=Qa(r,p),eo(r,f),i=zd(e,r,i,u,p,f),u=$d(),e!==null&&!kn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~f,ms(e,r,f)):(Et&&u&&Nd(r),r.flags|=1,yn(e,r,i,f),r.child)}function Zm(e,r,i,u,f){if(Sn(i)){var p=!0;bu(r)}else p=!1;if(eo(r,f),r.stateNode===null)qu(e,r),Im(r,i,u),Qd(r,i,u,f),u=!0;else if(e===null){var k=r.stateNode,R=r.memoizedProps;k.props=R;var P=k.context,X=i.contextType;typeof X=="object"&&X!==null?X=Kn(X):(X=Sn(i)?Ki:on.current,X=Qa(r,X));var oe=i.getDerivedStateFromProps,ce=typeof oe=="function"||typeof k.getSnapshotBeforeUpdate=="function";ce||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(R!==u||P!==X)&&Lm(r,k,u,X),ni=!1;var ie=r.memoizedState;k.state=ie,Pu(r,u,k,f),P=r.memoizedState,R!==u||ie!==P||wn.current||ni?(typeof oe=="function"&&(qd(r,i,oe,u),P=r.memoizedState),(R=ni||Mm(r,i,R,u,ie,P,X))?(ce||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(r.flags|=4194308)):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=P),k.props=u,k.state=P,k.context=X,u=R):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{k=r.stateNode,lm(e,r),R=r.memoizedProps,X=r.type===r.elementType?R:gr(r.type,R),k.props=X,ce=r.pendingProps,ie=k.context,P=i.contextType,typeof P=="object"&&P!==null?P=Kn(P):(P=Sn(i)?Ki:on.current,P=Qa(r,P));var we=i.getDerivedStateFromProps;(oe=typeof we=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(R!==ce||ie!==P)&&Lm(r,k,u,P),ni=!1,ie=r.memoizedState,k.state=ie,Pu(r,u,k,f);var Te=r.memoizedState;R!==ce||ie!==Te||wn.current||ni?(typeof we=="function"&&(qd(r,i,we,u),Te=r.memoizedState),(X=ni||Mm(r,i,X,u,ie,Te,P)||!1)?(oe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(u,Te,P),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(u,Te,P)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||R===e.memoizedProps&&ie===e.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&ie===e.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=Te),k.props=u,k.state=Te,k.context=P,u=X):(typeof k.componentDidUpdate!="function"||R===e.memoizedProps&&ie===e.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&ie===e.memoizedState||(r.flags|=1024),u=!1)}return Xd(e,r,i,u,p,f)}function Xd(e,r,i,u,f,p){Bm(e,r);var k=(r.flags&128)!==0;if(!u&&!k)return f&&Kh(r,i,!1),ms(e,r,p);u=r.stateNode,Pv.current=r;var R=k&&typeof i.getDerivedStateFromError!="function"?null:u.render();return r.flags|=1,e!==null&&k?(r.child=Xa(r,e.child,null,p),r.child=Xa(r,null,R,p)):yn(e,r,R,p),r.memoizedState=u.state,f&&Kh(r,i,!0),r.child}function qm(e){var r=e.stateNode;r.pendingContext?Yh(e,r.pendingContext,r.pendingContext!==r.context):r.context&&Yh(e,r.context,!1),Ld(e,r.containerInfo)}function Qm(e,r,i,u,f){return Ka(),Od(f),r.flags|=256,yn(e,r,i,u),r.child}var Jd={dehydrated:null,treeContext:null,retryLane:0};function ef(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ym(e,r,i){var u=r.pendingProps,f=bt.current,p=!1,k=(r.flags&128)!==0,R;if((R=k)||(R=e!==null&&e.memoizedState===null?!1:(f&2)!==0),R?(p=!0,r.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),ct(bt,f&1),e===null)return Cd(r),e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((r.mode&1)===0?r.lanes=1:e.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(k=u.children,e=u.fallback,p?(u=r.mode,p=r.child,k={mode:"hidden",children:k},(u&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=k):p=ic(k,u,0,null),e=oa(e,u,i,null),p.return=r,e.return=r,p.sibling=e,r.child=p,r.child.memoizedState=ef(i),r.memoizedState=Jd,e):tf(r,k));if(f=e.memoizedState,f!==null&&(R=f.dehydrated,R!==null))return Uv(e,r,k,u,R,f,i);if(p){p=u.fallback,k=r.mode,f=e.child,R=f.sibling;var P={mode:"hidden",children:u.children};return(k&1)===0&&r.child!==f?(u=r.child,u.childLanes=0,u.pendingProps=P,r.deletions=null):(u=ui(f,P),u.subtreeFlags=f.subtreeFlags&14680064),R!==null?p=ui(R,p):(p=oa(p,k,i,null),p.flags|=2),p.return=r,u.return=r,u.sibling=p,r.child=u,u=p,p=r.child,k=e.child.memoizedState,k=k===null?ef(i):{baseLanes:k.baseLanes|i,cachePool:null,transitions:k.transitions},p.memoizedState=k,p.childLanes=e.childLanes&~i,r.memoizedState=Jd,u}return p=e.child,e=p.sibling,u=ui(p,{mode:"visible",children:u.children}),(r.mode&1)===0&&(u.lanes=i),u.return=r,u.sibling=null,e!==null&&(i=r.deletions,i===null?(r.deletions=[e],r.flags|=16):i.push(e)),r.child=u,r.memoizedState=null,u}function tf(e,r){return r=ic({mode:"visible",children:r},e.mode,0,null),r.return=e,e.child=r}function Zu(e,r,i,u){return u!==null&&Od(u),Xa(r,e.child,null,i),e=tf(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Uv(e,r,i,u,f,p,k){if(i)return r.flags&256?(r.flags&=-257,u=Yd(Error(s(422))),Zu(e,r,k,u)):r.memoizedState!==null?(r.child=e.child,r.flags|=128,null):(p=u.fallback,f=r.mode,u=ic({mode:"visible",children:u.children},f,0,null),p=oa(p,f,k,null),p.flags|=2,u.return=r,p.return=r,u.sibling=p,r.child=u,(r.mode&1)!==0&&Xa(r,e.child,null,k),r.child.memoizedState=ef(k),r.memoizedState=Jd,p);if((r.mode&1)===0)return Zu(e,r,k,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var R=u.dgst;return u=R,p=Error(s(419)),u=Yd(p,u,void 0),Zu(e,r,k,u)}if(R=(k&e.childLanes)!==0,kn||R){if(u=Qt,u!==null){switch(k&-k){case 4:f=2;break;case 16:f=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|k))!==0?0:f,f!==0&&f!==p.retryLane&&(p.retryLane=f,fs(e,f),wr(u,e,f,-1))}return vf(),u=Yd(Error(s(421))),Zu(e,r,k,u)}return f.data==="$?"?(r.flags|=128,r.child=e.child,r=Xv.bind(null,e),f._reactRetry=r,null):(e=p.treeContext,Fn=ae(f.nextSibling),Ln=r,Et=!0,yr=null,e!==null&&(Yn[Gn++]=cs,Yn[Gn++]=ds,Yn[Gn++]=Xi,cs=e.id,ds=e.overflow,Xi=r),r=tf(r,u.children),r.flags|=4096,r)}function Gm(e,r,i){e.lanes|=r;var u=e.alternate;u!==null&&(u.lanes|=r),Dd(e.return,r,i)}function nf(e,r,i,u,f){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:f}:(p.isBackwards=r,p.rendering=null,p.renderingStartTime=0,p.last=u,p.tail=i,p.tailMode=f)}function Km(e,r,i){var u=r.pendingProps,f=u.revealOrder,p=u.tail;if(yn(e,r,u.children,i),u=bt.current,(u&2)!==0)u=u&1|2,r.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gm(e,i,r);else if(e.tag===19)Gm(e,i,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}if(ct(bt,u),(r.mode&1)===0)r.memoizedState=null;else switch(f){case"forwards":for(i=r.child,f=null;i!==null;)e=i.alternate,e!==null&&Uu(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null),nf(r,!1,f,i,p);break;case"backwards":for(i=null,f=r.child,r.child=null;f!==null;){if(e=f.alternate,e!==null&&Uu(e)===null){r.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}nf(r,!0,i,null,p);break;case"together":nf(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function qu(e,r){(r.mode&1)===0&&e!==null&&(e.alternate=null,r.alternate=null,r.flags|=2)}function ms(e,r,i){if(e!==null&&(r.dependencies=e.dependencies),ra|=r.lanes,(i&r.childLanes)===0)return null;if(e!==null&&r.child!==e.child)throw Error(s(153));if(r.child!==null){for(e=r.child,i=ui(e,e.pendingProps),r.child=i,i.return=r;e.sibling!==null;)e=e.sibling,i=i.sibling=ui(e,e.pendingProps),i.return=r;i.sibling=null}return r.child}function Vv(e,r,i){switch(r.tag){case 3:qm(r),Ka();break;case 5:dm(r);break;case 1:Sn(r.type)&&bu(r);break;case 4:Ld(r,r.stateNode.containerInfo);break;case 10:var u=r.type._context,f=r.memoizedProps.value;ct(Lu,u._currentValue),u._currentValue=f;break;case 13:if(u=r.memoizedState,u!==null)return u.dehydrated!==null?(ct(bt,bt.current&1),r.flags|=128,null):(i&r.child.childLanes)!==0?Ym(e,r,i):(ct(bt,bt.current&1),e=ms(e,r,i),e!==null?e.sibling:null);ct(bt,bt.current&1);break;case 19:if(u=(i&r.childLanes)!==0,(e.flags&128)!==0){if(u)return Km(e,r,i);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ct(bt,bt.current),u)break;return null;case 22:case 23:return r.lanes=0,Hm(e,r,i)}return ms(e,r,i)}var Xm,rf,Jm,ep;Xm=function(e,r){for(var i=r.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},rf=function(){},Jm=function(e,r,i,u){var f=e.memoizedProps;if(f!==u){e=r.stateNode,ta(Fr.current);var p=null;switch(i){case"input":f=Nr(e,f),u=Nr(e,u),p=[];break;case"select":f=ue({},f,{value:void 0}),u=ue({},u,{value:void 0}),p=[];break;case"textarea":f=qr(e,f),u=qr(e,u),p=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=qa)}Q(i,u);var k;i=null;for(X in f)if(!u.hasOwnProperty(X)&&f.hasOwnProperty(X)&&f[X]!=null)if(X==="style"){var R=f[X];for(k in R)R.hasOwnProperty(k)&&(i||(i={}),i[k]="")}else X!=="dangerouslySetInnerHTML"&&X!=="children"&&X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&X!=="autoFocus"&&(l.hasOwnProperty(X)?p||(p=[]):(p=p||[]).push(X,null));for(X in u){var P=u[X];if(R=f!=null?f[X]:void 0,u.hasOwnProperty(X)&&P!==R&&(P!=null||R!=null))if(X==="style")if(R){for(k in R)!R.hasOwnProperty(k)||P&&P.hasOwnProperty(k)||(i||(i={}),i[k]="");for(k in P)P.hasOwnProperty(k)&&R[k]!==P[k]&&(i||(i={}),i[k]=P[k])}else i||(p||(p=[]),p.push(X,i)),i=P;else X==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,R=R?R.__html:void 0,P!=null&&R!==P&&(p=p||[]).push(X,P)):X==="children"?typeof P!="string"&&typeof P!="number"||(p=p||[]).push(X,""+P):X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&(l.hasOwnProperty(X)?(P!=null&&X==="onScroll"&&vt("scroll",e),p||R===P||(p=[])):(p=p||[]).push(X,P))}i&&(p=p||[]).push("style",i);var X=p;(r.updateQueue=X)&&(r.flags|=4)}},ep=function(e,r,i,u){i!==u&&(r.flags|=4)};function Cl(e,r){if(!Et)switch(e.tailMode){case"hidden":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function un(e){var r=e.alternate!==null&&e.alternate.child===e.child,i=0,u=0;if(r)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=u,e.childLanes=i,r}function zv(e,r,i){var u=r.pendingProps;switch(Ed(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(r),null;case 1:return Sn(r.type)&&Ou(),un(r),null;case 3:return u=r.stateNode,to(),ht(wn),ht(on),Pd(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(Mu(r)?r.flags|=4:e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,yr!==null&&(pf(yr),yr=null))),rf(e,r),un(r),null;case 5:Fd(r);var f=ta(kl.current);if(i=r.type,e!==null&&r.stateNode!=null)Jm(e,r,i,u,f),e.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!u){if(r.stateNode===null)throw Error(s(166));return un(r),null}if(e=ta(Fr.current),Mu(r)){u=r.stateNode,i=r.type;var p=r.memoizedProps;switch(u[tt]=r,u[Ae]=p,e=(r.mode&1)!==0,i){case"dialog":vt("cancel",u),vt("close",u);break;case"iframe":case"object":case"embed":vt("load",u);break;case"video":case"audio":for(f=0;f<os.length;f++)vt(os[f],u);break;case"source":vt("error",u);break;case"img":case"image":case"link":vt("error",u),vt("load",u);break;case"details":vt("toggle",u);break;case"input":Wn(u,p),vt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!p.multiple},vt("invalid",u);break;case"textarea":Qr(u,p),vt("invalid",u)}Q(i,p),f=null;for(var k in p)if(p.hasOwnProperty(k)){var R=p[k];k==="children"?typeof R=="string"?u.textContent!==R&&(p.suppressHydrationWarning!==!0&&Mr(u.textContent,R,e),f=["children",R]):typeof R=="number"&&u.textContent!==""+R&&(p.suppressHydrationWarning!==!0&&Mr(u.textContent,R,e),f=["children",""+R]):l.hasOwnProperty(k)&&R!=null&&k==="onScroll"&&vt("scroll",u)}switch(i){case"input":jn(u),ar(u,p,!0);break;case"textarea":jn(u),lr(u);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(u.onclick=qa)}u=f,r.updateQueue=u,u!==null&&(r.flags|=4)}else{k=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Bn(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=k.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=k.createElement(i,{is:u.is}):(e=k.createElement(i),i==="select"&&(k=e,u.multiple?k.multiple=!0:u.size&&(k.size=u.size))):e=k.createElementNS(e,i),e[tt]=r,e[Ae]=u,Xm(e,r,!1,!1),r.stateNode=e;e:{switch(k=re(i,u),i){case"dialog":vt("cancel",e),vt("close",e),f=u;break;case"iframe":case"object":case"embed":vt("load",e),f=u;break;case"video":case"audio":for(f=0;f<os.length;f++)vt(os[f],e);f=u;break;case"source":vt("error",e),f=u;break;case"img":case"image":case"link":vt("error",e),vt("load",e),f=u;break;case"details":vt("toggle",e),f=u;break;case"input":Wn(e,u),f=Nr(e,u),vt("invalid",e);break;case"option":f=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},f=ue({},u,{value:void 0}),vt("invalid",e);break;case"textarea":Qr(e,u),f=qr(e,u),vt("invalid",e);break;default:f=u}Q(i,f),R=f;for(p in R)if(R.hasOwnProperty(p)){var P=R[p];p==="style"?le(e,P):p==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,P!=null&&Kr(e,P)):p==="children"?typeof P=="string"?(i!=="textarea"||P!=="")&&D(e,P):typeof P=="number"&&D(e,""+P):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(l.hasOwnProperty(p)?P!=null&&p==="onScroll"&&vt("scroll",e):P!=null&&F(e,p,P,k))}switch(i){case"input":jn(e),ar(e,u,!1);break;case"textarea":jn(e),lr(e);break;case"option":u.value!=null&&e.setAttribute("value",""+Be(u.value));break;case"select":e.multiple=!!u.multiple,p=u.value,p!=null?Dn(e,!!u.multiple,p,!1):u.defaultValue!=null&&Dn(e,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=qa)}switch(i){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return un(r),null;case 6:if(e&&r.stateNode!=null)ep(e,r,e.memoizedProps,u);else{if(typeof u!="string"&&r.stateNode===null)throw Error(s(166));if(i=ta(kl.current),ta(Fr.current),Mu(r)){if(u=r.stateNode,i=r.memoizedProps,u[tt]=r,(p=u.nodeValue!==i)&&(e=Ln,e!==null))switch(e.tag){case 3:Mr(u.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Mr(u.nodeValue,i,(e.mode&1)!==0)}p&&(r.flags|=4)}else u=(i.nodeType===9?i:i.ownerDocument).createTextNode(u),u[tt]=r,r.stateNode=u}return un(r),null;case 13:if(ht(bt),u=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Et&&Fn!==null&&(r.mode&1)!==0&&(r.flags&128)===0)rm(),Ka(),r.flags|=98560,p=!1;else if(p=Mu(r),u!==null&&u.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[tt]=r}else Ka(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;un(r),p=!1}else yr!==null&&(pf(yr),yr=null),p=!0;if(!p)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=i,r):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(r.child.flags|=8192,(r.mode&1)!==0&&(e===null||(bt.current&1)!==0?Ht===0&&(Ht=3):vf())),r.updateQueue!==null&&(r.flags|=4),un(r),null);case 4:return to(),rf(e,r),e===null&&Bi(r.stateNode.containerInfo),un(r),null;case 10:return Rd(r.type._context),un(r),null;case 17:return Sn(r.type)&&Ou(),un(r),null;case 19:if(ht(bt),p=r.memoizedState,p===null)return un(r),null;if(u=(r.flags&128)!==0,k=p.rendering,k===null)if(u)Cl(p,!1);else{if(Ht!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(k=Uu(e),k!==null){for(r.flags|=128,Cl(p,!1),u=k.updateQueue,u!==null&&(r.updateQueue=u,r.flags|=4),r.subtreeFlags=0,u=i,i=r.child;i!==null;)p=i,e=u,p.flags&=14680066,k=p.alternate,k===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=k.childLanes,p.lanes=k.lanes,p.child=k.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=k.memoizedProps,p.memoizedState=k.memoizedState,p.updateQueue=k.updateQueue,p.type=k.type,e=k.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ct(bt,bt.current&1|2),r.child}e=e.sibling}p.tail!==null&&wt()>io&&(r.flags|=128,u=!0,Cl(p,!1),r.lanes=4194304)}else{if(!u)if(e=Uu(k),e!==null){if(r.flags|=128,u=!0,i=e.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),Cl(p,!0),p.tail===null&&p.tailMode==="hidden"&&!k.alternate&&!Et)return un(r),null}else 2*wt()-p.renderingStartTime>io&&i!==1073741824&&(r.flags|=128,u=!0,Cl(p,!1),r.lanes=4194304);p.isBackwards?(k.sibling=r.child,r.child=k):(i=p.last,i!==null?i.sibling=k:r.child=k,p.last=k)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=wt(),r.sibling=null,i=bt.current,ct(bt,u?i&1|2:i&1),r):(un(r),null);case 22:case 23:return gf(),u=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(r.flags|=8192),u&&(r.mode&1)!==0?(An&1073741824)!==0&&(un(r),r.subtreeFlags&6&&(r.flags|=8192)):un(r),null;case 24:return null;case 25:return null}throw Error(s(156,r.tag))}function $v(e,r){switch(Ed(r),r.tag){case 1:return Sn(r.type)&&Ou(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return to(),ht(wn),ht(on),Pd(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 5:return Fd(r),null;case 13:if(ht(bt),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ka()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return ht(bt),null;case 4:return to(),null;case 10:return Rd(r.type._context),null;case 22:case 23:return gf(),null;case 24:return null;default:return null}}var Qu=!1,cn=!1,Wv=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function ro(e,r){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(u){Lt(e,r,u)}else i.current=null}function sf(e,r,i){try{i()}catch(u){Lt(e,r,u)}}var tp=!1;function Hv(e,r){if(g=fr,e=Eu(),ll(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var f=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var k=0,R=-1,P=-1,X=0,oe=0,ce=e,ie=null;t:for(;;){for(var we;ce!==i||f!==0&&ce.nodeType!==3||(R=k+f),ce!==p||u!==0&&ce.nodeType!==3||(P=k+u),ce.nodeType===3&&(k+=ce.nodeValue.length),(we=ce.firstChild)!==null;)ie=ce,ce=we;for(;;){if(ce===e)break t;if(ie===i&&++X===f&&(R=k),ie===p&&++oe===u&&(P=k),(we=ce.nextSibling)!==null)break;ce=ie,ie=ce.parentNode}ce=we}i=R===-1||P===-1?null:{start:R,end:P}}else i=null}i=i||{start:0,end:0}}else i=null;for(o={focusedElem:e,selectionRange:i},fr=!1,Ne=r;Ne!==null;)if(r=Ne,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,Ne=e;else for(;Ne!==null;){r=Ne;try{var Te=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var Oe=Te.memoizedProps,Pt=Te.memoizedState,G=r.stateNode,z=G.getSnapshotBeforeUpdate(r.elementType===r.type?Oe:gr(r.type,Oe),Pt);G.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var K=r.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(de){Lt(r,r.return,de)}if(e=r.sibling,e!==null){e.return=r.return,Ne=e;break}Ne=r.return}return Te=tp,tp=!1,Te}function Ol(e,r,i){var u=r.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&e)===e){var p=f.destroy;f.destroy=void 0,p!==void 0&&sf(r,i,p)}f=f.next}while(f!==u)}}function Yu(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var u=i.create;i.destroy=u()}i=i.next}while(i!==r)}}function af(e){var r=e.ref;if(r!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof r=="function"?r(e):r.current=e}}function np(e){var r=e.alternate;r!==null&&(e.alternate=null,np(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[tt],delete r[Ae],delete r[pn],delete r[Qn],delete r[Ks])),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 rp(e){return e.tag===5||e.tag===3||e.tag===4}function sp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rp(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 of(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?i.nodeType===8?i.parentNode.insertBefore(e,r):i.insertBefore(e,r):(i.nodeType===8?(r=i.parentNode,r.insertBefore(e,i)):(r=i,r.appendChild(e)),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=qa));else if(u!==4&&(e=e.child,e!==null))for(of(e,r,i),e=e.sibling;e!==null;)of(e,r,i),e=e.sibling}function lf(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?i.insertBefore(e,r):i.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(lf(e,r,i),e=e.sibling;e!==null;)lf(e,r,i),e=e.sibling}var tn=null,vr=!1;function si(e,r,i){for(i=i.child;i!==null;)ip(e,r,i),i=i.sibling}function ip(e,r,i){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(ba,i)}catch{}switch(i.tag){case 5:cn||ro(i,r);case 6:var u=tn,f=vr;tn=null,si(e,r,i),tn=u,vr=f,tn!==null&&(vr?(e=tn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):tn.removeChild(i.stateNode));break;case 18:tn!==null&&(vr?(e=tn,i=i.stateNode,e.nodeType===8?Y(e.parentNode,i):e.nodeType===1&&Y(e,i),It(e)):Y(tn,i.stateNode));break;case 4:u=tn,f=vr,tn=i.stateNode.containerInfo,vr=!0,si(e,r,i),tn=u,vr=f;break;case 0:case 11:case 14:case 15:if(!cn&&(u=i.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var p=f,k=p.destroy;p=p.tag,k!==void 0&&((p&2)!==0||(p&4)!==0)&&sf(i,r,k),f=f.next}while(f!==u)}si(e,r,i);break;case 1:if(!cn&&(ro(i,r),u=i.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=i.memoizedProps,u.state=i.memoizedState,u.componentWillUnmount()}catch(R){Lt(i,r,R)}si(e,r,i);break;case 21:si(e,r,i);break;case 22:i.mode&1?(cn=(u=cn)||i.memoizedState!==null,si(e,r,i),cn=u):si(e,r,i);break;default:si(e,r,i)}}function ap(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Wv),r.forEach(function(u){var f=Jv.bind(null,e,u);i.has(u)||(i.add(u),u.then(f,f))})}}function xr(e,r){var i=r.deletions;if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];try{var p=e,k=r,R=k;e:for(;R!==null;){switch(R.tag){case 5:tn=R.stateNode,vr=!1;break e;case 3:tn=R.stateNode.containerInfo,vr=!0;break e;case 4:tn=R.stateNode.containerInfo,vr=!0;break e}R=R.return}if(tn===null)throw Error(s(160));ip(p,k,f),tn=null,vr=!1;var P=f.alternate;P!==null&&(P.return=null),f.return=null}catch(X){Lt(f,r,X)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)op(r,e),r=r.sibling}function op(e,r){var i=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xr(r,e),Pr(e),u&4){try{Ol(3,e,e.return),Yu(3,e)}catch(Oe){Lt(e,e.return,Oe)}try{Ol(5,e,e.return)}catch(Oe){Lt(e,e.return,Oe)}}break;case 1:xr(r,e),Pr(e),u&512&&i!==null&&ro(i,i.return);break;case 5:if(xr(r,e),Pr(e),u&512&&i!==null&&ro(i,i.return),e.flags&32){var f=e.stateNode;try{D(f,"")}catch(Oe){Lt(e,e.return,Oe)}}if(u&4&&(f=e.stateNode,f!=null)){var p=e.memoizedProps,k=i!==null?i.memoizedProps:p,R=e.type,P=e.updateQueue;if(e.updateQueue=null,P!==null)try{R==="input"&&p.type==="radio"&&p.name!=null&&ir(f,p),re(R,k);var X=re(R,p);for(k=0;k<P.length;k+=2){var oe=P[k],ce=P[k+1];oe==="style"?le(f,ce):oe==="dangerouslySetInnerHTML"?Kr(f,ce):oe==="children"?D(f,ce):F(f,oe,ce,X)}switch(R){case"input":Hn(f,p);break;case"textarea":Yr(f,p);break;case"select":var ie=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!p.multiple;var we=p.value;we!=null?Dn(f,!!p.multiple,we,!1):ie!==!!p.multiple&&(p.defaultValue!=null?Dn(f,!!p.multiple,p.defaultValue,!0):Dn(f,!!p.multiple,p.multiple?[]:"",!1))}f[Ae]=p}catch(Oe){Lt(e,e.return,Oe)}}break;case 6:if(xr(r,e),Pr(e),u&4){if(e.stateNode===null)throw Error(s(162));f=e.stateNode,p=e.memoizedProps;try{f.nodeValue=p}catch(Oe){Lt(e,e.return,Oe)}}break;case 3:if(xr(r,e),Pr(e),u&4&&i!==null&&i.memoizedState.isDehydrated)try{It(r.containerInfo)}catch(Oe){Lt(e,e.return,Oe)}break;case 4:xr(r,e),Pr(e);break;case 13:xr(r,e),Pr(e),f=e.child,f.flags&8192&&(p=f.memoizedState!==null,f.stateNode.isHidden=p,!p||f.alternate!==null&&f.alternate.memoizedState!==null||(df=wt())),u&4&&ap(e);break;case 22:if(oe=i!==null&&i.memoizedState!==null,e.mode&1?(cn=(X=cn)||oe,xr(r,e),cn=X):xr(r,e),Pr(e),u&8192){if(X=e.memoizedState!==null,(e.stateNode.isHidden=X)&&!oe&&(e.mode&1)!==0)for(Ne=e,oe=e.child;oe!==null;){for(ce=Ne=oe;Ne!==null;){switch(ie=Ne,we=ie.child,ie.tag){case 0:case 11:case 14:case 15:Ol(4,ie,ie.return);break;case 1:ro(ie,ie.return);var Te=ie.stateNode;if(typeof Te.componentWillUnmount=="function"){u=ie,i=ie.return;try{r=u,Te.props=r.memoizedProps,Te.state=r.memoizedState,Te.componentWillUnmount()}catch(Oe){Lt(u,i,Oe)}}break;case 5:ro(ie,ie.return);break;case 22:if(ie.memoizedState!==null){cp(ce);continue}}we!==null?(we.return=ie,Ne=we):cp(ce)}oe=oe.sibling}e:for(oe=null,ce=e;;){if(ce.tag===5){if(oe===null){oe=ce;try{f=ce.stateNode,X?(p=f.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(R=ce.stateNode,P=ce.memoizedProps.style,k=P!=null&&P.hasOwnProperty("display")?P.display:null,R.style.display=ee("display",k))}catch(Oe){Lt(e,e.return,Oe)}}}else if(ce.tag===6){if(oe===null)try{ce.stateNode.nodeValue=X?"":ce.memoizedProps}catch(Oe){Lt(e,e.return,Oe)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===e)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===e)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===e)break e;oe===ce&&(oe=null),ce=ce.return}oe===ce&&(oe=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:xr(r,e),Pr(e),u&4&&ap(e);break;case 21:break;default:xr(r,e),Pr(e)}}function Pr(e){var r=e.flags;if(r&2){try{e:{for(var i=e.return;i!==null;){if(rp(i)){var u=i;break e}i=i.return}throw Error(s(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(D(f,""),u.flags&=-33);var p=sp(e);lf(e,p,f);break;case 3:case 4:var k=u.stateNode.containerInfo,R=sp(e);of(e,R,k);break;default:throw Error(s(161))}}catch(P){Lt(e,e.return,P)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function Bv(e,r,i){Ne=e,lp(e)}function lp(e,r,i){for(var u=(e.mode&1)!==0;Ne!==null;){var f=Ne,p=f.child;if(f.tag===22&&u){var k=f.memoizedState!==null||Qu;if(!k){var R=f.alternate,P=R!==null&&R.memoizedState!==null||cn;R=Qu;var X=cn;if(Qu=k,(cn=P)&&!X)for(Ne=f;Ne!==null;)k=Ne,P=k.child,k.tag===22&&k.memoizedState!==null?dp(f):P!==null?(P.return=k,Ne=P):dp(f);for(;p!==null;)Ne=p,lp(p),p=p.sibling;Ne=f,Qu=R,cn=X}up(e)}else(f.subtreeFlags&8772)!==0&&p!==null?(p.return=f,Ne=p):up(e)}}function up(e){for(;Ne!==null;){var r=Ne;if((r.flags&8772)!==0){var i=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:cn||Yu(5,r);break;case 1:var u=r.stateNode;if(r.flags&4&&!cn)if(i===null)u.componentDidMount();else{var f=r.elementType===r.type?i.memoizedProps:gr(r.type,i.memoizedProps);u.componentDidUpdate(f,i.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var p=r.updateQueue;p!==null&&cm(r,p,u);break;case 3:var k=r.updateQueue;if(k!==null){if(i=null,r.child!==null)switch(r.child.tag){case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}cm(r,k,i)}break;case 5:var R=r.stateNode;if(i===null&&r.flags&4){i=R;var P=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":P.autoFocus&&i.focus();break;case"img":P.src&&(i.src=P.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var X=r.alternate;if(X!==null){var oe=X.memoizedState;if(oe!==null){var ce=oe.dehydrated;ce!==null&&It(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}cn||r.flags&512&&af(r)}catch(ie){Lt(r,r.return,ie)}}if(r===e){Ne=null;break}if(i=r.sibling,i!==null){i.return=r.return,Ne=i;break}Ne=r.return}}function cp(e){for(;Ne!==null;){var r=Ne;if(r===e){Ne=null;break}var i=r.sibling;if(i!==null){i.return=r.return,Ne=i;break}Ne=r.return}}function dp(e){for(;Ne!==null;){var r=Ne;try{switch(r.tag){case 0:case 11:case 15:var i=r.return;try{Yu(4,r)}catch(P){Lt(r,i,P)}break;case 1:var u=r.stateNode;if(typeof u.componentDidMount=="function"){var f=r.return;try{u.componentDidMount()}catch(P){Lt(r,f,P)}}var p=r.return;try{af(r)}catch(P){Lt(r,p,P)}break;case 5:var k=r.return;try{af(r)}catch(P){Lt(r,k,P)}}}catch(P){Lt(r,r.return,P)}if(r===e){Ne=null;break}var R=r.sibling;if(R!==null){R.return=r.return,Ne=R;break}Ne=r.return}}var Zv=Math.ceil,Gu=U.ReactCurrentDispatcher,uf=U.ReactCurrentOwner,Jn=U.ReactCurrentBatchConfig,at=0,Qt=null,zt=null,nn=0,An=0,so=Ir(0),Ht=0,bl=null,ra=0,Ku=0,cf=0,jl=null,_n=null,df=0,io=1/0,ps=null,Xu=!1,ff=null,ii=null,Ju=!1,ai=null,ec=0,Rl=0,hf=null,tc=-1,nc=0;function gn(){return(at&6)!==0?wt():tc!==-1?tc:tc=wt()}function oi(e){return(e.mode&1)===0?1:(at&2)!==0&&nn!==0?nn&-nn:bv.transition!==null?(nc===0&&(nc=qo()),nc):(e=ut,e!==0||(e=window.event,e=e===void 0?16:Ia(e.type)),e)}function wr(e,r,i,u){if(50<Rl)throw Rl=0,hf=null,Error(s(185));es(e,i,u),((at&2)===0||e!==Qt)&&(e===Qt&&((at&2)===0&&(Ku|=i),Ht===4&&li(e,nn)),Nn(e,u),i===1&&at===0&&(r.mode&1)===0&&(io=wt()+500,ju&&ti()))}function Nn(e,r){var i=e.callbackNode;ja(e,r);var u=Or(e,e===Qt?nn:0);if(u===0)i!==null&&$o(i),e.callbackNode=null,e.callbackPriority=0;else if(r=u&-u,e.callbackPriority!==r){if(i!=null&&$o(i),r===1)e.tag===0?Ov(hp.bind(null,e)):Xh(hp.bind(null,e)),V(function(){(at&6)===0&&ti()}),i=null;else{switch(Mi(u)){case 1:i=Wo;break;case 4:i=Ho;break;case 16:i=Di;break;case 536870912:i=Bo;break;default:i=Di}i=Sp(i,fp.bind(null,e))}e.callbackPriority=r,e.callbackNode=i}}function fp(e,r){if(tc=-1,nc=0,(at&6)!==0)throw Error(s(327));var i=e.callbackNode;if(ao()&&e.callbackNode!==i)return null;var u=Or(e,e===Qt?nn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||r)r=rc(e,u);else{r=u;var f=at;at|=2;var p=pp();(Qt!==e||nn!==r)&&(ps=null,io=wt()+500,ia(e,r));do try{Yv();break}catch(R){mp(e,R)}while(!0);jd(),Gu.current=p,at=f,zt!==null?r=0:(Qt=null,nn=0,r=Ht)}if(r!==0){if(r===2&&(f=Ms(e),f!==0&&(u=f,r=mf(e,f))),r===1)throw i=bl,ia(e,0),li(e,u),Nn(e,wt()),i;if(r===6)li(e,u);else{if(f=e.current.alternate,(u&30)===0&&!qv(f)&&(r=rc(e,u),r===2&&(p=Ms(e),p!==0&&(u=p,r=mf(e,p))),r===1))throw i=bl,ia(e,0),li(e,u),Nn(e,wt()),i;switch(e.finishedWork=f,e.finishedLanes=u,r){case 0:case 1:throw Error(s(345));case 2:aa(e,_n,ps);break;case 3:if(li(e,u),(u&130023424)===u&&(r=df+500-wt(),10<r)){if(Or(e,0)!==0)break;if(f=e.suspendedLanes,(f&u)!==u){gn(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=v(aa.bind(null,e,_n,ps),r);break}aa(e,_n,ps);break;case 4:if(li(e,u),(u&4194240)===u)break;for(r=e.eventTimes,f=-1;0<u;){var k=31-Nt(u);p=1<<k,k=r[k],k>f&&(f=k),u&=~p}if(u=f,u=wt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Zv(u/1960))-u,10<u){e.timeoutHandle=v(aa.bind(null,e,_n,ps),u);break}aa(e,_n,ps);break;case 5:aa(e,_n,ps);break;default:throw Error(s(329))}}}return Nn(e,wt()),e.callbackNode===i?fp.bind(null,e):null}function mf(e,r){var i=jl;return e.current.memoizedState.isDehydrated&&(ia(e,r).flags|=256),e=rc(e,r),e!==2&&(r=_n,_n=i,r!==null&&pf(r)),e}function pf(e){_n===null?_n=e:_n.push.apply(_n,e)}function qv(e){for(var r=e;;){if(r.flags&16384){var i=r.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var u=0;u<i.length;u++){var f=i[u],p=f.getSnapshot;f=f.value;try{if(!Ot(p(),f))return!1}catch{return!1}}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function li(e,r){for(r&=~cf,r&=~Ku,e.suspendedLanes|=r,e.pingedLanes&=~r,e=e.expirationTimes;0<r;){var i=31-Nt(r),u=1<<i;e[i]=-1,r&=~u}}function hp(e){if((at&6)!==0)throw Error(s(327));ao();var r=Or(e,0);if((r&1)===0)return Nn(e,wt()),null;var i=rc(e,r);if(e.tag!==0&&i===2){var u=Ms(e);u!==0&&(r=u,i=mf(e,u))}if(i===1)throw i=bl,ia(e,0),li(e,r),Nn(e,wt()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=r,aa(e,_n,ps),Nn(e,wt()),null}function yf(e,r){var i=at;at|=1;try{return e(r)}finally{at=i,at===0&&(io=wt()+500,ju&&ti())}}function sa(e){ai!==null&&ai.tag===0&&(at&6)===0&&ao();var r=at;at|=1;var i=Jn.transition,u=ut;try{if(Jn.transition=null,ut=1,e)return e()}finally{ut=u,Jn.transition=i,at=r,(at&6)===0&&ti()}}function gf(){An=so.current,ht(so)}function ia(e,r){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,N(i)),zt!==null)for(i=zt.return;i!==null;){var u=i;switch(Ed(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&Ou();break;case 3:to(),ht(wn),ht(on),Pd();break;case 5:Fd(u);break;case 4:to();break;case 13:ht(bt);break;case 19:ht(bt);break;case 10:Rd(u.type._context);break;case 22:case 23:gf()}i=i.return}if(Qt=e,zt=e=ui(e.current,null),nn=An=r,Ht=0,bl=null,cf=Ku=ra=0,_n=jl=null,ea!==null){for(r=0;r<ea.length;r++)if(i=ea[r],u=i.interleaved,u!==null){i.interleaved=null;var f=u.next,p=i.pending;if(p!==null){var k=p.next;p.next=f,u.next=k}i.pending=u}ea=null}return e}function mp(e,r){do{var i=zt;try{if(jd(),Vu.current=Hu,zu){for(var u=jt.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}zu=!1}if(na=0,qt=Wt=jt=null,_l=!1,Nl=0,uf.current=null,i===null||i.return===null){Ht=1,bl=r,zt=null;break}e:{var p=e,k=i.return,R=i,P=r;if(r=nn,R.flags|=32768,P!==null&&typeof P=="object"&&typeof P.then=="function"){var X=P,oe=R,ce=oe.tag;if((oe.mode&1)===0&&(ce===0||ce===11||ce===15)){var ie=oe.alternate;ie?(oe.updateQueue=ie.updateQueue,oe.memoizedState=ie.memoizedState,oe.lanes=ie.lanes):(oe.updateQueue=null,oe.memoizedState=null)}var we=Um(k);if(we!==null){we.flags&=-257,Vm(we,k,R,p,r),we.mode&1&&Pm(p,X,r),r=we,P=X;var Te=r.updateQueue;if(Te===null){var Oe=new Set;Oe.add(P),r.updateQueue=Oe}else Te.add(P);break e}else{if((r&1)===0){Pm(p,X,r),vf();break e}P=Error(s(426))}}else if(Et&&R.mode&1){var Pt=Um(k);if(Pt!==null){(Pt.flags&65536)===0&&(Pt.flags|=256),Vm(Pt,k,R,p,r),Od(no(P,R));break e}}p=P=no(P,R),Ht!==4&&(Ht=2),jl===null?jl=[p]:jl.push(p),p=k;do{switch(p.tag){case 3:p.flags|=65536,r&=-r,p.lanes|=r;var G=Fm(p,P,r);um(p,G);break e;case 1:R=P;var z=p.type,K=p.stateNode;if((p.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(ii===null||!ii.has(K)))){p.flags|=65536,r&=-r,p.lanes|=r;var de=Am(p,R,r);um(p,de);break e}}p=p.return}while(p!==null)}gp(i)}catch(Re){r=Re,zt===i&&i!==null&&(zt=i=i.return);continue}break}while(!0)}function pp(){var e=Gu.current;return Gu.current=Hu,e===null?Hu:e}function vf(){(Ht===0||Ht===3||Ht===2)&&(Ht=4),Qt===null||(ra&268435455)===0&&(Ku&268435455)===0||li(Qt,nn)}function rc(e,r){var i=at;at|=2;var u=pp();(Qt!==e||nn!==r)&&(ps=null,ia(e,r));do try{Qv();break}catch(f){mp(e,f)}while(!0);if(jd(),at=i,Gu.current=u,zt!==null)throw Error(s(261));return Qt=null,nn=0,Ht}function Qv(){for(;zt!==null;)yp(zt)}function Yv(){for(;zt!==null&&!We();)yp(zt)}function yp(e){var r=wp(e.alternate,e,An);e.memoizedProps=e.pendingProps,r===null?gp(e):zt=r,uf.current=null}function gp(e){var r=e;do{var i=r.alternate;if(e=r.return,(r.flags&32768)===0){if(i=zv(i,r,An),i!==null){zt=i;return}}else{if(i=$v(i,r),i!==null){i.flags&=32767,zt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ht=6,zt=null;return}}if(r=r.sibling,r!==null){zt=r;return}zt=r=e}while(r!==null);Ht===0&&(Ht=5)}function aa(e,r,i){var u=ut,f=Jn.transition;try{Jn.transition=null,ut=1,Gv(e,r,i,u)}finally{Jn.transition=f,ut=u}return null}function Gv(e,r,i,u){do ao();while(ai!==null);if((at&6)!==0)throw Error(s(327));i=e.finishedWork;var f=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(au(e,p),e===Qt&&(zt=Qt=null,nn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Ju||(Ju=!0,Sp(Di,function(){return ao(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Jn.transition,Jn.transition=null;var k=ut;ut=1;var R=at;at|=4,uf.current=null,Hv(e,i),op(i,e),Sd(o),fr=!!g,o=g=null,e.current=i,Bv(i),Tr(),at=R,ut=k,Jn.transition=p}else e.current=i;if(Ju&&(Ju=!1,ai=e,ec=f),p=e.pendingLanes,p===0&&(ii=null),Zo(i.stateNode),Nn(e,wt()),r!==null)for(u=e.onRecoverableError,i=0;i<r.length;i++)f=r[i],u(f.value,{componentStack:f.stack,digest:f.digest});if(Xu)throw Xu=!1,e=ff,ff=null,e;return(ec&1)!==0&&e.tag!==0&&ao(),p=e.pendingLanes,(p&1)!==0?e===hf?Rl++:(Rl=0,hf=e):Rl=0,ti(),null}function ao(){if(ai!==null){var e=Mi(ec),r=Jn.transition,i=ut;try{if(Jn.transition=null,ut=16>e?16:e,ai===null)var u=!1;else{if(e=ai,ai=null,ec=0,(at&6)!==0)throw Error(s(331));var f=at;for(at|=4,Ne=e.current;Ne!==null;){var p=Ne,k=p.child;if((Ne.flags&16)!==0){var R=p.deletions;if(R!==null){for(var P=0;P<R.length;P++){var X=R[P];for(Ne=X;Ne!==null;){var oe=Ne;switch(oe.tag){case 0:case 11:case 15:Ol(8,oe,p)}var ce=oe.child;if(ce!==null)ce.return=oe,Ne=ce;else for(;Ne!==null;){oe=Ne;var ie=oe.sibling,we=oe.return;if(np(oe),oe===X){Ne=null;break}if(ie!==null){ie.return=we,Ne=ie;break}Ne=we}}}var Te=p.alternate;if(Te!==null){var Oe=Te.child;if(Oe!==null){Te.child=null;do{var Pt=Oe.sibling;Oe.sibling=null,Oe=Pt}while(Oe!==null)}}Ne=p}}if((p.subtreeFlags&2064)!==0&&k!==null)k.return=p,Ne=k;else e:for(;Ne!==null;){if(p=Ne,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Ol(9,p,p.return)}var G=p.sibling;if(G!==null){G.return=p.return,Ne=G;break e}Ne=p.return}}var z=e.current;for(Ne=z;Ne!==null;){k=Ne;var K=k.child;if((k.subtreeFlags&2064)!==0&&K!==null)K.return=k,Ne=K;else e:for(k=z;Ne!==null;){if(R=Ne,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Yu(9,R)}}catch(Re){Lt(R,R.return,Re)}if(R===k){Ne=null;break e}var de=R.sibling;if(de!==null){de.return=R.return,Ne=de;break e}Ne=R.return}}if(at=f,ti(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(ba,e)}catch{}u=!0}return u}finally{ut=i,Jn.transition=r}}return!1}function vp(e,r,i){r=no(i,r),r=Fm(e,r,1),e=ri(e,r,1),r=gn(),e!==null&&(es(e,1,r),Nn(e,r))}function Lt(e,r,i){if(e.tag===3)vp(e,e,i);else for(;r!==null;){if(r.tag===3){vp(r,e,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ii===null||!ii.has(u))){e=no(i,e),e=Am(r,e,1),r=ri(r,e,1),e=gn(),r!==null&&(es(r,1,e),Nn(r,e));break}}r=r.return}}function Kv(e,r,i){var u=e.pingCache;u!==null&&u.delete(r),r=gn(),e.pingedLanes|=e.suspendedLanes&i,Qt===e&&(nn&i)===i&&(Ht===4||Ht===3&&(nn&130023424)===nn&&500>wt()-df?ia(e,0):cf|=i),Nn(e,r)}function xp(e,r){r===0&&((e.mode&1)===0?r=1:(r=Rs,Rs<<=1,(Rs&130023424)===0&&(Rs=4194304)));var i=gn();e=fs(e,r),e!==null&&(es(e,r,i),Nn(e,i))}function Xv(e){var r=e.memoizedState,i=0;r!==null&&(i=r.retryLane),xp(e,i)}function Jv(e,r){var i=0;switch(e.tag){case 13:var u=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(s(314))}u!==null&&u.delete(r),xp(e,i)}var wp;wp=function(e,r,i){if(e!==null)if(e.memoizedProps!==r.pendingProps||wn.current)kn=!0;else{if((e.lanes&i)===0&&(r.flags&128)===0)return kn=!1,Vv(e,r,i);kn=(e.flags&131072)!==0}else kn=!1,Et&&(r.flags&1048576)!==0&&Jh(r,Du,r.index);switch(r.lanes=0,r.tag){case 2:var u=r.type;qu(e,r),e=r.pendingProps;var f=Qa(r,on.current);eo(r,i),f=zd(null,r,u,e,f,i);var p=$d();return r.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Sn(u)?(p=!0,bu(r)):p=!1,r.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Id(r),f.updater=Bu,r.stateNode=f,f._reactInternals=r,Qd(r,u,e,i),r=Xd(null,r,u,!0,p,i)):(r.tag=0,Et&&p&&Nd(r),yn(null,r,f,i),r=r.child),r;case 16:u=r.elementType;e:{switch(qu(e,r),e=r.pendingProps,f=u._init,u=f(u._payload),r.type=u,f=r.tag=t0(u),e=gr(u,e),f){case 0:r=Kd(null,r,u,e,i);break e;case 1:r=Zm(null,r,u,e,i);break e;case 11:r=zm(null,r,u,e,i);break e;case 14:r=$m(null,r,u,gr(u.type,e),i);break e}throw Error(s(306,u,""))}return r;case 0:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),Kd(e,r,u,f,i);case 1:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),Zm(e,r,u,f,i);case 3:e:{if(qm(r),e===null)throw Error(s(387));u=r.pendingProps,p=r.memoizedState,f=p.element,lm(e,r),Pu(r,u,null,i);var k=r.memoizedState;if(u=k.element,p.isDehydrated)if(p={element:u,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){f=no(Error(s(423)),r),r=Qm(e,r,u,i,f);break e}else if(u!==f){f=no(Error(s(424)),r),r=Qm(e,r,u,i,f);break e}else for(Fn=ae(r.stateNode.containerInfo.firstChild),Ln=r,Et=!0,yr=null,i=am(r,null,u,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ka(),u===f){r=ms(e,r,i);break e}yn(e,r,u,i)}r=r.child}return r;case 5:return dm(r),e===null&&Cd(r),u=r.type,f=r.pendingProps,p=e!==null?e.memoizedProps:null,k=f.children,m(u,f)?k=null:p!==null&&m(u,p)&&(r.flags|=32),Bm(e,r),yn(e,r,k,i),r.child;case 6:return e===null&&Cd(r),null;case 13:return Ym(e,r,i);case 4:return Ld(r,r.stateNode.containerInfo),u=r.pendingProps,e===null?r.child=Xa(r,null,u,i):yn(e,r,u,i),r.child;case 11:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),zm(e,r,u,f,i);case 7:return yn(e,r,r.pendingProps,i),r.child;case 8:return yn(e,r,r.pendingProps.children,i),r.child;case 12:return yn(e,r,r.pendingProps.children,i),r.child;case 10:e:{if(u=r.type._context,f=r.pendingProps,p=r.memoizedProps,k=f.value,ct(Lu,u._currentValue),u._currentValue=k,p!==null)if(Ot(p.value,k)){if(p.children===f.children&&!wn.current){r=ms(e,r,i);break e}}else for(p=r.child,p!==null&&(p.return=r);p!==null;){var R=p.dependencies;if(R!==null){k=p.child;for(var P=R.firstContext;P!==null;){if(P.context===u){if(p.tag===1){P=hs(-1,i&-i),P.tag=2;var X=p.updateQueue;if(X!==null){X=X.shared;var oe=X.pending;oe===null?P.next=P:(P.next=oe.next,oe.next=P),X.pending=P}}p.lanes|=i,P=p.alternate,P!==null&&(P.lanes|=i),Dd(p.return,i,r),R.lanes|=i;break}P=P.next}}else if(p.tag===10)k=p.type===r.type?null:p.child;else if(p.tag===18){if(k=p.return,k===null)throw Error(s(341));k.lanes|=i,R=k.alternate,R!==null&&(R.lanes|=i),Dd(k,i,r),k=p.sibling}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===r){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}yn(e,r,f.children,i),r=r.child}return r;case 9:return f=r.type,u=r.pendingProps.children,eo(r,i),f=Kn(f),u=u(f),r.flags|=1,yn(e,r,u,i),r.child;case 14:return u=r.type,f=gr(u,r.pendingProps),f=gr(u.type,f),$m(e,r,u,f,i);case 15:return Wm(e,r,r.type,r.pendingProps,i);case 17:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),qu(e,r),r.tag=1,Sn(u)?(e=!0,bu(r)):e=!1,eo(r,i),Im(r,u,f),Qd(r,u,f,i),Xd(null,r,u,!0,e,i);case 19:return Km(e,r,i);case 22:return Hm(e,r,i)}throw Error(s(156,r.tag))};function Sp(e,r){return zo(e,r)}function e0(e,r,i,u){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function er(e,r,i,u){return new e0(e,r,i,u)}function xf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function t0(e){if(typeof e=="function")return xf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ve)return 11;if(e===Pe)return 14}return 2}function ui(e,r){var i=e.alternate;return i===null?(i=er(e.tag,r,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=r,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,r=e.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function sc(e,r,i,u,f,p){var k=2;if(u=e,typeof e=="function")xf(e)&&(k=1);else if(typeof e=="string")k=5;else e:switch(e){case se:return oa(i.children,f,p,r);case me:k=8,f|=8;break;case ye:return e=er(12,i,r,f|2),e.elementType=ye,e.lanes=p,e;case he:return e=er(13,i,r,f),e.elementType=he,e.lanes=p,e;case Me:return e=er(19,i,r,f),e.elementType=Me,e.lanes=p,e;case $e:return ic(i,f,p,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ke:k=10;break e;case pe:k=9;break e;case ve:k=11;break e;case Pe:k=14;break e;case Xe:k=16,u=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return r=er(k,i,r,f),r.elementType=e,r.type=u,r.lanes=p,r}function oa(e,r,i,u){return e=er(7,e,u,r),e.lanes=i,e}function ic(e,r,i,u){return e=er(22,e,u,r),e.elementType=$e,e.lanes=i,e.stateNode={isHidden:!1},e}function wf(e,r,i){return e=er(6,e,null,r),e.lanes=i,e}function Sf(e,r,i){return r=er(4,e.children!==null?e.children:[],e.key,r),r.lanes=i,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function n0(e,r,i,u,f){this.tag=r,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=Jr(0),this.expirationTimes=Jr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jr(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function kf(e,r,i,u,f,p,k,R,P){return e=new n0(e,r,i,R,P),r===1?(r=1,p===!0&&(r|=8)):r=0,p=er(3,null,null,r),e.current=p,p.stateNode=e,p.memoizedState={element:u,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Id(p),e}function r0(e,r,i){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:J,key:u==null?null:""+u,children:e,containerInfo:r,implementation:i}}function kp(e){if(!e)return Lr;e=e._reactInternals;e:{if(Er(e)!==e||e.tag!==1)throw Error(s(170));var r=e;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Sn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(Sn(i))return Gh(e,i,r)}return r}function _p(e,r,i,u,f,p,k,R,P){return e=kf(i,u,!0,e,f,p,k,R,P),e.context=kp(null),i=e.current,u=gn(),f=oi(i),p=hs(u,f),p.callback=r??null,ri(i,p,f),e.current.lanes=f,es(e,f,u),Nn(e,u),e}function ac(e,r,i,u){var f=r.current,p=gn(),k=oi(f);return i=kp(i),r.context===null?r.context=i:r.pendingContext=i,r=hs(p,k),r.payload={element:e},u=u===void 0?null:u,u!==null&&(r.callback=u),e=ri(f,r,k),e!==null&&(wr(e,f,k,p),Au(e,f,k)),k}function oc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Np(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<r?i:r}}function _f(e,r){Np(e,r),(e=e.alternate)&&Np(e,r)}function s0(){return null}var Ep=typeof reportError=="function"?reportError:function(e){console.error(e)};function Nf(e){this._internalRoot=e}lc.prototype.render=Nf.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(s(409));ac(e,r,null,null)},lc.prototype.unmount=Nf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;sa(function(){ac(null,e,null,null)}),r[mt]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var r=Qo();e={blockedOn:null,target:e,priority:r};for(var i=0;i<jr.length&&r!==0&&r<jr[i].priority;i++);jr.splice(i,0,e),i===0&&uu(e)}};function Ef(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Tp(){}function i0(e,r,i,u,f){if(f){if(typeof u=="function"){var p=u;u=function(){var X=oc(k);p.call(X)}}var k=_p(r,u,e,0,null,!1,!1,"",Tp);return e._reactRootContainer=k,e[mt]=k.current,Bi(e.nodeType===8?e.parentNode:e),sa(),k}for(;f=e.lastChild;)e.removeChild(f);if(typeof u=="function"){var R=u;u=function(){var X=oc(P);R.call(X)}}var P=kf(e,0,!1,null,null,!1,!1,"",Tp);return e._reactRootContainer=P,e[mt]=P.current,Bi(e.nodeType===8?e.parentNode:e),sa(function(){ac(r,P,i,u)}),P}function cc(e,r,i,u,f){var p=i._reactRootContainer;if(p){var k=p;if(typeof f=="function"){var R=f;f=function(){var P=oc(k);R.call(P)}}ac(r,k,e,f)}else k=i0(i,r,e,f,u);return oc(k)}Ls=function(e){switch(e.tag){case 3:var r=e.stateNode;if(r.current.memoizedState.isDehydrated){var i=Xr(r.pendingLanes);i!==0&&(Is(r,i|1),Nn(r,wt()),(at&6)===0&&(io=wt()+500,ti()))}break;case 13:sa(function(){var u=fs(e,1);if(u!==null){var f=gn();wr(u,e,1,f)}}),_f(e,1)}},Fs=function(e){if(e.tag===13){var r=fs(e,134217728);if(r!==null){var i=gn();wr(r,e,134217728,i)}_f(e,134217728)}},ou=function(e){if(e.tag===13){var r=oi(e),i=fs(e,r);if(i!==null){var u=gn();wr(i,e,r,u)}_f(e,r)}},Qo=function(){return ut},lu=function(e,r){var i=ut;try{return ut=e,r()}finally{ut=i}},xt=function(e,r,i){switch(r){case"input":if(Hn(e,i),r=i.name,i.type==="radio"&&r!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<i.length;r++){var u=i[r];if(u!==e&&u.form===e.form){var f=Gi(u);if(!f)throw Error(s(90));sr(u),Hn(u,f)}}}break;case"textarea":Yr(e,i);break;case"select":r=i.value,r!=null&&Dn(e,!!i.multiple,r,!1)}},Ri=yf,Cs=sa;var a0={usingClientEntryPoint:!1,Events:[Xs,Js,Gi,ji,Ts,yf]},Dl={findFiberByHostInstance:In,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},o0={bundleType:Dl.bundleType,version:Dl.version,rendererPackageName:Dl.rendererPackageName,rendererConfig:Dl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:U.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=su(e),e===null?null:e.stateNode},findFiberByHostInstance:Dl.findFiberByHostInstance||s0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dc.isDisabled&&dc.supportsFiber)try{ba=dc.inject(o0),en=dc}catch{}}return En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a0,En.createPortal=function(e,r){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ef(r))throw Error(s(200));return r0(e,r,null,i)},En.createRoot=function(e,r){if(!Ef(e))throw Error(s(299));var i=!1,u="",f=Ep;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onRecoverableError!==void 0&&(f=r.onRecoverableError)),r=kf(e,1,!1,null,null,i,!1,u,f),e[mt]=r.current,Bi(e.nodeType===8?e.parentNode:e),new Nf(r)},En.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=su(r),e=e===null?null:e.stateNode,e},En.flushSync=function(e){return sa(e)},En.hydrate=function(e,r,i){if(!uc(r))throw Error(s(200));return cc(null,e,r,!0,i)},En.hydrateRoot=function(e,r,i){if(!Ef(e))throw Error(s(405));var u=i!=null&&i.hydratedSources||null,f=!1,p="",k=Ep;if(i!=null&&(i.unstable_strictMode===!0&&(f=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),r=_p(r,null,e,1,i??null,f,!1,p,k),e[mt]=r.current,Bi(e),u)for(e=0;e<u.length;e++)i=u[e],f=i._getVersion,f=f(i._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[i,f]:r.mutableSourceEagerHydrationData.push(i,f);return new lc(r)},En.render=function(e,r,i){if(!uc(r))throw Error(s(200));return cc(null,e,r,!1,i)},En.unmountComponentAtNode=function(e){if(!uc(e))throw Error(s(40));return e._reactRootContainer?(sa(function(){cc(null,null,e,!1,function(){e._reactRootContainer=null,e[mt]=null})}),!0):!1},En.unstable_batchedUpdates=yf,En.unstable_renderSubtreeIntoContainer=function(e,r,i,u){if(!uc(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return cc(e,r,i,!1,u)},En.version="18.3.1-next-f1338f8080-20240426",En}var Lp;function ag(){if(Lp)return bf.exports;Lp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),bf.exports=v0(),bf.exports}var Fp;function x0(){if(Fp)return hc;Fp=1;var t=ag();return hc.createRoot=t.createRoot,hc.hydrateRoot=t.hydrateRoot,hc}var w0=x0();ag();/**
 * @remix-run/router v1.23.3
 *
 * 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 Pl(){return Pl=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)({}).hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},Pl.apply(null,arguments)}var ki;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ki||(ki={}));const Ap="popstate";function S0(t){t===void 0&&(t={});function n(a,l){let{pathname:c,search:h,hash:y}=a.location;return Yf("",{pathname:c,search:h,hash:y},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function s(a,l){return typeof l=="string"?l:Sc(l)}return _0(n,s,null,t)}function Dt(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function Oh(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function k0(){return Math.random().toString(36).substr(2,8)}function Pp(t,n){return{usr:t.state,key:t.key,idx:n}}function Yf(t,n,s,a){return s===void 0&&(s=null),Pl({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof n=="string"?Mo(n):n,{state:s,key:n&&n.key||a||k0()})}function Sc(t){let{pathname:n="/",search:s="",hash:a=""}=t;return s&&s!=="?"&&(n+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function Mo(t){let n={};if(t){let s=t.indexOf("#");s>=0&&(n.hash=t.substr(s),t=t.substr(0,s));let a=t.indexOf("?");a>=0&&(n.search=t.substr(a),t=t.substr(0,a)),t&&(n.pathname=t)}return n}function _0(t,n,s,a){a===void 0&&(a={});let{window:l=document.defaultView,v5Compat:c=!1}=a,h=l.history,y=ki.Pop,x=null,w=E();w==null&&(w=0,h.replaceState(Pl({},h.state,{idx:w}),""));function E(){return(h.state||{idx:null}).idx}function O(){y=ki.Pop;let b=E(),I=b==null?null:b-w;w=b,x&&x({action:y,location:T.location,delta:I})}function _(b,I){y=ki.Push;let j=Yf(T.location,b,I);w=E()+1;let F=Pp(j,w),U=T.createHref(j);try{h.pushState(F,"",U)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;l.location.assign(U)}c&&x&&x({action:y,location:T.location,delta:1})}function S(b,I){y=ki.Replace;let j=Yf(T.location,b,I);w=E();let F=Pp(j,w),U=T.createHref(j);h.replaceState(F,"",U),c&&x&&x({action:y,location:T.location,delta:0})}function C(b){let I=l.location.origin!=="null"?l.location.origin:l.location.href,j=typeof b=="string"?b:Sc(b);return j=j.replace(/ $/,"%20"),Dt(I,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,I)}let T={get action(){return y},get location(){return t(l,h)},listen(b){if(x)throw new Error("A history only accepts one active listener");return l.addEventListener(Ap,O),x=b,()=>{l.removeEventListener(Ap,O),x=null}},createHref(b){return n(l,b)},createURL:C,encodeLocation(b){let I=C(b);return{pathname:I.pathname,search:I.search,hash:I.hash}},push:_,replace:S,go(b){return h.go(b)}};return T}var Up;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Up||(Up={}));function N0(t,n,s){return s===void 0&&(s="/"),E0(t,n,s)}function E0(t,n,s,a){let l=typeof n=="string"?Mo(n):n,c=Co(l.pathname||"/",s);if(c==null)return null;let h=og(t);T0(h);let y=null,x=A0(c);for(let w=0;y==null&&w<h.length;++w)y=L0(h[w],x);return y}function og(t,n,s,a){n===void 0&&(n=[]),s===void 0&&(s=[]),a===void 0&&(a="");let l=(c,h,y)=>{let x={relativePath:y===void 0?c.path||"":y,caseSensitive:c.caseSensitive===!0,childrenIndex:h,route:c};x.relativePath.startsWith("/")&&(Dt(x.relativePath.startsWith(a),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(a.length));let w=Ei([a,x.relativePath]),E=s.concat(x);c.children&&c.children.length>0&&(Dt(c.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+w+'".')),og(c.children,n,E,w)),!(c.path==null&&!c.index)&&n.push({path:w,score:M0(w,c.index),routesMeta:E})};return t.forEach((c,h)=>{var y;if(c.path===""||!((y=c.path)!=null&&y.includes("?")))l(c,h);else for(let x of lg(c.path))l(c,h,x)}),n}function lg(t){let n=t.split("/");if(n.length===0)return[];let[s,...a]=n,l=s.endsWith("?"),c=s.replace(/\?$/,"");if(a.length===0)return l?[c,""]:[c];let h=lg(a.join("/")),y=[];return y.push(...h.map(x=>x===""?c:[c,x].join("/"))),l&&y.push(...h),y.map(x=>t.startsWith("/")&&x===""?"/":x)}function T0(t){t.sort((n,s)=>n.score!==s.score?s.score-n.score:I0(n.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}const C0=/^:[\w-]+$/,O0=3,b0=2,j0=1,R0=10,D0=-2,Vp=t=>t==="*";function M0(t,n){let s=t.split("/"),a=s.length;return s.some(Vp)&&(a+=D0),n&&(a+=b0),s.filter(l=>!Vp(l)).reduce((l,c)=>l+(C0.test(c)?O0:c===""?j0:R0),a)}function I0(t,n){return t.length===n.length&&t.slice(0,-1).every((a,l)=>a===n[l])?t[t.length-1]-n[n.length-1]:0}function L0(t,n,s){let{routesMeta:a}=t,l={},c="/",h=[];for(let y=0;y<a.length;++y){let x=a[y],w=y===a.length-1,E=c==="/"?n:n.slice(c.length)||"/",O=Gf({path:x.relativePath,caseSensitive:x.caseSensitive,end:w},E),_=x.route;if(!O)return null;Object.assign(l,O.params),h.push({params:l,pathname:Ei([c,O.pathname]),pathnameBase:$0(Ei([c,O.pathnameBase])),route:_}),O.pathnameBase!=="/"&&(c=Ei([c,O.pathnameBase]))}return h}function Gf(t,n){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[s,a]=F0(t.path,t.caseSensitive,t.end),l=n.match(s);if(!l)return null;let c=l[0],h=c.replace(/(.)\/+$/,"$1"),y=l.slice(1);return{params:a.reduce((w,E,O)=>{let{paramName:_,isOptional:S}=E;if(_==="*"){let T=y[O]||"";h=c.slice(0,c.length-T.length).replace(/(.)\/+$/,"$1")}const C=y[O];return S&&!C?w[_]=void 0:w[_]=(C||"").replace(/%2F/g,"/"),w},{}),pathname:c,pathnameBase:h,pattern:t}}function F0(t,n,s){n===void 0&&(n=!1),s===void 0&&(s=!0),Oh(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let a=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,y,x)=>(a.push({paramName:y,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),a]}function A0(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Oh(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+n+").")),t}}function Co(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let s=n.endsWith("/")?n.length-1:n.length,a=t.charAt(s);return a&&a!=="/"?null:t.slice(s)||"/"}const P0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,U0=t=>P0.test(t);function V0(t,n){n===void 0&&(n="/");let{pathname:s,search:a="",hash:l=""}=typeof t=="string"?Mo(t):t,c;if(s)if(U0(s))c=s;else{if(s.includes("//")){let h=s;s=ug(s),Oh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(h+" -> "+s))}s.startsWith("/")?c=zp(s.substring(1),"/"):c=zp(s,n)}else c=n;return{pathname:c,search:W0(a),hash:H0(l)}}function zp(t,n){let s=n.replace(/\/+$/,"").split("/");return t.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Df(t,n,s,a){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+n+"` field ["+JSON.stringify(a)+"].  Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function z0(t){return t.filter((n,s)=>s===0||n.route.path&&n.route.path.length>0)}function bh(t,n){let s=z0(t);return n?s.map((a,l)=>l===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function jh(t,n,s,a){a===void 0&&(a=!1);let l;typeof t=="string"?l=Mo(t):(l=Pl({},t),Dt(!l.pathname||!l.pathname.includes("?"),Df("?","pathname","search",l)),Dt(!l.pathname||!l.pathname.includes("#"),Df("#","pathname","hash",l)),Dt(!l.search||!l.search.includes("#"),Df("#","search","hash",l)));let c=t===""||l.pathname==="",h=c?"/":l.pathname,y;if(h==null)y=s;else{let O=n.length-1;if(!a&&h.startsWith("..")){let _=h.split("/");for(;_[0]==="..";)_.shift(),O-=1;l.pathname=_.join("/")}y=O>=0?n[O]:"/"}let x=V0(l,y),w=h&&h!=="/"&&h.endsWith("/"),E=(c||h===".")&&s.endsWith("/");return!x.pathname.endsWith("/")&&(w||E)&&(x.pathname+="/"),x}const ug=t=>t.replace(/\/\/+/g,"/"),Ei=t=>ug(t.join("/")),$0=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W0=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,H0=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function B0(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const cg=["post","put","patch","delete"];new Set(cg);const Z0=["get",...cg];new Set(Z0);/**
 * React Router v6.30.4
 *
 * 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 Ul(){return Ul=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)({}).hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},Ul.apply(null,arguments)}const Mc=Z.createContext(null),dg=Z.createContext(null),Ns=Z.createContext(null),Ic=Z.createContext(null),Es=Z.createContext({outlet:null,matches:[],isDataRoute:!1}),fg=Z.createContext(null);function q0(t,n){let{relative:s}=n===void 0?{}:n;Io()||Dt(!1);let{basename:a,navigator:l}=Z.useContext(Ns),{hash:c,pathname:h,search:y}=Fc(t,{relative:s}),x=h;return a!=="/"&&(x=h==="/"?a:Ei([a,h])),l.createHref({pathname:x,search:y,hash:c})}function Io(){return Z.useContext(Ic)!=null}function Na(){return Io()||Dt(!1),Z.useContext(Ic).location}function hg(t){Z.useContext(Ns).static||Z.useLayoutEffect(t)}function Lc(){let{isDataRoute:t}=Z.useContext(Es);return t?lx():Q0()}function Q0(){Io()||Dt(!1);let t=Z.useContext(Mc),{basename:n,future:s,navigator:a}=Z.useContext(Ns),{matches:l}=Z.useContext(Es),{pathname:c}=Na(),h=JSON.stringify(bh(l,s.v7_relativeSplatPath)),y=Z.useRef(!1);return hg(()=>{y.current=!0}),Z.useCallback(function(w,E){if(E===void 0&&(E={}),!y.current)return;if(typeof w=="number"){a.go(w);return}let O=jh(w,JSON.parse(h),c,E.relative==="path");t==null&&n!=="/"&&(O.pathname=O.pathname==="/"?n:Ei([n,O.pathname])),(E.replace?a.replace:a.push)(O,E.state,E)},[n,a,h,c,t])}const Y0=Z.createContext(null);function G0(t){let n=Z.useContext(Es).outlet;return n&&Z.createElement(Y0.Provider,{value:t},n)}function Fc(t,n){let{relative:s}=n===void 0?{}:n,{future:a}=Z.useContext(Ns),{matches:l}=Z.useContext(Es),{pathname:c}=Na(),h=JSON.stringify(bh(l,a.v7_relativeSplatPath));return Z.useMemo(()=>jh(t,JSON.parse(h),c,s==="path"),[t,h,c,s])}function K0(t,n){return X0(t,n)}function X0(t,n,s,a){Io()||Dt(!1);let{navigator:l}=Z.useContext(Ns),{matches:c}=Z.useContext(Es),h=c[c.length-1],y=h?h.params:{};h&&h.pathname;let x=h?h.pathnameBase:"/";h&&h.route;let w=Na(),E;if(n){var O;let b=typeof n=="string"?Mo(n):n;x==="/"||(O=b.pathname)!=null&&O.startsWith(x)||Dt(!1),E=b}else E=w;let _=E.pathname||"/",S=_;if(x!=="/"){let b=x.replace(/^\//,"").split("/");S="/"+_.replace(/^\//,"").split("/").slice(b.length).join("/")}let C=N0(t,{pathname:S}),T=rx(C&&C.map(b=>Object.assign({},b,{params:Object.assign({},y,b.params),pathname:Ei([x,l.encodeLocation?l.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?x:Ei([x,l.encodeLocation?l.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),c,s,a);return n&&T?Z.createElement(Ic.Provider,{value:{location:Ul({pathname:"/",search:"",hash:"",state:null,key:"default"},E),navigationType:ki.Pop}},T):T}function J0(){let t=ox(),n=B0(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),s=t instanceof Error?t.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return Z.createElement(Z.Fragment,null,Z.createElement("h2",null,"Unexpected Application Error!"),Z.createElement("h3",{style:{fontStyle:"italic"}},n),s?Z.createElement("pre",{style:l},s):null,null)}const ex=Z.createElement(J0,null);class tx extends Z.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,s){return s.location!==n.location||s.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:s.error,location:s.location,revalidation:n.revalidation||s.revalidation}}componentDidCatch(n,s){console.error("React Router caught the following error during render",n,s)}render(){return this.state.error!==void 0?Z.createElement(Es.Provider,{value:this.props.routeContext},Z.createElement(fg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nx(t){let{routeContext:n,match:s,children:a}=t,l=Z.useContext(Mc);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),Z.createElement(Es.Provider,{value:n},a)}function rx(t,n,s,a){var l;if(n===void 0&&(n=[]),s===void 0&&(s=null),a===void 0&&(a=null),t==null){var c;if(!s)return null;if(s.errors)t=s.matches;else if((c=a)!=null&&c.v7_partialHydration&&n.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let h=t,y=(l=s)==null?void 0:l.errors;if(y!=null){let E=h.findIndex(O=>O.route.id&&(y==null?void 0:y[O.route.id])!==void 0);E>=0||Dt(!1),h=h.slice(0,Math.min(h.length,E+1))}let x=!1,w=-1;if(s&&a&&a.v7_partialHydration)for(let E=0;E<h.length;E++){let O=h[E];if((O.route.HydrateFallback||O.route.hydrateFallbackElement)&&(w=E),O.route.id){let{loaderData:_,errors:S}=s,C=O.route.loader&&_[O.route.id]===void 0&&(!S||S[O.route.id]===void 0);if(O.route.lazy||C){x=!0,w>=0?h=h.slice(0,w+1):h=[h[0]];break}}}return h.reduceRight((E,O,_)=>{let S,C=!1,T=null,b=null;s&&(S=y&&O.route.id?y[O.route.id]:void 0,T=O.route.errorElement||ex,x&&(w<0&&_===0?(ux("route-fallback"),C=!0,b=null):w===_&&(C=!0,b=O.route.hydrateFallbackElement||null)));let I=n.concat(h.slice(0,_+1)),j=()=>{let F;return S?F=T:C?F=b:O.route.Component?F=Z.createElement(O.route.Component,null):O.route.element?F=O.route.element:F=E,Z.createElement(nx,{match:O,routeContext:{outlet:E,matches:I,isDataRoute:s!=null},children:F})};return s&&(O.route.ErrorBoundary||O.route.errorElement||_===0)?Z.createElement(tx,{location:s.location,revalidation:s.revalidation,component:T,error:S,children:j(),routeContext:{outlet:null,matches:I,isDataRoute:!0}}):j()},null)}var mg=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(mg||{}),pg=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(pg||{});function sx(t){let n=Z.useContext(Mc);return n||Dt(!1),n}function ix(t){let n=Z.useContext(dg);return n||Dt(!1),n}function ax(t){let n=Z.useContext(Es);return n||Dt(!1),n}function yg(t){let n=ax(),s=n.matches[n.matches.length-1];return s.route.id||Dt(!1),s.route.id}function ox(){var t;let n=Z.useContext(fg),s=ix(),a=yg();return n!==void 0?n:(t=s.errors)==null?void 0:t[a]}function lx(){let{router:t}=sx(mg.UseNavigateStable),n=yg(pg.UseNavigateStable),s=Z.useRef(!1);return hg(()=>{s.current=!0}),Z.useCallback(function(l,c){c===void 0&&(c={}),s.current&&(typeof l=="number"?t.navigate(l):t.navigate(l,Ul({fromRouteId:n},c)))},[t,n])}const $p={};function ux(t,n,s){$p[t]||($p[t]=!0)}function cx(t,n){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function dx(t){let{to:n,replace:s,state:a,relative:l}=t;Io()||Dt(!1);let{future:c,static:h}=Z.useContext(Ns),{matches:y}=Z.useContext(Es),{pathname:x}=Na(),w=Lc(),E=jh(n,bh(y,c.v7_relativeSplatPath),x,l==="path"),O=JSON.stringify(E);return Z.useEffect(()=>w(JSON.parse(O),{replace:s,state:a,relative:l}),[w,O,l,s,a]),null}function fx(t){return G0(t.context)}function ua(t){Dt(!1)}function hx(t){let{basename:n="/",children:s=null,location:a,navigationType:l=ki.Pop,navigator:c,static:h=!1,future:y}=t;Io()&&Dt(!1);let x=n.replace(/^\/*/,"/"),w=Z.useMemo(()=>({basename:x,navigator:c,static:h,future:Ul({v7_relativeSplatPath:!1},y)}),[x,y,c,h]);typeof a=="string"&&(a=Mo(a));let{pathname:E="/",search:O="",hash:_="",state:S=null,key:C="default"}=a,T=Z.useMemo(()=>{let b=Co(E,x);return b==null?null:{location:{pathname:b,search:O,hash:_,state:S,key:C},navigationType:l}},[x,E,O,_,S,C,l]);return T==null?null:Z.createElement(Ns.Provider,{value:w},Z.createElement(Ic.Provider,{children:s,value:T}))}function mx(t){let{children:n,location:s}=t;return K0(Kf(n),s)}new Promise(()=>{});function Kf(t,n){n===void 0&&(n=[]);let s=[];return Z.Children.forEach(t,(a,l)=>{if(!Z.isValidElement(a))return;let c=[...n,l];if(a.type===Z.Fragment){s.push.apply(s,Kf(a.props.children,c));return}a.type!==ua&&Dt(!1),!a.props.index||!a.props.children||Dt(!1);let h={id:a.props.id||c.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(h.children=Kf(a.props.children,c)),s.push(h)}),s}/**
 * React Router DOM v6.30.4
 *
 * 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 kc(){return kc=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)({}).hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},kc.apply(null,arguments)}function gg(t,n){if(t==null)return{};var s={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(n.indexOf(a)!==-1)continue;s[a]=t[a]}return s}function px(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function yx(t,n){return t.button===0&&(!n||n==="_self")&&!px(t)}function Xf(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((n,s)=>{let a=t[s];return n.concat(Array.isArray(a)?a.map(l=>[s,l]):[[s,a]])},[]))}function gx(t,n){let s=Xf(t);return n&&n.forEach((a,l)=>{s.has(l)||n.getAll(l).forEach(c=>{s.append(l,c)})}),s}const vx=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],xx=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],wx="6";try{window.__reactRouterVersion=wx}catch{}const Sx=Z.createContext({isTransitioning:!1}),kx="startTransition",Wp=p0[kx];function _x(t){let{basename:n,children:s,future:a,window:l}=t,c=Z.useRef();c.current==null&&(c.current=S0({window:l,v5Compat:!0}));let h=c.current,[y,x]=Z.useState({action:h.action,location:h.location}),{v7_startTransition:w}=a||{},E=Z.useCallback(O=>{w&&Wp?Wp(()=>x(O)):x(O)},[x,w]);return Z.useLayoutEffect(()=>h.listen(E),[h,E]),Z.useEffect(()=>cx(a),[a]),Z.createElement(hx,{basename:n,children:s,location:y.location,navigationType:y.action,navigator:h,future:a})}const Nx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ex=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ac=Z.forwardRef(function(n,s){let{onClick:a,relative:l,reloadDocument:c,replace:h,state:y,target:x,to:w,preventScrollReset:E,viewTransition:O}=n,_=gg(n,vx),{basename:S}=Z.useContext(Ns),C,T=!1;if(typeof w=="string"&&Ex.test(w)&&(C=w,Nx))try{let F=new URL(window.location.href),U=w.startsWith("//")?new URL(F.protocol+w):new URL(w),$=Co(U.pathname,S);U.origin===F.origin&&$!=null?w=$+U.search+U.hash:T=!0}catch{}let b=q0(w,{relative:l}),I=Ox(w,{replace:h,state:y,target:x,preventScrollReset:E,relative:l,viewTransition:O});function j(F){a&&a(F),F.defaultPrevented||I(F)}return Z.createElement("a",kc({},_,{href:C||b,onClick:T||c?a:j,ref:s,target:x}))}),Tx=Z.forwardRef(function(n,s){let{"aria-current":a="page",caseSensitive:l=!1,className:c="",end:h=!1,style:y,to:x,viewTransition:w,children:E}=n,O=gg(n,xx),_=Fc(x,{relative:O.relative}),S=Na(),C=Z.useContext(dg),{navigator:T,basename:b}=Z.useContext(Ns),I=C!=null&&bx(_)&&w===!0,j=T.encodeLocation?T.encodeLocation(_).pathname:_.pathname,F=S.pathname,U=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;l||(F=F.toLowerCase(),U=U?U.toLowerCase():null,j=j.toLowerCase()),U&&b&&(U=Co(U,b)||U);const $=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let J=F===j||!h&&F.startsWith(j)&&F.charAt($)==="/",se=U!=null&&(U===j||!h&&U.startsWith(j)&&U.charAt(j.length)==="/"),me={isActive:J,isPending:se,isTransitioning:I},ye=J?a:void 0,ke;typeof c=="function"?ke=c(me):ke=[c,J?"active":null,se?"pending":null,I?"transitioning":null].filter(Boolean).join(" ");let pe=typeof y=="function"?y(me):y;return Z.createElement(Ac,kc({},O,{"aria-current":ye,className:ke,ref:s,style:pe,to:x,viewTransition:w}),typeof E=="function"?E(me):E)});var Jf;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Jf||(Jf={}));var Hp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Hp||(Hp={}));function Cx(t){let n=Z.useContext(Mc);return n||Dt(!1),n}function Ox(t,n){let{target:s,replace:a,state:l,preventScrollReset:c,relative:h,viewTransition:y}=n===void 0?{}:n,x=Lc(),w=Na(),E=Fc(t,{relative:h});return Z.useCallback(O=>{if(yx(O,s)){O.preventDefault();let _=a!==void 0?a:Sc(w)===Sc(E);x(t,{replace:_,state:l,preventScrollReset:c,relative:h,viewTransition:y})}},[w,x,E,a,l,s,t,c,h,y])}function vg(t){let n=Z.useRef(Xf(t)),s=Z.useRef(!1),a=Na(),l=Z.useMemo(()=>gx(a.search,s.current?null:n.current),[a.search]),c=Lc(),h=Z.useCallback((y,x)=>{const w=Xf(typeof y=="function"?y(l):y);s.current=!0,c("?"+w,x)},[c,l]);return[l,h]}function bx(t,n){n===void 0&&(n={});let s=Z.useContext(Sx);s==null&&Dt(!1);let{basename:a}=Cx(Jf.useViewTransitionState),l=Fc(t,{relative:n.relative});if(!s.isTransitioning)return!1;let c=Co(s.currentLocation.pathname,a)||s.currentLocation.pathname,h=Co(s.nextLocation.pathname,a)||s.nextLocation.pathname;return Gf(l.pathname,h)!=null||Gf(l.pathname,c)!=null}var Lo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fa,hi,mo,Yy,jx=(Yy=class extends Lo{constructor(){super();Ie(this,fa);Ie(this,hi);Ie(this,mo);xe(this,mo,n=>{if(typeof window<"u"&&window.addEventListener){const s=()=>n();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){L(this,hi)||this.setEventListener(L(this,mo))}onUnsubscribe(){var n;this.hasListeners()||((n=L(this,hi))==null||n.call(this),xe(this,hi,void 0))}setEventListener(n){var s;xe(this,mo,n),(s=L(this,hi))==null||s.call(this),xe(this,hi,n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(n){L(this,fa)!==n&&(xe(this,fa,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(s=>{s(n)})}isFocused(){var n;return typeof L(this,fa)=="boolean"?L(this,fa):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},fa=new WeakMap,hi=new WeakMap,mo=new WeakMap,Yy),Rh=new jx,Rx={setTimeout:(t,n)=>setTimeout(t,n),clearTimeout:t=>clearTimeout(t),setInterval:(t,n)=>setInterval(t,n),clearInterval:t=>clearInterval(t)},mi,Th,Gy,Dx=(Gy=class{constructor(){Ie(this,mi,Rx);Ie(this,Th,!1)}setTimeoutProvider(t){xe(this,mi,t)}setTimeout(t,n){return L(this,mi).setTimeout(t,n)}clearTimeout(t){L(this,mi).clearTimeout(t)}setInterval(t,n){return L(this,mi).setInterval(t,n)}clearInterval(t){L(this,mi).clearInterval(t)}},mi=new WeakMap,Th=new WeakMap,Gy),da=new Dx;function Mx(t){setTimeout(t,0)}var Ix=typeof window>"u"||"Deno"in globalThis;function xn(){}function Lx(t,n){return typeof t=="function"?t(n):t}function eh(t){return typeof t=="number"&&t>=0&&t!==1/0}function xg(t,n){return Math.max(t+(n||0)-Date.now(),0)}function Ti(t,n){return typeof t=="function"?t(n):t}function Un(t,n){return typeof t=="function"?t(n):t}function Bp(t,n){const{type:s="all",exact:a,fetchStatus:l,predicate:c,queryKey:h,stale:y}=t;if(h){if(a){if(n.queryHash!==Dh(h,n.options))return!1}else if(!Vl(n.queryKey,h))return!1}if(s!=="all"){const x=n.isActive();if(s==="active"&&!x||s==="inactive"&&x)return!1}return!(typeof y=="boolean"&&n.isStale()!==y||l&&l!==n.state.fetchStatus||c&&!c(n))}function Zp(t,n){const{exact:s,status:a,predicate:l,mutationKey:c}=t;if(c){if(!n.options.mutationKey)return!1;if(s){if(Sa(n.options.mutationKey)!==Sa(c))return!1}else if(!Vl(n.options.mutationKey,c))return!1}return!(a&&n.state.status!==a||l&&!l(n))}function Dh(t,n){return((n==null?void 0:n.queryKeyHashFn)||Sa)(t)}function Sa(t){return JSON.stringify(t,(n,s)=>th(s)?Object.keys(s).sort().reduce((a,l)=>(a[l]=s[l],a),{}):s)}function Vl(t,n){return t===n?!0:typeof t!=typeof n?!1:t&&n&&typeof t=="object"&&typeof n=="object"?Object.keys(n).every(s=>Vl(t[s],n[s])):!1}var Fx=Object.prototype.hasOwnProperty;function wg(t,n,s=0){if(t===n)return t;if(s>500)return n;const a=qp(t)&&qp(n);if(!a&&!(th(t)&&th(n)))return n;const c=(a?t:Object.keys(t)).length,h=a?n:Object.keys(n),y=h.length,x=a?new Array(y):{};let w=0;for(let E=0;E<y;E++){const O=a?E:h[E],_=t[O],S=n[O];if(_===S){x[O]=_,(a?E<c:Fx.call(t,O))&&w++;continue}if(_===null||S===null||typeof _!="object"||typeof S!="object"){x[O]=S;continue}const C=wg(_,S,s+1);x[O]=C,C===_&&w++}return c===y&&w===c?t:x}function _c(t,n){if(!n||Object.keys(t).length!==Object.keys(n).length)return!1;for(const s in t)if(t[s]!==n[s])return!1;return!0}function qp(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function th(t){if(!Qp(t))return!1;const n=t.constructor;if(n===void 0)return!0;const s=n.prototype;return!(!Qp(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Qp(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ax(t){return new Promise(n=>{da.setTimeout(n,t)})}function nh(t,n,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,n):s.structuralSharing!==!1?wg(t,n):n}function Px(t,n,s=0){const a=[...t,n];return s&&a.length>s?a.slice(1):a}function Ux(t,n,s=0){const a=[n,...t];return s&&a.length>s?a.slice(0,-1):a}var Mh=Symbol();function Sg(t,n){return!t.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!t.queryFn||t.queryFn===Mh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Ih(t,n){return typeof t=="function"?t(...n):!!t}function Vx(t,n,s){let a=!1,l;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(l??(l=n()),a||(a=!0,l.aborted?s():l.addEventListener("abort",s,{once:!0})),l)}),t}var zl=(()=>{let t=()=>Ix;return{isServer(){return t()},setIsServer(n){t=n}}})();function rh(){let t,n;const s=new Promise((l,c)=>{t=l,n=c});s.status="pending",s.catch(()=>{});function a(l){Object.assign(s,l),delete s.resolve,delete s.reject}return s.resolve=l=>{a({status:"fulfilled",value:l}),t(l)},s.reject=l=>{a({status:"rejected",reason:l}),n(l)},s}var zx=Mx;function $x(){let t=[],n=0,s=y=>{y()},a=y=>{y()},l=zx;const c=y=>{n?t.push(y):l(()=>{s(y)})},h=()=>{const y=t;t=[],y.length&&l(()=>{a(()=>{y.forEach(x=>{s(x)})})})};return{batch:y=>{let x;n++;try{x=y()}finally{n--,n||h()}return x},batchCalls:y=>(...x)=>{c(()=>{y(...x)})},schedule:c,setNotifyFunction:y=>{s=y},setBatchNotifyFunction:y=>{a=y},setScheduler:y=>{l=y}}}var Zt=$x(),po,pi,yo,Ky,Wx=(Ky=class extends Lo{constructor(){super();Ie(this,po,!0);Ie(this,pi);Ie(this,yo);xe(this,yo,n=>{if(typeof window<"u"&&window.addEventListener){const s=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",a)}}})}onSubscribe(){L(this,pi)||this.setEventListener(L(this,yo))}onUnsubscribe(){var n;this.hasListeners()||((n=L(this,pi))==null||n.call(this),xe(this,pi,void 0))}setEventListener(n){var s;xe(this,yo,n),(s=L(this,pi))==null||s.call(this),xe(this,pi,n(this.setOnline.bind(this)))}setOnline(n){L(this,po)!==n&&(xe(this,po,n),this.listeners.forEach(a=>{a(n)}))}isOnline(){return L(this,po)}},po=new WeakMap,pi=new WeakMap,yo=new WeakMap,Ky),Nc=new Wx;function Hx(t){return Math.min(1e3*2**t,3e4)}function kg(t){return(t??"online")==="online"?Nc.isOnline():!0}var sh=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function _g(t){let n=!1,s=0,a;const l=rh(),c=()=>l.status!=="pending",h=T=>{var b;if(!c()){const I=new sh(T);_(I),(b=t.onCancel)==null||b.call(t,I)}},y=()=>{n=!0},x=()=>{n=!1},w=()=>Rh.isFocused()&&(t.networkMode==="always"||Nc.isOnline())&&t.canRun(),E=()=>kg(t.networkMode)&&t.canRun(),O=T=>{c()||(a==null||a(),l.resolve(T))},_=T=>{c()||(a==null||a(),l.reject(T))},S=()=>new Promise(T=>{var b;a=I=>{(c()||w())&&T(I)},(b=t.onPause)==null||b.call(t)}).then(()=>{var T;a=void 0,c()||(T=t.onContinue)==null||T.call(t)}),C=()=>{if(c())return;let T;const b=s===0?t.initialPromise:void 0;try{T=b??t.fn()}catch(I){T=Promise.reject(I)}Promise.resolve(T).then(O).catch(I=>{var J;if(c())return;const j=t.retry??(zl.isServer()?0:3),F=t.retryDelay??Hx,U=typeof F=="function"?F(s,I):F,$=j===!0||typeof j=="number"&&s<j||typeof j=="function"&&j(s,I);if(n||!$){_(I);return}s++,(J=t.onFail)==null||J.call(t,s,I),Ax(U).then(()=>w()?void 0:S()).then(()=>{n?_(I):C()})})};return{promise:l,status:()=>l.status,cancel:h,continue:()=>(a==null||a(),l),cancelRetry:y,continueRetry:x,canStart:E,start:()=>(E()?C():S().then(C),l)}}var ha,Xy,Ng=(Xy=class{constructor(){Ie(this,ha)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eh(this.gcTime)&&xe(this,ha,da.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(zl.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,ha)!==void 0&&(da.clearTimeout(L(this,ha)),xe(this,ha,void 0))}},ha=new WeakMap,Xy);function Bx(t){return{onFetch:(n,s)=>{var E,O,_,S,C;const a=n.options,l=(_=(O=(E=n.fetchOptions)==null?void 0:E.meta)==null?void 0:O.fetchMore)==null?void 0:_.direction,c=((S=n.state.data)==null?void 0:S.pages)||[],h=((C=n.state.data)==null?void 0:C.pageParams)||[];let y={pages:[],pageParams:[]},x=0;const w=async()=>{let T=!1;const b=F=>{Vx(F,()=>n.signal,()=>T=!0)},I=Sg(n.options,n.fetchOptions),j=async(F,U,$)=>{if(T)return Promise.reject(n.signal.reason);if(U==null&&F.pages.length)return Promise.resolve(F);const se=(()=>{const pe={client:n.client,queryKey:n.queryKey,pageParam:U,direction:$?"backward":"forward",meta:n.options.meta};return b(pe),pe})(),me=await I(se),{maxPages:ye}=n.options,ke=$?Ux:Px;return{pages:ke(F.pages,me,ye),pageParams:ke(F.pageParams,U,ye)}};if(l&&c.length){const F=l==="backward",U=F?Zx:Yp,$={pages:c,pageParams:h},J=U(a,$);y=await j($,J,F)}else{const F=t??c.length;do{const U=x===0?h[0]??a.initialPageParam:Yp(a,y);if(x>0&&U==null)break;y=await j(y,U),x++}while(x<F)}return y};n.options.persister?n.fetchFn=()=>{var T,b;return(b=(T=n.options).persister)==null?void 0:b.call(T,w,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},s)}:n.fetchFn=w}}}function Yp(t,{pages:n,pageParams:s}){const a=n.length-1;return n.length>0?t.getNextPageParam(n[a],n,s[a],s):void 0}function Zx(t,{pages:n,pageParams:s}){var a;return n.length>0?(a=t.getPreviousPageParam)==null?void 0:a.call(t,n[0],n,s[0],s):void 0}var go,ma,vo,tr,pa,Gt,Bl,ya,Pn,Eg,ys,Jy,qx=(Jy=class extends Ng{constructor(n){super();Ie(this,Pn);Ie(this,go);Ie(this,ma);Ie(this,vo);Ie(this,tr);Ie(this,pa);Ie(this,Gt);Ie(this,Bl);Ie(this,ya);xe(this,ya,!1),xe(this,Bl,n.defaultOptions),this.setOptions(n.options),this.observers=[],xe(this,pa,n.client),xe(this,tr,L(this,pa).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,xe(this,ma,Kp(this.options)),this.state=n.state??L(this,ma),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,go)}get promise(){var n;return(n=L(this,Gt))==null?void 0:n.promise}setOptions(n){if(this.options={...L(this,Bl),...n},n!=null&&n._type&&xe(this,go,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Kp(this.options);s.data!==void 0&&(this.setState(Gp(s.data,s.dataUpdatedAt)),xe(this,ma,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,tr).remove(this)}setData(n,s){const a=nh(this.state.data,n,this.options);return Je(this,Pn,ys).call(this,{data:a,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),a}setState(n){Je(this,Pn,ys).call(this,{type:"setState",state:n})}cancel(n){var a,l;const s=(a=L(this,Gt))==null?void 0:a.promise;return(l=L(this,Gt))==null||l.cancel(n),s?s.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,ma)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Un(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Ti(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!xg(this.state.dataUpdatedAt,n)}onFocus(){var s;const n=this.observers.find(a=>a.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(s=L(this,Gt))==null||s.continue()}onOnline(){var s;const n=this.observers.find(a=>a.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(s=L(this,Gt))==null||s.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),L(this,tr).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(s=>s!==n),this.observers.length||(L(this,Gt)&&(L(this,ya)||Je(this,Pn,Eg).call(this)?L(this,Gt).cancel({revert:!0}):L(this,Gt).cancelRetry()),this.scheduleGc()),L(this,tr).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Je(this,Pn,ys).call(this,{type:"invalidate"})}async fetch(n,s){var w,E,O,_,S,C,T,b,I,j,F;if(this.state.fetchStatus!=="idle"&&((w=L(this,Gt))==null?void 0:w.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(L(this,Gt))return L(this,Gt).continueRetry(),L(this,Gt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const U=this.observers.find($=>$.options.queryFn);U&&this.setOptions(U.options)}const a=new AbortController,l=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(xe(this,ya,!0),a.signal)})},c=()=>{const U=Sg(this.options,s),J=(()=>{const se={client:L(this,pa),queryKey:this.queryKey,meta:this.meta};return l(se),se})();return xe(this,ya,!1),this.options.persister?this.options.persister(U,J,this):U(J)},y=(()=>{const U={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:L(this,pa),state:this.state,fetchFn:c};return l(U),U})(),x=L(this,go)==="infinite"?Bx(this.options.pages):this.options.behavior;x==null||x.onFetch(y,this),xe(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((E=y.fetchOptions)==null?void 0:E.meta))&&Je(this,Pn,ys).call(this,{type:"fetch",meta:(O=y.fetchOptions)==null?void 0:O.meta}),xe(this,Gt,_g({initialPromise:s==null?void 0:s.initialPromise,fn:y.fetchFn,onCancel:U=>{U instanceof sh&&U.revert&&this.setState({...L(this,vo),fetchStatus:"idle"}),a.abort()},onFail:(U,$)=>{Je(this,Pn,ys).call(this,{type:"failed",failureCount:U,error:$})},onPause:()=>{Je(this,Pn,ys).call(this,{type:"pause"})},onContinue:()=>{Je(this,Pn,ys).call(this,{type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0}));try{const U=await L(this,Gt).start();if(U===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(U),(S=(_=L(this,tr).config).onSuccess)==null||S.call(_,U,this),(T=(C=L(this,tr).config).onSettled)==null||T.call(C,U,this.state.error,this),U}catch(U){if(U instanceof sh){if(U.silent)return L(this,Gt).promise;if(U.revert){if(this.state.data===void 0)throw U;return this.state.data}}throw Je(this,Pn,ys).call(this,{type:"error",error:U}),(I=(b=L(this,tr).config).onError)==null||I.call(b,U,this),(F=(j=L(this,tr).config).onSettled)==null||F.call(j,this.state.data,U,this),U}finally{this.scheduleGc()}}},go=new WeakMap,ma=new WeakMap,vo=new WeakMap,tr=new WeakMap,pa=new WeakMap,Gt=new WeakMap,Bl=new WeakMap,ya=new WeakMap,Pn=new WeakSet,Eg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ys=function(n){const s=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Tg(a.data,this.options),fetchMeta:n.meta??null};case"success":const l={...a,...Gp(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return xe(this,vo,n.manual?l:void 0),l;case"error":const c=n.error;return{...a,error:c,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=s(this.state),Zt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),L(this,tr).notify({query:this,type:"updated",action:n})})},Jy);function Tg(t,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kg(n.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Gp(t,n){return{data:t,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Kp(t){const n=typeof t.initialData=="function"?t.initialData():t.initialData,s=n!==void 0,a=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Cn,st,Zl,vn,ga,xo,vs,yi,ql,wo,So,va,xa,gi,ko,pt,Ll,ih,ah,oh,lh,uh,ch,dh,Cg,eg,Qx=(eg=class extends Lo{constructor(n,s){super();Ie(this,pt);Ie(this,Cn);Ie(this,st);Ie(this,Zl);Ie(this,vn);Ie(this,ga);Ie(this,xo);Ie(this,vs);Ie(this,yi);Ie(this,ql);Ie(this,wo);Ie(this,So);Ie(this,va);Ie(this,xa);Ie(this,gi);Ie(this,ko,new Set);this.options=s,xe(this,Cn,n),xe(this,yi,null),xe(this,vs,rh()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,st).addObserver(this),Xp(L(this,st),this.options)?Je(this,pt,Ll).call(this):this.updateResult(),Je(this,pt,lh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fh(L(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fh(L(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Je(this,pt,uh).call(this),Je(this,pt,ch).call(this),L(this,st).removeObserver(this)}setOptions(n){const s=this.options,a=L(this,st);if(this.options=L(this,Cn).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Un(this.options.enabled,L(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Je(this,pt,dh).call(this),L(this,st).setOptions(this.options),s._defaulted&&!_c(this.options,s)&&L(this,Cn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,st),observer:this});const l=this.hasListeners();l&&Jp(L(this,st),a,this.options,s)&&Je(this,pt,Ll).call(this),this.updateResult(),l&&(L(this,st)!==a||Un(this.options.enabled,L(this,st))!==Un(s.enabled,L(this,st))||Ti(this.options.staleTime,L(this,st))!==Ti(s.staleTime,L(this,st)))&&Je(this,pt,ih).call(this);const c=Je(this,pt,ah).call(this);l&&(L(this,st)!==a||Un(this.options.enabled,L(this,st))!==Un(s.enabled,L(this,st))||c!==L(this,gi))&&Je(this,pt,oh).call(this,c)}getOptimisticResult(n){const s=L(this,Cn).getQueryCache().build(L(this,Cn),n),a=this.createResult(s,n);return Gx(this,a)&&(xe(this,vn,a),xe(this,xo,this.options),xe(this,ga,L(this,st).state)),a}getCurrentResult(){return L(this,vn)}trackResult(n,s){return new Proxy(n,{get:(a,l)=>(this.trackProp(l),s==null||s(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,vs).status==="pending"&&L(this,vs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(n){L(this,ko).add(n)}getCurrentQuery(){return L(this,st)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const s=L(this,Cn).defaultQueryOptions(n),a=L(this,Cn).getQueryCache().build(L(this,Cn),s);return a.fetch().then(()=>this.createResult(a,s))}fetch(n){return Je(this,pt,Ll).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,vn)))}createResult(n,s){var ye;const a=L(this,st),l=this.options,c=L(this,vn),h=L(this,ga),y=L(this,xo),w=n!==a?n.state:L(this,Zl),{state:E}=n;let O={...E},_=!1,S;if(s._optimisticResults){const ke=this.hasListeners(),pe=!ke&&Xp(n,s),ve=ke&&Jp(n,a,s,l);(pe||ve)&&(O={...O,...Tg(E.data,n.options)}),s._optimisticResults==="isRestoring"&&(O.fetchStatus="idle")}let{error:C,errorUpdatedAt:T,status:b}=O;S=O.data;let I=!1;if(s.placeholderData!==void 0&&S===void 0&&b==="pending"){let ke;c!=null&&c.isPlaceholderData&&s.placeholderData===(y==null?void 0:y.placeholderData)?(ke=c.data,I=!0):ke=typeof s.placeholderData=="function"?s.placeholderData((ye=L(this,So))==null?void 0:ye.state.data,L(this,So)):s.placeholderData,ke!==void 0&&(b="success",S=nh(c==null?void 0:c.data,ke,s),_=!0)}if(s.select&&S!==void 0&&!I)if(c&&S===(h==null?void 0:h.data)&&s.select===L(this,ql))S=L(this,wo);else try{xe(this,ql,s.select),S=s.select(S),S=nh(c==null?void 0:c.data,S,s),xe(this,wo,S),xe(this,yi,null)}catch(ke){xe(this,yi,ke)}L(this,yi)&&(C=L(this,yi),S=L(this,wo),T=Date.now(),b="error");const j=O.fetchStatus==="fetching",F=b==="pending",U=b==="error",$=F&&j,J=S!==void 0,me={status:b,fetchStatus:O.fetchStatus,isPending:F,isSuccess:b==="success",isError:U,isInitialLoading:$,isLoading:$,data:S,dataUpdatedAt:O.dataUpdatedAt,error:C,errorUpdatedAt:T,failureCount:O.fetchFailureCount,failureReason:O.fetchFailureReason,errorUpdateCount:O.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:O.dataUpdateCount>w.dataUpdateCount||O.errorUpdateCount>w.errorUpdateCount,isFetching:j,isRefetching:j&&!F,isLoadingError:U&&!J,isPaused:O.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:U&&J,isStale:Lh(n,s),refetch:this.refetch,promise:L(this,vs),isEnabled:Un(s.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const ke=me.data!==void 0,pe=me.status==="error"&&!ke,ve=Pe=>{pe?Pe.reject(me.error):ke&&Pe.resolve(me.data)},he=()=>{const Pe=xe(this,vs,me.promise=rh());ve(Pe)},Me=L(this,vs);switch(Me.status){case"pending":n.queryHash===a.queryHash&&ve(Me);break;case"fulfilled":(pe||me.data!==Me.value)&&he();break;case"rejected":(!pe||me.error!==Me.reason)&&he();break}}return me}updateResult(){const n=L(this,vn),s=this.createResult(L(this,st),this.options);if(xe(this,ga,L(this,st).state),xe(this,xo,this.options),L(this,ga).data!==void 0&&xe(this,So,L(this,st)),_c(s,n))return;xe(this,vn,s);const a=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!L(this,ko).size)return!0;const h=new Set(c??L(this,ko));return this.options.throwOnError&&h.add("error"),Object.keys(L(this,vn)).some(y=>{const x=y;return L(this,vn)[x]!==n[x]&&h.has(x)})};Je(this,pt,Cg).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Je(this,pt,lh).call(this)}},Cn=new WeakMap,st=new WeakMap,Zl=new WeakMap,vn=new WeakMap,ga=new WeakMap,xo=new WeakMap,vs=new WeakMap,yi=new WeakMap,ql=new WeakMap,wo=new WeakMap,So=new WeakMap,va=new WeakMap,xa=new WeakMap,gi=new WeakMap,ko=new WeakMap,pt=new WeakSet,Ll=function(n){Je(this,pt,dh).call(this);let s=L(this,st).fetch(this.options,n);return n!=null&&n.throwOnError||(s=s.catch(xn)),s},ih=function(){Je(this,pt,uh).call(this);const n=Ti(this.options.staleTime,L(this,st));if(zl.isServer()||L(this,vn).isStale||!eh(n))return;const a=xg(L(this,vn).dataUpdatedAt,n)+1;xe(this,va,da.setTimeout(()=>{L(this,vn).isStale||this.updateResult()},a))},ah=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,st)):this.options.refetchInterval)??!1},oh=function(n){Je(this,pt,ch).call(this),xe(this,gi,n),!(zl.isServer()||Un(this.options.enabled,L(this,st))===!1||!eh(L(this,gi))||L(this,gi)===0)&&xe(this,xa,da.setInterval(()=>{(this.options.refetchIntervalInBackground||Rh.isFocused())&&Je(this,pt,Ll).call(this)},L(this,gi)))},lh=function(){Je(this,pt,ih).call(this),Je(this,pt,oh).call(this,Je(this,pt,ah).call(this))},uh=function(){L(this,va)!==void 0&&(da.clearTimeout(L(this,va)),xe(this,va,void 0))},ch=function(){L(this,xa)!==void 0&&(da.clearInterval(L(this,xa)),xe(this,xa,void 0))},dh=function(){const n=L(this,Cn).getQueryCache().build(L(this,Cn),this.options);if(n===L(this,st))return;const s=L(this,st);xe(this,st,n),xe(this,Zl,n.state),this.hasListeners()&&(s==null||s.removeObserver(this),n.addObserver(this))},Cg=function(n){Zt.batch(()=>{n.listeners&&this.listeners.forEach(s=>{s(L(this,vn))}),L(this,Cn).getQueryCache().notify({query:L(this,st),type:"observerResultsUpdated"})})},eg);function Yx(t,n){return Un(n.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Un(n.retryOnMount,t)===!1)}function Xp(t,n){return Yx(t,n)||t.state.data!==void 0&&fh(t,n,n.refetchOnMount)}function fh(t,n,s){if(Un(n.enabled,t)!==!1&&Ti(n.staleTime,t)!=="static"){const a=typeof s=="function"?s(t):s;return a==="always"||a!==!1&&Lh(t,n)}return!1}function Jp(t,n,s,a){return(t!==n||Un(a.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&Lh(t,s)}function Lh(t,n){return Un(n.enabled,t)!==!1&&t.isStaleByTime(Ti(n.staleTime,t))}function Gx(t,n){return!_c(t.getCurrentResult(),n)}var Ql,zr,dn,wa,$r,di,tg,Kx=(tg=class extends Ng{constructor(n){super();Ie(this,$r);Ie(this,Ql);Ie(this,zr);Ie(this,dn);Ie(this,wa);xe(this,Ql,n.client),this.mutationId=n.mutationId,xe(this,dn,n.mutationCache),xe(this,zr,[]),this.state=n.state||Og(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){L(this,zr).includes(n)||(L(this,zr).push(n),this.clearGcTimeout(),L(this,dn).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){xe(this,zr,L(this,zr).filter(s=>s!==n)),this.scheduleGc(),L(this,dn).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){L(this,zr).length||(this.state.status==="pending"?this.scheduleGc():L(this,dn).remove(this))}continue(){var n;return((n=L(this,wa))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var h,y,x,w,E,O,_,S,C,T,b,I,j,F,U,$,J,se;const s=()=>{Je(this,$r,di).call(this,{type:"continue"})},a={client:L(this,Ql),meta:this.options.meta,mutationKey:this.options.mutationKey};xe(this,wa,_g({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(me,ye)=>{Je(this,$r,di).call(this,{type:"failed",failureCount:me,error:ye})},onPause:()=>{Je(this,$r,di).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,dn).canRun(this)}));const l=this.state.status==="pending",c=!L(this,wa).canStart();try{if(l)s();else{Je(this,$r,di).call(this,{type:"pending",variables:n,isPaused:c}),L(this,dn).config.onMutate&&await L(this,dn).config.onMutate(n,this,a);const ye=await((y=(h=this.options).onMutate)==null?void 0:y.call(h,n,a));ye!==this.state.context&&Je(this,$r,di).call(this,{type:"pending",context:ye,variables:n,isPaused:c})}const me=await L(this,wa).start();return await((w=(x=L(this,dn).config).onSuccess)==null?void 0:w.call(x,me,n,this.state.context,this,a)),await((O=(E=this.options).onSuccess)==null?void 0:O.call(E,me,n,this.state.context,a)),await((S=(_=L(this,dn).config).onSettled)==null?void 0:S.call(_,me,null,this.state.variables,this.state.context,this,a)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,me,null,n,this.state.context,a)),Je(this,$r,di).call(this,{type:"success",data:me}),me}catch(me){try{await((I=(b=L(this,dn).config).onError)==null?void 0:I.call(b,me,n,this.state.context,this,a))}catch(ye){Promise.reject(ye)}try{await((F=(j=this.options).onError)==null?void 0:F.call(j,me,n,this.state.context,a))}catch(ye){Promise.reject(ye)}try{await(($=(U=L(this,dn).config).onSettled)==null?void 0:$.call(U,void 0,me,this.state.variables,this.state.context,this,a))}catch(ye){Promise.reject(ye)}try{await((se=(J=this.options).onSettled)==null?void 0:se.call(J,void 0,me,n,this.state.context,a))}catch(ye){Promise.reject(ye)}throw Je(this,$r,di).call(this,{type:"error",error:me}),me}finally{L(this,dn).runNext(this)}}},Ql=new WeakMap,zr=new WeakMap,dn=new WeakMap,wa=new WeakMap,$r=new WeakSet,di=function(n){const s=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=s(this.state),Zt.batch(()=>{L(this,zr).forEach(a=>{a.onMutationUpdate(n)}),L(this,dn).notify({mutation:this,type:"updated",action:n})})},tg);function Og(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xs,kr,Yl,ng,Xx=(ng=class extends Lo{constructor(n={}){super();Ie(this,xs);Ie(this,kr);Ie(this,Yl);this.config=n,xe(this,xs,new Set),xe(this,kr,new Map),xe(this,Yl,0)}build(n,s,a){const l=new Kx({client:n,mutationCache:this,mutationId:++fc(this,Yl)._,options:n.defaultMutationOptions(s),state:a});return this.add(l),l}add(n){L(this,xs).add(n);const s=mc(n);if(typeof s=="string"){const a=L(this,kr).get(s);a?a.push(n):L(this,kr).set(s,[n])}this.notify({type:"added",mutation:n})}remove(n){if(L(this,xs).delete(n)){const s=mc(n);if(typeof s=="string"){const a=L(this,kr).get(s);if(a)if(a.length>1){const l=a.indexOf(n);l!==-1&&a.splice(l,1)}else a[0]===n&&L(this,kr).delete(s)}}this.notify({type:"removed",mutation:n})}canRun(n){const s=mc(n);if(typeof s=="string"){const a=L(this,kr).get(s),l=a==null?void 0:a.find(c=>c.state.status==="pending");return!l||l===n}else return!0}runNext(n){var a;const s=mc(n);if(typeof s=="string"){const l=(a=L(this,kr).get(s))==null?void 0:a.find(c=>c!==n&&c.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Zt.batch(()=>{L(this,xs).forEach(n=>{this.notify({type:"removed",mutation:n})}),L(this,xs).clear(),L(this,kr).clear()})}getAll(){return Array.from(L(this,xs))}find(n){const s={exact:!0,...n};return this.getAll().find(a=>Zp(s,a))}findAll(n={}){return this.getAll().filter(s=>Zp(n,s))}notify(n){Zt.batch(()=>{this.listeners.forEach(s=>{s(n)})})}resumePausedMutations(){const n=this.getAll().filter(s=>s.state.isPaused);return Zt.batch(()=>Promise.all(n.map(s=>s.continue().catch(xn))))}},xs=new WeakMap,kr=new WeakMap,Yl=new WeakMap,ng);function mc(t){var n;return(n=t.options.scope)==null?void 0:n.id}var ws,vi,On,Ss,ks,vc,hh,rg,Jx=(rg=class extends Lo{constructor(s,a){super();Ie(this,ks);Ie(this,ws);Ie(this,vi);Ie(this,On);Ie(this,Ss);xe(this,ws,s),this.setOptions(a),this.bindMethods(),Je(this,ks,vc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var l;const a=this.options;this.options=L(this,ws).defaultMutationOptions(s),_c(this.options,a)||L(this,ws).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,On),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&Sa(a.mutationKey)!==Sa(this.options.mutationKey)?this.reset():((l=L(this,On))==null?void 0:l.state.status)==="pending"&&L(this,On).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=L(this,On))==null||s.removeObserver(this)}onMutationUpdate(s){Je(this,ks,vc).call(this),Je(this,ks,hh).call(this,s)}getCurrentResult(){return L(this,vi)}reset(){var s;(s=L(this,On))==null||s.removeObserver(this),xe(this,On,void 0),Je(this,ks,vc).call(this),Je(this,ks,hh).call(this)}mutate(s,a){var l;return xe(this,Ss,a),(l=L(this,On))==null||l.removeObserver(this),xe(this,On,L(this,ws).getMutationCache().build(L(this,ws),this.options)),L(this,On).addObserver(this),L(this,On).execute(s)}},ws=new WeakMap,vi=new WeakMap,On=new WeakMap,Ss=new WeakMap,ks=new WeakSet,vc=function(){var a;const s=((a=L(this,On))==null?void 0:a.state)??Og();xe(this,vi,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},hh=function(s){Zt.batch(()=>{var a,l,c,h,y,x,w,E;if(L(this,Ss)&&this.hasListeners()){const O=L(this,vi).variables,_=L(this,vi).context,S={client:L(this,ws),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(l=(a=L(this,Ss)).onSuccess)==null||l.call(a,s.data,O,_,S)}catch(C){Promise.reject(C)}try{(h=(c=L(this,Ss)).onSettled)==null||h.call(c,s.data,null,O,_,S)}catch(C){Promise.reject(C)}}else if((s==null?void 0:s.type)==="error"){try{(x=(y=L(this,Ss)).onError)==null||x.call(y,s.error,O,_,S)}catch(C){Promise.reject(C)}try{(E=(w=L(this,Ss)).onSettled)==null||E.call(w,void 0,s.error,O,_,S)}catch(C){Promise.reject(C)}}}this.listeners.forEach(O=>{O(L(this,vi))})})},rg),Wr,sg,ew=(sg=class extends Lo{constructor(n={}){super();Ie(this,Wr);this.config=n,xe(this,Wr,new Map)}build(n,s,a){const l=s.queryKey,c=s.queryHash??Dh(l,s);let h=this.get(c);return h||(h=new qx({client:n,queryKey:l,queryHash:c,options:n.defaultQueryOptions(s),state:a,defaultOptions:n.getQueryDefaults(l)}),this.add(h)),h}add(n){L(this,Wr).has(n.queryHash)||(L(this,Wr).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const s=L(this,Wr).get(n.queryHash);s&&(n.destroy(),s===n&&L(this,Wr).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Zt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return L(this,Wr).get(n)}getAll(){return[...L(this,Wr).values()]}find(n){const s={exact:!0,...n};return this.getAll().find(a=>Bp(s,a))}findAll(n={}){const s=this.getAll();return Object.keys(n).length>0?s.filter(a=>Bp(n,a)):s}notify(n){Zt.batch(()=>{this.listeners.forEach(s=>{s(n)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Wr=new WeakMap,sg),Ft,xi,wi,_o,No,Si,Eo,To,ig,tw=(ig=class{constructor(t={}){Ie(this,Ft);Ie(this,xi);Ie(this,wi);Ie(this,_o);Ie(this,No);Ie(this,Si);Ie(this,Eo);Ie(this,To);xe(this,Ft,t.queryCache||new ew),xe(this,xi,t.mutationCache||new Xx),xe(this,wi,t.defaultOptions||{}),xe(this,_o,new Map),xe(this,No,new Map),xe(this,Si,0)}mount(){fc(this,Si)._++,L(this,Si)===1&&(xe(this,Eo,Rh.subscribe(async t=>{t&&(await this.resumePausedMutations(),L(this,Ft).onFocus())})),xe(this,To,Nc.subscribe(async t=>{t&&(await this.resumePausedMutations(),L(this,Ft).onOnline())})))}unmount(){var t,n;fc(this,Si)._--,L(this,Si)===0&&((t=L(this,Eo))==null||t.call(this),xe(this,Eo,void 0),(n=L(this,To))==null||n.call(this),xe(this,To,void 0))}isFetching(t){return L(this,Ft).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return L(this,xi).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const n=this.defaultQueryOptions({queryKey:t});return(s=L(this,Ft).get(n.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),s=L(this,Ft).build(this,n),a=s.state.data;return a===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Ti(n.staleTime,s))&&this.prefetchQuery(n),Promise.resolve(a))}getQueriesData(t){return L(this,Ft).findAll(t).map(({queryKey:n,state:s})=>{const a=s.data;return[n,a]})}setQueryData(t,n,s){const a=this.defaultQueryOptions({queryKey:t}),l=L(this,Ft).get(a.queryHash),c=l==null?void 0:l.state.data,h=Lx(n,c);if(h!==void 0)return L(this,Ft).build(this,a).setData(h,{...s,manual:!0})}setQueriesData(t,n,s){return Zt.batch(()=>L(this,Ft).findAll(t).map(({queryKey:a})=>[a,this.setQueryData(a,n,s)]))}getQueryState(t){var s;const n=this.defaultQueryOptions({queryKey:t});return(s=L(this,Ft).get(n.queryHash))==null?void 0:s.state}removeQueries(t){const n=L(this,Ft);Zt.batch(()=>{n.findAll(t).forEach(s=>{n.remove(s)})})}resetQueries(t,n){const s=L(this,Ft);return Zt.batch(()=>(s.findAll(t).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const s={revert:!0,...n},a=Zt.batch(()=>L(this,Ft).findAll(t).map(l=>l.cancel(s)));return Promise.all(a).then(xn).catch(xn)}invalidateQueries(t,n={}){return Zt.batch(()=>(L(this,Ft).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},n)))}refetchQueries(t,n={}){const s={...n,cancelRefetch:n.cancelRefetch??!0},a=Zt.batch(()=>L(this,Ft).findAll(t).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,s);return s.throwOnError||(c=c.catch(xn)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(xn)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const s=L(this,Ft).build(this,n);return s.isStaleByTime(Ti(n.staleTime,s))?s.fetch(n):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xn).catch(xn)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xn).catch(xn)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Nc.isOnline()?L(this,xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Ft)}getMutationCache(){return L(this,xi)}getDefaultOptions(){return L(this,wi)}setDefaultOptions(t){xe(this,wi,t)}setQueryDefaults(t,n){L(this,_o).set(Sa(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...L(this,_o).values()],s={};return n.forEach(a=>{Vl(t,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(t,n){L(this,No).set(Sa(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...L(this,No).values()],s={};return n.forEach(a=>{Vl(t,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const n={...L(this,wi).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=Dh(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Mh&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...L(this,wi).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){L(this,Ft).clear(),L(this,xi).clear()}},Ft=new WeakMap,xi=new WeakMap,wi=new WeakMap,_o=new WeakMap,No=new WeakMap,Si=new WeakMap,Eo=new WeakMap,To=new WeakMap,ig),bg=Z.createContext(void 0),zn=t=>{const n=Z.useContext(bg);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},nw=({client:t,children:n})=>(Z.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),d.jsx(bg.Provider,{value:t,children:n})),jg=Z.createContext(!1),rw=()=>Z.useContext(jg);jg.Provider;function sw(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var iw=Z.createContext(sw()),aw=()=>Z.useContext(iw),ow=(t,n,s)=>{const a=s!=null&&s.state.error&&typeof t.throwOnError=="function"?Ih(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||a)&&(n.isReset()||(t.retryOnMount=!1))},lw=t=>{Z.useEffect(()=>{t.clearReset()},[t])},uw=({result:t,errorResetBoundary:n,throwOnError:s,query:a,suspense:l})=>t.isError&&!n.isReset()&&!t.isFetching&&a&&(l&&t.data===void 0||Ih(s,[t.error,a])),cw=t=>{if(t.suspense){const s=l=>l==="static"?l:Math.max(l??1e3,1e3),a=t.staleTime;t.staleTime=typeof a=="function"?(...l)=>s(a(...l)):s(a),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},dw=(t,n)=>t.isLoading&&t.isFetching&&!n,fw=(t,n)=>(t==null?void 0:t.suspense)&&n.isPending,ey=(t,n,s)=>n.fetchOptimistic(t).catch(()=>{s.clearReset()});function hw(t,n,s){var S,C,T,b;const a=rw(),l=aw(),c=zn(),h=c.defaultQueryOptions(t);(C=(S=c.getDefaultOptions().queries)==null?void 0:S._experimental_beforeQuery)==null||C.call(S,h);const y=c.getQueryCache().get(h.queryHash),x=t.subscribed!==!1;h._optimisticResults=a?"isRestoring":x?"optimistic":void 0,cw(h),ow(h,l,y),lw(l);const w=!c.getQueryCache().get(h.queryHash),[E]=Z.useState(()=>new n(c,h)),O=E.getOptimisticResult(h),_=!a&&x;if(Z.useSyncExternalStore(Z.useCallback(I=>{const j=_?E.subscribe(Zt.batchCalls(I)):xn;return E.updateResult(),j},[E,_]),()=>E.getCurrentResult(),()=>E.getCurrentResult()),Z.useEffect(()=>{E.setOptions(h)},[h,E]),fw(h,O))throw ey(h,E,l);if(uw({result:O,errorResetBoundary:l,throwOnError:h.throwOnError,query:y,suspense:h.suspense}))throw O.error;if((b=(T=c.getDefaultOptions().queries)==null?void 0:T._experimental_afterQuery)==null||b.call(T,h,O),h.experimental_prefetchInRender&&!zl.isServer()&&dw(O,a)){const I=w?ey(h,E,l):y==null?void 0:y.promise;I==null||I.catch(xn).finally(()=>{E.updateResult()})}return h.notifyOnChangeProps?O:E.trackResult(O)}function bn(t,n){return hw(t,Qx)}function Zr(t,n){const s=zn(),[a]=Z.useState(()=>new Jx(s,t));Z.useEffect(()=>{a.setOptions(t)},[a,t]);const l=Z.useSyncExternalStore(Z.useCallback(h=>a.subscribe(Zt.batchCalls(h)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=Z.useCallback((h,y)=>{a.mutate(h,y).catch(xn)},[a]);if(l.error&&Ih(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}const mw=/\{[^{}]+\}/g,pw=()=>{var t,n;return typeof process=="object"&&Number.parseInt((n=(t=process==null?void 0:process.versions)==null?void 0:t.node)==null?void 0:n.substring(0,2))>=18&&process.versions.undici};function yw(){return Math.random().toString(36).slice(2,11)}function gw(t){let{baseUrl:n="",Request:s=globalThis.Request,fetch:a=globalThis.fetch,querySerializer:l,bodySerializer:c,pathSerializer:h,headers:y,requestInitExt:x=void 0,...w}={...t};x=pw()?x:void 0,n=ry(n);const E=[];async function O(_,S){var ze;const{baseUrl:C,fetch:T=a,Request:b=s,headers:I,params:j={},parseAs:F="json",querySerializer:U,bodySerializer:$=c??xw,pathSerializer:J,body:se,middleware:me=[],...ye}=S||{};let ke=n;C&&(ke=ry(C)??n);let pe=typeof l=="function"?l:ty(l);U&&(pe=typeof U=="function"?U:ty({...typeof l=="object"?l:{},...U}));const ve=J||h||vw,he=se===void 0?void 0:$(se,ny(y,I,j.header)),Me=ny(he===void 0||he instanceof FormData?{}:{"Content-Type":"application/json"},y,I,j.header),Pe=[...E,...me],Xe={redirect:"follow",...w,...ye,body:he,headers:Me};let $e,te,ge=new b(ww(_,{baseUrl:ke,params:j,querySerializer:pe,pathSerializer:ve}),Xe),ue;for(const Ce in ye)Ce in ge||(ge[Ce]=ye[Ce]);if(Pe.length){$e=yw(),te=Object.freeze({baseUrl:ke,fetch:T,parseAs:F,querySerializer:pe,bodySerializer:$,pathSerializer:ve});for(const Ce of Pe)if(Ce&&typeof Ce=="object"&&typeof Ce.onRequest=="function"){const je=await Ce.onRequest({request:ge,schemaPath:_,params:j,options:te,id:$e});if(je)if(je instanceof b)ge=je;else if(je instanceof Response){ue=je;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!ue){try{ue=await T(ge,x)}catch(Ce){let je=Ce;if(Pe.length)for(let Le=Pe.length-1;Le>=0;Le--){const Qe=Pe[Le];if(Qe&&typeof Qe=="object"&&typeof Qe.onError=="function"){const Be=await Qe.onError({request:ge,error:je,schemaPath:_,params:j,options:te,id:$e});if(Be){if(Be instanceof Response){je=void 0,ue=Be;break}if(Be instanceof Error){je=Be;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(je)throw je}if(Pe.length)for(let Ce=Pe.length-1;Ce>=0;Ce--){const je=Pe[Ce];if(je&&typeof je=="object"&&typeof je.onResponse=="function"){const Le=await je.onResponse({request:ge,response:ue,schemaPath:_,params:j,options:te,id:$e});if(Le){if(!(Le instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");ue=Le}}}}const B=ue.headers.get("Content-Length");if(ue.status===204||ge.method==="HEAD"||B==="0"&&!((ze=ue.headers.get("Transfer-Encoding"))!=null&&ze.includes("chunked")))return ue.ok?{data:void 0,response:ue}:{error:void 0,response:ue};if(ue.ok)return{data:await(async()=>{if(F==="stream")return ue.body;if(F==="json"&&!B){const je=await ue.text();return je?JSON.parse(je):void 0}return await ue[F]()})(),response:ue};let ne=await ue.text();try{ne=JSON.parse(ne)}catch{}return{error:ne,response:ue}}return{request(_,S,C){return O(S,{...C,method:_.toUpperCase()})},GET(_,S){return O(_,{...S,method:"GET"})},PUT(_,S){return O(_,{...S,method:"PUT"})},POST(_,S){return O(_,{...S,method:"POST"})},DELETE(_,S){return O(_,{...S,method:"DELETE"})},OPTIONS(_,S){return O(_,{...S,method:"OPTIONS"})},HEAD(_,S){return O(_,{...S,method:"HEAD"})},PATCH(_,S){return O(_,{...S,method:"PATCH"})},TRACE(_,S){return O(_,{...S,method:"TRACE"})},use(..._){for(const S of _)if(S){if(typeof S!="object"||!("onRequest"in S||"onResponse"in S||"onError"in S))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");E.push(S)}},eject(..._){for(const S of _){const C=E.indexOf(S);C!==-1&&E.splice(C,1)}}}}function Pc(t,n,s){if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${(s==null?void 0:s.allowReserved)===!0?n:encodeURIComponent(n)}`}function Rg(t,n,s){if(!n||typeof n!="object")return"";const a=[],l={simple:",",label:".",matrix:";"}[s.style]||"&";if(s.style!=="deepObject"&&s.explode===!1){for(const y in n)a.push(y,s.allowReserved===!0?n[y]:encodeURIComponent(n[y]));const h=a.join(",");switch(s.style){case"form":return`${t}=${h}`;case"label":return`.${h}`;case"matrix":return`;${t}=${h}`;default:return h}}for(const h in n){const y=s.style==="deepObject"?`${t}[${h}]`:h;a.push(Pc(y,n[h],s))}const c=a.join(l);return s.style==="label"||s.style==="matrix"?`${l}${c}`:c}function Dg(t,n,s){if(!Array.isArray(n))return"";if(s.explode===!1){const c={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[s.style]||",",h=(s.allowReserved===!0?n:n.map(y=>encodeURIComponent(y))).join(c);switch(s.style){case"simple":return h;case"label":return`.${h}`;case"matrix":return`;${t}=${h}`;default:return`${t}=${h}`}}const a={simple:",",label:".",matrix:";"}[s.style]||"&",l=[];for(const c of n)s.style==="simple"||s.style==="label"?l.push(s.allowReserved===!0?c:encodeURIComponent(c)):l.push(Pc(t,c,s));return s.style==="label"||s.style==="matrix"?`${a}${l.join(a)}`:l.join(a)}function ty(t){return function(s){const a=[];if(s&&typeof s=="object")for(const l in s){const c=s[l];if(c!=null){if(Array.isArray(c)){if(c.length===0)continue;a.push(Dg(l,c,{style:"form",explode:!0,...t==null?void 0:t.array,allowReserved:(t==null?void 0:t.allowReserved)||!1}));continue}if(typeof c=="object"){a.push(Rg(l,c,{style:"deepObject",explode:!0,...t==null?void 0:t.object,allowReserved:(t==null?void 0:t.allowReserved)||!1}));continue}a.push(Pc(l,c,t))}}return a.join("&")}}function vw(t,n){let s=t;for(const a of t.match(mw)??[]){let l=a.substring(1,a.length-1),c=!1,h="simple";if(l.endsWith("*")&&(c=!0,l=l.substring(0,l.length-1)),l.startsWith(".")?(h="label",l=l.substring(1)):l.startsWith(";")&&(h="matrix",l=l.substring(1)),!n||n[l]===void 0||n[l]===null)continue;const y=n[l];if(Array.isArray(y)){s=s.replace(a,Dg(l,y,{style:h,explode:c}));continue}if(typeof y=="object"){s=s.replace(a,Rg(l,y,{style:h,explode:c}));continue}if(h==="matrix"){s=s.replace(a,`;${Pc(l,y)}`);continue}s=s.replace(a,h==="label"?`.${encodeURIComponent(y)}`:encodeURIComponent(y))}return s}function xw(t,n){return t instanceof FormData?t:n&&(n.get instanceof Function?n.get("Content-Type")??n.get("content-type"):n["Content-Type"]??n["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(t).toString():JSON.stringify(t)}function ww(t,n){var l;let s=`${n.baseUrl}${t}`;(l=n.params)!=null&&l.path&&(s=n.pathSerializer(s,n.params.path));let a=n.querySerializer(n.params.query??{});return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s}function ny(...t){const n=new Headers;for(const s of t){if(!s||typeof s!="object")continue;const a=s instanceof Headers?s.entries():Object.entries(s);for(const[l,c]of a)if(c===null)n.delete(l);else if(Array.isArray(c))for(const h of c)n.append(l,h);else c!==void 0&&n.set(l,c)}return n}function ry(t){return t.endsWith("/")?t.substring(0,t.length-1):t}class mh extends Error{constructor(n,s){super(n),this.status=s,this.name="ApiError"}}const Tt=gw({baseUrl:"/api/v1"});function Vt({data:t,error:n,response:s}){if(n!==void 0||!s.ok)throw new mh((n==null?void 0:n.error)??`HTTP ${s.status}`,s.status);if(t===void 0)throw new mh("empty response body",s.status);return t}function Mg({error:t,response:n}){if(t!==void 0||!n.ok)throw new mh((t==null?void 0:t.error)??`HTTP ${n.status}`,n.status)}function Sw(t=1e4){return bn({queryKey:["health"],queryFn:async()=>Vt(await Tt.GET("/health")),refetchInterval:t,retry:!1})}function kw(){return Zr({mutationFn:async()=>Vt(await Tt.POST("/shutdown"))})}function Ig(){return bn({queryKey:["machine"],queryFn:async()=>Vt(await Tt.GET("/machine"))})}function Lg(){return bn({queryKey:["machines"],queryFn:async()=>Vt(await Tt.GET("/machines"))})}function _w(){const t=zn();return Zr({mutationFn:async n=>Vt(await Tt.PUT("/machine",{body:{name:n}})),onSuccess:()=>{t.invalidateQueries({queryKey:["machine"]}),t.invalidateQueries({queryKey:["machines"]})}})}function Nw(){return bn({queryKey:["agents"],queryFn:async()=>Vt(await Tt.GET("/agents"))})}function Ew(){return bn({queryKey:["config","user-prompt"],queryFn:async()=>{const{data:t,error:n,response:s}=await Tt.GET("/config/user-prompt",{parseAs:"text"});return Vt({data:t,error:n,response:s})}})}function Tw(){const t=zn();return Zr({mutationFn:async n=>Mg(await Tt.PUT("/config/user-prompt",{body:{content:n}})),onSuccess:()=>{t.invalidateQueries({queryKey:["config","user-prompt"]})}})}function Fh(t={},n){return bn({queryKey:["routines",t],queryFn:async()=>Vt(await Tt.GET("/routines",{params:{query:t}})),...n})}function Cw(t,n=!0){return bn({queryKey:["routines",t],queryFn:async()=>Vt(await Tt.GET("/routines/{id}",{params:{path:{id:t}}})),enabled:n&&t.length>0})}function Gl(t,n){t.invalidateQueries({queryKey:["routines"]}),n&&t.invalidateQueries({queryKey:["routines",n]})}function Ow(){const t=zn();return Zr({mutationFn:async n=>Vt(await Tt.POST("/routines",{body:n})),onSuccess:()=>Gl(t)})}function bw(){const t=zn();return Zr({mutationFn:async({id:n,body:s})=>Vt(await Tt.PATCH("/routines/{id}",{params:{path:{id:n}},body:s})),onSuccess:(n,{id:s})=>Gl(t,s)})}function jw(){const t=zn();return Zr({mutationFn:async n=>Vt(await Tt.DELETE("/routines/{id}",{params:{path:{id:n}}})),onSuccess:(n,s)=>Gl(t,s)})}function Fg(){const t=zn();return Zr({mutationFn:async n=>Vt(await Tt.POST("/routines/{id}/trigger",{params:{path:{id:n}}})),onSuccess:(n,s)=>Gl(t,s)})}function Rw(){const t=zn();return Zr({mutationFn:async()=>Vt(await Tt.POST("/routines/cleanup")),onSuccess:()=>Gl(t)})}function Ag(){return bn({queryKey:["routines","lock"],queryFn:async()=>Vt(await Tt.GET("/routines/lock"))})}function Pg(){const t=zn();return Zr({mutationFn:async n=>Vt(await Tt.DELETE("/routines/lock",{params:{query:{scope:n}}})),onSuccess:()=>void t.invalidateQueries({queryKey:["routines","lock"]})})}function Ug(t){return bn({queryKey:["routines","runs",t],queryFn:async()=>Vt(await Tt.GET("/routines/runs",{params:{query:{limit:t}}}))})}function Dw(t,n=!0){return bn({queryKey:["routines",t,"runs"],queryFn:async()=>Vt(await Tt.GET("/routines/{id}/runs",{params:{path:{id:t}}})),enabled:n&&t.length>0})}async function Vg(t){const{data:n,error:s,response:a}=await t;return Vt({data:n,error:s,response:a})}function Mw(t,n=!0){return bn({queryKey:["routines",t,"logs"],queryFn:()=>Vg(Tt.GET("/routines/{id}/logs",{params:{path:{id:t}},parseAs:"text"})),enabled:n&&t.length>0})}function Iw(t,n,s=!0){return bn({queryKey:["routines",t,"runs",n,"log"],queryFn:()=>Vg(Tt.GET("/routines/{id}/runs/{workbench}/log",{params:{path:{id:t,workbench:n}},parseAs:"text"})),enabled:s&&t.length>0&&n.length>0})}function Lw(t,n=!0){return bn({queryKey:["routines",t,"flags"],queryFn:async()=>Vt(await Tt.GET("/routines/{id}/flags",{params:{path:{id:t}}})),enabled:n&&t.length>0})}function Fw(){const t=zn();return Zr({mutationFn:async({id:n,filename:s})=>Mg(await Tt.DELETE("/routines/{id}/flags/{filename}",{params:{path:{id:n,filename:s}}})),onSuccess:(n,{id:s})=>void t.invalidateQueries({queryKey:["routines",s,"flags"]})})}function Aw(t){return t?`/api/v1/routines.ics?routine=${encodeURIComponent(t)}`:"/api/v1/routines.ics"}const zg="moadim.client.theme";function Pw(){try{return localStorage.getItem(zg)==="light"}catch{return!1}}function Uw(t){try{localStorage.setItem(zg,t?"light":"dark")}catch{}}function Vw(t){document.documentElement.classList.toggle("theme-light",t)}function zw(t){return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function $w(t){const{health:n}=t,s=(n==null?void 0:n.status.toUpperCase())??"UNKNOWN",a=n!=null&&n.version?`/ v${n.version}`:"",l=n!=null&&n.git_sha&&n.git_sha!=="unknown"?`build: ${n.git_sha}`:void 0,c=(n==null?void 0:n.uptime_secs)!==void 0&&n.uptime_secs!==null?`/ UP ${zw(n.uptime_secs)}`:"",h=n!=null&&n.dependencies?!n.dependencies.tmux:!1,y=n!=null&&n.dependencies?!n.dependencies.python3:!1;return d.jsxs("header",{className:"app-header",children:[d.jsxs("span",{className:"brand",children:["MOADIM",d.jsx("span",{className:"brand-sub",children:"/ control"}),a&&d.jsx("span",{className:"brand-sub",title:l,children:a})]}),d.jsx("div",{className:"header-spacer"}),d.jsxs("div",{className:"header-right",children:[h&&d.jsx("span",{className:"dep-warn",title:"tmux is not on the daemon's PATH — all routine runs will silently fail",children:"⚠ NO TMUX"}),y&&d.jsx("span",{className:"dep-warn",title:"python3 is not on the daemon's PATH — the claude agent setup step will fail silently",children:"⚠ NO PYTHON3"}),d.jsxs("div",{className:"health",children:[d.jsx("div",{className:`health-dot ${t.healthOk?"ok":"error"}`}),d.jsx("span",{children:s}),d.jsx("span",{children:c})]}),t.machineName&&d.jsx("button",{className:"machine-badge",title:"Click to rename this machine",onClick:t.onRenameMachine,children:t.machineName}),d.jsx("button",{className:"icon-btn",title:t.light?"Switch to dark mode":"Switch to light mode",onClick:t.onTheme,children:t.light?"☀":"🌙"}),d.jsx("button",{className:"icon-btn",title:"Command palette (⌘K)",onClick:t.onPalette,children:"⌘K"}),d.jsx("button",{className:"icon-btn",title:"Refresh",onClick:t.onRefresh,children:"↻"}),d.jsx("button",{className:"icon-btn danger",title:"Stop the server",disabled:!t.healthOk,onClick:t.onStop,children:"⏻ Stop"})]})]})}const Ww=[{to:"/",label:"Overview",end:!0},{to:"/routines",label:"Routines",end:!1},{to:"/heatmap",label:"Heatmap",end:!1},{to:"/settings",label:"Settings",end:!1}];function Hw(){return d.jsx("nav",{className:"app-nav",children:Ww.map(t=>d.jsx(Tx,{to:t.to,end:t.end,className:({isActive:n})=>`nav-link${n?" active":""}`,children:t.label},t.to))})}function Bw(t){switch(t){case"nav-overview":return"home";case"nav-routines":case"routine":return"routines";case"nav-heatmap":return"heatmap";case"nav-settings":return"settings";default:return}}function Zw(t){switch(t){case"nav-overview":case"nav-routines":case"nav-heatmap":case"nav-settings":return"GO";case"routine":return"ROUTINE";default:return"ACTION"}}function sy(t,n){const s=n.trim();if(s==="")return 0;const a=[...t.toLowerCase()],l=[...s.toLowerCase()];let c=0,h=0,y;for(const x of l){let w;for(;h<a.length;){const E=a[h];if(h+=1,E===x){w=h-1;break}}if(w===void 0)return;c+=1,w===0?c+=10:/[a-z0-9]/i.test(a[w-1]??"")||(c+=6),y!==void 0&&w===y+1&&(c+=8),y=w}return c-=Math.floor(a.length/16),c}function qw(t,n){const s=sy(t.title,n),a=sy(t.keywords,n),l=a===void 0?void 0:a-4;return s!==void 0&&l!==void 0?Math.max(s,l):s??l}function Qw(t,n){const s=[];return t.forEach((a,l)=>{const c=qw(a,n);c!==void 0&&s.push([l,c])}),s.sort(([a,l],[c,h])=>h-l||a-c),s.map(([a])=>a)}function Yw(t,n){return t||(n.trim()!==""?n:"—")}function Gw(t){const n=Yw(t.schedule_description,t.schedule),s=[];return t.enabled?(t.skip_runs??0)>0?s.push("SNOOZED"):t.agent_registered||s.push("AGENT MISSING"):s.push("DISABLED"),t.flag_count>0&&s.push("FLAGS"),s.length===0?n:`${n} — ${s.join(", ")}`}function Kw(t){const n=[{kind:"nav-overview",title:"Overview",subtitle:"Fleet summary & upcoming runs",keywords:"home dashboard kpi summary landing"},{kind:"nav-routines",title:"Routines",subtitle:"Manage agent-driven routines",keywords:"agents automation"},{kind:"nav-heatmap",title:"Heatmap",subtitle:"7-day x 24-hour fire-density grid",keywords:"schedule density grid busy collisions calendar"},{kind:"nav-settings",title:"Settings",subtitle:"Persistent agent prompt",keywords:"config preferences user prompt"},{kind:"action-refresh",title:"Refresh",subtitle:"Re-poll server health",keywords:"reload health status action"},{kind:"action-stop",title:"Stop Server",subtitle:"Shut the moadim server down",keywords:"shutdown halt kill quit action"},{kind:"action-toggle-theme",title:"Toggle Theme",subtitle:"Switch between dark and light mode",keywords:"theme light dark mode toggle appearance action"}];for(const s of t)n.push({kind:"routine",title:s.title,subtitle:Gw(s),keywords:`${s.id} ${s.agent} ${s.schedule} ${(s.tags??[]).join(" ")} routine`,routineId:s.id});return n}function Xw(t,n){return n===0?0:Math.min(t,n-1)}function Jw(t,n){return n===0?0:Math.min(t+1,n-1)}function eS(t){return Math.max(0,t-1)}function tS(t){return Math.max(0,t-1)}const nS={home:"/",routines:"/routines",heatmap:"/heatmap",settings:"/settings"};function rS({open:t,onClose:n,onRefresh:s,onStop:a,onToggleTheme:l}){const c=Lc(),[h,y]=Z.useState(""),[x,w]=Z.useState(0),E=Z.useRef(null),{data:O}=bn({queryKey:["command-palette","routines"],queryFn:async()=>Vt(await Tt.GET("/routines")),enabled:t});if(Z.useEffect(()=>{var j;t&&(y(""),w(0),(j=E.current)==null||j.focus())},[t]),!t)return null;const _=Kw(O??[]),S=Qw(_,h),C=Xw(x,S.length),T=j=>{const F=_[S[j]??-1];if(F)switch(F.kind){case"action-refresh":s();break;case"action-stop":a();break;case"action-toggle-theme":l();break;default:{const U=Bw(F.kind);U&&c(nS[U]??"/")}}n()},b=j=>{switch(j.key){case"ArrowDown":j.preventDefault(),w(Jw(C,S.length));break;case"ArrowUp":j.preventDefault(),w(eS(C));break;case"Home":j.preventDefault(),w(0);break;case"End":j.preventDefault(),w(tS(S.length));break;case"Enter":j.preventDefault(),T(C);break;case"Escape":j.preventDefault(),n();break}},I=S.length>0?`cmdk-opt-${C}`:void 0;return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"cmdk",role:"dialog","aria-modal":"true","aria-label":"Command palette",onClick:j=>j.stopPropagation(),children:[d.jsxs("div",{className:"cmdk-search",children:[d.jsx("span",{"aria-hidden":"true",children:"›"}),d.jsx("input",{ref:E,className:"cmdk-input",type:"text",placeholder:"Search pages, routines…",autoComplete:"off",spellCheck:!1,role:"combobox","aria-expanded":"true","aria-controls":"cmdk-listbox","aria-autocomplete":"list","aria-activedescendant":I,value:h,onChange:j=>{y(j.target.value),w(0)},onKeyDown:b}),d.jsx("span",{className:"cmdk-hint","aria-hidden":"true",children:"ESC"})]}),S.length===0?d.jsxs("div",{className:"cmdk-empty",children:[d.jsx("div",{children:"NO MATCHES"}),d.jsx("div",{children:"no page or routine matches"})]}):d.jsx("ul",{id:"cmdk-listbox",className:"cmdk-list",role:"listbox","aria-label":"Results",children:S.map((j,F)=>{const U=_[j];if(!U)return null;const $=F===C;return d.jsxs("li",{id:`cmdk-opt-${F}`,className:`cmdk-row${$?" active":""}`,role:"option","aria-selected":$,onClick:()=>T(F),onMouseEnter:()=>w(F),children:[d.jsx("span",{className:"kind-badge",children:Zw(U.kind)}),d.jsxs("span",{className:"cmdk-row-text",children:[d.jsx("span",{className:"cmdk-row-title",children:U.title}),d.jsx("span",{className:"cmdk-row-sub",children:U.subtitle})]})]},j)})}),d.jsxs("div",{className:"cmdk-foot","aria-hidden":"true",children:[d.jsxs("span",{children:[d.jsx("span",{className:"cmdk-key",children:"↑↓"})," navigate"]}),d.jsxs("span",{children:[d.jsx("span",{className:"cmdk-key",children:"↵"})," open"]}),d.jsxs("span",{children:[d.jsx("span",{className:"cmdk-key",children:"esc"})," close"]})]})]})})}function sS({current:t,onCancel:n,onConfirm:s}){const[a,l]=Z.useState(t),[c,h]=Z.useState(!1),y=a.trim(),x=async()=>{if(y!==""){h(!0);try{await s(y)}finally{h(!1)}}};return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"rename-machine-title",onClick:w=>w.stopPropagation(),children:[d.jsx("div",{id:"rename-machine-title",className:"dialog-title",children:"Rename machine"}),d.jsxs("div",{className:"dialog-msg",children:[d.jsx("label",{className:"form-label",htmlFor:"rename-machine-input",children:"Machine name"}),d.jsx("input",{id:"rename-machine-input",className:"form-input",type:"text",value:a,onChange:w=>l(w.target.value),disabled:c,autoComplete:"off",spellCheck:!1})]}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{className:"btn btn-ghost",onClick:n,disabled:c,children:"Cancel"}),d.jsx("button",{className:"btn btn-primary",onClick:()=>void x(),disabled:c||y==="",children:c?"Saving…":"Rename"})]})]})})}function iS({onCancel:t,onConfirm:n}){return d.jsx("div",{className:"overlay",onClick:t,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"shutdown-dialog-title",onClick:s=>s.stopPropagation(),children:[d.jsx("div",{id:"shutdown-dialog-title",className:"dialog-title",children:"⏻ Stop server"}),d.jsx("div",{className:"dialog-msg",children:"Stop the moadim server? Scheduled jobs and routines will not run until it is started again."}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{className:"btn btn-ghost",onClick:t,children:"Cancel"}),d.jsx("button",{className:"btn btn-danger",onClick:n,children:"Stop server"})]})]})})}const $g=Z.createContext(null);function aS({children:t}){const[n,s]=Z.useState([]),a=Z.useRef(0),l=Z.useCallback((c,h)=>{const y=a.current++;s(x=>[...x,{id:y,msg:c,kind:h}]),setTimeout(()=>s(x=>x.filter(w=>w.id!==y)),5e3)},[]);return d.jsx($g.Provider,{value:{toasts:n,addToast:l},children:t})}function Fo(){const t=Z.useContext($g);if(!t)throw new Error("useToasts must be used within a ToastProvider");return t}function oS(){const{toasts:t}=Fo();return d.jsx("div",{className:"toast-wrap",role:"status","aria-live":"polite","aria-atomic":"false",children:t.map(n=>d.jsx("div",{className:`toast ${n.kind}`,children:n.msg},n.id))})}function lS(){var I,j,F;const[t,n]=Z.useState(Pw),[s,a]=Z.useState(!1),[l,c]=Z.useState(!1),[h,y]=Z.useState(!1),x=zn(),{addToast:w}=Fo(),E=Sw(3e4),O=Ig(),_=kw(),S=_w();Z.useEffect(()=>{Vw(t)},[t]),Z.useEffect(()=>{const U=$=>{($.metaKey||$.ctrlKey)&&$.key.toLowerCase()==="k"?($.preventDefault(),c(J=>!J)):$.key==="Escape"&&(a(!1),y(!1))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[]);const C=()=>{n(U=>{const $=!U;return Uw($),$})},T=()=>{a(!1),_.mutate(void 0,{onSuccess:()=>{w("Server stopping…","ok"),x.invalidateQueries({queryKey:["health"]})},onError:U=>w(`Stop failed: ${U.message}`,"err")})},b=async U=>{try{await S.mutateAsync(U),y(!1),w(`Machine renamed to "${U}"`,"ok")}catch($){throw w(`Rename failed: ${$ instanceof Error?$.message:String($)}`,"err"),$}};return d.jsxs("div",{className:"app-shell",children:[d.jsx($w,{health:E.data,healthOk:((I=E.data)==null?void 0:I.running)??!1,light:t,machineName:(j=O.data)==null?void 0:j.name,onRefresh:()=>void E.refetch(),onStop:()=>a(!0),onPalette:()=>c(U=>!U),onTheme:C,onRenameMachine:()=>y(!0)}),d.jsx(Hw,{}),d.jsx("div",{className:"page",children:d.jsx(fx,{})}),d.jsx(rS,{open:l,onClose:()=>c(!1),onRefresh:()=>void E.refetch(),onStop:()=>a(!0),onToggleTheme:C}),h&&d.jsx(sS,{current:((F=O.data)==null?void 0:F.name)??"",onCancel:()=>y(!1),onConfirm:b}),s&&d.jsx(iS,{onCancel:()=>a(!1),onConfirm:T}),d.jsx(oS,{})]})}function Wg({status:t,onUnlock:n}){return!t||!t.locked?null:d.jsxs("div",{className:"card",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",marginBottom:16,borderColor:"var(--warn)"},children:[d.jsxs("div",{style:{fontSize:13,fontWeight:600},children:["⚠ Routines globally locked — scheduling and manual triggers paused",t.shared&&d.jsx("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-faint)"},children:"SHARED .lock"}),t.local&&d.jsx("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-faint)"},children:"LOCAL .local.lock"})]}),d.jsx("button",{className:"btn btn-ghost",onClick:n,children:"Unlock all"})]})}const Hg=[{token:"off",label:"Off",ms:void 0},{token:"5",label:"5s",ms:5e3},{token:"15",label:"15s",ms:15e3},{token:"30",label:"30s",ms:3e4},{token:"60",label:"60s",ms:6e4}],Bg="moadim.refresh-interval";function uS(t){return t==="off"||t==="5"||t==="15"||t==="30"||t==="60"}function Uc(t){var n;return(n=Hg.find(s=>s.token===t))==null?void 0:n.ms}function Vc(){try{const t=localStorage.getItem(Bg);return uS(t)?t:"off"}catch{return"off"}}function zc(t){try{localStorage.setItem(Bg,t)}catch{}}function Ah(t){return t<60?"updated just now":t<3600?`updated ${Math.floor(t/60)}m ago`:`updated ${Math.floor(t/3600)}h ago`}function $c({token:t,updatedAtMs:n,onChange:s}){const[,a]=Z.useState(0);Z.useEffect(()=>{const c=setInterval(()=>a(h=>h+1),1e3);return()=>clearInterval(c)},[]);const l=n>0?Ah(Math.max(0,Math.floor((Date.now()-n)/1e3))):void 0;return d.jsxs("div",{className:"refresh-control",children:[d.jsx("label",{className:"refresh-lbl",htmlFor:"refresh-interval",children:"AUTO"}),d.jsx("select",{id:"refresh-interval",className:"refresh-select",value:t,"aria-label":"Auto-refresh interval",onChange:c=>s(c.target.value),children:Hg.map(c=>d.jsx("option",{value:c.token,children:c.label},c.token))}),l!==void 0&&d.jsx("span",{className:"refresh-fresh",title:"Time since the list last refreshed",children:l})]})}var Tn={},iy;function cS(){if(iy)return Tn;iy=1,Object.defineProperty(Tn,"__esModule",{value:!0});class t extends Error{}class n extends t{constructor(o){super(`Invalid DateTime: ${o.toMessage()}`)}}class s extends t{constructor(o){super(`Invalid Interval: ${o.toMessage()}`)}}class a extends t{constructor(o){super(`Invalid Duration: ${o.toMessage()}`)}}class l extends t{}class c extends t{constructor(o){super(`Invalid unit ${o}`)}}class h extends t{}class y extends t{constructor(){super("Zone is an abstract class")}}const x="numeric",w="short",E="long",O={year:x,month:x,day:x},_={year:x,month:w,day:x},S={year:x,month:w,day:x,weekday:w},C={year:x,month:E,day:x},T={year:x,month:E,day:x,weekday:E},b={hour:x,minute:x},I={hour:x,minute:x,second:x},j={hour:x,minute:x,second:x,timeZoneName:w},F={hour:x,minute:x,second:x,timeZoneName:E},U={hour:x,minute:x,hourCycle:"h23"},$={hour:x,minute:x,second:x,hourCycle:"h23"},J={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:w},se={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:E},me={year:x,month:x,day:x,hour:x,minute:x},ye={year:x,month:x,day:x,hour:x,minute:x,second:x},ke={year:x,month:w,day:x,hour:x,minute:x},pe={year:x,month:w,day:x,hour:x,minute:x,second:x},ve={year:x,month:w,day:x,weekday:w,hour:x,minute:x},he={year:x,month:E,day:x,hour:x,minute:x,timeZoneName:w},Me={year:x,month:E,day:x,hour:x,minute:x,second:x,timeZoneName:w},Pe={year:x,month:E,day:x,weekday:E,hour:x,minute:x,timeZoneName:E},Xe={year:x,month:E,day:x,weekday:E,hour:x,minute:x,second:x,timeZoneName:E};class $e{get type(){throw new y}get name(){throw new y}get ianaName(){return this.name}get isUniversal(){throw new y}offsetName(o,m){throw new y}formatOffset(o,m){throw new y}offset(o){throw new y}equals(o){throw new y}get isValid(){throw new y}}let te=null;class ge extends $e{static get instance(){return te===null&&(te=new ge),te}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(o,{format:m,locale:v}){return au(o,m,v)}formatOffset(o,m){return Ls(this.offset(o),m)}offset(o){return-new Date(o).getTimezoneOffset()}equals(o){return o.type==="system"}get isValid(){return!0}}const ue=new Map;function B(g){let o=ue.get(g);return o===void 0&&(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:g,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),ue.set(g,o)),o}const ne={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ze(g,o){const m=g.format(o).replace(/\u200E/g,""),v=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(m),[,N,M,V,H,Y,ae,Fe]=v;return[V,N,M,H,Y,ae,Fe]}function Ce(g,o){const m=g.formatToParts(o),v=[];for(let N=0;N<m.length;N++){const{type:M,value:V}=m[N],H=ne[M];M==="era"?v[H]=V:We(H)||(v[H]=parseInt(V,10))}return v}const je=new Map;class Le extends $e{static create(o){let m=je.get(o);return m===void 0&&je.set(o,m=new Le(o)),m}static resetCache(){je.clear(),ue.clear()}static isValidSpecifier(o){return this.isValidZone(o)}static isValidZone(o){if(!o)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:o}).format(),!0}catch{return!1}}constructor(o){super(),this.zoneName=o,this.valid=Le.isValidZone(o)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(o,{format:m,locale:v}){return au(o,m,v,this.name)}formatOffset(o,m){return Ls(this.offset(o),m)}offset(o){if(!this.valid)return NaN;const m=new Date(o);if(isNaN(m))return NaN;const v=B(this.name);let[N,M,V,H,Y,ae,Fe]=v.formatToParts?Ce(v,m):ze(v,m);H==="BC"&&(N=-Math.abs(N)+1);const tt=Ms({year:N,month:M,day:V,hour:Y===24?0:Y,minute:ae,second:Fe,millisecond:0});let Ae=+m;const mt=Ae%1e3;return Ae-=mt>=0?mt:1e3+mt,(tt-Ae)/(60*1e3)}equals(o){return o.type==="iana"&&o.name===this.name}get isValid(){return this.valid}}let Qe={};function Be(g,o={}){const m=JSON.stringify([g,o]);let v=Qe[m];return v||(v=new Intl.ListFormat(g,o),Qe[m]=v),v}const lt=new Map;function Ct(g,o={}){const m=JSON.stringify([g,o]);let v=lt.get(m);return v===void 0&&(v=new Intl.DateTimeFormat(g,o),lt.set(m,v)),v}const jn=new Map;function sr(g,o={}){const m=JSON.stringify([g,o]);let v=jn.get(m);return v===void 0&&(v=new Intl.NumberFormat(g,o),jn.set(m,v)),v}const $n=new Map;function Nr(g,o={}){const{base:m,...v}=o,N=JSON.stringify([g,v]);let M=$n.get(N);return M===void 0&&(M=new Intl.RelativeTimeFormat(g,o),$n.set(N,M)),M}let Wn=null;function ir(){return Wn||(Wn=new Intl.DateTimeFormat().resolvedOptions().locale,Wn)}const Hn=new Map;function ar(g){let o=Hn.get(g);return o===void 0&&(o=new Intl.DateTimeFormat(g).resolvedOptions(),Hn.set(g,o)),o}const Rn=new Map;function or(g){let o=Rn.get(g);if(!o){const m=new Intl.Locale(g);o="getWeekInfo"in m?m.getWeekInfo():m.weekInfo,"minimalDays"in o||(o={...D,...o}),Rn.set(g,o)}return o}function Dn(g){const o=g.indexOf("-x-");o!==-1&&(g=g.substring(0,o));const m=g.indexOf("-u-");if(m===-1)return[g];{let v,N;try{v=Ct(g).resolvedOptions(),N=g}catch{const Y=g.substring(0,m);v=Ct(Y).resolvedOptions(),N=Y}const{numberingSystem:M,calendar:V}=v;return[N,M,V]}}function qr(g,o,m){return(m||o)&&(g.includes("-u-")||(g+="-u"),m&&(g+=`-ca-${m}`),o&&(g+=`-nu-${o}`)),g}function Qr(g){const o=[];for(let m=1;m<=12;m++){const v=He.utc(2009,m,1);o.push(g(v))}return o}function Yr(g){const o=[];for(let m=1;m<=7;m++){const v=He.utc(2016,11,13+m);o.push(g(v))}return o}function lr(g,o,m,v){const N=g.listingMode();return N==="error"?null:N==="en"?m(o):v(o)}function Bn(g){return g.numberingSystem&&g.numberingSystem!=="latn"?!1:g.numberingSystem==="latn"||!g.locale||g.locale.startsWith("en")||ar(g.locale).numberingSystem==="latn"}class Gr{constructor(o,m,v){this.padTo=v.padTo||0,this.floor=v.floor||!1;const{padTo:N,floor:M,...V}=v;if(!m||Object.keys(V).length>0){const H={useGrouping:!1,...v};v.padTo>0&&(H.minimumIntegerDigits=v.padTo),this.inf=sr(o,H)}}format(o){if(this.inf){const m=this.floor?Math.floor(o):o;return this.inf.format(m)}else{const m=this.floor?Math.floor(o):Xr(o,3);return Mt(m,this.padTo)}}}class At{constructor(o,m,v){this.opts=v,this.originalZone=void 0;let N;if(this.opts.timeZone)this.dt=o;else if(o.zone.type==="fixed"){const V=-1*(o.offset/60),H=V>=0?`Etc/GMT+${V}`:`Etc/GMT${V}`;o.offset!==0&&Le.create(H).valid?(N=H,this.dt=o):(N="UTC",this.dt=o.offset===0?o:o.setZone("UTC").plus({minutes:o.offset}),this.originalZone=o.zone)}else o.zone.type==="system"?this.dt=o:o.zone.type==="iana"?(this.dt=o,N=o.zone.name):(N="UTC",this.dt=o.setZone("UTC").plus({minutes:o.offset}),this.originalZone=o.zone);const M={...this.opts};M.timeZone=M.timeZone||N,this.dtf=Ct(m,M)}format(){return this.originalZone?this.formatToParts().map(({value:o})=>o).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const o=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?o.map(m=>{if(m.type==="timeZoneName"){const v=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...m,value:v}}else return m}):o}resolvedOptions(){return this.dtf.resolvedOptions()}}class Kr{constructor(o,m,v){this.opts={style:"long",...v},!m&&Ho()&&(this.rtf=Nr(o,v))}format(o,m){return this.rtf?this.rtf.format(o,m):cu(m,o,this.opts.numeric,this.opts.style!=="long")}formatToParts(o,m){return this.rtf?this.rtf.formatToParts(o,m):[]}}const D={firstDay:1,minimalDays:4,weekend:[6,7]};class A{static fromOpts(o){return A.create(o.locale,o.numberingSystem,o.outputCalendar,o.weekSettings,o.defaultToEN)}static create(o,m,v,N,M=!1){const V=o||gt.defaultLocale,H=V||(M?"en-US":ir()),Y=m||gt.defaultNumberingSystem,ae=v||gt.defaultOutputCalendar,Fe=Zo(N)||gt.defaultWeekSettings;return new A(H,Y,ae,Fe,V)}static resetCache(){Wn=null,lt.clear(),jn.clear(),$n.clear(),Hn.clear(),Rn.clear()}static fromObject({locale:o,numberingSystem:m,outputCalendar:v,weekSettings:N}={}){return A.create(o,m,v,N)}constructor(o,m,v,N,M){const[V,H,Y]=Dn(o);this.locale=V,this.numberingSystem=m||H||null,this.outputCalendar=v||Y||null,this.weekSettings=N,this.intl=qr(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=M,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Bn(this)),this.fastNumbersCached}listingMode(){const o=this.isEnglish(),m=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return o&&m?"en":"intl"}clone(o){return!o||Object.getOwnPropertyNames(o).length===0?this:A.create(o.locale||this.specifiedLocale,o.numberingSystem||this.numberingSystem,o.outputCalendar||this.outputCalendar,Zo(o.weekSettings)||this.weekSettings,o.defaultToEN||!1)}redefaultToEN(o={}){return this.clone({...o,defaultToEN:!0})}redefaultToSystem(o={}){return this.clone({...o,defaultToEN:!1})}months(o,m=!1){return lr(this,o,Ra,()=>{const v=this.intl==="ja"||this.intl.startsWith("ja-");m&=!v;const N=m?{month:o,day:"numeric"}:{month:o},M=m?"format":"standalone";if(!this.monthsCache[M][o]){const V=v?H=>this.dtFormatter(H,N).format():H=>this.extract(H,N,"month");this.monthsCache[M][o]=Qr(V)}return this.monthsCache[M][o]})}weekdays(o,m=!1){return lr(this,o,dr,()=>{const v=m?{weekday:o,year:"numeric",month:"long",day:"numeric"}:{weekday:o},N=m?"format":"standalone";return this.weekdaysCache[N][o]||(this.weekdaysCache[N][o]=Yr(M=>this.extract(M,v,"weekday"))),this.weekdaysCache[N][o]})}meridiems(){return lr(this,void 0,()=>As,()=>{if(!this.meridiemCache){const o={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[He.utc(2016,11,13,9),He.utc(2016,11,13,19)].map(m=>this.extract(m,o,"dayperiod"))}return this.meridiemCache})}eras(o){return lr(this,o,Yo,()=>{const m={era:o};return this.eraCache[o]||(this.eraCache[o]=[He.utc(-40,1,1),He.utc(2017,1,1)].map(v=>this.extract(v,m,"era"))),this.eraCache[o]})}extract(o,m,v){const N=this.dtFormatter(o,m),M=N.formatToParts(),V=M.find(H=>H.type.toLowerCase()===v);return V?V.value:null}numberFormatter(o={}){return new Gr(this.intl,o.forceSimple||this.fastNumbers,o)}dtFormatter(o,m={}){return new At(o,this.intl,m)}relFormatter(o={}){return new Kr(this.intl,this.isEnglish(),o)}listFormatter(o={}){return Be(this.intl,o)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ar(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Di()?or(this.locale):D}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(o){return this.locale===o.locale&&this.numberingSystem===o.numberingSystem&&this.outputCalendar===o.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let q=null;class ee extends $e{static get utcInstance(){return q===null&&(q=new ee(0)),q}static instance(o){return o===0?ee.utcInstance:new ee(o)}static parseSpecifier(o){if(o){const m=o.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(m)return new ee(Is(m[1],m[2]))}return null}constructor(o){super(),this.fixed=o}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ls(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ls(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(o,m){return Ls(this.fixed,m)}get isUniversal(){return!0}offset(){return this.fixed}equals(o){return o.type==="fixed"&&o.fixed===this.fixed}get isValid(){return!0}}class le extends $e{constructor(o){super(),this.zoneName=o}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function W(g,o){if(We(g)||g===null)return o;if(g instanceof $e)return g;if(Zc(g)){const m=g.toLowerCase();return m==="default"?o:m==="local"||m==="system"?ge.instance:m==="utc"||m==="gmt"?ee.utcInstance:ee.parseSpecifier(m)||Le.create(g)}else return Tr(g)?ee.instance(g):typeof g=="object"&&"offset"in g&&typeof g.offset=="function"?g:new le(g)}const Q={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},re={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},_e=Q.hanidec.replace(/[\[|\]]/g,"").split("");function Ke(g){let o=parseInt(g,10);if(isNaN(o)){o="";for(let m=0;m<g.length;m++){const v=g.charCodeAt(m);if(g[m].search(Q.hanidec)!==-1)o+=_e.indexOf(g[m]);else for(const N in re){const[M,V]=re[N];v>=M&&v<=V&&(o+=v-M)}}return parseInt(o,10)}else return o}const xt=new Map;function Kt(){xt.clear()}function yt({numberingSystem:g},o=""){const m=g||"latn";let v=xt.get(m);v===void 0&&(v=new Map,xt.set(m,v));let N=v.get(o);return N===void 0&&(N=new RegExp(`${Q[m]}${o}`),v.set(o,N)),N}let ur=()=>Date.now(),ji="system",Ts=null,Ri=null,Cs=null,Ea=60,Po,Os=null;class gt{static get now(){return ur}static set now(o){ur=o}static set defaultZone(o){ji=o}static get defaultZone(){return W(ji,ge.instance)}static get defaultLocale(){return Ts}static set defaultLocale(o){Ts=o}static get defaultNumberingSystem(){return Ri}static set defaultNumberingSystem(o){Ri=o}static get defaultOutputCalendar(){return Cs}static set defaultOutputCalendar(o){Cs=o}static get defaultWeekSettings(){return Os}static set defaultWeekSettings(o){Os=Zo(o)}static get twoDigitCutoffYear(){return Ea}static set twoDigitCutoffYear(o){Ea=o%100}static get throwOnInvalid(){return Po}static set throwOnInvalid(o){Po=o}static resetCaches(){A.resetCache(),Le.resetCache(),He.resetCache(),Kt()}}class Xt{constructor(o,m){this.reason=o,this.explanation=m}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const tu=[0,31,59,90,120,151,181,212,243,273,304,334],bs=[0,31,60,91,121,152,182,213,244,274,305,335];function Jt(g,o){return new Xt("unit out of range",`you specified ${o} (of type ${typeof o}) as a ${g}, which is invalid`)}function js(g,o,m){const v=new Date(Date.UTC(g,o-1,m));g<100&&g>=0&&v.setUTCFullYear(v.getUTCFullYear()-1900);const N=v.getUTCDay();return N===0?7:N}function Ta(g,o,m){return m+(Or(g)?bs:tu)[o-1]}function nu(g,o){const m=Or(g)?bs:tu,v=m.findIndex(M=>M<o),N=o-m[v];return{month:v+1,day:N}}function Uo(g,o){return(g-o+7)%7+1}function Ca(g,o=4,m=1){const{year:v,month:N,day:M}=g,V=Ta(v,N,M),H=Uo(js(v,N,M),m);let Y=Math.floor((V-H+14-o)/7),ae;return Y<1?(ae=v-1,Y=Jr(ae,o,m)):Y>Jr(v,o,m)?(ae=v+1,Y=1):ae=v,{weekYear:ae,weekNumber:Y,weekday:H,...Fs(g)}}function Er(g,o=4,m=1){const{weekYear:v,weekNumber:N,weekday:M}=g,V=Uo(js(v,1,o),m),H=Ds(v);let Y=N*7+M-V-7+o,ae;Y<1?(ae=v-1,Y+=Ds(ae)):Y>H?(ae=v+1,Y-=Ds(v)):ae=v;const{month:Fe,day:Ze}=nu(ae,Y);return{year:ae,month:Fe,day:Ze,...Fs(g)}}function Oa(g){const{year:o,month:m,day:v}=g,N=Ta(o,m,v);return{year:o,ordinal:N,...Fs(g)}}function Vo(g){const{year:o,ordinal:m}=g,{month:v,day:N}=nu(o,m);return{year:o,month:v,day:N,...Fs(g)}}function ru(g,o){if(!We(g.localWeekday)||!We(g.localWeekNumber)||!We(g.localWeekYear)){if(!We(g.weekday)||!We(g.weekNumber)||!We(g.weekYear))throw new l("Cannot mix locale-based week fields with ISO-based week fields");return We(g.localWeekday)||(g.weekday=g.localWeekday),We(g.localWeekNumber)||(g.weekNumber=g.localWeekNumber),We(g.localWeekYear)||(g.weekYear=g.localWeekYear),delete g.localWeekday,delete g.localWeekNumber,delete g.localWeekYear,{minDaysInFirstWeek:o.getMinDaysInFirstWeek(),startOfWeek:o.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function su(g,o=4,m=1){const v=wt(g.weekYear),N=Nt(g.weekNumber,1,Jr(g.weekYear,o,m)),M=Nt(g.weekday,1,7);return v?N?M?!1:Jt("weekday",g.weekday):Jt("week",g.weekNumber):Jt("weekYear",g.weekYear)}function iu(g){const o=wt(g.year),m=Nt(g.ordinal,1,Ds(g.year));return o?m?!1:Jt("ordinal",g.ordinal):Jt("year",g.year)}function zo(g){const o=wt(g.year),m=Nt(g.month,1,12),v=Nt(g.day,1,ja(g.year,g.month));return o?m?v?!1:Jt("day",g.day):Jt("month",g.month):Jt("year",g.year)}function $o(g){const{hour:o,minute:m,second:v,millisecond:N}=g,M=Nt(o,0,23)||o===24&&m===0&&v===0&&N===0,V=Nt(m,0,59),H=Nt(v,0,59),Y=Nt(N,0,999);return M?V?H?Y?!1:Jt("millisecond",N):Jt("second",v):Jt("minute",m):Jt("hour",o)}function We(g){return typeof g>"u"}function Tr(g){return typeof g=="number"}function wt(g){return typeof g=="number"&&g%1===0}function Zc(g){return typeof g=="string"}function Wo(g){return Object.prototype.toString.call(g)==="[object Date]"}function Ho(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Di(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function qc(g){return Array.isArray(g)?g:[g]}function Bo(g,o,m){if(g.length!==0)return g.reduce((v,N)=>{const M=[o(N),N];return v&&m(v[0],M[0])===v[0]?v:M},null)[1]}function ba(g,o){return o.reduce((m,v)=>(m[v]=g[v],m),{})}function en(g,o){return Object.prototype.hasOwnProperty.call(g,o)}function Zo(g){if(g==null)return null;if(typeof g!="object")throw new h("Week settings must be an object");if(!Nt(g.firstDay,1,7)||!Nt(g.minimalDays,1,7)||!Array.isArray(g.weekend)||g.weekend.some(o=>!Nt(o,1,7)))throw new h("Invalid week settings");return{firstDay:g.firstDay,minimalDays:g.minimalDays,weekend:Array.from(g.weekend)}}function Nt(g,o,m){return wt(g)&&g>=o&&g<=m}function Qc(g,o){return g-o*Math.floor(g/o)}function Mt(g,o=2){const m=g<0;let v;return m?v="-"+(""+-g).padStart(o,"0"):v=(""+g).padStart(o,"0"),v}function Cr(g){if(!(We(g)||g===null||g===""))return parseInt(g,10)}function Zn(g){if(!(We(g)||g===null||g===""))return parseFloat(g)}function Rs(g){if(!(We(g)||g===null||g==="")){const o=parseFloat("0."+g)*1e3;return Math.floor(o)}}function Xr(g,o,m="round"){const v=10**o;switch(m){case"expand":return g>0?Math.ceil(g*v)/v:Math.floor(g*v)/v;case"trunc":return Math.trunc(g*v)/v;case"round":return Math.round(g*v)/v;case"floor":return Math.floor(g*v)/v;case"ceil":return Math.ceil(g*v)/v;default:throw new RangeError(`Value rounding ${m} is out of range`)}}function Or(g){return g%4===0&&(g%100!==0||g%400===0)}function Ds(g){return Or(g)?366:365}function ja(g,o){const m=Qc(o-1,12)+1,v=g+(o-m)/12;return m===2?Or(v)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][m-1]}function Ms(g){let o=Date.UTC(g.year,g.month-1,g.day,g.hour,g.minute,g.second,g.millisecond);return g.year<100&&g.year>=0&&(o=new Date(o),o.setUTCFullYear(g.year,g.month-1,g.day)),+o}function qo(g,o,m){return-Uo(js(g,1,o),m)+o-1}function Jr(g,o=4,m=1){const v=qo(g,o,m),N=qo(g+1,o,m);return(Ds(g)-v+N)/7}function es(g){return g>99?g:g>gt.twoDigitCutoffYear?1900+g:2e3+g}function au(g,o,m,v=null){const N=new Date(g),M={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};v&&(M.timeZone=v);const V={timeZoneName:o,...M},H=new Intl.DateTimeFormat(m,V).formatToParts(N).find(Y=>Y.type.toLowerCase()==="timezonename");return H?H.value:null}function Is(g,o){let m=parseInt(g,10);Number.isNaN(m)&&(m=0);const v=parseInt(o,10)||0,N=m<0||Object.is(m,-0)?-v:v;return m*60+N}function ut(g){const o=Number(g);if(typeof g=="boolean"||g===""||!Number.isFinite(o))throw new h(`Invalid unit value ${g}`);return o}function Mi(g,o){const m={};for(const v in g)if(en(g,v)){const N=g[v];if(N==null)continue;m[o(v)]=ut(N)}return m}function Ls(g,o){const m=Math.trunc(Math.abs(g/60)),v=Math.trunc(Math.abs(g%60)),N=g>=0?"+":"-";switch(o){case"short":return`${N}${Mt(m,2)}:${Mt(v,2)}`;case"narrow":return`${N}${m}${v>0?`:${v}`:""}`;case"techie":return`${N}${Mt(m,2)}${Mt(v,2)}`;default:throw new RangeError(`Value format ${o} is out of range for property format`)}}function Fs(g){return ba(g,["hour","minute","second","millisecond"])}const ou=["January","February","March","April","May","June","July","August","September","October","November","December"],Qo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lu=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ra(g){switch(g){case"narrow":return[...lu];case"short":return[...Qo];case"long":return[...ou];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Ii=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],cr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],br=["M","T","W","T","F","S","S"];function dr(g){switch(g){case"narrow":return[...br];case"short":return[...cr];case"long":return[...Ii];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const As=["AM","PM"],Li=["Before Christ","Anno Domini"],jr=["BC","AD"],Yc=["B","A"];function Yo(g){switch(g){case"narrow":return[...Yc];case"short":return[...jr];case"long":return[...Li];default:return null}}function Fi(g){return As[g.hour<12?0:1]}function Gc(g,o){return dr(o)[g.weekday-1]}function uu(g,o){return Ra(o)[g.month-1]}function Da(g,o){return Yo(o)[g.year<0?0:1]}function cu(g,o,m="always",v=!1){const N={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},M=["hours","minutes","seconds"].indexOf(g)===-1;if(m==="auto"&&M){const Ze=g==="days";switch(o){case 1:return Ze?"tomorrow":`next ${N[g][0]}`;case-1:return Ze?"yesterday":`last ${N[g][0]}`;case 0:return Ze?"today":`this ${N[g][0]}`}}const V=Object.is(o,-0)||o<0,H=Math.abs(o),Y=H===1,ae=N[g],Fe=v?Y?ae[1]:ae[2]||ae[1]:Y?N[g][0]:g;return V?`${H} ${Fe} ago`:`in ${H} ${Fe}`}function du(g,o){let m="";for(const v of g)v.literal?m+=v.val:m+=o(v.val);return m}const Ai={D:O,DD:_,DDD:C,DDDD:T,t:b,tt:I,ttt:j,tttt:F,T:U,TT:$,TTT:J,TTTT:se,f:me,ff:ke,fff:he,ffff:Pe,F:ye,FF:pe,FFF:Me,FFFF:Xe};class It{static create(o,m={}){return new It(o,m)}static parseFormat(o){let m=null,v="",N=!1;const M=[];for(let V=0;V<o.length;V++){const H=o.charAt(V);H==="'"?((v.length>0||N)&&M.push({literal:N||/^\s+$/.test(v),val:v===""?"'":v}),m=null,v="",N=!N):N||H===m?v+=H:(v.length>0&&M.push({literal:/^\s+$/.test(v),val:v}),v=H,m=H)}return v.length>0&&M.push({literal:N||/^\s+$/.test(v),val:v}),M}static macroTokenToFormatOpts(o){return Ai[o]}constructor(o,m){this.opts=m,this.loc=o,this.systemLoc=null}formatWithSystemDefault(o,m){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(o,{...this.opts,...m}).format()}dtFormatter(o,m={}){return this.loc.dtFormatter(o,{...this.opts,...m})}formatDateTime(o,m){return this.dtFormatter(o,m).format()}formatDateTimeParts(o,m){return this.dtFormatter(o,m).formatToParts()}formatInterval(o,m){return this.dtFormatter(o.start,m).dtf.formatRange(o.start.toJSDate(),o.end.toJSDate())}resolvedOptions(o,m){return this.dtFormatter(o,m).resolvedOptions()}num(o,m=0,v=void 0){if(this.opts.forceSimple)return Mt(o,m);const N={...this.opts};return m>0&&(N.padTo=m),v&&(N.signDisplay=v),this.loc.numberFormatter(N).format(o)}formatDateTimeFromString(o,m){const v=this.loc.listingMode()==="en",N=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",M=(Ae,mt)=>this.loc.extract(o,Ae,mt),V=Ae=>o.isOffsetFixed&&o.offset===0&&Ae.allowZ?"Z":o.isValid?o.zone.formatOffset(o.ts,Ae.format):"",H=()=>v?Fi(o):M({hour:"numeric",hourCycle:"h12"},"dayperiod"),Y=(Ae,mt)=>v?uu(o,Ae):M(mt?{month:Ae}:{month:Ae,day:"numeric"},"month"),ae=(Ae,mt)=>v?Gc(o,Ae):M(mt?{weekday:Ae}:{weekday:Ae,month:"long",day:"numeric"},"weekday"),Fe=Ae=>{const mt=It.macroTokenToFormatOpts(Ae);return mt?this.formatWithSystemDefault(o,mt):Ae},Ze=Ae=>v?Da(o,Ae):M({era:Ae},"era"),tt=Ae=>{switch(Ae){case"S":return this.num(o.millisecond);case"u":case"SSS":return this.num(o.millisecond,3);case"s":return this.num(o.second);case"ss":return this.num(o.second,2);case"uu":return this.num(Math.floor(o.millisecond/10),2);case"uuu":return this.num(Math.floor(o.millisecond/100));case"m":return this.num(o.minute);case"mm":return this.num(o.minute,2);case"h":return this.num(o.hour%12===0?12:o.hour%12);case"hh":return this.num(o.hour%12===0?12:o.hour%12,2);case"H":return this.num(o.hour);case"HH":return this.num(o.hour,2);case"Z":return V({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return V({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return V({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return o.zone.offsetName(o.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return o.zone.offsetName(o.ts,{format:"long",locale:this.loc.locale});case"z":return o.zoneName;case"a":return H();case"d":return N?M({day:"numeric"},"day"):this.num(o.day);case"dd":return N?M({day:"2-digit"},"day"):this.num(o.day,2);case"c":return this.num(o.weekday);case"ccc":return ae("short",!0);case"cccc":return ae("long",!0);case"ccccc":return ae("narrow",!0);case"E":return this.num(o.weekday);case"EEE":return ae("short",!1);case"EEEE":return ae("long",!1);case"EEEEE":return ae("narrow",!1);case"L":return N?M({month:"numeric",day:"numeric"},"month"):this.num(o.month);case"LL":return N?M({month:"2-digit",day:"numeric"},"month"):this.num(o.month,2);case"LLL":return Y("short",!0);case"LLLL":return Y("long",!0);case"LLLLL":return Y("narrow",!0);case"M":return N?M({month:"numeric"},"month"):this.num(o.month);case"MM":return N?M({month:"2-digit"},"month"):this.num(o.month,2);case"MMM":return Y("short",!1);case"MMMM":return Y("long",!1);case"MMMMM":return Y("narrow",!1);case"y":return N?M({year:"numeric"},"year"):this.num(o.year);case"yy":return N?M({year:"2-digit"},"year"):this.num(o.year.toString().slice(-2),2);case"yyyy":return N?M({year:"numeric"},"year"):this.num(o.year,4);case"yyyyyy":return N?M({year:"numeric"},"year"):this.num(o.year,6);case"G":return Ze("short");case"GG":return Ze("long");case"GGGGG":return Ze("narrow");case"kk":return this.num(o.weekYear.toString().slice(-2),2);case"kkkk":return this.num(o.weekYear,4);case"W":return this.num(o.weekNumber);case"WW":return this.num(o.weekNumber,2);case"n":return this.num(o.localWeekNumber);case"nn":return this.num(o.localWeekNumber,2);case"ii":return this.num(o.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(o.localWeekYear,4);case"o":return this.num(o.ordinal);case"ooo":return this.num(o.ordinal,3);case"q":return this.num(o.quarter);case"qq":return this.num(o.quarter,2);case"X":return this.num(Math.floor(o.ts/1e3));case"x":return this.num(o.ts);default:return Fe(Ae)}};return du(It.parseFormat(m),tt)}formatDurationFromString(o,m){const v=this.opts.signMode==="negativeLargestOnly"?-1:1,N=Fe=>{switch(Fe[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},M=(Fe,Ze)=>tt=>{const Ae=N(tt);if(Ae){const mt=Ze.isNegativeDuration&&Ae!==Ze.largestUnit?v:1;let pn;return this.opts.signMode==="negativeLargestOnly"&&Ae!==Ze.largestUnit?pn="never":this.opts.signMode==="all"?pn="always":pn="auto",this.num(Fe.get(Ae)*mt,tt.length,pn)}else return tt},V=It.parseFormat(m),H=V.reduce((Fe,{literal:Ze,val:tt})=>Ze?Fe:Fe.concat(tt),[]),Y=o.shiftTo(...H.map(N).filter(Fe=>Fe)),ae={isNegativeDuration:Y<0,largestUnit:Object.keys(Y.values)[0]};return du(V,M(Y,ae))}}const ts=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function fr(...g){const o=g.reduce((m,v)=>m+v.source,"");return RegExp(`^${o}$`)}function Ps(...g){return o=>g.reduce(([m,v,N],M)=>{const[V,H,Y]=M(o,N);return[{...m,...V},H||v,Y]},[{},null,1]).slice(0,2)}function Us(g,...o){if(g==null)return[null,null];for(const[m,v]of o){const N=m.exec(g);if(N)return v(N)}return[null,null]}function Ma(...g){return(o,m)=>{const v={};let N;for(N=0;N<g.length;N++)v[g[N]]=Cr(o[m+N]);return[v,null,m+N]}}const Pi=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Go=`(?:${Pi.source}?(?:\\[(${ts.source})\\])?)?`,Ia=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,hr=RegExp(`${Ia.source}${Go}`),Ui=RegExp(`(?:[Tt]${hr.source})?`),La=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,fu=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Fa=/(\d{4})-?(\d{3})/,Aa=Ma("weekYear","weekNumber","weekDay"),hu=Ma("year","ordinal"),hn=/(\d{4})-(\d\d)-(\d\d)/,ns=RegExp(`${Ia.source} ?(?:${Pi.source}|(${ts.source}))?`),Ko=RegExp(`(?: ${ns.source})?`);function qn(g,o,m){const v=g[o];return We(v)?m:Cr(v)}function Kc(g,o){return[{year:qn(g,o),month:qn(g,o+1,1),day:qn(g,o+2,1)},null,o+3]}function Rr(g,o){return[{hours:qn(g,o,0),minutes:qn(g,o+1,0),seconds:qn(g,o+2,0),milliseconds:Rs(g[o+3])},null,o+4]}function rs(g,o){const m=!g[o]&&!g[o+1],v=Is(g[o+1],g[o+2]),N=m?null:ee.instance(v);return[{},N,o+3]}function mr(g,o){const m=g[o]?Le.create(g[o]):null;return[{},m,o+1]}const Pa=RegExp(`^T?${Ia.source}$`),mu=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Xc(g){const[o,m,v,N,M,V,H,Y,ae]=g,Fe=o[0]==="-",Ze=Y&&Y[0]==="-",tt=(Ae,mt=!1)=>Ae!==void 0&&(mt||Ae&&Fe)?-Ae:Ae;return[{years:tt(Zn(m)),months:tt(Zn(v)),weeks:tt(Zn(N)),days:tt(Zn(M)),hours:tt(Zn(V)),minutes:tt(Zn(H)),seconds:tt(Zn(Y),Y==="-0"),milliseconds:tt(Rs(ae),Ze)}]}const Jc={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Xo(g,o,m,v,N,M,V){const H={year:o.length===2?es(Cr(o)):Cr(o),month:Qo.indexOf(m)+1,day:Cr(v),hour:Cr(N),minute:Cr(M)};return V&&(H.second=Cr(V)),g&&(H.weekday=g.length>3?Ii.indexOf(g)+1:cr.indexOf(g)+1),H}const Jo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ed(g){const[,o,m,v,N,M,V,H,Y,ae,Fe,Ze]=g,tt=Xo(o,N,v,m,M,V,H);let Ae;return Y?Ae=Jc[Y]:ae?Ae=0:Ae=Is(Fe,Ze),[tt,new ee(Ae)]}function td(g){return g.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const nd=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rd=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,sd=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function el(g){const[,o,m,v,N,M,V,H]=g;return[Xo(o,N,v,m,M,V,H),ee.utcInstance]}function id(g){const[,o,m,v,N,M,V,H]=g;return[Xo(o,H,m,v,N,M,V),ee.utcInstance]}const ad=fr(La,Ui),od=fr(fu,Ui),ld=fr(Fa,Ui),tl=fr(hr),pu=Ps(Kc,Rr,rs,mr),ud=Ps(Aa,Rr,rs,mr),cd=Ps(hu,Rr,rs,mr),yu=Ps(Rr,rs,mr);function dd(g){return Us(g,[ad,pu],[od,ud],[ld,cd],[tl,yu])}function fd(g){return Us(td(g),[Jo,ed])}function hd(g){return Us(g,[nd,el],[rd,el],[sd,id])}function md(g){return Us(g,[mu,Xc])}const pd=Ps(Rr);function yd(g){return Us(g,[Pa,pd])}const gd=fr(hn,Ko),nl=fr(ns),Vi=Ps(Rr,rs,mr);function vd(g){return Us(g,[gd,pu],[nl,Vi])}const rl="Invalid Duration",sl={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},gu={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...sl},mn=146097/400,ss=146097/4800,Vs={years:{quarters:4,months:12,weeks:mn/7,days:mn,hours:mn*24,minutes:mn*24*60,seconds:mn*24*60*60,milliseconds:mn*24*60*60*1e3},quarters:{months:3,weeks:mn/28,days:mn/4,hours:mn*24/4,minutes:mn*24*60/4,seconds:mn*24*60*60/4,milliseconds:mn*24*60*60*1e3/4},months:{weeks:ss/7,days:ss,hours:ss*24,minutes:ss*24*60,seconds:ss*24*60*60,milliseconds:ss*24*60*60*1e3},...sl},is=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],xd=is.slice(0).reverse();function pr(g,o,m=!1){const v={values:m?o.values:{...g.values,...o.values||{}},loc:g.loc.clone(o.loc),conversionAccuracy:o.conversionAccuracy||g.conversionAccuracy,matrix:o.matrix||g.matrix};return new et(v)}function il(g,o){var m;let v=(m=o.milliseconds)!=null?m:0;for(const N of xd.slice(1))o[N]&&(v+=o[N]*g[N].milliseconds);return v}function al(g,o){const m=il(g,o)<0?-1:1;is.reduceRight((v,N)=>{if(We(o[N]))return v;if(v){const M=o[v]*m,V=g[N][v],H=Math.floor(M/V);o[N]+=H*m,o[v]-=H*V*m}return N},null),is.reduce((v,N)=>{if(We(o[N]))return v;if(v){const M=o[v]%1;o[v]-=M,o[N]+=M*g[v][N]}return N},null)}function zs(g){const o={};for(const[m,v]of Object.entries(g))v!==0&&(o[m]=v);return o}class et{constructor(o){const m=o.conversionAccuracy==="longterm"||!1;let v=m?Vs:gu;o.matrix&&(v=o.matrix),this.values=o.values,this.loc=o.loc||A.create(),this.conversionAccuracy=m?"longterm":"casual",this.invalid=o.invalid||null,this.matrix=v,this.isLuxonDuration=!0}static fromMillis(o,m){return et.fromObject({milliseconds:o},m)}static fromObject(o,m={}){if(o==null||typeof o!="object")throw new h(`Duration.fromObject: argument expected to be an object, got ${o===null?"null":typeof o}`);return new et({values:Mi(o,et.normalizeUnit),loc:A.fromObject(m),conversionAccuracy:m.conversionAccuracy,matrix:m.matrix})}static fromDurationLike(o){if(Tr(o))return et.fromMillis(o);if(et.isDuration(o))return o;if(typeof o=="object")return et.fromObject(o);throw new h(`Unknown duration argument ${o} of type ${typeof o}`)}static fromISO(o,m){const[v]=md(o);return v?et.fromObject(v,m):et.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static fromISOTime(o,m){const[v]=yd(o);return v?et.fromObject(v,m):et.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static invalid(o,m=null){if(!o)throw new h("need to specify a reason the Duration is invalid");const v=o instanceof Xt?o:new Xt(o,m);if(gt.throwOnInvalid)throw new a(v);return new et({invalid:v})}static normalizeUnit(o){const m={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[o&&o.toLowerCase()];if(!m)throw new c(o);return m}static isDuration(o){return o&&o.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(o,m={}){const v={...m,floor:m.round!==!1&&m.floor!==!1};return this.isValid?It.create(this.loc,v).formatDurationFromString(this,o):rl}toHuman(o={}){if(!this.isValid)return rl;const m=o.showZeros!==!1,v=is.map(N=>{const M=this.values[N];return We(M)||M===0&&!m?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...o,unit:N.slice(0,-1)}).format(M)}).filter(N=>N);return this.loc.listFormatter({type:"conjunction",style:o.listStyle||"narrow",...o}).format(v)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let o="P";return this.years!==0&&(o+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(o+=this.months+this.quarters*3+"M"),this.weeks!==0&&(o+=this.weeks+"W"),this.days!==0&&(o+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(o+="T"),this.hours!==0&&(o+=this.hours+"H"),this.minutes!==0&&(o+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(o+=Xr(this.seconds+this.milliseconds/1e3,3)+"S"),o==="P"&&(o+="T0S"),o}toISOTime(o={}){if(!this.isValid)return null;const m=this.toMillis();return m<0||m>=864e5?null:(o={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...o,includeOffset:!1},He.fromMillis(m,{zone:"UTC"}).toISOTime(o))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?il(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(o){if(!this.isValid)return this;const m=et.fromDurationLike(o),v={};for(const N of is)(en(m.values,N)||en(this.values,N))&&(v[N]=m.get(N)+this.get(N));return pr(this,{values:v},!0)}minus(o){if(!this.isValid)return this;const m=et.fromDurationLike(o);return this.plus(m.negate())}mapUnits(o){if(!this.isValid)return this;const m={};for(const v of Object.keys(this.values))m[v]=ut(o(this.values[v],v));return pr(this,{values:m},!0)}get(o){return this[et.normalizeUnit(o)]}set(o){if(!this.isValid)return this;const m={...this.values,...Mi(o,et.normalizeUnit)};return pr(this,{values:m})}reconfigure({locale:o,numberingSystem:m,conversionAccuracy:v,matrix:N}={}){const V={loc:this.loc.clone({locale:o,numberingSystem:m}),matrix:N,conversionAccuracy:v};return pr(this,V)}as(o){return this.isValid?this.shiftTo(o).get(o):NaN}normalize(){if(!this.isValid)return this;const o=this.toObject();return al(this.matrix,o),pr(this,{values:o},!0)}rescale(){if(!this.isValid)return this;const o=zs(this.normalize().shiftToAll().toObject());return pr(this,{values:o},!0)}shiftTo(...o){if(!this.isValid)return this;if(o.length===0)return this;o=o.map(V=>et.normalizeUnit(V));const m={},v={},N=this.toObject();let M;for(const V of is)if(o.indexOf(V)>=0){M=V;let H=0;for(const ae in v)H+=this.matrix[ae][V]*v[ae],v[ae]=0;Tr(N[V])&&(H+=N[V]);const Y=Math.trunc(H);m[V]=Y,v[V]=(H*1e3-Y*1e3)/1e3}else Tr(N[V])&&(v[V]=N[V]);for(const V in v)v[V]!==0&&(m[M]+=V===M?v[V]:v[V]/this.matrix[M][V]);return al(this.matrix,m),pr(this,{values:m},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const o={};for(const m of Object.keys(this.values))o[m]=this.values[m]===0?0:-this.values[m];return pr(this,{values:o},!0)}removeZeros(){if(!this.isValid)return this;const o=zs(this.values);return pr(this,{values:o},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(o){if(!this.isValid||!o.isValid||!this.loc.equals(o.loc))return!1;function m(v,N){return v===void 0||v===0?N===void 0||N===0:v===N}for(const v of is)if(!m(this.values[v],o.values[v]))return!1;return!0}}const $s="Invalid Interval";function Ua(g,o){return!g||!g.isValid?St.invalid("missing or invalid start"):!o||!o.isValid?St.invalid("missing or invalid end"):o<g?St.invalid("end before start",`The end of an interval must be after its start, but you had start=${g.toISO()} and end=${o.toISO()}`):null}class St{constructor(o){this.s=o.start,this.e=o.end,this.invalid=o.invalid||null,this.isLuxonInterval=!0}static invalid(o,m=null){if(!o)throw new h("need to specify a reason the Interval is invalid");const v=o instanceof Xt?o:new Xt(o,m);if(gt.throwOnInvalid)throw new s(v);return new St({invalid:v})}static fromDateTimes(o,m){const v=Mr(o),N=Mr(m),M=Ua(v,N);return M??new St({start:v,end:N})}static after(o,m){const v=et.fromDurationLike(m),N=Mr(o);return St.fromDateTimes(N,N.plus(v))}static before(o,m){const v=et.fromDurationLike(m),N=Mr(o);return St.fromDateTimes(N.minus(v),N)}static fromISO(o,m){const[v,N]=(o||"").split("/",2);if(v&&N){let M,V;try{M=He.fromISO(v,m),V=M.isValid}catch{V=!1}let H,Y;try{H=He.fromISO(N,m),Y=H.isValid}catch{Y=!1}if(V&&Y)return St.fromDateTimes(M,H);if(V){const ae=et.fromISO(N,m);if(ae.isValid)return St.after(M,ae)}else if(Y){const ae=et.fromISO(v,m);if(ae.isValid)return St.before(H,ae)}}return St.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static isInterval(o){return o&&o.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(o="milliseconds"){return this.isValid?this.toDuration(o).get(o):NaN}count(o="milliseconds",m){if(!this.isValid)return NaN;const v=this.start.startOf(o,m);let N;return m!=null&&m.useLocaleWeeks?N=this.end.reconfigure({locale:v.locale}):N=this.end,N=N.startOf(o,m),Math.floor(N.diff(v,o).get(o))+(N.valueOf()!==this.end.valueOf())}hasSame(o){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,o):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(o){return this.isValid?this.s>o:!1}isBefore(o){return this.isValid?this.e<=o:!1}contains(o){return this.isValid?this.s<=o&&this.e>o:!1}set({start:o,end:m}={}){return this.isValid?St.fromDateTimes(o||this.s,m||this.e):this}splitAt(...o){if(!this.isValid)return[];const m=o.map(Mr).filter(V=>this.contains(V)).sort((V,H)=>V.toMillis()-H.toMillis()),v=[];let{s:N}=this,M=0;for(;N<this.e;){const V=m[M]||this.e,H=+V>+this.e?this.e:V;v.push(St.fromDateTimes(N,H)),N=H,M+=1}return v}splitBy(o){const m=et.fromDurationLike(o);if(!this.isValid||!m.isValid||m.as("milliseconds")===0)return[];let{s:v}=this,N=1,M;const V=[];for(;v<this.e;){const H=this.start.plus(m.mapUnits(Y=>Y*N));M=+H>+this.e?this.e:H,V.push(St.fromDateTimes(v,M)),v=M,N+=1}return V}divideEqually(o){return this.isValid?this.splitBy(this.length()/o).slice(0,o):[]}overlaps(o){return this.e>o.s&&this.s<o.e}abutsStart(o){return this.isValid?+this.e==+o.s:!1}abutsEnd(o){return this.isValid?+o.e==+this.s:!1}engulfs(o){return this.isValid?this.s<=o.s&&this.e>=o.e:!1}equals(o){return!this.isValid||!o.isValid?!1:this.s.equals(o.s)&&this.e.equals(o.e)}intersection(o){if(!this.isValid)return this;const m=this.s>o.s?this.s:o.s,v=this.e<o.e?this.e:o.e;return m>=v?null:St.fromDateTimes(m,v)}union(o){if(!this.isValid)return this;const m=this.s<o.s?this.s:o.s,v=this.e>o.e?this.e:o.e;return St.fromDateTimes(m,v)}static merge(o){const[m,v]=o.sort((N,M)=>N.s-M.s).reduce(([N,M],V)=>M?M.overlaps(V)||M.abutsStart(V)?[N,M.union(V)]:[N.concat([M]),V]:[N,V],[[],null]);return v&&m.push(v),m}static xor(o){let m=null,v=0;const N=[],M=o.map(Y=>[{time:Y.s,type:"s"},{time:Y.e,type:"e"}]),V=Array.prototype.concat(...M),H=V.sort((Y,ae)=>Y.time-ae.time);for(const Y of H)v+=Y.type==="s"?1:-1,v===1?m=Y.time:(m&&+m!=+Y.time&&N.push(St.fromDateTimes(m,Y.time)),m=null);return St.merge(N)}difference(...o){return St.xor([this].concat(o)).map(m=>this.intersection(m)).filter(m=>m&&!m.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:$s}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(o=O,m={}){return this.isValid?It.create(this.s.loc.clone(m),o).formatInterval(this):$s}toISO(o){return this.isValid?`${this.s.toISO(o)}/${this.e.toISO(o)}`:$s}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:$s}toISOTime(o){return this.isValid?`${this.s.toISOTime(o)}/${this.e.toISOTime(o)}`:$s}toFormat(o,{separator:m=" – "}={}){return this.isValid?`${this.s.toFormat(o)}${m}${this.e.toFormat(o)}`:$s}toDuration(o,m){return this.isValid?this.e.diff(this.s,o,m):et.invalid(this.invalidReason)}mapEndpoints(o){return St.fromDateTimes(o(this.s),o(this.e))}}class Ws{static hasDST(o=gt.defaultZone){const m=He.now().setZone(o).set({month:12});return!o.isUniversal&&m.offset!==m.set({month:6}).offset}static isValidIANAZone(o){return Le.isValidZone(o)}static normalizeZone(o){return W(o,gt.defaultZone)}static getStartOfWeek({locale:o=null,locObj:m=null}={}){return(m||A.create(o)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:o=null,locObj:m=null}={}){return(m||A.create(o)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:o=null,locObj:m=null}={}){return(m||A.create(o)).getWeekendDays().slice()}static months(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null,outputCalendar:M="gregory"}={}){return(N||A.create(m,v,M)).months(o)}static monthsFormat(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null,outputCalendar:M="gregory"}={}){return(N||A.create(m,v,M)).months(o,!0)}static weekdays(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null}={}){return(N||A.create(m,v,null)).weekdays(o)}static weekdaysFormat(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null}={}){return(N||A.create(m,v,null)).weekdays(o,!0)}static meridiems({locale:o=null}={}){return A.create(o).meridiems()}static eras(o="short",{locale:m=null}={}){return A.create(m,null,"gregory").eras(o)}static features(){return{relative:Ho(),localeWeek:Di()}}}function Va(g,o){const m=N=>N.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),v=m(o)-m(g);return Math.floor(et.fromMillis(v).as("days"))}function ol(g,o,m){const v=[["years",(Y,ae)=>ae.year-Y.year],["quarters",(Y,ae)=>ae.quarter-Y.quarter+(ae.year-Y.year)*4],["months",(Y,ae)=>ae.month-Y.month+(ae.year-Y.year)*12],["weeks",(Y,ae)=>{const Fe=Va(Y,ae);return(Fe-Fe%7)/7}],["days",Va]],N={},M=g;let V,H;for(const[Y,ae]of v)m.indexOf(Y)>=0&&(V=Y,N[Y]=ae(g,o),H=M.plus(N),H>o?(N[Y]--,g=M.plus(N),g>o&&(H=g,N[Y]--,g=M.plus(N))):g=H);return[g,N,H,V]}function vu(g,o,m,v){let[N,M,V,H]=ol(g,o,m);const Y=o-N,ae=m.filter(Ze=>["hours","minutes","seconds","milliseconds"].indexOf(Ze)>=0);ae.length===0&&(V<o&&(V=N.plus({[H]:1})),V!==N&&(M[H]=(M[H]||0)+Y/(V-N)));const Fe=et.fromObject(M,v);return ae.length>0?et.fromMillis(Y,v).shiftTo(...ae).plus(Fe):Fe}const xu="missing Intl.DateTimeFormat.formatToParts support";function it(g,o=m=>m){return{regex:g,deser:([m])=>o(Ke(m))}}const wu="[  ]",Su=new RegExp(wu,"g");function wd(g){return g.replace(/\./g,"\\.?").replace(Su,wu)}function ku(g){return g.replace(/\./g,"").replace(Su," ").toLowerCase()}function Ot(g,o){return g===null?null:{regex:RegExp(g.map(wd).join("|")),deser:([m])=>g.findIndex(v=>ku(m)===ku(v))+o}}function Hs(g,o){return{regex:g,deser:([,m,v])=>Is(m,v),groups:o}}function zi(g){return{regex:g,deser:([o])=>o}}function _u(g){return g.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Nu(g,o){const m=yt(o),v=yt(o,"{2}"),N=yt(o,"{3}"),M=yt(o,"{4}"),V=yt(o,"{6}"),H=yt(o,"{1,2}"),Y=yt(o,"{1,3}"),ae=yt(o,"{1,6}"),Fe=yt(o,"{1,9}"),Ze=yt(o,"{2,4}"),tt=yt(o,"{4,6}"),Ae=Qn=>({regex:RegExp(_u(Qn.val)),deser:([Ks])=>Ks,literal:!0}),pn=(Qn=>{if(g.literal)return Ae(Qn);switch(Qn.val){case"G":return Ot(o.eras("short"),0);case"GG":return Ot(o.eras("long"),0);case"y":return it(ae);case"yy":return it(Ze,es);case"yyyy":return it(M);case"yyyyy":return it(tt);case"yyyyyy":return it(V);case"M":return it(H);case"MM":return it(v);case"MMM":return Ot(o.months("short",!0),1);case"MMMM":return Ot(o.months("long",!0),1);case"L":return it(H);case"LL":return it(v);case"LLL":return Ot(o.months("short",!1),1);case"LLLL":return Ot(o.months("long",!1),1);case"d":return it(H);case"dd":return it(v);case"o":return it(Y);case"ooo":return it(N);case"HH":return it(v);case"H":return it(H);case"hh":return it(v);case"h":return it(H);case"mm":return it(v);case"m":return it(H);case"q":return it(H);case"qq":return it(v);case"s":return it(H);case"ss":return it(v);case"S":return it(Y);case"SSS":return it(N);case"u":return zi(Fe);case"uu":return zi(H);case"uuu":return it(m);case"a":return Ot(o.meridiems(),0);case"kkkk":return it(M);case"kk":return it(Ze,es);case"W":return it(H);case"WW":return it(v);case"E":case"c":return it(m);case"EEE":return Ot(o.weekdays("short",!1),1);case"EEEE":return Ot(o.weekdays("long",!1),1);case"ccc":return Ot(o.weekdays("short",!0),1);case"cccc":return Ot(o.weekdays("long",!0),1);case"Z":case"ZZ":return Hs(new RegExp(`([+-]${H.source})(?::(${v.source}))?`),2);case"ZZZ":return Hs(new RegExp(`([+-]${H.source})(${v.source})?`),2);case"z":return zi(/[a-z_+-/]{1,256}?/i);case" ":return zi(/[^\S\n\r]/);default:return Ae(Qn)}})(g)||{invalidReason:xu};return pn.token=g,pn}const Eu={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function ll(g,o,m){const{type:v,value:N}=g;if(v==="literal"){const Y=/^\s+$/.test(N);return{literal:!Y,val:Y?" ":N}}const M=o[v];let V=v;v==="hour"&&(o.hour12!=null?V=o.hour12?"hour12":"hour24":o.hourCycle!=null?o.hourCycle==="h11"||o.hourCycle==="h12"?V="hour12":V="hour24":V=m.hour12?"hour12":"hour24");let H=Eu[V];if(typeof H=="object"&&(H=H[M]),H)return{literal:!1,val:H}}function Sd(g){return[`^${g.map(m=>m.regex).reduce((m,v)=>`${m}(${v.source})`,"")}$`,g]}function kd(g,o,m){const v=g.match(o);if(v){const N={};let M=1;for(const V in m)if(en(m,V)){const H=m[V],Y=H.groups?H.groups+1:1;!H.literal&&H.token&&(N[H.token.val[0]]=H.deser(v.slice(M,M+Y))),M+=Y}return[v,N]}else return[v,{}]}function Bs(g){const o=M=>{switch(M){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let m=null,v;return We(g.z)||(m=Le.create(g.z)),We(g.Z)||(m||(m=new ee(g.Z)),v=g.Z),We(g.q)||(g.M=(g.q-1)*3+1),We(g.h)||(g.h<12&&g.a===1?g.h+=12:g.h===12&&g.a===0&&(g.h=0)),g.G===0&&g.y&&(g.y=-g.y),We(g.u)||(g.S=Rs(g.u)),[Object.keys(g).reduce((M,V)=>{const H=o(V);return H&&(M[H]=g[V]),M},{}),m,v]}let $i=null;function Wi(){return $i||($i=He.fromMillis(1555555555555)),$i}function ul(g,o){if(g.literal)return g;const m=It.macroTokenToFormatOpts(g.val),v=fl(m,o);return v==null||v.includes(void 0)?g:v}function cl(g,o){return Array.prototype.concat(...g.map(m=>ul(m,o)))}class Hi{constructor(o,m){if(this.locale=o,this.format=m,this.tokens=cl(It.parseFormat(m),o),this.units=this.tokens.map(v=>Nu(v,o)),this.disqualifyingUnit=this.units.find(v=>v.invalidReason),!this.disqualifyingUnit){const[v,N]=Sd(this.units);this.regex=RegExp(v,"i"),this.handlers=N}}explainFromTokens(o){if(this.isValid){const[m,v]=kd(o,this.regex,this.handlers),[N,M,V]=v?Bs(v):[null,null,void 0];if(en(v,"a")&&en(v,"H"))throw new l("Can't include meridiem when specifying 24-hour format");return{input:o,tokens:this.tokens,regex:this.regex,rawMatches:m,matches:v,result:N,zone:M,specificOffset:V}}else return{input:o,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function as(g,o,m){return new Hi(g,m).explainFromTokens(o)}function dl(g,o,m){const{result:v,zone:N,specificOffset:M,invalidReason:V}=as(g,o,m);return[v,N,M,V]}function fl(g,o){if(!g)return null;const v=It.create(o,g).dtFormatter(Wi()),N=v.formatToParts(),M=v.resolvedOptions();return N.map(V=>ll(V,g,M))}const Zs="Invalid DateTime",hl=864e13;function qs(g){return new Xt("unsupported zone",`the zone "${g.name}" is not supported`)}function za(g){return g.weekData===null&&(g.weekData=Ca(g.c)),g.weekData}function $a(g){return g.localWeekData===null&&(g.localWeekData=Ca(g.c,g.loc.getMinDaysInFirstWeek(),g.loc.getStartOfWeek())),g.localWeekData}function Dr(g,o){const m={ts:g.ts,zone:g.zone,c:g.c,o:g.o,loc:g.loc,invalid:g.invalid};return new He({...m,...o,old:m})}function ml(g,o,m){let v=g-o*60*1e3;const N=m.offset(v);if(o===N)return[v,o];v-=(N-o)*60*1e3;const M=m.offset(v);return N===M?[v,N]:[g-Math.min(N,M)*60*1e3,Math.max(N,M)]}function Mn(g,o){g+=o*60*1e3;const m=new Date(g);return{year:m.getUTCFullYear(),month:m.getUTCMonth()+1,day:m.getUTCDate(),hour:m.getUTCHours(),minute:m.getUTCMinutes(),second:m.getUTCSeconds(),millisecond:m.getUTCMilliseconds()}}function Qs(g,o,m){return ml(Ms(g),o,m)}function Wa(g,o){const m=g.o,v=g.c.year+Math.trunc(o.years),N=g.c.month+Math.trunc(o.months)+Math.trunc(o.quarters)*3,M={...g.c,year:v,month:N,day:Math.min(g.c.day,ja(v,N))+Math.trunc(o.days)+Math.trunc(o.weeks)*7},V=et.fromObject({years:o.years-Math.trunc(o.years),quarters:o.quarters-Math.trunc(o.quarters),months:o.months-Math.trunc(o.months),weeks:o.weeks-Math.trunc(o.weeks),days:o.days-Math.trunc(o.days),hours:o.hours,minutes:o.minutes,seconds:o.seconds,milliseconds:o.milliseconds}).as("milliseconds"),H=Ms(M);let[Y,ae]=ml(H,m,g.zone);return V!==0&&(Y+=V,ae=g.zone.offset(Y)),{ts:Y,o:ae}}function Ys(g,o,m,v,N,M){const{setZone:V,zone:H}=m;if(g&&Object.keys(g).length!==0||o){const Y=o||H,ae=He.fromObject(g,{...m,zone:Y,specificOffset:M});return V?ae:ae.setZone(H)}else return He.invalid(new Xt("unparsable",`the input "${N}" can't be parsed as ${v}`))}function Ha(g,o,m=!0){return g.isValid?It.create(A.create("en-US"),{allowZ:m,forceSimple:!0}).formatDateTimeFromString(g,o):null}function os(g,o,m){const v=g.c.year>9999||g.c.year<0;let N="";if(v&&g.c.year>=0&&(N+="+"),N+=Mt(g.c.year,v?6:4),m==="year")return N;if(o){if(N+="-",N+=Mt(g.c.month),m==="month")return N;N+="-"}else if(N+=Mt(g.c.month),m==="month")return N;return N+=Mt(g.c.day),N}function Tu(g,o,m,v,N,M,V){let H=!m||g.c.millisecond!==0||g.c.second!==0,Y="";switch(V){case"day":case"month":case"year":break;default:if(Y+=Mt(g.c.hour),V==="hour")break;if(o){if(Y+=":",Y+=Mt(g.c.minute),V==="minute")break;H&&(Y+=":",Y+=Mt(g.c.second))}else{if(Y+=Mt(g.c.minute),V==="minute")break;H&&(Y+=Mt(g.c.second))}if(V==="second")break;H&&(!v||g.c.millisecond!==0)&&(Y+=".",Y+=Mt(g.c.millisecond,3))}return N&&(g.isOffsetFixed&&g.offset===0&&!M?Y+="Z":g.o<0?(Y+="-",Y+=Mt(Math.trunc(-g.o/60)),Y+=":",Y+=Mt(Math.trunc(-g.o%60))):(Y+="+",Y+=Mt(Math.trunc(g.o/60)),Y+=":",Y+=Mt(Math.trunc(g.o%60)))),M&&(Y+="["+g.zone.ianaName+"]"),Y}const pl={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Cu={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},vt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Gs=["year","month","day","hour","minute","second","millisecond"],Ba=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Bi=["year","ordinal","hour","minute","second","millisecond"];function Zi(g){const o={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[g.toLowerCase()];if(!o)throw new c(g);return o}function Za(g){switch(g.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Zi(g)}}function qi(g){if(Yi===void 0&&(Yi=gt.now()),g.type!=="iana")return g.offset(Yi);const o=g.name;let m=gl.get(o);return m===void 0&&(m=g.offset(Yi),gl.set(o,m)),m}function Qi(g,o){const m=W(o.zone,gt.defaultZone);if(!m.isValid)return He.invalid(qs(m));const v=A.fromObject(o);let N,M;if(We(g.year))N=gt.now();else{for(const Y of Gs)We(g[Y])&&(g[Y]=pl[Y]);const V=zo(g)||$o(g);if(V)return He.invalid(V);const H=qi(m);[N,M]=Qs(g,H,m)}return new He({ts:N,zone:m,loc:v,o:M})}function ls(g,o,m){const v=We(m.round)?!0:m.round,N=We(m.rounding)?"trunc":m.rounding,M=(H,Y)=>(H=Xr(H,v||m.calendary?0:2,m.calendary?"round":N),o.loc.clone(m).relFormatter(m).format(H,Y)),V=H=>m.calendary?o.hasSame(g,H)?0:o.startOf(H).diff(g.startOf(H),H).get(H):o.diff(g,H).get(H);if(m.unit)return M(V(m.unit),m.unit);for(const H of m.units){const Y=V(H);if(Math.abs(Y)>=1)return M(Y,H)}return M(g>o?-0:0,m.units[m.units.length-1])}function yl(g){let o={},m;return g.length>0&&typeof g[g.length-1]=="object"?(o=g[g.length-1],m=Array.from(g).slice(0,g.length-1)):m=Array.from(g),[o,m]}let Yi;const gl=new Map;class He{constructor(o){const m=o.zone||gt.defaultZone;let v=o.invalid||(Number.isNaN(o.ts)?new Xt("invalid input"):null)||(m.isValid?null:qs(m));this.ts=We(o.ts)?gt.now():o.ts;let N=null,M=null;if(!v)if(o.old&&o.old.ts===this.ts&&o.old.zone.equals(m))[N,M]=[o.old.c,o.old.o];else{const H=Tr(o.o)&&!o.old?o.o:m.offset(this.ts);N=Mn(this.ts,H),v=Number.isNaN(N.year)?new Xt("invalid input"):null,N=v?null:N,M=v?null:H}this._zone=m,this.loc=o.loc||A.create(),this.invalid=v,this.weekData=null,this.localWeekData=null,this.c=N,this.o=M,this.isLuxonDateTime=!0}static now(){return new He({})}static local(){const[o,m]=yl(arguments),[v,N,M,V,H,Y,ae]=m;return Qi({year:v,month:N,day:M,hour:V,minute:H,second:Y,millisecond:ae},o)}static utc(){const[o,m]=yl(arguments),[v,N,M,V,H,Y,ae]=m;return o.zone=ee.utcInstance,Qi({year:v,month:N,day:M,hour:V,minute:H,second:Y,millisecond:ae},o)}static fromJSDate(o,m={}){const v=Wo(o)?o.valueOf():NaN;if(Number.isNaN(v))return He.invalid("invalid input");const N=W(m.zone,gt.defaultZone);return N.isValid?new He({ts:v,zone:N,loc:A.fromObject(m)}):He.invalid(qs(N))}static fromMillis(o,m={}){if(Tr(o))return o<-hl||o>hl?He.invalid("Timestamp out of range"):new He({ts:o,zone:W(m.zone,gt.defaultZone),loc:A.fromObject(m)});throw new h(`fromMillis requires a numerical input, but received a ${typeof o} with value ${o}`)}static fromSeconds(o,m={}){if(Tr(o))return new He({ts:o*1e3,zone:W(m.zone,gt.defaultZone),loc:A.fromObject(m)});throw new h("fromSeconds requires a numerical input")}static fromObject(o,m={}){o=o||{};const v=W(m.zone,gt.defaultZone);if(!v.isValid)return He.invalid(qs(v));const N=A.fromObject(m),M=Mi(o,Za),{minDaysInFirstWeek:V,startOfWeek:H}=ru(M,N),Y=gt.now(),ae=We(m.specificOffset)?v.offset(Y):m.specificOffset,Fe=!We(M.ordinal),Ze=!We(M.year),tt=!We(M.month)||!We(M.day),Ae=Ze||tt,mt=M.weekYear||M.weekNumber;if((Ae||Fe)&&mt)throw new l("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(tt&&Fe)throw new l("Can't mix ordinal dates with month/day");const pn=mt||M.weekday&&!Ae;let Qn,Ks,In=Mn(Y,ae);pn?(Qn=Ba,Ks=Cu,In=Ca(In,V,H)):Fe?(Qn=Bi,Ks=vt,In=Oa(In)):(Qn=Gs,Ks=pl);let Xs=!1;for(const ct of Qn){const Lr=M[ct];We(Lr)?Xs?M[ct]=Ks[ct]:M[ct]=In[ct]:Xs=!0}const Js=pn?su(M,V,H):Fe?iu(M):zo(M),Gi=Js||$o(M);if(Gi)return He.invalid(Gi);const vl=pn?Er(M,V,H):Fe?Vo(M):M,[ei,Ir]=Qs(vl,ae,v),ht=new He({ts:ei,zone:v,o:Ir,loc:N});return M.weekday&&Ae&&o.weekday!==ht.weekday?He.invalid("mismatched weekday",`you can't specify both a weekday of ${M.weekday} and a date of ${ht.toISO()}`):ht.isValid?ht:He.invalid(ht.invalid)}static fromISO(o,m={}){const[v,N]=dd(o);return Ys(v,N,m,"ISO 8601",o)}static fromRFC2822(o,m={}){const[v,N]=fd(o);return Ys(v,N,m,"RFC 2822",o)}static fromHTTP(o,m={}){const[v,N]=hd(o);return Ys(v,N,m,"HTTP",m)}static fromFormat(o,m,v={}){if(We(o)||We(m))throw new h("fromFormat requires an input string and a format");const{locale:N=null,numberingSystem:M=null}=v,V=A.fromOpts({locale:N,numberingSystem:M,defaultToEN:!0}),[H,Y,ae,Fe]=dl(V,o,m);return Fe?He.invalid(Fe):Ys(H,Y,v,`format ${m}`,o,ae)}static fromString(o,m,v={}){return He.fromFormat(o,m,v)}static fromSQL(o,m={}){const[v,N]=vd(o);return Ys(v,N,m,"SQL",o)}static invalid(o,m=null){if(!o)throw new h("need to specify a reason the DateTime is invalid");const v=o instanceof Xt?o:new Xt(o,m);if(gt.throwOnInvalid)throw new n(v);return new He({invalid:v})}static isDateTime(o){return o&&o.isLuxonDateTime||!1}static parseFormatForOpts(o,m={}){const v=fl(o,A.fromObject(m));return v?v.map(N=>N?N.val:null).join(""):null}static expandFormat(o,m={}){return cl(It.parseFormat(o),A.fromObject(m)).map(N=>N.val).join("")}static resetCache(){Yi=void 0,gl.clear()}get(o){return this[o]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?za(this).weekYear:NaN}get weekNumber(){return this.isValid?za(this).weekNumber:NaN}get weekday(){return this.isValid?za(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?$a(this).weekday:NaN}get localWeekNumber(){return this.isValid?$a(this).weekNumber:NaN}get localWeekYear(){return this.isValid?$a(this).weekYear:NaN}get ordinal(){return this.isValid?Oa(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ws.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ws.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ws.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ws.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const o=864e5,m=6e4,v=Ms(this.c),N=this.zone.offset(v-o),M=this.zone.offset(v+o),V=this.zone.offset(v-N*m),H=this.zone.offset(v-M*m);if(V===H)return[this];const Y=v-V*m,ae=v-H*m,Fe=Mn(Y,V),Ze=Mn(ae,H);return Fe.hour===Ze.hour&&Fe.minute===Ze.minute&&Fe.second===Ze.second&&Fe.millisecond===Ze.millisecond?[Dr(this,{ts:Y}),Dr(this,{ts:ae})]:[this]}get isInLeapYear(){return Or(this.year)}get daysInMonth(){return ja(this.year,this.month)}get daysInYear(){return this.isValid?Ds(this.year):NaN}get weeksInWeekYear(){return this.isValid?Jr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Jr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(o={}){const{locale:m,numberingSystem:v,calendar:N}=It.create(this.loc.clone(o),o).resolvedOptions(this);return{locale:m,numberingSystem:v,outputCalendar:N}}toUTC(o=0,m={}){return this.setZone(ee.instance(o),m)}toLocal(){return this.setZone(gt.defaultZone)}setZone(o,{keepLocalTime:m=!1,keepCalendarTime:v=!1}={}){if(o=W(o,gt.defaultZone),o.equals(this.zone))return this;if(o.isValid){let N=this.ts;if(m||v){const M=o.offset(this.ts),V=this.toObject();[N]=Qs(V,M,o)}return Dr(this,{ts:N,zone:o})}else return He.invalid(qs(o))}reconfigure({locale:o,numberingSystem:m,outputCalendar:v}={}){const N=this.loc.clone({locale:o,numberingSystem:m,outputCalendar:v});return Dr(this,{loc:N})}setLocale(o){return this.reconfigure({locale:o})}set(o){if(!this.isValid)return this;const m=Mi(o,Za),{minDaysInFirstWeek:v,startOfWeek:N}=ru(m,this.loc),M=!We(m.weekYear)||!We(m.weekNumber)||!We(m.weekday),V=!We(m.ordinal),H=!We(m.year),Y=!We(m.month)||!We(m.day),ae=H||Y,Fe=m.weekYear||m.weekNumber;if((ae||V)&&Fe)throw new l("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Y&&V)throw new l("Can't mix ordinal dates with month/day");let Ze;M?Ze=Er({...Ca(this.c,v,N),...m},v,N):We(m.ordinal)?(Ze={...this.toObject(),...m},We(m.day)&&(Ze.day=Math.min(ja(Ze.year,Ze.month),Ze.day))):Ze=Vo({...Oa(this.c),...m});const[tt,Ae]=Qs(Ze,this.o,this.zone);return Dr(this,{ts:tt,o:Ae})}plus(o){if(!this.isValid)return this;const m=et.fromDurationLike(o);return Dr(this,Wa(this,m))}minus(o){if(!this.isValid)return this;const m=et.fromDurationLike(o).negate();return Dr(this,Wa(this,m))}startOf(o,{useLocaleWeeks:m=!1}={}){if(!this.isValid)return this;const v={},N=et.normalizeUnit(o);switch(N){case"years":v.month=1;case"quarters":case"months":v.day=1;case"weeks":case"days":v.hour=0;case"hours":v.minute=0;case"minutes":v.second=0;case"seconds":v.millisecond=0;break}if(N==="weeks")if(m){const M=this.loc.getStartOfWeek(),{weekday:V}=this;V<M&&(v.weekNumber=this.weekNumber-1),v.weekday=M}else v.weekday=1;if(N==="quarters"){const M=Math.ceil(this.month/3);v.month=(M-1)*3+1}return this.set(v)}endOf(o,m){return this.isValid?this.plus({[o]:1}).startOf(o,m).minus(1):this}toFormat(o,m={}){return this.isValid?It.create(this.loc.redefaultToEN(m)).formatDateTimeFromString(this,o):Zs}toLocaleString(o=O,m={}){return this.isValid?It.create(this.loc.clone(m),o).formatDateTime(this):Zs}toLocaleParts(o={}){return this.isValid?It.create(this.loc.clone(o),o).formatDateTimeParts(this):[]}toISO({format:o="extended",suppressSeconds:m=!1,suppressMilliseconds:v=!1,includeOffset:N=!0,extendedZone:M=!1,precision:V="milliseconds"}={}){if(!this.isValid)return null;V=Zi(V);const H=o==="extended";let Y=os(this,H,V);return Gs.indexOf(V)>=3&&(Y+="T"),Y+=Tu(this,H,m,v,N,M,V),Y}toISODate({format:o="extended",precision:m="day"}={}){return this.isValid?os(this,o==="extended",Zi(m)):null}toISOWeekDate(){return Ha(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:o=!1,suppressSeconds:m=!1,includeOffset:v=!0,includePrefix:N=!1,extendedZone:M=!1,format:V="extended",precision:H="milliseconds"}={}){return this.isValid?(H=Zi(H),(N&&Gs.indexOf(H)>=3?"T":"")+Tu(this,V==="extended",m,o,v,M,H)):null}toRFC2822(){return Ha(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ha(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?os(this,!0):null}toSQLTime({includeOffset:o=!0,includeZone:m=!1,includeOffsetSpace:v=!0}={}){let N="HH:mm:ss.SSS";return(m||o)&&(v&&(N+=" "),m?N+="z":o&&(N+="ZZ")),Ha(this,N,!0)}toSQL(o={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(o)}`:null}toString(){return this.isValid?this.toISO():Zs}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(o={}){if(!this.isValid)return{};const m={...this.c};return o.includeConfig&&(m.outputCalendar=this.outputCalendar,m.numberingSystem=this.loc.numberingSystem,m.locale=this.loc.locale),m}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(o,m="milliseconds",v={}){if(!this.isValid||!o.isValid)return et.invalid("created by diffing an invalid DateTime");const N={locale:this.locale,numberingSystem:this.numberingSystem,...v},M=qc(m).map(et.normalizeUnit),V=o.valueOf()>this.valueOf(),H=V?this:o,Y=V?o:this,ae=vu(H,Y,M,N);return V?ae.negate():ae}diffNow(o="milliseconds",m={}){return this.diff(He.now(),o,m)}until(o){return this.isValid?St.fromDateTimes(this,o):this}hasSame(o,m,v){if(!this.isValid)return!1;const N=o.valueOf(),M=this.setZone(o.zone,{keepLocalTime:!0});return M.startOf(m,v)<=N&&N<=M.endOf(m,v)}equals(o){return this.isValid&&o.isValid&&this.valueOf()===o.valueOf()&&this.zone.equals(o.zone)&&this.loc.equals(o.loc)}toRelative(o={}){if(!this.isValid)return null;const m=o.base||He.fromObject({},{zone:this.zone}),v=o.padding?this<m?-o.padding:o.padding:0;let N=["years","months","days","hours","minutes","seconds"],M=o.unit;return Array.isArray(o.unit)&&(N=o.unit,M=void 0),ls(m,this.plus(v),{...o,numeric:"always",units:N,unit:M})}toRelativeCalendar(o={}){return this.isValid?ls(o.base||He.fromObject({},{zone:this.zone}),this,{...o,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...o){if(!o.every(He.isDateTime))throw new h("min requires all arguments be DateTimes");return Bo(o,m=>m.valueOf(),Math.min)}static max(...o){if(!o.every(He.isDateTime))throw new h("max requires all arguments be DateTimes");return Bo(o,m=>m.valueOf(),Math.max)}static fromFormatExplain(o,m,v={}){const{locale:N=null,numberingSystem:M=null}=v,V=A.fromOpts({locale:N,numberingSystem:M,defaultToEN:!0});return as(V,o,m)}static fromStringExplain(o,m,v={}){return He.fromFormatExplain(o,m,v)}static buildFormatParser(o,m={}){const{locale:v=null,numberingSystem:N=null}=m,M=A.fromOpts({locale:v,numberingSystem:N,defaultToEN:!0});return new Hi(M,o)}static fromFormatParser(o,m,v={}){if(We(o)||We(m))throw new h("fromFormatParser requires an input string and a format parser");const{locale:N=null,numberingSystem:M=null}=v,V=A.fromOpts({locale:N,numberingSystem:M,defaultToEN:!0});if(!V.equals(m.locale))throw new h(`fromFormatParser called with a locale of ${V}, but the format parser was created for ${m.locale}`);const{result:H,zone:Y,specificOffset:ae,invalidReason:Fe}=m.explainFromTokens(o);return Fe?He.invalid(Fe):Ys(H,Y,v,`format ${m.format}`,o,ae)}static get DATE_SHORT(){return O}static get DATE_MED(){return _}static get DATE_MED_WITH_WEEKDAY(){return S}static get DATE_FULL(){return C}static get DATE_HUGE(){return T}static get TIME_SIMPLE(){return b}static get TIME_WITH_SECONDS(){return I}static get TIME_WITH_SHORT_OFFSET(){return j}static get TIME_WITH_LONG_OFFSET(){return F}static get TIME_24_SIMPLE(){return U}static get TIME_24_WITH_SECONDS(){return $}static get TIME_24_WITH_SHORT_OFFSET(){return J}static get TIME_24_WITH_LONG_OFFSET(){return se}static get DATETIME_SHORT(){return me}static get DATETIME_SHORT_WITH_SECONDS(){return ye}static get DATETIME_MED(){return ke}static get DATETIME_MED_WITH_SECONDS(){return pe}static get DATETIME_MED_WITH_WEEKDAY(){return ve}static get DATETIME_FULL(){return he}static get DATETIME_FULL_WITH_SECONDS(){return Me}static get DATETIME_HUGE(){return Pe}static get DATETIME_HUGE_WITH_SECONDS(){return Xe}}function Mr(g){if(He.isDateTime(g))return g;if(g&&g.valueOf&&Tr(g.valueOf()))return He.fromJSDate(g);if(g&&typeof g=="object")return He.fromObject(g);throw new h(`Unknown datetime argument: ${g}, of type ${typeof g}`)}const qa="3.7.2";return Tn.DateTime=He,Tn.Duration=et,Tn.FixedOffsetZone=ee,Tn.IANAZone=Le,Tn.Info=Ws,Tn.Interval=St,Tn.InvalidZone=le,Tn.Settings=gt,Tn.SystemZone=ge,Tn.VERSION=qa,Tn.Zone=$e,Tn}var Mf,ay;function dS(){if(ay)return Mf;ay=1;var t=cS();n.prototype.addYear=function(){this._date=this._date.plus({years:1})},n.prototype.addMonth=function(){this._date=this._date.plus({months:1}).startOf("month")},n.prototype.addDay=function(){this._date=this._date.plus({days:1}).startOf("day")},n.prototype.addHour=function(){var s=this._date;this._date=this._date.plus({hours:1}).startOf("hour"),this._date<=s&&(this._date=this._date.plus({hours:1}))},n.prototype.addMinute=function(){var s=this._date;this._date=this._date.plus({minutes:1}).startOf("minute"),this._date<s&&(this._date=this._date.plus({hours:1}))},n.prototype.addSecond=function(){var s=this._date;this._date=this._date.plus({seconds:1}).startOf("second"),this._date<s&&(this._date=this._date.plus({hours:1}))},n.prototype.subtractYear=function(){this._date=this._date.minus({years:1})},n.prototype.subtractMonth=function(){this._date=this._date.minus({months:1}).endOf("month").startOf("second")},n.prototype.subtractDay=function(){this._date=this._date.minus({days:1}).endOf("day").startOf("second")},n.prototype.subtractHour=function(){var s=this._date;this._date=this._date.minus({hours:1}).endOf("hour").startOf("second"),this._date>=s&&(this._date=this._date.minus({hours:1}))},n.prototype.subtractMinute=function(){var s=this._date;this._date=this._date.minus({minutes:1}).endOf("minute").startOf("second"),this._date>s&&(this._date=this._date.minus({hours:1}))},n.prototype.subtractSecond=function(){var s=this._date;this._date=this._date.minus({seconds:1}).startOf("second"),this._date>s&&(this._date=this._date.minus({hours:1}))},n.prototype.getDate=function(){return this._date.day},n.prototype.getFullYear=function(){return this._date.year},n.prototype.getDay=function(){var s=this._date.weekday;return s==7?0:s},n.prototype.getMonth=function(){return this._date.month-1},n.prototype.getHours=function(){return this._date.hour},n.prototype.getMinutes=function(){return this._date.minute},n.prototype.getSeconds=function(){return this._date.second},n.prototype.getMilliseconds=function(){return this._date.millisecond},n.prototype.getTime=function(){return this._date.valueOf()},n.prototype.getUTCDate=function(){return this._getUTC().day},n.prototype.getUTCFullYear=function(){return this._getUTC().year},n.prototype.getUTCDay=function(){var s=this._getUTC().weekday;return s==7?0:s},n.prototype.getUTCMonth=function(){return this._getUTC().month-1},n.prototype.getUTCHours=function(){return this._getUTC().hour},n.prototype.getUTCMinutes=function(){return this._getUTC().minute},n.prototype.getUTCSeconds=function(){return this._getUTC().second},n.prototype.toISOString=function(){return this._date.toUTC().toISO()},n.prototype.toJSON=function(){return this._date.toJSON()},n.prototype.setDate=function(s){this._date=this._date.set({day:s})},n.prototype.setFullYear=function(s){this._date=this._date.set({year:s})},n.prototype.setDay=function(s){this._date=this._date.set({weekday:s})},n.prototype.setMonth=function(s){this._date=this._date.set({month:s+1})},n.prototype.setHours=function(s){this._date=this._date.set({hour:s})},n.prototype.setMinutes=function(s){this._date=this._date.set({minute:s})},n.prototype.setSeconds=function(s){this._date=this._date.set({second:s})},n.prototype.setMilliseconds=function(s){this._date=this._date.set({millisecond:s})},n.prototype._getUTC=function(){return this._date.toUTC()},n.prototype.toString=function(){return this.toDate().toString()},n.prototype.toDate=function(){return this._date.toJSDate()},n.prototype.isLastDayOfMonth=function(){var s=this._date.plus({days:1}).startOf("day");return this._date.month!==s.month},n.prototype.isLastWeekdayOfMonth=function(){var s=this._date.plus({days:7}).startOf("day");return this._date.month!==s.month};function n(s,a){var l={zone:a};if(s?s instanceof n?this._date=s._date:s instanceof Date?this._date=t.DateTime.fromJSDate(s,l):typeof s=="number"?this._date=t.DateTime.fromMillis(s,l):typeof s=="string"&&(this._date=t.DateTime.fromISO(s,l),this._date.isValid||(this._date=t.DateTime.fromRFC2822(s,l)),this._date.isValid||(this._date=t.DateTime.fromSQL(s,l)),this._date.isValid||(this._date=t.DateTime.fromFormat(s,"EEE, d MMM yyyy HH:mm:ss",l))):this._date=t.DateTime.local(),!this._date||!this._date.isValid)throw new Error("CronDate: unhandled timestamp: "+JSON.stringify(s));a&&a!==this._date.zoneName&&(this._date=this._date.setZone(a))}return Mf=n,Mf}var If,oy;function fS(){if(oy)return If;oy=1;function t(l){return{start:l,count:1}}function n(l,c){l.end=c,l.step=c-l.start,l.count=2}function s(l,c,h){c&&(c.count===2?(l.push(t(c.start)),l.push(t(c.end))):l.push(c)),h&&l.push(h)}function a(l){for(var c=[],h=void 0,y=0;y<l.length;y++){var x=l[y];typeof x!="number"?(s(c,h,t(x)),h=void 0):h?h.count===1?n(h,x):h.step===x-h.end?(h.count++,h.end=x):h.count===2?(c.push(t(h.start)),h=t(h.end),n(h,x)):(s(c,h),h=t(x)):h=t(x)}return s(c,h),c}return If=a,If}var Lf,ly;function hS(){if(ly)return Lf;ly=1;var t=fS();function n(s,a,l){var c=t(s);if(c.length===1){var h=c[0],y=h.step;if(y===1&&h.start===a&&h.end===l)return"*";if(y!==1&&h.start===a&&h.end===l-y+1)return"*/"+y}for(var x=[],w=0,E=c.length;w<E;++w){var O=c[w];if(O.count===1){x.push(O.start);continue}var y=O.step;if(O.step===1){x.push(O.start+"-"+O.end);continue}var _=O.start==0?O.count-1:O.count;O.step*_>O.end?x=x.concat(Array.from({length:O.end-O.start+1}).map(function(C,T){var b=O.start+T;return(b-O.start)%O.step===0?b:null}).filter(function(C){return C!=null})):O.end===l-O.step+1?x.push(O.start+"/"+O.step):x.push(O.start+"-"+O.end+"/"+O.step)}return x.join(",")}return Lf=n,Lf}var Ff,uy;function mS(){if(uy)return Ff;uy=1;var t=dS(),n=hS(),s=1e4;function a(l,c){this._options=c,this._utc=c.utc||!1,this._tz=this._utc?"UTC":c.tz,this._currentDate=new t(c.currentDate,this._tz),this._startDate=c.startDate?new t(c.startDate,this._tz):null,this._endDate=c.endDate?new t(c.endDate,this._tz):null,this._isIterator=c.iterator||!1,this._hasIterated=!1,this._nthDayOfWeek=c.nthDayOfWeek||0,this.fields=a._freezeFields(l)}return a.map=["second","minute","hour","dayOfMonth","month","dayOfWeek"],a.predefined={"@yearly":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@hourly":"0 * * * *"},a.constraints=[{min:0,max:59,chars:[]},{min:0,max:59,chars:[]},{min:0,max:23,chars:[]},{min:1,max:31,chars:["L"]},{min:1,max:12,chars:[]},{min:0,max:7,chars:["L"]}],a.daysInMonth=[31,29,31,30,31,30,31,31,30,31,30,31],a.aliases={month:{jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},dayOfWeek:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6}},a.parseDefaults=["0","*","*","*","*","*"],a.standardValidCharacters=/^[,*\d/-]+$/,a.dayOfWeekValidCharacters=/^[?,*\dL#/-]+$/,a.dayOfMonthValidCharacters=/^[?,*\dL/-]+$/,a.validCharacters={second:a.standardValidCharacters,minute:a.standardValidCharacters,hour:a.standardValidCharacters,dayOfMonth:a.dayOfMonthValidCharacters,month:a.standardValidCharacters,dayOfWeek:a.dayOfWeekValidCharacters},a._isValidConstraintChar=function(c,h){return typeof h!="string"?!1:c.chars.some(function(y){return h.indexOf(y)>-1})},a._parseField=function(c,h,y){switch(c){case"month":case"dayOfWeek":var x=a.aliases[c];h=h.replace(/[a-z]{3}/gi,function(_){if(_=_.toLowerCase(),typeof x[_]<"u")return x[_];throw new Error('Validation error, cannot resolve alias "'+_+'"')});break}if(!a.validCharacters[c].test(h))throw new Error("Invalid characters, got value: "+h);h.indexOf("*")!==-1?h=h.replace(/\*/g,y.min+"-"+y.max):h.indexOf("?")!==-1&&(h=h.replace(/\?/g,y.min+"-"+y.max));function w(_){var S=[];function C(j){if(j instanceof Array)for(var F=0,U=j.length;F<U;F++){var $=j[F];if(a._isValidConstraintChar(y,$)){S.push($);continue}if(typeof $!="number"||Number.isNaN($)||$<y.min||$>y.max)throw new Error("Constraint error, got value "+$+" expected range "+y.min+"-"+y.max);S.push($)}else{if(a._isValidConstraintChar(y,j)){S.push(j);return}var J=+j;if(Number.isNaN(J)||J<y.min||J>y.max)throw new Error("Constraint error, got value "+j+" expected range "+y.min+"-"+y.max);c==="dayOfWeek"&&(J=J%7),S.push(J)}}var T=_.split(",");if(!T.every(function(j){return j.length>0}))throw new Error("Invalid list value format");if(T.length>1)for(var b=0,I=T.length;b<I;b++)C(E(T[b]));else C(E(_));return S.sort(a._sortCompareFn),S}function E(_){var S=1,C=_.split("/");if(C.length>2)throw new Error("Invalid repeat: "+_);return C.length>1?(C[0]==+C[0]&&(C=[C[0]+"-"+y.max,C[1]]),O(C[0],C[C.length-1])):O(_,S)}function O(_,S){var C=[],T=_.split("-");if(T.length>1){if(T.length<2)return+_;if(!T[0].length){if(!T[1].length)throw new Error("Invalid range: "+_);return+_}var b=+T[0],I=+T[1];if(Number.isNaN(b)||Number.isNaN(I)||b<y.min||I>y.max)throw new Error("Constraint error, got range "+b+"-"+I+" expected range "+y.min+"-"+y.max);if(b>I)throw new Error("Invalid range: "+_);var j=+S;if(Number.isNaN(j)||j<=0)throw new Error("Constraint error, cannot repeat at every "+j+" time.");c==="dayOfWeek"&&I%7===0&&C.push(0);for(var F=b,U=I;F<=U;F++){var $=C.indexOf(F)!==-1;!$&&j>0&&j%S===0?(j=1,C.push(F)):j++}return C}return Number.isNaN(+_)?_:+_}return w(h)},a._sortCompareFn=function(l,c){var h=typeof l=="number",y=typeof c=="number";return h&&y?l-c:!h&&y?1:h&&!y?-1:l.localeCompare(c)},a._handleMaxDaysInMonth=function(l){if(l.month.length===1){var c=a.daysInMonth[l.month[0]-1];if(l.dayOfMonth[0]>c)throw new Error("Invalid explicit day of month definition");return l.dayOfMonth.filter(function(h){return h==="L"?!0:h<=c}).sort(a._sortCompareFn)}},a._freezeFields=function(l){for(var c=0,h=a.map.length;c<h;++c){var y=a.map[c],x=l[y];l[y]=Object.freeze(x)}return Object.freeze(l)},a.prototype._applyTimezoneShift=function(l,c,h){if(h==="Month"||h==="Day"){var y=l.getTime();l[c+h]();var x=l.getTime();y===x&&(l.getMinutes()===0&&l.getSeconds()===0?l.addHour():l.getMinutes()===59&&l.getSeconds()===59&&l.subtractHour())}else{var w=l.getHours();l[c+h]();var E=l.getHours(),O=E-w;O===2?this.fields.hour.length!==24&&(this._dstStart=E):O===0&&l.getMinutes()===0&&l.getSeconds()===0&&this.fields.hour.length!==24&&(this._dstEnd=E)}},a.prototype._findSchedule=function(c){function h($,J){for(var se=0,me=J.length;se<me;se++)if(J[se]>=$)return J[se]===$;return J[0]===$}function y($,J){if(J<6){if($.getDate()<8&&J===1)return!0;var se=$.getDate()%7?1:0,me=$.getDate()-$.getDate()%7,ye=Math.floor(me/7)+se;return ye===J}return!1}function x($){return $.length>0&&$.some(function(J){return typeof J=="string"&&J.indexOf("L")>=0})}c=c||!1;var w=c?"subtract":"add",E=new t(this._currentDate,this._tz),O=this._startDate,_=this._endDate,S=E.getTime(),C=0;function T($){return $.some(function(J){if(!x([J]))return!1;var se=Number.parseInt(J[0])%7;if(Number.isNaN(se))throw new Error("Invalid last weekday of the month expression: "+J);return E.getDay()===se&&E.isLastWeekdayOfMonth()})}for(;C<s;){if(C++,c){if(O&&E.getTime()-O.getTime()<0)throw new Error("Out of the timespan range")}else if(_&&_.getTime()-E.getTime()<0)throw new Error("Out of the timespan range");var b=h(E.getDate(),this.fields.dayOfMonth);x(this.fields.dayOfMonth)&&(b=b||E.isLastDayOfMonth());var I=h(E.getDay(),this.fields.dayOfWeek);x(this.fields.dayOfWeek)&&(I=I||T(this.fields.dayOfWeek));var j=this.fields.dayOfMonth.length>=a.daysInMonth[E.getMonth()],F=this.fields.dayOfWeek.length===a.constraints[5].max-a.constraints[5].min+1,U=E.getHours();if(!b&&(!I||F)){this._applyTimezoneShift(E,w,"Day");continue}if(!j&&F&&!b){this._applyTimezoneShift(E,w,"Day");continue}if(j&&!F&&!I){this._applyTimezoneShift(E,w,"Day");continue}if(this._nthDayOfWeek>0&&!y(E,this._nthDayOfWeek)){this._applyTimezoneShift(E,w,"Day");continue}if(!h(E.getMonth()+1,this.fields.month)){this._applyTimezoneShift(E,w,"Month");continue}if(h(U,this.fields.hour)){if(this._dstEnd===U&&!c){this._dstEnd=null,this._applyTimezoneShift(E,"add","Hour");continue}}else if(this._dstStart!==U){this._dstStart=null,this._applyTimezoneShift(E,w,"Hour");continue}else if(!h(U-1,this.fields.hour)){E[w+"Hour"]();continue}if(!h(E.getMinutes(),this.fields.minute)){this._applyTimezoneShift(E,w,"Minute");continue}if(!h(E.getSeconds(),this.fields.second)){this._applyTimezoneShift(E,w,"Second");continue}if(S===E.getTime()){w==="add"||E.getMilliseconds()===0?this._applyTimezoneShift(E,w,"Second"):E.setMilliseconds(0);continue}break}if(C>=s)throw new Error("Invalid expression, loop limit exceeded");return this._currentDate=new t(E,this._tz),this._hasIterated=!0,E},a.prototype.next=function(){var c=this._findSchedule();return this._isIterator?{value:c,done:!this.hasNext()}:c},a.prototype.prev=function(){var c=this._findSchedule(!0);return this._isIterator?{value:c,done:!this.hasPrev()}:c},a.prototype.hasNext=function(){var l=this._currentDate,c=this._hasIterated;try{return this._findSchedule(),!0}catch{return!1}finally{this._currentDate=l,this._hasIterated=c}},a.prototype.hasPrev=function(){var l=this._currentDate,c=this._hasIterated;try{return this._findSchedule(!0),!0}catch{return!1}finally{this._currentDate=l,this._hasIterated=c}},a.prototype.iterate=function(c,h){var y=[];if(c>=0)for(var x=0,w=c;x<w;x++)try{var E=this.next();y.push(E),h&&h(E,x)}catch{break}else for(var x=0,w=c;x>w;x--)try{var E=this.prev();y.push(E),h&&h(E,x)}catch{break}return y},a.prototype.reset=function(c){this._currentDate=new t(c||this._options.currentDate)},a.prototype.stringify=function(c){for(var h=[],y=c?0:1,x=a.map.length;y<x;++y){var w=a.map[y],E=this.fields[w],O=a.constraints[y];w==="dayOfMonth"&&this.fields.month.length===1?O={min:1,max:a.daysInMonth[this.fields.month[0]-1]}:w==="dayOfWeek"&&(O={min:0,max:6},E=E[E.length-1]===7?E.slice(0,-1):E),h.push(n(E,O.min,O.max))}return h.join(" ")},a.parse=function(c,h){var y=this;typeof h=="function"&&(h={});function x(w,E){E||(E={}),typeof E.currentDate>"u"&&(E.currentDate=new t(void 0,y._tz)),a.predefined[w]&&(w=a.predefined[w]);var O=[],_=(w+"").trim().split(/\s+/);if(_.length>6)throw new Error("Invalid cron expression");for(var S=a.map.length-_.length,C=0,T=a.map.length;C<T;++C){var b=a.map[C],I=_[_.length>T?C:C-S];if(C<S||!I)O.push(a._parseField(b,a.parseDefaults[C],a.constraints[C]));else{var j=b==="dayOfWeek"?J(I):I;O.push(a._parseField(b,j,a.constraints[C]))}}for(var F={},C=0,T=a.map.length;C<T;C++){var U=a.map[C];F[U]=O[C]}var $=a._handleMaxDaysInMonth(F);return F.dayOfMonth=$||F.dayOfMonth,new a(F,E);function J(se){var me=se.split("#");if(me.length>1){var ye=+me[me.length-1];if(/,/.test(se))throw new Error("Constraint error, invalid dayOfWeek `#` and `,` special characters are incompatible");if(/\//.test(se))throw new Error("Constraint error, invalid dayOfWeek `#` and `/` special characters are incompatible");if(/-/.test(se))throw new Error("Constraint error, invalid dayOfWeek `#` and `-` special characters are incompatible");if(me.length>2||Number.isNaN(ye)||ye<1||ye>5)throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return E.nthDayOfWeek=ye,me[0]}return se}}return x(c,h)},a.fieldsToExpression=function(c,h){function y(b,I,j){if(!I)throw new Error("Validation error, Field "+b+" is missing");if(I.length===0)throw new Error("Validation error, Field "+b+" contains no values");for(var F=0,U=I.length;F<U;F++){var $=I[F];if(!a._isValidConstraintChar(j,$)&&(typeof $!="number"||Number.isNaN($)||$<j.min||$>j.max))throw new Error("Constraint error, got value "+$+" expected range "+j.min+"-"+j.max)}}for(var x={},w=0,E=a.map.length;w<E;++w){var O=a.map[w],_=c[O];y(O,_,a.constraints[w]);for(var S=[],C=-1;++C<_.length;)S[C]=_[C];if(_=S.sort(a._sortCompareFn).filter(function(b,I,j){return!I||b!==j[I-1]}),_.length!==S.length)throw new Error("Validation error, Field "+O+" contains duplicate values");x[O]=_}var T=a._handleMaxDaysInMonth(x);return x.dayOfMonth=T||x.dayOfMonth,new a(x,h||{})},Ff=a,Ff}const pS={},yS=Object.freeze(Object.defineProperty({__proto__:null,default:pS},Symbol.toStringTag,{value:"Module"})),gS=d0(yS);var Af,cy;function vS(){if(cy)return Af;cy=1;var t=mS();function n(){}return n._parseEntry=function(a){var l=a.split(" ");if(l.length===6)return{interval:t.parse(a)};if(l.length>6)return{interval:t.parse(l.slice(0,6).join(" ")),command:l.slice(6,l.length)};throw new Error("Invalid entry: "+a)},n.parseExpression=function(a,l){return t.parse(a,l)},n.fieldsToExpression=function(a,l){return t.fieldsToExpression(a,l)},n.parseString=function(a){for(var l=a.split(`
`),c={variables:{},expressions:[],errors:{}},h=0,y=l.length;h<y;h++){var x=l[h],w=null,E=x.trim();if(E.length>0){if(E.match(/^#/))continue;if(w=E.match(/^(.*)=(.*)$/))c.variables[w[1]]=w[2];else{var O=null;try{O=n._parseEntry("0 "+E),c.expressions.push(O.interval)}catch(_){c.errors[E]=_}}}}return c},n.parseFile=function(a,l){gS.readFile(a,function(c,h){if(c){l(c);return}return l(null,n.parseString(h.toString()))})},Af=n,Af}var xS=vS(),Pf={exports:{}},dy;function wS(){return dy||(dy=1,(function(t,n){(function(a,l){t.exports=l()})(globalThis,()=>(()=>{var s={949(h,y,x){Object.defineProperty(y,"__esModule",{value:!0}),y.CronParser=void 0;var w=x(515),E=(function(){function O(_,S,C){S===void 0&&(S=!0),C===void 0&&(C=!1),this.expression=_,this.dayOfWeekStartIndexZero=S,this.monthStartIndexZero=C}return O.prototype.parse=function(){var _,S,C=(_=this.expression)!==null&&_!==void 0?_:"";if(C==="@reboot")return S=["@reboot","","","","","",""],S;if(C.startsWith("@")){var T=this.parseSpecial(this.expression);S=this.extractParts(T)}else S=this.extractParts(this.expression);return this.normalize(S),this.validate(S),S},O.prototype.parseSpecial=function(_){var S={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},C=S[_];if(!C)throw new Error("Unknown special expression.");return C},O.prototype.extractParts=function(_){if(!this.expression)throw new Error("cron expression is empty");for(var S=_.trim().split(/[ ]+/),C=0;C<S.length;C++)if(S[C].includes(",")){var T=S[C].split(",").map(function(I){return I.trim()}).filter(function(I){return I!==""}).map(function(I){return isNaN(Number(I))?I:Number(I)}).filter(function(I){return I!==null&&I!==""});T.length===0&&T.push("*"),T.sort(function(I,j){return I!==null&&j!==null?I-j:0}),S[C]=T.map(function(I){return I!==null?I.toString():""}).join(",")}if(S.length<5)throw new Error("Expression has only ".concat(S.length," part").concat(S.length==1?"":"s",". At least 5 parts are required."));if(S.length==5)S.unshift(""),S.push("");else if(S.length==6){var b=/\d{4}$/.test(S[5])||S[4]=="?"||S[2]=="?";b?S.unshift(""):S.push("")}else if(S.length>7)throw new Error("Expression has ".concat(S.length," parts; too many!"));return S},O.prototype.normalize=function(_){var S=this;if(_[3]=_[3].replace("?","*"),_[5]=_[5].replace("?","*"),_[2]=_[2].replace("?","*"),_[0].indexOf("0/")==0&&(_[0]=_[0].replace("0/","*/")),_[1].indexOf("0/")==0&&(_[1]=_[1].replace("0/","*/")),_[2].indexOf("0/")==0&&(_[2]=_[2].replace("0/","*/")),_[3].indexOf("1/")==0&&(_[3]=_[3].replace("1/","*/")),_[4].indexOf("1/")==0&&(_[4]=_[4].replace("1/","*/")),_[6].indexOf("1/")==0&&(_[6]=_[6].replace("1/","*/")),_[5]=_[5].replace(/(^\d)|([^#/\s]\d)/g,function($){var J=$.replace(/\D/,""),se=J;return S.dayOfWeekStartIndexZero?J=="7"&&(se="0"):se=(parseInt(J)-1).toString(),$.replace(J,se)}),_[5]=="L"&&(_[5]="6"),_[3]=="?"&&(_[3]="*"),_[3].indexOf("W")>-1&&(_[3].indexOf(",")>-1||_[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var C={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var T in C)_[5]=_[5].replace(new RegExp(T,"gi"),C[T].toString());_[4]=_[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function($){var J=$.replace(/\D/,""),se=J;return S.monthStartIndexZero&&(se=(parseInt(J)+1).toString()),$.replace(J,se)});var b={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var I in b)_[4]=_[4].replace(new RegExp(I,"gi"),b[I].toString());_[0]=="0"&&(_[0]=""),!/\*|\-|\,|\//.test(_[2])&&(/\*|\//.test(_[1])||/\*|\//.test(_[0]))&&(_[2]+="-".concat(_[2]));for(var j=0;j<_.length;j++)if(_[j].indexOf(",")!=-1&&(_[j]=_[j].split(",").filter(function($){return $!==""}).join(",")||"*"),_[j]=="*/1"&&(_[j]="*"),_[j].indexOf("/")>-1&&!/^\*|\-|\,/.test(_[j])){var F=null;switch(j){case 4:F="12";break;case 5:F="6";break;case 6:F="9999";break;default:F=null;break}if(F!==null){var U=_[j].split("/");_[j]="".concat(U[0],"-").concat(F,"/").concat(U[1])}}},O.prototype.validate=function(_){var S="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(_[0],S),this.validateOnlyExpectedCharactersFound(_[1],S),this.validateOnlyExpectedCharactersFound(_[2],S),this.validateOnlyExpectedCharactersFound(_[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(_[4],S),this.validateOnlyExpectedCharactersFound(_[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(_[6],S),this.validateAnyRanges(_)},O.prototype.validateAnyRanges=function(_){w.default.secondRange(_[0]),w.default.minuteRange(_[1]),w.default.hourRange(_[2]),w.default.dayOfMonthRange(_[3]),w.default.monthRange(_[4],this.monthStartIndexZero),w.default.dayOfWeekRange(_[5],this.dayOfWeekStartIndexZero)},O.prototype.validateOnlyExpectedCharactersFound=function(_,S){var C=_.match(new RegExp("[^".concat(S,"]+"),"gi"));if(C&&C.length)throw new Error("Expression contains invalid values: '".concat(C.toString(),"'"))},O})();y.CronParser=E},333(h,y,x){Object.defineProperty(y,"__esModule",{value:!0}),y.ExpressionDescriptor=void 0;var w=x(823),E=x(949),O=(function(){function _(S,C){if(this.expression=S,this.options=C,this.expressionParts=new Array(5),!this.options.locale&&_.defaultLocale&&(this.options.locale=_.defaultLocale),!_.locales[this.options.locale]){var T=Object.keys(_.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(T,"'.")),this.options.locale=T}this.i18n=_.locales[this.options.locale],C.use24HourTimeFormat===void 0&&(C.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return _.toString=function(S,C){var T=C===void 0?{}:C,b=T.throwExceptionOnParseError,I=b===void 0?!0:b,j=T.verbose,F=j===void 0?!1:j,U=T.dayOfWeekStartIndexZero,$=U===void 0?!0:U,J=T.monthStartIndexZero,se=J===void 0?!1:J,me=T.use24HourTimeFormat,ye=T.trimHoursLeadingZero,ke=ye===void 0?!1:ye,pe=T.locale,ve=pe===void 0?null:pe,he=T.logicalAndDayFields,Me=he===void 0?!1:he,Pe={throwExceptionOnParseError:I,verbose:F,dayOfWeekStartIndexZero:$,monthStartIndexZero:se,use24HourTimeFormat:me,trimHoursLeadingZero:ke,locale:ve,logicalAndDayFields:Me};Pe.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var Xe=new _(S,Pe);return Xe.getFullDescription()},_.initialize=function(S,C){C===void 0&&(C="en"),_.specialCharacters=["/","-",",","*"],_.defaultLocale=C,S.load(_.locales)},_.prototype.getFullDescription=function(){var S,C,T="";try{var b=new E.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=b.parse(),this.expressionParts[0]==="@reboot")return((C=(S=this.i18n).atReboot)===null||C===void 0?void 0:C.call(S))||"Run once, at startup";var I=this.getTimeOfDayDescription(),j=this.getDayOfMonthDescription(),F=this.getMonthDescription(),U=this.getDayOfWeekDescription(),$=this.getYearDescription();T+=I+j+U+F+$,T=this.transformVerbosity(T,!!this.options.verbose),T=T.charAt(0).toLocaleUpperCase()+T.substr(1)}catch(J){if(!this.options.throwExceptionOnParseError)T=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(J)}return T},_.prototype.getTimeOfDayDescription=function(){var S=this.expressionParts[0],C=this.expressionParts[1],T=this.expressionParts[2],b="";if(!w.StringUtilities.containsAny(C,_.specialCharacters)&&!w.StringUtilities.containsAny(T,_.specialCharacters)&&!w.StringUtilities.containsAny(S,_.specialCharacters))b+=this.i18n.atSpace()+this.formatTime(T,C,S);else if(!S&&C.indexOf("-")>-1&&!(C.indexOf(",")>-1)&&!(C.indexOf("/")>-1)&&!w.StringUtilities.containsAny(T,_.specialCharacters)){var I=C.split("-");b+=w.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(T,I[0],""),this.formatTime(T,I[1],""))}else if(!S&&T.indexOf(",")>-1&&T.indexOf("-")==-1&&T.indexOf("/")==-1&&!w.StringUtilities.containsAny(C,_.specialCharacters)){var j=T.split(",");b+=this.i18n.at();for(var F=0;F<j.length;F++)b&&(b+=" "),b+=this.formatTime(j[F],C,""),F<j.length-2&&(b+=","),F==j.length-2&&(b+=this.i18n.spaceAnd())}else{var U=this.getSecondsDescription(),$=this.getMinutesDescription(),J=this.getHoursDescription();if(b+=U,b&&$&&(b+=", "),b+=$,$===J)return b;b&&J&&(b+=", "),b+=J}return b},_.prototype.getSecondsDescription=function(){var S=this,C=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(T){return T},function(T){return w.StringUtilities.format(S.i18n.everyX0Seconds(T),T)},function(T){return S.i18n.secondsX0ThroughX1PastTheMinute()},function(T){return T=="0"?"":parseInt(T)<20?S.i18n.atX0SecondsPastTheMinute(T):S.i18n.atX0SecondsPastTheMinuteGt20()||S.i18n.atX0SecondsPastTheMinute(T)});return C},_.prototype.getMinutesDescription=function(){var S=this,C=this.expressionParts[0],T=this.expressionParts[2],b=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(I){return I},function(I){return w.StringUtilities.format(S.i18n.everyX0Minutes(I),I)},function(I){return S.i18n.minutesX0ThroughX1PastTheHour()},function(I){var j,F;try{return I=="0"&&T.indexOf("/")==-1&&C==""?S.i18n.everyHour():I=="0"?((F=(j=S.i18n).onTheHour)===null||F===void 0?void 0:F.call(j))||S.i18n.atX0MinutesPastTheHour(I):parseInt(I)<20?S.i18n.atX0MinutesPastTheHour(I):S.i18n.atX0MinutesPastTheHourGt20()||S.i18n.atX0MinutesPastTheHour(I)}catch{return S.i18n.atX0MinutesPastTheHour(I)}});return b},_.prototype.getHoursDescription=function(){var S=this,C=this.expressionParts[2],T=0,b=[];C.split("/")[0].split(",").forEach(function(F){var U=F.split("-");U.length===2&&b.push({value:U[1],index:T+1}),T+=U.length});var I=0,j=this.getSegmentDescription(C,this.i18n.everyHour(),function(F){var U=b.find(function(J){return J.value===F&&J.index===I}),$=U&&S.expressionParts[1]!=="0";return I++,$?S.formatTime(F,"59",""):S.formatTime(F,"0","")},function(F){return w.StringUtilities.format(S.i18n.everyX0Hours(F),F)},function(F){return S.i18n.betweenX0AndX1()},function(F){return S.i18n.atX0()});return j},_.prototype.getDayOfWeekDescription=function(){var S=this,C=this.i18n.daysOfTheWeek(),T=null;return this.expressionParts[5]=="*"?T="":T=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(b,I){var j=b;b.indexOf("#")>-1?j=b.substring(0,b.indexOf("#")):b.indexOf("L")>-1&&(j=j.replace("L",""));var F=parseInt(j),U=S.i18n.daysOfTheWeekInCase?S.i18n.daysOfTheWeekInCase(I)[F]:C[F];if(b.indexOf("#")>-1){var $=null,J=b.substring(b.indexOf("#")+1),se=b.substring(0,b.indexOf("#"));switch(J){case"1":$=S.i18n.first(se);break;case"2":$=S.i18n.second(se);break;case"3":$=S.i18n.third(se);break;case"4":$=S.i18n.fourth(se);break;case"5":$=S.i18n.fifth(se);break}U=$+" "+U}return U},function(b){return parseInt(b)==1?"":w.StringUtilities.format(S.i18n.commaEveryX0DaysOfTheWeek(b),b)},function(b){var I=b.substring(0,b.indexOf("-")),j=S.expressionParts[3]!="*";return j?S.i18n.commaAndX0ThroughX1(I):S.i18n.commaX0ThroughX1(I)},function(b){var I=null;if(b.indexOf("#")>-1){var j=b.substring(b.indexOf("#")+1),F=b.substring(0,b.indexOf("#"));I=S.i18n.commaOnThe(j,F).trim()+S.i18n.spaceX0OfTheMonth()}else if(b.indexOf("L")>-1)I=S.i18n.commaOnTheLastX0OfTheMonth(b.replace("L",""));else{var U=S.expressionParts[3]!="*";U?S.options.logicalAndDayFields?I=S.i18n.commaOnlyOnX0(b):I=S.i18n.commaAndOnX0():I=S.i18n.commaOnlyOnX0(b)}return I}),T},_.prototype.getMonthDescription=function(){var S=this,C=this.i18n.monthsOfTheYear(),T=this.getSegmentDescription(this.expressionParts[4],"",function(b,I){return I&&S.i18n.monthsOfTheYearInCase?S.i18n.monthsOfTheYearInCase(I)[parseInt(b)-1]:C[parseInt(b)-1]},function(b){return parseInt(b)==1?"":w.StringUtilities.format(S.i18n.commaEveryX0Months(b),b)},function(b){return S.i18n.commaMonthX0ThroughMonthX1()||S.i18n.commaX0ThroughX1()},function(b){return S.i18n.commaOnlyInMonthX0?S.i18n.commaOnlyInMonthX0():S.i18n.commaOnlyInX0()});return T},_.prototype.getDayOfMonthDescription=function(){var S=this,C=null,T=this.expressionParts[3];switch(T){case"L":C=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":C=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var b=T.match(/(\d{1,2}W)|(W\d{1,2})/);if(b){var I=parseInt(b[0].replace("W","")),j=I==1?this.i18n.firstWeekday():w.StringUtilities.format(this.i18n.weekdayNearestDayX0(),I.toString());C=w.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),j);break}else{var F=T.match(/L-(\d{1,2})/);if(F){var U=F[1];C=w.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(U),U);break}else{if(T=="*"&&this.expressionParts[5]!="*")return"";C=this.getSegmentDescription(T,this.i18n.commaEveryDay(),function($){return $=="L"?S.i18n.lastDay():S.i18n.dayX0?w.StringUtilities.format(S.i18n.dayX0(),$):$},function($){return $=="1"?S.i18n.commaEveryDay():S.i18n.commaEveryX0Days($)},function($){return S.i18n.commaBetweenDayX0AndX1OfTheMonth($)},function($){return S.i18n.commaOnDayX0OfTheMonth($)})}break}}return C},_.prototype.getYearDescription=function(){var S=this,C=this.getSegmentDescription(this.expressionParts[6],"",function(T){return/^\d+$/.test(T)?new Date(parseInt(T),1).getFullYear().toString():T},function(T){return w.StringUtilities.format(S.i18n.commaEveryX0Years(T),T)},function(T){return S.i18n.commaYearX0ThroughYearX1()||S.i18n.commaX0ThroughX1()},function(T){return S.i18n.commaOnlyInYearX0?S.i18n.commaOnlyInYearX0():S.i18n.commaOnlyInX0()});return C},_.prototype.getSegmentDescription=function(S,C,T,b,I,j){var F=null,U=S.indexOf("/")>-1,$=S.indexOf("-")>-1,J=S.indexOf(",")>-1;if(!S)F="";else if(S==="*")F=C;else if(!U&&!$&&!J)F=w.StringUtilities.format(j(S),T(S));else if(J){for(var se=S.split(","),me="",ye=this.i18n.spaceAnd(),ke=0;ke<se.length;ke++)if(ke>0&&se.length>2&&(me+=",",ke<se.length-1&&(me+=" ")),ke>0&&se.length>1&&(ke==se.length-1||se.length==2)&&(me+=ye==","&&se.length>2?" ":"".concat(ye," ")),se[ke].indexOf("/")>-1||se[ke].indexOf("-")>-1){var pe=se[ke].indexOf("-")>-1&&se[ke].indexOf("/")==-1,ve=this.getSegmentDescription(se[ke],C,T,b,pe?this.i18n.commaX0ThroughX1:I,j);pe&&(ve=ve.replace(", ","")),me+=ve}else if(!U)me+=T(se[ke]);else{var he=this.getSegmentDescription(se[ke],C,T,b,I,j);he&&he.startsWith(", ")&&(he=he.substring(2)),me+=he}U?F=me:F=w.StringUtilities.format(j(S),me)}else if(U){var se=S.split("/");if(F=w.StringUtilities.format(b(se[1]),se[1]),se[0].indexOf("-")>-1){var Me=this.generateRangeSegmentDescription(se[0],I,T);Me.indexOf(", ")!=0&&(F+=", "),F+=Me}else if(se[0].indexOf("*")==-1){var Pe=w.StringUtilities.format(j(se[0]),T(se[0]));Pe=Pe.replace(", ",""),F+=w.StringUtilities.format(this.i18n.commaStartingX0(),Pe)}}else $&&(F=this.generateRangeSegmentDescription(S,I,T));return F},_.prototype.generateRangeSegmentDescription=function(S,C,T){var b="",I=S.split("-"),j=T(I[0],1),F=T(I[1],2),U=C(S);return b+=w.StringUtilities.format(U,j,F),b},_.prototype.formatTime=function(S,C,T){var b=0,I=0,j=parseInt(S)+b,F=parseInt(C)+I;F>=60?(F-=60,j+=1):F<0&&(F+=60,j-=1),j>=24?j=j-24:j<0&&(j=24+j);var U="",$=!1;this.options.use24HourTimeFormat||($=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),U=$?"".concat(this.getPeriod(j)," "):" ".concat(this.getPeriod(j)),j>12&&(j-=12),j===0&&(j=12));var J="";T&&(J=":".concat(("00"+T).substring(T.length)));var se=j.toString(),me=("00"+se).substring(se.length),ye=F.toString(),ke=("00"+ye).substring(ye.length),pe=this.options.trimHoursLeadingZero?se:me;return"".concat($?U:"").concat(pe,":").concat(ke).concat(J).concat($?"":U)},_.prototype.transformVerbosity=function(S,C){if(!C&&(S=S.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),S=S.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),S=S.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),S=S.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var T=0,b=Object.entries(this.i18n.conciseVerbosityReplacements());T<b.length;T++){var I=b[T],j=I[0],F=I[1];S=S.replace(new RegExp(j,"g"),F)}return S},_.prototype.getPeriod=function(S){return S>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},_.locales={},_})();y.ExpressionDescriptor=O},747(h,y,x){Object.defineProperty(y,"__esModule",{value:!0}),y.enLocaleLoader=void 0;var w=x(486),E=(function(){function O(){}return O.prototype.load=function(_){_.en=new w.en},O})();y.enLocaleLoader=E},486(h,y){Object.defineProperty(y,"__esModule",{value:!0}),y.en=void 0;var x=(function(){function w(){}return w.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},w.prototype.atX0MinutesPastTheHourGt20=function(){return null},w.prototype.commaMonthX0ThroughMonthX1=function(){return null},w.prototype.commaYearX0ThroughYearX1=function(){return null},w.prototype.use24HourTimeFormatByDefault=function(){return!1},w.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},w.prototype.everyMinute=function(){return"every minute"},w.prototype.everyHour=function(){return"every hour"},w.prototype.atSpace=function(){return"At "},w.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},w.prototype.at=function(){return"At"},w.prototype.spaceAnd=function(){return" and"},w.prototype.everySecond=function(){return"every second"},w.prototype.everyX0Seconds=function(){return"every %s seconds"},w.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},w.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},w.prototype.everyX0Minutes=function(){return"every %s minutes"},w.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},w.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},w.prototype.everyX0Hours=function(){return"every %s hours"},w.prototype.betweenX0AndX1=function(){return"between %s and %s"},w.prototype.atX0=function(){return"at %s"},w.prototype.commaEveryDay=function(){return", every day"},w.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},w.prototype.commaX0ThroughX1=function(){return", %s through %s"},w.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},w.prototype.first=function(){return"first"},w.prototype.second=function(){return"second"},w.prototype.third=function(){return"third"},w.prototype.fourth=function(){return"fourth"},w.prototype.fifth=function(){return"fifth"},w.prototype.commaOnThe=function(){return", on the "},w.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},w.prototype.lastDay=function(){return"the last day"},w.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},w.prototype.commaOnlyOnX0=function(){return", only on %s"},w.prototype.commaAndOnX0=function(){return", and on %s"},w.prototype.commaEveryX0Months=function(){return", every %s months"},w.prototype.commaOnlyInX0=function(){return", only in %s"},w.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},w.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},w.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},w.prototype.firstWeekday=function(){return"first weekday"},w.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},w.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},w.prototype.commaEveryX0Days=function(){return", every %s days in a month"},w.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},w.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},w.prototype.commaEveryHour=function(){return", every hour"},w.prototype.commaEveryX0Years=function(){return", every %s years"},w.prototype.commaStartingX0=function(){return", starting %s"},w.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},w.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},w.prototype.atReboot=function(){return"Run once, at startup"},w.prototype.onTheHour=function(){return"on the hour"},w})();y.en=x},515(h,y){Object.defineProperty(y,"__esModule",{value:!0});function x(E,O){if(!E)throw new Error(O)}var w=(function(){function E(){}return E.secondRange=function(O){for(var _=O.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var C=parseInt(_[S],10);x(C>=0&&C<=59,"seconds part must be >= 0 and <= 59")}},E.minuteRange=function(O){for(var _=O.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var C=parseInt(_[S],10);x(C>=0&&C<=59,"minutes part must be >= 0 and <= 59")}},E.hourRange=function(O){for(var _=O.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var C=parseInt(_[S],10);x(C>=0&&C<=23,"hours part must be >= 0 and <= 23")}},E.dayOfMonthRange=function(O){for(var _=O.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var C=parseInt(_[S],10);x(C>=1&&C<=31,"DOM part must be >= 1 and <= 31")}},E.monthRange=function(O,_){for(var S=O.split(","),C=0;C<S.length;C++)if(!isNaN(parseInt(S[C],10))){var T=parseInt(S[C],10);x(T>=1&&T<=12,_?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},E.dayOfWeekRange=function(O,_){for(var S=O.split(","),C=0;C<S.length;C++)if(!isNaN(parseInt(S[C],10))){var T=parseInt(S[C],10);x(T>=0&&T<=6,_?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},E})();y.default=w},823(h,y){Object.defineProperty(y,"__esModule",{value:!0}),y.StringUtilities=void 0;var x=(function(){function w(){}return w.format=function(E){for(var O=[],_=1;_<arguments.length;_++)O[_-1]=arguments[_];return E.replace(/%s/g,function(S){return O.shift()})},w.containsAny=function(E,O){return O.some(function(_){return E.indexOf(_)>-1})},w})();y.StringUtilities=x}},a={};function l(h){var y=a[h];if(y!==void 0)return y.exports;var x=a[h]={exports:{}};return s[h](x,x.exports,l),x.exports}var c={};return(()=>{var h=c;Object.defineProperty(h,"__esModule",{value:!0}),h.toString=void 0;var y=l(333),x=l(747);y.ExpressionDescriptor.initialize(new x.enLocaleLoader),h.default=y.ExpressionDescriptor;var w=y.ExpressionDescriptor.toString;h.toString=w})(),c})())})(Pf)),Pf.exports}var SS=wS();function Zg(t){const n=t.trim();if(n===""||n.startsWith("@"))return n;const s=n.split(/\s+/);return s.length===7?s.slice(1,6).join(" "):n}function kS(t){if(t.trim()==="")return[!1,"— enter a cron expression —"];try{return[!0,SS.toString(Zg(t),{throwExceptionOnParseError:!0})]}catch{return[!1,"Invalid cron expression"]}}function Oo(t){if(t===0)return"—";const n=Math.floor(Date.now()/1e3),s=Math.max(0,n-t);return s<60?"just now":s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:`${Math.floor(s/86400)}d ago`}const _S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Kl(t,n){const s=Zg(t);if(s!=="")try{return xS.parseExpression(s,{currentDate:n})}catch{return}}function Ao(t,n){const s=Kl(t,n);if(s!=null&&s.hasNext())return s.next().toDate()}function NS(t,n,s){const a=Kl(t,n);if(!a)return[];const l=[];for(;l.length<s&&a.hasNext();)l.push(a.next().toDate());return l}function Ph(t,n,s){const a=Ao(t,n);return a!==void 0&&a.getTime()-n.getTime()<=s}function Wc(t,n){const s=Math.floor((n.getTime()-t.getTime())/1e3);if(s<=0)return"now";const a=Math.floor(s/60);if(a<1)return"in <1m";if(a<60)return`in ${a}m`;const l=Math.floor(a/60);if(l<24){const h=a%60;return h===0?`in ${l}h`:`in ${l}h ${h}m`}return`in ${Math.floor(l/24)}d`}function Br(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function Uh(t,n){const s=`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`,a=Math.round((Br(n).getTime()-Br(t).getTime())/864e5);return a===0?s:a===1?`tomorrow ${s}`:`${_S[n.getMonth()]} ${n.getDate()}, ${s}`}const Xl=["SUN","MON","TUE","WED","THU","FRI","SAT"],Vh=["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"],ph=42,ES=4e3;function TS(t,n){const s=t.getFullYear()*12+t.getMonth()+n,a=Math.floor(s/12),l=(s%12+12)%12;return new Date(a,l,1)}const CS=2e3;function qg(t,n){const s=Br(n),a=new Date(s.getTime()-1e3),l=Kl(t,a);if(!l)return[];const c=new Date(s.getTime()+864e5),h=[];for(let y=0;y<CS&&l.hasNext();y++){const x=l.next().toDate();if(!(x.getTime()<s.getTime())){if(x.getTime()>=c.getTime())break;h.push(x)}}return h}function OS(t,n){const s=new Date(n.getTime()-1e3),a=Kl(t,s);if(!a)return;const l=new Array(ph).fill(0),c=Br(n).getTime();for(let h=0;h<ES&&a.hasNext();h++){const y=a.next().toDate(),x=Math.floor((Br(y).getTime()-c)/864e5);if(!(x<0)){if(x>=ph)break;l[x]=(l[x]??0)+1}}return l}const Qg=36e5,bS=8,fy={dormant:0,"dead-schedule":1,"agent-unregistered":2,"has-open-flags":3},jS={dormant:"DORMANT","dead-schedule":"DEAD SCHEDULE","agent-unregistered":"AGENT MISSING","has-open-flags":"OPEN FLAGS"},RS={dormant:"assigned to no machine — fires nowhere","dead-schedule":"schedule has no future fire — never runs again","agent-unregistered":"agent not registered — every run errors","has-open-flags":"agent raised flags during a run — needs review"};function Yg(t,n){return t<n?-1:t>n?1:0}function DS(t,n){if(t.enabled){if(t.machinesEmpty)return"dormant";if(Ao(t.schedule,n)===void 0)return"dead-schedule";if(t.agentRegistered===!1)return"agent-unregistered";if(t.flagCount>0)return"has-open-flags"}}function Gg(t,n){const s=[];for(const a of t){const l=DS(a,n);l!==void 0&&s.push({kind:a.kind,label:a.label,reason:l,flagCount:a.flagCount})}return s.sort((a,l)=>fy[a.reason]-fy[l.reason]||Yg(a.label,l.label)),s}function MS(t,n){const s=t.length,a=t.filter(x=>x.enabled).length,l=t.filter(x=>x.enabled&&!x.snoozed&&Ph(x.schedule,n,Qg)).length,c=t.reduce((x,w)=>x+w.flagCount,0),h=t.filter(x=>x.enabled&&x.snoozed).length,y=t.filter(x=>x.enabled&&x.machinesEmpty).length;return{total:s,enabled:a,disabled:s-a,dueSoon:l,attention:Gg(t,n).length,flags:c,snoozed:h,dormant:y}}function IS(t,n){const s=[];for(const a of t){if(!a.enabled||a.snoozed)continue;const l=Ao(a.schedule,n);l!==void 0&&s.push({kind:a.kind,id:a.id,label:a.label,human:a.human,schedule:a.schedule,at:l,soon:l.getTime()-n.getTime()<=Qg,flagCount:a.flagCount})}return s.sort((a,l)=>a.at.getTime()-l.at.getTime()||Yg(a.label,l.label)),s.slice(0,bS)}function LS(t,n){return t[0]===void 0?void 0:Wc(n,t[0].at)}function FS(t){return(t??[]).every(n=>n.trim()==="")}function AS(t,n){const s=t.snoozed_until!=null&&t.snoozed_until>Math.floor(n.getTime()/1e3),a=t.skip_runs!=null&&t.skip_runs>0;return s||a}function PS(t,n){return{kind:"routine",id:t.id,label:t.title,schedule:t.schedule,human:t.schedule_description??void 0,enabled:t.enabled,machinesEmpty:FS(t.machines),agentRegistered:t.agent_registered,flagCount:t.flag_count,snoozed:AS(t,n)}}function US(t,n){return t.map(s=>PS(s,n))}function VS({items:t}){return d.jsx("div",{className:"table-wrap attn-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"TYPE"}),d.jsx("th",{children:"NAME"}),d.jsx("th",{children:"ISSUE"}),d.jsx("th",{children:"DETAIL"})]})}),d.jsx("tbody",{children:t.map((n,s)=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("span",{className:"kind-badge routine",children:"ROUTINE"})}),d.jsx("td",{children:d.jsx(Ac,{className:"ov-name-link",to:"/routines",children:n.label})}),d.jsx("td",{children:d.jsx("span",{className:"attn-badge",children:jS[n.reason]})}),d.jsx("td",{className:"attn-detail",children:n.reason==="has-open-flags"&&n.flagCount>0?`${n.flagCount} open flag${n.flagCount===1?"":"s"} — needs review`:RS[n.reason]})]},s))})]})})}function zS({kpis:t,nextRun:n}){return d.jsxs("div",{className:"stats",children:[d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"SCHEDULED"}),d.jsx("div",{className:"stat-val",children:t.total})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"ENABLED"}),d.jsx("div",{className:"stat-val c-accent",children:t.enabled})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"DUE SOON"}),d.jsx("div",{className:"stat-val c-red",children:t.dueSoon})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"ATTENTION"}),d.jsx("div",{className:`stat-val ${t.attention>0?"c-red":"c-accent"}`,children:t.attention})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"DISABLED"}),d.jsx("div",{className:"stat-val c-amber",children:t.disabled})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"DORMANT"}),d.jsx("div",{className:`stat-val ${t.dormant>0?"c-amber":""}`,children:t.dormant})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"FLAGS"}),d.jsx("div",{className:`stat-val ${t.flags>0?"c-red":"c-accent"}`,children:t.flags})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"SNOOZED"}),d.jsx("div",{className:`stat-val ${t.snoozed>0?"c-amber":"c-accent"}`,children:t.snoozed})]}),d.jsxs("div",{className:"stat-card stat-card-wide",children:[d.jsx("div",{className:"stat-label",children:"NEXT RUN"}),d.jsx("div",{className:"stat-val stat-val-sm",children:n??"—"})]})]})}function Kg(t){return`run-status ${t}`}function zh(t){switch(t){case"running":return"RUNNING";case"success":return"SUCCESS";case"failed":return"FAILED";default:return"UNKNOWN"}}function Xg(t,n){const s=Math.max(0,n-t);return s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`}function $S(t,n){if(t>=n)return"expired";const s=n-t;return s<60?"expires in <1m":s<3600?`expires in ${Math.floor(s/60)}m`:`expires in ${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`}function WS({runs:t,loading:n}){return n?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):t.length===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⧗"}),d.jsx("div",{className:"empty-msg",children:"NO RUNS YET"})]})}):d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"ROUTINE"}),d.jsx("th",{children:"STARTED"}),d.jsx("th",{children:"DURATION"}),d.jsx("th",{children:"STATUS"}),d.jsx("th",{children:"EXIT CODE"})]})}),d.jsx("tbody",{children:t.map(s=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx(Ac,{to:`/routines?history=${encodeURIComponent(s.routine_id)}`,children:s.routine_title})}),d.jsx("td",{children:d.jsx("div",{className:"cell-time",children:Oo(s.started_at)})}),d.jsx("td",{children:d.jsx("span",{className:"cell-meta",children:s.finished_at==null?"—":Xg(s.started_at,s.finished_at)})}),d.jsx("td",{children:d.jsx("span",{className:Kg(s.status),children:zh(s.status)})}),d.jsx("td",{children:s.exit_code==null?"—":s.exit_code})]},s.workbench))})]})})}function HS({runs:t,now:n,loading:s,error:a,onTrigger:l}){return a!==void 0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⚠"}),d.jsx("div",{className:"empty-msg",children:"FAILED TO LOAD"}),d.jsx("div",{className:"empty-sub",children:a})]})}):s?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):t.length===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"◷"}),d.jsx("div",{className:"empty-msg",children:"NO UPCOMING RUNS"}),d.jsx("div",{className:"empty-sub",children:"no enabled routine is scheduled to fire"})]})}):d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"TYPE"}),d.jsx("th",{children:"NAME"}),d.jsx("th",{children:"SCHEDULE"}),d.jsx("th",{children:"NEXT RUN"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:t.map((c,h)=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("span",{className:"kind-badge routine",children:"ROUTINE"})}),d.jsxs("td",{children:[d.jsx(Ac,{className:"ov-name-link",to:"/routines",children:c.label}),c.flagCount>0&&d.jsx("span",{className:"ov-flag-badge",title:`${c.flagCount} open flag${c.flagCount===1?"":"s"}`,children:`⚑ ${c.flagCount}`})]}),d.jsx("td",{children:d.jsx("div",{className:"cell-schedule-human",children:c.human??c.schedule})}),d.jsxs("td",{className:"cell-next",children:[d.jsx("div",{className:"cell-next-when",children:Uh(n,c.at)}),d.jsx("div",{className:c.soon?"cell-next-until soon":"cell-next-until",children:Wc(n,c.at)})]}),d.jsx("td",{className:"cell-act",children:d.jsx("button",{className:"btn btn-sm btn-ghost run-now-btn",title:"Trigger now",onClick:()=>l(c.id),children:"▶ RUN"})})]},h))})]})})}const BS=8,ZS=1e4;function qS(){const t=zn(),{addToast:n}=Fo(),s=Fh(),a=Ug(BS),l=Ag(),c=Pg(),h=Fg(),[y,x]=Z.useState(()=>new Date),[w,E]=Z.useState(Vc);Z.useEffect(()=>{const $=setInterval(()=>x(new Date),ZS);return()=>clearInterval($)},[]),Z.useEffect(()=>{const $=Uc(w);if($===void 0)return;const J=setInterval(()=>{t.invalidateQueries({queryKey:["routines"]})},$);return()=>clearInterval(J)},[w,t]);const O=Z.useCallback($=>{zc($),E($)},[]),_=Z.useCallback($=>{h.mutate($,{onSuccess:()=>n("Triggered","ok"),onError:J=>n(`Trigger failed: ${J instanceof Error?J.message:String(J)}`,"err")})},[h,n]),S=Z.useCallback(()=>{c.mutate("all")},[c]),C=US(s.data??[],y),T=MS(C,y),b=Gg(C,y),I=IS(C,y),j=LS(I,y),F=Math.max(s.dataUpdatedAt,a.dataUpdatedAt,l.dataUpdatedAt),U=s.error instanceof Error?s.error.message:void 0;return d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Overview"}),d.jsx(Wg,{status:l.data,onUnlock:S}),d.jsx(zS,{kpis:T,nextRun:j}),b.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"section-hd",children:d.jsx("span",{className:"section-label attn",children:"NEEDS ATTENTION"})}),d.jsx(VS,{items:b})]}),d.jsxs("div",{className:"section-hd",children:[d.jsx("span",{className:"section-label",children:"UPCOMING RUNS"}),d.jsx("div",{className:"section-acts",children:d.jsx($c,{token:w,updatedAtMs:F,onChange:O})})]}),d.jsx(HS,{runs:I,now:y,loading:s.isLoading,error:U,onTrigger:_}),d.jsx("div",{className:"section-hd",children:d.jsx("span",{className:"section-label",children:"RECENT RUNS"})}),d.jsx(WS,{runs:a.data??[],loading:a.isLoading})]})}function QS({count:t,onEnable:n,onDisable:s,onDelete:a,onClear:l}){return t===0?null:d.jsxs("div",{className:"bulk-bar",children:[d.jsxs("span",{className:"bulk-count",children:[t," SELECTED"]}),d.jsxs("div",{className:"bulk-acts",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:n,children:"ENABLE"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"DISABLE"}),d.jsx("button",{type:"button",className:"btn btn-danger btn-sm",onClick:a,children:"DELETE"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:l,children:"CLEAR"})]})]})}function YS({count:t,onCancel:n,onConfirm:s}){return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true",onClick:a=>a.stopPropagation(),children:[d.jsx("div",{className:"dialog-title",children:"⚠ DELETE ROUTINES"}),d.jsxs("div",{className:"dialog-msg",children:["Delete ",t," selected routine",t===1?"":"s","? This cannot be undone."]}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:n,children:"Cancel"}),d.jsx("button",{type:"button",className:"btn btn-danger",onClick:s,children:"Delete"})]})]})})}function GS({title:t,onCancel:n,onConfirm:s}){return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true",onClick:a=>a.stopPropagation(),children:[d.jsx("div",{className:"dialog-title",children:"⚠ DELETE ROUTINE"}),d.jsxs("div",{className:"dialog-msg",children:['Delete the routine "',t,'"? This cannot be undone.']}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:n,children:"Cancel"}),d.jsx("button",{type:"button",className:"btn btn-danger",onClick:s,children:"Delete"})]})]})})}const hy=["B","KB","MB","GB","TB"];function KS(t){if(t<1024)return`${t} B`;let n=t,s=0;for(;n>=1024&&s<hy.length-1;)n/=1024,s++;return`${n.toFixed(1)} ${hy[s]}`}const pc=[40,140,300,600],XS=Vh.map(t=>t.slice(0,3));function JS({items:t,loading:n,onClick:s}){var b;const[a,l]=Z.useState(0),[c,h]=Z.useState(0),y=Z.useRef(null);if(Z.useEffect(()=>{var I;(I=y.current)==null||I.scrollIntoView({block:"center"})},[a,c]),n)return d.jsx("div",{className:"day-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})});const x=Br(new Date),w=new Date(x);w.setDate(w.getDate()+a);const E=a===0?new Date().getHours():-1,O=Array.from({length:24},()=>[]);let _=0;for(const I of t)for(const j of qg(I.schedule,w))(b=O[j.getHours()])==null||b.push({time:j,label:I.label,id:I.id,snoozed:I.snoozed,flagCount:I.flagCount}),_++;for(const I of O)I.sort((j,F)=>j.time.getTime()-F.time.getTime());const S=`${Xl[w.getDay()]} · ${XS[w.getMonth()]} ${w.getDate()} ${w.getFullYear()}`,C=c>0,T=pc[c]??pc[0];return d.jsxs("div",{className:"day-wrap",children:[d.jsxs("div",{className:"day-nav",children:[d.jsx("button",{type:"button",className:"btn-refresh",title:"Previous day","aria-label":"Previous day",onClick:()=>l(I=>I-1),children:"‹"}),d.jsx("div",{className:"day-date",children:S}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Next day","aria-label":"Next day",onClick:()=>l(I=>I+1),children:"›"}),d.jsxs("div",{className:"day-zoom",children:[d.jsx("button",{type:"button",className:"btn-refresh",title:"Zoom out","aria-label":"Zoom out",disabled:c===0,onClick:()=>h(I=>Math.max(0,I-1)),children:"−"}),d.jsxs("span",{className:"day-zoom-level",children:[c+1,"×"]}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Zoom into the hour","aria-label":"Zoom in",disabled:c===pc.length-1,onClick:()=>h(I=>Math.min(pc.length-1,I+1)),children:"+"})]}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>l(0),children:"TODAY"})]}),_===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"🗓"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"no fire times on this day"})]}):d.jsx("div",{className:C?"day-scroll detail":"day-scroll",style:{"--dh":`${T}px`},children:O.map((I,j)=>d.jsxs("div",{className:j===E?"day-hour now":"day-hour",ref:j===E?y:void 0,children:[C?d.jsxs("div",{className:"day-hour-label",children:[d.jsxs("span",{children:[String(j).padStart(2,"0"),":00"]}),d.jsxs("span",{className:"qt",children:[String(j).padStart(2,"0"),":15"]}),d.jsxs("span",{className:"qt",children:[String(j).padStart(2,"0"),":30"]}),d.jsxs("span",{className:"qt",children:[String(j).padStart(2,"0"),":45"]}),d.jsx("span",{className:"qt-end"})]}):d.jsxs("div",{className:"day-hour-label",children:[String(j).padStart(2,"0"),":00"]}),d.jsx("div",{className:"day-hour-slot",children:I.map((F,U)=>{const $=(F.time.getMinutes()+F.time.getSeconds()/60)/60,J=C?{top:`${($*100).toFixed(3)}%`}:void 0;let se="day-chip";return s&&F.id&&(se+=" clickable"),F.snoozed&&(se+=" snoozed"),d.jsxs("div",{className:se,style:J,title:F.label,onClick:()=>F.id&&(s==null?void 0:s(F.id)),children:[d.jsxs("span",{className:"day-chip-time",children:[String(F.time.getHours()).padStart(2,"0"),":",String(F.time.getMinutes()).padStart(2,"0")]}),d.jsx("span",{className:"day-chip-label",children:F.label}),F.flagCount>0&&d.jsxs("span",{className:"day-chip-flag",children:["⚑",F.flagCount]})]},U)})})]},j))})]})}const $h=36e5,e1=["all","enabled","disabled","dormant","due","snoozed","flagged","agent-unreg"];function Jg(t){return e1.includes(t)?t:"all"}const ev="\0all";function gs(t){return t.kind==="all"?ev:t.value}function co(t){return t===ev?{kind:"all"}:{kind:"named",value:t}}const tv="\0any",nv="\0unassigned";function xc(t){switch(t.kind){case"any":return tv;case"unassigned":return nv;case"machine":return t.value}}function rv(t){return t===tv?{kind:"any"}:t===nv?{kind:"unassigned"}:{kind:"machine",value:t}}function Uf(){return{query:"",status:"all",agent:{kind:"all"},machine:{kind:"any"},repository:{kind:"all"},tag:{kind:"all"}}}function sv(t){return t.query.trim()!==""||t.status!=="all"||t.agent.kind!=="all"||t.machine.kind!=="any"||t.repository.kind!=="all"||t.tag.kind!=="all"}function t1(t,n,s,a){const l=n.machines??[];switch(t.status){case"enabled":if(!n.enabled)return!1;break;case"disabled":if(n.enabled)return!1;break;case"dormant":if(!(n.enabled&&l.length===0))return!1;break;case"due":if(!(n.enabled&&Ph(n.schedule,s,a)))return!1;break;case"snoozed":if(!ka(n,s))return!1;break;case"flagged":if((n.flag_count??0)===0)return!1;break;case"agent-unreg":if(n.agent_registered)return!1;break}if(t.agent.kind==="named"&&n.agent!==t.agent.value||t.machine.kind==="unassigned"&&l.length>0||t.machine.kind==="machine"&&!l.includes(t.machine.value))return!1;const c=t.repository;if(c.kind==="named"&&!(n.repositories??[]).some(y=>y.repository===c.value)||t.tag.kind==="named"&&!(n.tags??[]).includes(t.tag.value))return!1;const h=t.query.trim().toLowerCase();if(h!==""){const y=(n.repositories??[]).map(O=>O.repository.toLowerCase()).join(" "),x=(n.schedule_description??"").toLowerCase(),w=(n.tags??[]).map(O=>O.toLowerCase()).join(" ");if(![n.title.toLowerCase(),n.agent.toLowerCase(),n.schedule.toLowerCase(),y,x,w].join(" ").includes(h))return!1}return!0}function n1(t,n,s,a){return t.filter(l=>t1(n,l,s,a))}function yh(t){const n=t.last_manual_trigger_at??void 0,s=t.last_scheduled_trigger_at??void 0;return n===void 0?s:s===void 0?n:Math.max(n,s)}function my(t){switch(t){case"dormant":return 0;case"dead-schedule":return 1;case"agent-missing":return 2;case"disabled":return 3;case"power-saving":return 4;case"snoozed":return 5;case"healthy":return 6}}function gh(t){switch(t){case"dormant":return"DORMANT";case"dead-schedule":return"DEAD SCHEDULE";case"agent-missing":return"AGENT MISSING";case"disabled":return"DISABLED";case"power-saving":return"POWER SAVING";case"snoozed":return"SNOOZED";case"healthy":return"HEALTHY"}}function r1(t){switch(t){case"dormant":return"health-badge dormant";case"dead-schedule":return"health-badge dead";case"agent-missing":return"health-badge agent-missing";case"disabled":return"health-badge disabled";case"power-saving":return"health-badge power-saving";case"snoozed":return"health-badge snoozed";case"healthy":return"health-badge healthy"}}function ka(t,n){const s=t.snoozed_until;return s!=null&&s*1e3>n.getTime()?!0:(t.skip_runs??0)>0}function s1(t,n){const s=t.snoozed_until;if(s!=null){const l=s*1e3;if(l>n.getTime()){const c=Math.floor((l-n.getTime())/1e3);return c<3600?`${Math.floor(c/60)}m left`:c<86400?`${Math.floor(c/3600)}h left`:`${Math.floor(c/86400)}d left`}}const a=t.skip_runs;return a!=null&&a>0?`${a} run${a===1?"":"s"} skipped`:""}function Ec(t,n){return t.enabled?t.power_saving?"power-saving":(t.machines??[]).every(a=>a.trim()==="")?"dormant":Ao(t.schedule,n)===void 0?"dead-schedule":t.agent_registered?ka(t,n)?"snoozed":"healthy":"agent-missing":"disabled"}function i1(t){return t.enabled?t.power_saving?"Routine is in power-saving mode":"Run now":"Routine is disabled"}function a1(t){return[...new Set(t.map(n=>n.agent))].sort()}function o1(t){return[...new Set(t.flatMap(n=>n.machines??[]))].sort()}function l1(t){return[...new Set(t.flatMap(n=>(n.repositories??[]).map(s=>s.repository)))].sort()}function u1(t){return[...new Set(t.flatMap(n=>n.tags??[]))].sort()}const c1=[["all","All"],["enabled","Enabled"],["disabled","Disabled"],["dormant","Dormant"],["due","Due soon"],["snoozed","Snoozed"],["flagged","Flagged"],["agent-unreg","Agent unregistered"]];function d1({filter:t,agents:n,machines:s,repositories:a,tags:l,shown:c,total:h,searchRef:y,onQuery:x,onStatus:w,onAgent:E,onMachine:O,onRepository:_,onTag:S,onClear:C}){return d.jsxs("div",{className:"filter-bar",children:[d.jsxs("div",{className:"filter-field",children:[d.jsx("input",{ref:y,type:"text",className:"filter-input",placeholder:"Search routines…  ( / )","aria-label":"Search routines",value:t.query,onChange:T=>x(T.target.value)}),d.jsx("span",{className:"filter-label",children:"STATUS"}),d.jsx("select",{className:"filter-select","aria-label":"Status filter",value:t.status,onChange:T=>w(Jg(T.target.value)),children:c1.map(([T,b])=>d.jsx("option",{value:T,children:b},T))}),d.jsx("span",{className:"filter-label",children:"AGENT"}),d.jsxs("select",{className:"filter-select","aria-label":"Agent filter",value:gs(t.agent),onChange:T=>E(co(T.target.value)),children:[d.jsx("option",{value:gs({kind:"all"}),children:"Any"}),n.map(T=>d.jsx("option",{value:T,children:T},T))]}),d.jsx("span",{className:"filter-label",children:"MACHINE"}),d.jsxs("select",{className:"filter-select","aria-label":"Machine filter",value:xc(t.machine),onChange:T=>O(rv(T.target.value)),children:[d.jsx("option",{value:xc({kind:"any"}),children:"Any"}),d.jsx("option",{value:xc({kind:"unassigned"}),children:"None"}),s.map(T=>d.jsx("option",{value:T,children:T},T))]}),d.jsx("span",{className:"filter-label",children:"REPOSITORY"}),d.jsxs("select",{className:"filter-select","aria-label":"Repository filter",value:gs(t.repository),onChange:T=>_(co(T.target.value)),children:[d.jsx("option",{value:gs({kind:"all"}),children:"Any"}),a.map(T=>d.jsx("option",{value:T,children:T},T))]}),l.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"filter-label",children:"TAG"}),d.jsxs("select",{className:"filter-select","aria-label":"Tag filter",value:gs(t.tag),onChange:T=>S(co(T.target.value)),children:[d.jsx("option",{value:gs({kind:"all"}),children:"Any"}),l.map(T=>d.jsx("option",{value:T,children:T},T))]})]})]}),d.jsxs("div",{className:"filter-field",children:[d.jsxs("span",{className:"filter-count",children:["Showing ",c," of ",h]}),sv(t)&&d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Clear all filters",onClick:C,children:"CLEAR"})]})]})}const f1=["title","next_run","last_fire","agent","health","enabled","updated"];function h1(t){return f1.includes(t)?t:void 0}function m1(t){return t==="asc"?"desc":"asc"}function p1(t){return t==="desc"?"desc":"asc"}const y1=["none","agent","machine","status","health"];function iv(t){return y1.includes(t)?t:"none"}function g1(t){switch(t){case"none":return"None";case"agent":return"Agent";case"machine":return"Machine";case"status":return"Status";case"health":return"Health"}}function v1(t,n){var s;switch(n){case"none":return"";case"agent":return t.agent;case"machine":return((s=t.machines)==null?void 0:s[0])??"(unassigned)";case"status":return t.enabled?"Enabled":"Disabled";case"health":return gh(Ec(t,new Date))}}function x1(t,n){if(n==="none")return[["",t]];const s=new Map;for(const a of t){const l=v1(a,n),c=s.get(l);c?c.push(a):s.set(l,[a])}return[...s.entries()].sort(([a],[l])=>a<l?-1:a>l?1:0)}function w1(t,n,s,a){if(n===void 0)return t;const l=(c,h)=>{let y;switch(n){case"title":y=c.title.toLowerCase().localeCompare(h.title.toLowerCase());break;case"agent":y=c.agent.toLowerCase().localeCompare(h.agent.toLowerCase());break;case"enabled":y=Number(c.enabled)-Number(h.enabled);break;case"updated":y=c.updated_at-h.updated_at;break;case"health":y=my(Ec(c,a))-my(Ec(h,a));break;case"last_fire":{const w=yh(c),E=yh(h);y=(w??-1)-(E??-1);break}case"next_run":{const w=_=>{var S;return _.enabled?(S=Ao(_.schedule,a))==null?void 0:S.getTime():void 0},E=w(c),O=w(h);E!==void 0&&O!==void 0?y=E-O:E!==void 0?y=-1:O!==void 0?y=1:y=0;break}}const x=s==="desc"?-y:y;return x!==0?x:c.id.localeCompare(h.id)};return[...t].sort(l)}const S1=["none","agent","machine","status","health"];function k1({groupBy:t,onChange:n}){return d.jsxs("div",{className:"group-by-ctrl",children:[d.jsx("label",{htmlFor:"routine-group-by-select",children:"GROUP BY"}),d.jsx("select",{id:"routine-group-by-select",className:"filter-select","aria-label":"Group routines by",value:t,onChange:s=>n(iv(s.target.value)),children:S1.map(s=>d.jsx("option",{value:s,children:g1(s)},s))})]})}function _1({routines:t,loading:n,onEdit:s}){const[a,l]=Z.useState(0),{addToast:c}=Fo();if(n)return d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})});const h=()=>{const C=`${window.location.origin}${Aw()}`;navigator.clipboard.writeText(C).then(()=>c("Calendar feed URL copied","ok")).catch(()=>c("Copy failed","err"))},y=new Date;y.setHours(0,0,0,0);const x=TS(y,a),w=new Date(x);w.setDate(w.getDate()-x.getDay());const E=new Date,O=Array.from({length:ph},()=>[]);let _=0;for(const C of t.filter(T=>T.enabled)){const T=OS(C.schedule,w);if(T===void 0)continue;_++;const b=ka(C,E);T.forEach((I,j)=>{var F;I>0&&((F=O[j])==null||F.push({id:C.id,title:C.title,count:I,snoozed:b}))})}const S=`${Vh[x.getMonth()]} ${x.getFullYear()}`;return d.jsxs("div",{className:"cal-wrap",children:[d.jsxs("div",{className:"cal-nav",children:[d.jsx("button",{type:"button",className:"btn-refresh",title:"Previous month","aria-label":"Previous month",onClick:()=>l(C=>C-1),children:"‹"}),d.jsx("div",{className:"cal-month",children:S}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Next month","aria-label":"Next month",onClick:()=>l(C=>C+1),children:"›"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>l(0),children:"TODAY"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Copy the routines.ics feed URL",onClick:h,children:"SUBSCRIBE"})]}),_===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"🗓"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"enabled routines with a valid schedule appear here"})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"cal-weekdays",children:Xl.map(C=>d.jsx("div",{className:"cal-weekday",children:C},C))}),d.jsx("div",{className:"cal-grid",children:O.map((C,T)=>{const b=new Date(w);b.setDate(b.getDate()+T);let I="cal-day";return b.getMonth()!==x.getMonth()&&(I+=" other-month"),b.getTime()===y.getTime()&&(I+=" today"),d.jsxs("div",{className:I,children:[d.jsx("div",{className:"cal-daynum",children:b.getDate()}),d.jsxs("div",{className:"cal-hits",children:[C.slice(0,4).map((j,F)=>{const U=j.count>1?`${j.title} ×${j.count}`:j.title;let $="cal-chip clickable";return j.snoozed&&($+=" snoozed"),d.jsx("div",{className:$,title:U,onClick:()=>s(j.id),children:U},`${j.id}-${F}`)}),C.length>4&&d.jsxs("div",{className:"cal-more",children:["+",C.length-4," more"]})]})]},T)})})]})]})}function N1({id:t,title:n,onBack:s}){const a=Lw(t),l=Fw(),c=a.data??[];return d.jsxs("main",{className:"logs-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"← BACK"}),d.jsxs("div",{className:"page-title",children:["FLAGS / ",n]}),a.dataUpdatedAt>0&&d.jsx("span",{className:"page-freshness",children:Ah(Math.max(0,(Date.now()-a.dataUpdatedAt)/1e3))}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void a.refetch(),children:"↻"})]}),a.isLoading?d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})}):a.isError?d.jsx("div",{className:"logs-error",children:a.error.message}):c.length===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⚑"}),d.jsx("div",{className:"empty-msg",children:"NO OPEN FLAGS"})]}):d.jsxs("div",{className:"flags-list",children:[d.jsxs("div",{className:"flags-count",children:[c.length," open flag",c.length===1?"":"s"]}),c.map(h=>d.jsxs("div",{className:"flag-item",children:[d.jsxs("div",{className:"flag-item-hd",children:[d.jsx("span",{className:"flag-type",children:h.type}),d.jsx("span",{className:"flag-scope",children:h.scope==="general"?"general":"local"}),d.jsx("span",{className:"flag-age",title:h.filename,children:Oo(h.created_at)}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",disabled:l.isPending,onClick:()=>l.mutate({id:t,filename:h.filename}),children:"RESOLVE"})]}),d.jsx("div",{className:"flag-desc",children:h.description})]},h.filename))]})]})}var Jl=t=>t.type==="checkbox",_i=t=>t instanceof Date,an=t=>t==null;const Wh=t=>typeof t=="object";var Rt=t=>!an(t)&&!Array.isArray(t)&&Wh(t)&&!_i(t),E1=t=>Rt(t)&&t.target?Jl(t.target)?t.target.checked:t.target.value:t,T1=(t,n)=>n.split(".").some((s,a,l)=>!isNaN(Number(s))&&t.has(l.slice(0,a).join("."))),av=t=>{const n=t.constructor&&t.constructor.prototype;return Rt(n)&&n.hasOwnProperty("isPrototypeOf")},Hc=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ut(t){if(t instanceof Date)return new Date(t);const n=typeof FileList<"u"&&t instanceof FileList;if(Hc&&(t instanceof Blob||n))return t;const s=Array.isArray(t);if(!s&&!(Rt(t)&&av(t)))return t;const a=s?[]:Object.create(Object.getPrototypeOf(t));for(const l in t)Object.prototype.hasOwnProperty.call(t,l)&&(a[l]=Ut(t[l]));return a}const oo={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},_r={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Sr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ov="root",Hh=["__proto__","constructor","prototype"],C1=/^\w*$/;var eu=t=>C1.test(t),_t=t=>t===void 0;const O1=/[.[\]'"]/;var Bc=t=>t.split(O1).filter(Boolean),Ee=(t,n,s)=>{if(!n||!Rt(t))return s;const a=eu(n)?[n]:Bc(n);if(a.some(c=>Hh.includes(c)))return s;const l=a.reduce((c,h)=>an(c)?void 0:c[h],t);return _t(l)||l===t?_t(t[n])?s:t[n]:l},Ur=t=>typeof t=="boolean",nr=t=>typeof t=="function",kt=(t,n,s)=>{let a=-1;const l=eu(n)?[n]:Bc(n),c=l.length,h=c-1;for(;++a<c;){const y=l[a];let x=s;if(a!==h){const w=t[y];x=Rt(w)||Array.isArray(w)?w:isNaN(+l[a+1])?{}:[]}if(Hh.includes(y))return;t[y]=x,t=t[y]}};const b1=sn.createContext(null);b1.displayName="HookFormControlContext";var j1=(t,n,s,a=!0)=>{const l={};for(const c in t)Object.defineProperty(l,c,{get:()=>{const h=c;return n._proxyFormState[h]!==_r.all&&(n._proxyFormState[h]=!a||_r.all),t[h]}});return l};const R1=Hc?sn.useLayoutEffect:sn.useEffect;var fn=t=>typeof t=="string",D1=(t,n,s,a,l)=>fn(t)?(a&&n.watch.add(t),Ee(s,t,l)):Array.isArray(t)?t.map(c=>(a&&n.watch.add(c),Ee(s,c))):(a&&(n.watchAll=!0),s),vh=t=>an(t)||!Wh(t);const py=(t,n)=>n.length===0&&!Array.isArray(t)&&!av(t);function Vr(t,n,s=new WeakMap){if(t===n)return!0;if(vh(t)||vh(n))return Object.is(t,n);if(_i(t)&&_i(n))return Object.is(t.getTime(),n.getTime());const a=Object.keys(t),l=Object.keys(n);if(a.length!==l.length)return!1;if(py(t,a)||py(n,l))return Object.is(t,n);if(!a.length&&Array.isArray(t)!==Array.isArray(n))return!1;const c=s.get(t);if(c&&c.has(n))return!0;if(c)c.add(n);else{const h=new WeakSet;h.add(n),s.set(t,h)}for(const h of a){const y=t[h];if(!(h in n))return!1;if(h!=="ref"){const x=n[h];if(_i(y)&&_i(x)||(Rt(y)||Array.isArray(y))&&(Rt(x)||Array.isArray(x))?!Vr(y,x,s):!Object.is(y,x))return!1}}return!0}const lv=t=>{const n={};for(const s of Object.keys(t))if(Wh(t[s])&&t[s]!==null&&!_i(t[s])){const a=lv(t[s]);for(const l of Object.keys(a))n[`${s}.${l}`]=a[l]}else n[s]=t[s];return n},M1=sn.createContext(null);M1.displayName="HookFormContext";var I1=(t,n,s,a,l)=>n?{...s[t],types:{...s[t]&&s[t].types?s[t].types:{},[a]:l||!0}}:{},uv=t=>Array.isArray(t)?t.filter(Boolean):[],wc=t=>Array.isArray(t)?t:[t],yy=()=>{let t=[];return{get observers(){return t},next:l=>{for(const c of t)c.next&&c.next(l)},subscribe:l=>(t.push(l),{unsubscribe:()=>{t=t.filter(c=>c!==l)}}),unsubscribe:()=>{t=[]}}};function cv(t,n){const s={};for(const a in t)if(t.hasOwnProperty(a)){const l=t[a],c=n[a];if(l&&Rt(l)&&c){const h=cv(l,c);Rt(h)&&(s[a]=h)}else t[a]&&(s[a]=c)}return s}var rn=t=>Rt(t)&&!Object.keys(t).length,Bh=t=>t.type==="file",Tc=t=>{if(!Hc)return!1;const n=t?t.ownerDocument:0;return t instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},dv=t=>t.type==="select-multiple",Zh=t=>t.type==="radio",L1=t=>Zh(t)||Jl(t),Vf=t=>Tc(t)&&t.isConnected;function F1(t,n){const s=n.slice(0,-1).length;let a=0;for(;a<s;){if(an(t)){t=void 0;break}t=t[n[a]],a++}return t}function A1(t){for(const n in t)if(t.hasOwnProperty(n)&&!_t(t[n]))return!1;return!0}function $t(t,n){if(fn(n)&&Object.prototype.hasOwnProperty.call(t,n))return delete t[n],t;const s=Array.isArray(n)?n:eu(n)?[n]:Bc(n);if(s.some(h=>Hh.includes(String(h))))return t;const a=s.length===1?t:F1(t,s),l=s.length-1,c=s[l];return a&&delete a[c],l!==0&&(Rt(a)&&rn(a)||Array.isArray(a)&&A1(a))&&$t(t,s.slice(0,-1)),t}var P1=t=>{for(const n in t)if(nr(t[n]))return!0;return!1};function fv(t){return Array.isArray(t)||Rt(t)&&!P1(t)}function xh(t,n={}){for(const s in t){const a=t[s];fv(a)?(n[s]=Array.isArray(a)?[]:{},xh(a,n[s])):_t(a)||(n[s]=!0)}return n}function wh(t){if(t!==!1){if(t===!0)return!0;if(Array.isArray(t)){const n=t.map(s=>wh(s));return n.some(s=>s!==void 0)?n:void 0}if(Rt(t)){const n={};for(const s in t){const a=wh(t[s]);_t(a)||(n[s]=a)}return Object.keys(n).length?n:void 0}}}function ca(t,n,s){s||(s=xh(n));for(const a in t){const l=t[a];if(fv(l))_t(n)||vh(s[a])?s[a]=xh(l,Array.isArray(l)?[]:{}):ca(l,an(n)?{}:n[a],s[a]);else{const c=n[a];s[a]=!Vr(l,c)}}return wh(s)||{}}const gy={value:!1,isValid:!1},vy={value:!0,isValid:!0};var hv=t=>{if(Array.isArray(t)){if(t.length>1){const n=t.filter(s=>s&&s.checked&&!s.disabled).map(s=>s.value);return{value:n,isValid:!!n.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!_t(t[0].attributes.value)?_t(t[0].value)||t[0].value===""?vy:{value:t[0].value,isValid:!0}:vy:gy}return gy},mv=(t,{valueAsNumber:n,valueAsDate:s,setValueAs:a})=>_t(t)?t:n?t===""?NaN:t&&+t:s&&fn(t)?new Date(t):a?a(t):t;const xy={isValid:!1,value:null};var pv=t=>Array.isArray(t)?t.reduce((n,s)=>s&&s.checked&&!s.disabled?{isValid:!0,value:s.value}:n,xy):xy;function wy(t){const n=t.ref;return Bh(n)?n.files:Zh(n)?pv(t.refs).value:dv(n)?[...n.selectedOptions].map(({value:s})=>s):Jl(n)?hv(t.refs).value:mv(_t(n.value)?t.ref.value:n.value,t)}var U1=(t,n,s,a)=>{const l={};for(const c of t){const h=Ee(n,c);h&&kt(l,c,h._f)}return{criteriaMode:s,names:[...t],fields:l,shouldUseNativeValidation:a}},Cc=t=>t instanceof RegExp,Il=t=>_t(t)?t:Cc(t)?t.source:Rt(t)?Cc(t.value)?t.value.source:t.value:t,yc=t=>({isOnSubmit:!t||t===_r.onSubmit,isOnBlur:t===_r.onBlur,isOnChange:t===_r.onChange,isOnAll:t===_r.all,isOnTouch:t===_r.onTouched});const Sy="AsyncFunction";var V1=t=>{if(!t||!t.validate)return!1;if(nr(t.validate))return t.validate.constructor.name===Sy;if(Rt(t.validate)){for(const n in t.validate)if(t.validate[n].constructor.name===Sy)return!0}return!1},z1=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),zf=(t,n,s)=>{if(s)return!1;if(n.watchAll||n.watch.has(t))return!0;for(const a of n.watch)if(t.startsWith(a)&&t.charAt(a.length)===".")return!0;return!1};const Al=(t,n,s,a)=>{for(const l of s||Object.keys(t)){const c=Ee(t,l);if(c){const{_f:h,...y}=c;if(h){if(h.refs&&h.refs[0]&&n(h.refs[0],l)&&!a)return!0;if(h.ref&&n(h.ref,h.name)&&!a)return!0;if(Al(y,n))break}else if(Rt(y)&&Al(y,n))break}}};function ky(t,n,s){const a=Ee(t,s);if(a||eu(s))return{error:a,name:s};const l=s.split(".");for(;l.length;){const c=l.join("."),h=Ee(n,c),y=Ee(t,c);if(h&&!Array.isArray(h)&&s!==c)return{name:s};if(y&&y.type)return{name:c,error:y};if(y&&y.root&&y.root.type)return{name:`${c}.root`,error:y.root};l.pop()}return{name:s}}var $1=(t,n,s,a)=>{s(t);const{name:l,...c}=t,h=Object.keys(c);return!h.length||a&&h.length>=Object.keys(n).length||h.find(y=>n[y]===(!a||_r.all))},W1=(t,n,s)=>!t||!n||t===n||wc(t).some(a=>a&&(s?a===n||a.startsWith(n+"."):a.startsWith(n)||n.startsWith(a))),H1=(t,n,s,a,l)=>l.isOnAll?!1:!s&&l.isOnTouch?!(n||t):(s?a.isOnBlur:l.isOnBlur)?!t:(s?a.isOnChange:l.isOnChange)?t:!0,B1=(t,n)=>!uv(Ee(t,n)).length&&$t(t,n),_y=(t,n,s)=>{const a=Ee(t,s),l=Array.isArray(a)?a:[];return kt(l,ov,n[s]),kt(t,s,l),t};function Ny(t,n,s="validate"){if(fn(t)||Array.isArray(t)&&t.every(fn)||Ur(t)&&!t)return{type:s,message:fn(t)?t:"",ref:n}}var lo=t=>Rt(t)&&!Cc(t)?t:{value:t,message:""},Ey=async(t,n,s,a,l,c)=>{const{ref:h,refs:y,required:x,maxLength:w,minLength:E,min:O,max:_,pattern:S,validate:C,name:T,valueAsNumber:b,mount:I}=t._f,j=Ee(s,T);if(!I||n.has(T))return{};const F=y?y[0]:h,U=ve=>{if(l&&F.reportValidity){const he=Ur(ve)?"":ve||"";y?y.forEach(Me=>Me.setCustomValidity(he)):F.setCustomValidity(he),F.reportValidity()}},$={},J=Zh(h),se=Jl(h),me=J||se,ye=(b||Bh(h))&&_t(h.value)&&_t(j)||Tc(h)&&h.value===""||j===""||Array.isArray(j)&&!j.length,ke=I1.bind(null,T,a,$),pe=(ve,he,Me,Pe=Sr.maxLength,Xe=Sr.minLength)=>{const $e=ve?he:Me;$[T]={type:ve?Pe:Xe,message:$e,ref:h,...ke(ve?Pe:Xe,$e)}};if(c?!Array.isArray(j)||!j.length:x&&(!me&&(ye||an(j))||Ur(j)&&!j||se&&!hv(y).isValid||J&&!pv(y).isValid)){const{value:ve,message:he}=fn(x)?{value:!!x,message:x}:lo(x);if(ve&&($[T]={type:Sr.required,message:he,ref:F,...ke(Sr.required,he)},!a))return U(he),$}if(!ye&&(!an(O)||!an(_))){let ve,he;const Me=lo(_),Pe=lo(O);if(!an(j)&&!isNaN(j)){const Xe=h.valueAsNumber||j&&+j;an(Me.value)||(ve=Xe>Me.value),an(Pe.value)||(he=Xe<Pe.value)}else{const Xe=h.valueAsDate||new Date(j),$e=ue=>new Date(new Date().toDateString()+" "+ue),te=h.type=="time",ge=h.type=="week";fn(Me.value)&&j&&(ve=te?$e(j)>$e(Me.value):ge?j>Me.value:Xe>new Date(Me.value)),fn(Pe.value)&&j&&(he=te?$e(j)<$e(Pe.value):ge?j<Pe.value:Xe<new Date(Pe.value))}if((ve||he)&&(pe(!!ve,Me.message,Pe.message,Sr.max,Sr.min),!a))return U($[T].message),$}if((w||E)&&!ye&&(fn(j)||c&&Array.isArray(j))){const ve=lo(w),he=lo(E),Me=!an(ve.value)&&j.length>+ve.value,Pe=!an(he.value)&&j.length<+he.value;if((Me||Pe)&&(pe(Me,ve.message,he.message),!a))return U($[T].message),$}if(S&&!ye&&fn(j)){const{value:ve,message:he}=lo(S);if(Cc(ve)&&!j.match(ve)&&($[T]={type:Sr.pattern,message:he,ref:h,...ke(Sr.pattern,he)},!a))return U(he),$}if(C){if(nr(C)){const ve=await C(j,s),he=Ny(ve,F);if(he&&($[T]={...he,...ke(Sr.validate,he.message)},!a))return U(he.message),$}else if(Rt(C)){let ve={};for(const he in C){if(!rn(ve)&&!a)break;const Me=Ny(await C[he](j,s),F,he);Me&&(ve={...Me,...ke(he,Me.message)},U(Me.message),a&&($[T]=ve))}if(!rn(ve)&&($[T]={ref:F,...ve},!a))return $}}return U(!0),$};const Z1={mode:_r.onSubmit,reValidateMode:_r.onChange,shouldFocusError:!0},$f="form",yv={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function q1(t={}){let n={...Z1,...t},s={...Ut(yv),isLoading:nr(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},a={},l=Rt(n.defaultValues)||Rt(n.values)?Ut(n.defaultValues||n.values)||{}:{},c=n.shouldUnregister?{}:Ut(l),h={action:!1,mount:!1,watch:!1,keepIsValid:!1},y={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},x,w=0,E=0,O=yc(n.mode),_=yc(n.reValidateMode);const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},C={...S};let T={...C};const b={array:yy(),state:yy()},I=n.criteriaMode===_r.all,j=D=>A=>{clearTimeout(w),w=setTimeout(D,A)},F=async D=>{if(!h.keepIsValid&&!n.disabled&&(C.isValid||T.isValid||D)){let A;n.resolver?(A=rn((await he()).errors),U()):A=await Xe({fields:a,onlyCheckValid:!0,eventType:oo.VALID}),A!==s.isValid&&b.state.next({isValid:A})}},U=(D,A)=>{!n.disabled&&(C.isValidating||C.validatingFields||T.isValidating||T.validatingFields)&&((D||Array.from(y.mount)).forEach(q=>{q&&(A?kt(s.validatingFields,q,A):$t(s.validatingFields,q))}),b.state.next({validatingFields:s.validatingFields,isValidating:!rn(s.validatingFields)}))},$=()=>{s.dirtyFields=ca(l,c)},J=(D,A=[],q,ee,le=!0,W=!0)=>{if(ee&&q&&!n.disabled){if(h.action=!0,W&&Array.isArray(Ee(a,D))){const Q=q(Ee(a,D),ee.argA,ee.argB);le&&kt(a,D,Q)}if(W&&Array.isArray(Ee(s.errors,D))){const Q=q(Ee(s.errors,D),ee.argA,ee.argB);le&&kt(s.errors,D,Q),B1(s.errors,D)}if((C.touchedFields||T.touchedFields)&&W&&Array.isArray(Ee(s.touchedFields,D))){const Q=q(Ee(s.touchedFields,D),ee.argA,ee.argB);le&&kt(s.touchedFields,D,Q)}(C.dirtyFields||T.dirtyFields)&&$(),b.state.next({name:D,isDirty:te(D,A),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else kt(c,D,A)},se=(D,A)=>{kt(s.errors,D,A),s.errors={...s.errors},b.state.next({errors:s.errors})},me=D=>{s.errors=D,b.state.next({errors:s.errors,isValid:!1})},ye=D=>{const A=eu(D)?[D]:Bc(D);let q=c,ee=l;for(let le=0;le<A.length-1;le++){const W=A[le];if(q=an(q)?q:q[W],ee=an(ee)?ee:ee[W],q===null&&ee!==null)return!0}return!1},ke=(D,A,q,ee)=>{const le=Ee(a,D);if(le){if(ye(D))return;const W=_t(Ee(c,D)),Q=Ee(c,D,_t(q)?Ee(l,D):q);_t(Q)||ee&&ee.defaultChecked||A?kt(c,D,A?Q:wy(le._f)):B(D,Q),h.mount&&!h.action&&(F(),W&&s.isDirty&&(C.isDirty||T.isDirty)&&(te()||(s.isDirty=!1,b.state.next({...s}))),t.shouldUnregister&&W&&!_t(Ee(c,D))&&zf(D,y)&&(h.watch=!0))}},pe=(D,A,q,ee,le)=>{let W=!1,Q=!1;const re={name:D};if(!n.disabled){if(!q||ee){const _e=Vr(Ee(l,D),A);(C.isDirty||T.isDirty)&&(Q=s.isDirty,s.isDirty=re.isDirty=!_e||te(),W=Q!==re.isDirty),Q=!!Ee(s.dirtyFields,D),_e!==s.isDirty?s.dirtyFields=ca(l,c):_e?$t(s.dirtyFields,D):kt(s.dirtyFields,D,!0),re.dirtyFields=s.dirtyFields,W=W||(C.dirtyFields||T.dirtyFields)&&Q!==!_e}if(q){const _e=Ee(s.touchedFields,D);_e||(kt(s.touchedFields,D,q),re.touchedFields=s.touchedFields,W=W||(C.touchedFields||T.touchedFields)&&_e!==q)}W&&le&&b.state.next(re)}return W?re:{}},ve=(D,A,q,ee)=>{const le=Ee(s.errors,D),W=(C.isValid||T.isValid)&&Ur(A)&&s.isValid!==A;if(n.delayError&&q?(x=j(()=>se(D,q)),x(n.delayError)):(clearTimeout(w),x=null,q?kt(s.errors,D,q):$t(s.errors,D),s.errors={...s.errors}),(q?!Vr(le,q):le)||!rn(ee)||W){const Q={...ee,...W&&Ur(A)?{isValid:A}:{},errors:s.errors,name:D};s={...s,...Q},b.state.next(Q)}},he=async D=>(U(D,!0),await n.resolver(c,n.context,U1(D||y.mount,a,n.criteriaMode,n.shouldUseNativeValidation))),Me=async D=>{const{errors:A}=await he(D);if(U(D),D){for(const q of D){const ee=Ee(A,q);ee?y.array.has(q)&&Rt(ee)&&!Object.keys(ee).some(le=>!Number.isNaN(Number(le)))?_y(s.errors,{[q]:ee},q):kt(s.errors,q,ee):$t(s.errors,q)}s.errors={...s.errors}}else s.errors=A;return A},Pe=async({name:D,eventType:A})=>{if(t.validate){const q=await t.validate({formValues:c,formState:s,name:D,eventType:A});if(Rt(q))for(const ee in q){const le=q[ee];le&&sr(`${$f}.${ee}`,{message:fn(le.message)?le.message:"",type:le.type||Sr.validate})}else fn(q)||!q?sr($f,{message:q||"",type:Sr.validate}):jn($f);return q}return!0},Xe=async({fields:D,onlyCheckValid:A,name:q,eventType:ee,context:le={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(le.runRootValidation=!0,!await Pe({name:q,eventType:ee})&&(le.valid=!1,A)))return le.valid;for(const W in D){const Q=D[W];if(Q){const{_f:re,..._e}=Q;if(re){const Ke=y.array.has(re.name),xt=Q._f&&V1(Q._f),Kt=C.validatingFields||C.isValidating||T.validatingFields||T.isValidating;xt&&Kt&&U([re.name],!0);const yt=await Ey(Q,y.disabled,c,I,n.shouldUseNativeValidation&&!A,Ke);if(xt&&Kt&&U([re.name]),yt[re.name]&&(le.valid=!1,A)||(!A&&(Ee(yt,re.name)?Ke?_y(s.errors,yt,re.name):kt(s.errors,re.name,yt[re.name]):$t(s.errors,re.name)),t.shouldUseNativeValidation&&yt[re.name]))break}!rn(_e)&&await Xe({context:le,onlyCheckValid:A,fields:_e,name:W,eventType:ee})}}return le.valid},$e=()=>{for(const D of y.unMount){const A=Ee(a,D);A&&(A._f.refs?A._f.refs.every(q=>!Vf(q)):!Vf(A._f.ref))&&ir(D)}y.unMount=new Set},te=(D,A)=>!n.disabled&&(D&&A&&kt(c,D,A),!Vr(h.mount?c:l,l)),ge=(D,A,q)=>D1(D,y,{...h.mount?c:_t(A)?l:fn(D)?{[D]:A}:A},q,A),ue=D=>uv(Ee(h.mount?c:l,D,n.shouldUnregister?Ee(l,D,[]):[])),B=(D,A,q={},ee=!1,le=!1)=>{const W=Ee(a,D);let Q=A;if(W){const re=W._f;re&&(!re.disabled&&kt(c,D,mv(A,re)),Q=Tc(re.ref)&&an(A)?"":A,dv(re.ref)?[...re.ref.options].forEach(_e=>_e.selected=Q.includes(_e.value)):re.refs?Jl(re.ref)?re.refs.forEach(_e=>{(!_e.defaultChecked||!_e.disabled)&&(Array.isArray(Q)?_e.checked=!!Q.find(Ke=>Ke===_e.value):_e.checked=Q===_e.value||!!Q)}):re.refs.forEach(_e=>_e.checked=_e.value===Q):Bh(re.ref)?re.ref.value="":(re.ref.value=Q,!re.ref.type&&!le&&b.state.next({name:D,values:ee?c:Ut(c)})))}(q.shouldDirty||q.shouldTouch)&&pe(D,Q,q.shouldTouch,q.shouldDirty,!le),q.shouldValidate&&Be(D)},ne=(D,A,q,ee=!1,le=!1)=>{for(const W in A){if(!A.hasOwnProperty(W))return;const Q=A[W],re=D+"."+W,_e=Ee(a,re);(y.array.has(D)||Rt(Q)||_e&&!_e._f)&&!_i(Q)?ne(re,Q,q,ee,le):B(re,Q,q,ee,le)}},ze=(D,A,q,ee,le=!1)=>{const W=Ee(a,D),Q=y.array.has(D),re=ee?A:Ut(A),_e=Ee(c,D),Ke=Vr(_e,re);if(Ke||kt(c,D,re),Q)b.array.next({name:D,values:ee?c:Ut(c)}),(C.isDirty||C.dirtyFields||T.isDirty||T.dirtyFields)&&q.shouldDirty&&($(),le||b.state.next({name:D,dirtyFields:s.dirtyFields,isDirty:te(D,re)}));else{const xt=Array.isArray(re)&&!re.length||rn(re);!W||W._f||an(re)||xt?B(D,re,q,ee,le):ne(D,re,q,ee,le)}if(!Ke&&!le){const xt=zf(D,y),Kt=ee?c:Ut(c);b.state.next({...xt&&s,name:h.mount||xt?D:void 0,values:Kt})}},Ce=(D,A,q={})=>ze(D,A,q,!1),je=(D,A={})=>{const q=nr(D)?D(c):D;if(!Vr(c,q)){c={...c,...q};const ee=lv(q);for(const le of y.mount)le in ee&&ze(le,ee[le],A,!0,!0);b.state.next({...s,name:void 0,type:void 0,...E?{values:c}:{}}),A.shouldValidate&&F()}},Le=async D=>{h.mount=!0;const A=D.target;let q=A.name,ee=!0;const le=Ee(a,q),W=Q=>{ee=Number.isNaN(Q)||_i(Q)&&isNaN(Q.getTime())||Vr(Q,Ee(c,q,Q))};if(le){let Q,re;const _e=A.type?wy(le._f):E1(D),Ke=D.type===oo.BLUR||D.type===oo.FOCUS_OUT,xt=!z1(le._f)&&!t.validate&&!n.resolver&&!Ee(s.errors,q)&&!le._f.deps,Kt=xt||H1(Ke,Ee(s.touchedFields,q),s.isSubmitted,_,O),yt=zf(q,y,Ke);kt(c,q,_e),Ke?(!A||!A.readOnly)&&(le._f.onBlur&&le._f.onBlur(D),x&&x(0)):le._f.onChange&&le._f.onChange(D);const ur=pe(q,_e,Ke),ji=!rn(ur)||yt;if(!Ke&&b.state.next({name:q,type:D.type,...E?{values:Ut(c)}:{}}),Kt)return(!xt||!s.isValid)&&(C.isValid||T.isValid)&&(n.mode==="onBlur"?Ke&&F():Ke||F()),ji&&b.state.next({name:q,...yt?{}:ur});if(!n.resolver&&t.validate&&await Pe({name:q,eventType:D.type}),!Ke&&yt&&b.state.next({...s}),n.resolver){const{errors:Ts}=await he([q]);if(U([q]),W(_e),!ee){!rn(ur)&&b.state.next(ur);return}const Ri=ky(s.errors,a,q),Cs=ky(Ts,a,Ri.name||q);Q=Cs.error,q=Cs.name,re=rn(Ts)}else U([q],!0),Q=(await Ey(le,y.disabled,c,I,n.shouldUseNativeValidation))[q],U([q]),W(_e),ee&&(Q?re=!1:(C.isValid||T.isValid)&&(re=await Xe({fields:a,onlyCheckValid:!0,name:q,eventType:D.type})));ee&&(le._f.deps&&(!Array.isArray(le._f.deps)||le._f.deps.length>0)&&Be(le._f.deps),ve(q,re,Q,ur))}},Qe=(D,A)=>{if(Ee(s.errors,A)&&D.focus)return D.focus(),1},Be=async(D,A={})=>{let q,ee;const le=wc(D);if(n.resolver){const W=await Me(_t(D)?D:le);q=rn(W),ee=D?!le.some(Q=>Ee(W,Q)):q}else D?(ee=(await Promise.all(le.map(async W=>{const Q=Ee(a,W);return await Xe({fields:Q&&Q._f?{[W]:Q}:Q,eventType:oo.TRIGGER})}))).every(Boolean),!(!ee&&!s.isValid)&&F()):ee=q=await Xe({fields:a,name:D,eventType:oo.TRIGGER});return b.state.next({...!fn(D)||(C.isValid||T.isValid)&&q!==s.isValid?{}:{name:D},...n.resolver||!D?{isValid:q}:{},errors:s.errors}),A.shouldFocus&&!ee&&Al(a,Qe,D?le:y.mount),ee},lt=(D,A)=>{let q={...h.mount?c:l};return A&&(q=cv(A.dirtyFields?s.dirtyFields:s.touchedFields,q)),_t(D)?q:fn(D)?Ee(q,D):D.map(ee=>Ee(q,ee))},Ct=(D,A)=>({invalid:!!Ee((A||s).errors,D),isDirty:!!Ee((A||s).dirtyFields,D),error:Ee((A||s).errors,D),isValidating:!!Ee(s.validatingFields,D),isTouched:!!Ee((A||s).touchedFields,D)}),jn=D=>{const A=D?wc(D):void 0;A==null||A.forEach(q=>$t(s.errors,q)),A?A.forEach(q=>{b.state.next({name:q,errors:s.errors})}):b.state.next({errors:{}})},sr=(D,A,q)=>{const ee=(Ee(a,D,{_f:{}})._f||{}).ref,le=Ee(s.errors,D)||{},{ref:W,message:Q,type:re,..._e}=le;kt(s.errors,D,{..._e,...A,ref:ee}),b.state.next({name:D,errors:s.errors,isValid:!1}),q&&q.shouldFocus&&ee&&ee.focus&&ee.focus()},$n=(D,A)=>{if(nr(D)){E++;const{unsubscribe:q}=b.state.subscribe({next:le=>"values"in le&&D(le.values||ge(void 0,A),le)});let ee=!1;return{unsubscribe:()=>{ee||(ee=!0,E--,q())}}}return ge(D,A,!0)},Nr=D=>{var A;const q=!!(!((A=D.formState)===null||A===void 0)&&A.values);q&&E++;const{unsubscribe:ee}=b.state.subscribe({next:W=>{if(W1(D.name,W.name,D.exact)&&$1(W,D.formState||C,Bn,D.reRenderRoot)){const Q={...c};D.callback({values:Q,...s,...W,defaultValues:l})}}});if(!q)return ee;let le=!1;return()=>{le||(le=!0,E--,ee())}},Wn=D=>(h.mount=!0,T={...T,...D.formState},Nr({...D,formState:{...S,...D.formState}})),ir=(D,A={})=>{for(const q of D?wc(D):y.mount)y.mount.delete(q),y.array.delete(q),A.keepValue||($t(a,q),$t(c,q)),!A.keepError&&$t(s.errors,q),!A.keepDirty&&$t(s.dirtyFields,q),!A.keepTouched&&$t(s.touchedFields,q),!A.keepIsValidating&&$t(s.validatingFields,q),!n.shouldUnregister&&!A.keepDefaultValue&&$t(l,q);b.state.next({values:Ut(c)}),b.state.next({...s,...A.keepDirty?{isDirty:te()}:{}}),!A.keepIsValid&&F()},Hn=({disabled:D,name:A})=>{if(Ur(D)&&h.mount||D||y.disabled.has(A)){const le=y.disabled.has(A)!==!!D;D?y.disabled.add(A):y.disabled.delete(A),le&&h.mount&&!h.action&&F()}},ar=(D,A={})=>{let q=Ee(a,D);const ee=Ur(A.disabled)||Ur(n.disabled),le=!y.registerName.has(D)&&q&&q._f&&!q._f.mount;return kt(a,D,{...q||{},_f:{...q&&q._f?q._f:{ref:{name:D}},name:D,mount:!0,...A}}),y.mount.add(D),q&&!le?Hn({disabled:Ur(A.disabled)?A.disabled:n.disabled,name:D}):ke(D,!0,A.value),{...ee?{disabled:A.disabled||n.disabled}:{},...n.progressive?{required:!!A.required,min:Il(A.min),max:Il(A.max),minLength:Il(A.minLength),maxLength:Il(A.maxLength),pattern:Il(A.pattern)}:{},name:D,onChange:Le,onBlur:Le,ref:W=>{if(W){y.registerName.add(D),ar(D,A),y.registerName.delete(D),q=Ee(a,D);const Q=_t(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,re=L1(Q),_e=q._f.refs||[];if(re?_e.find(Ke=>Ke===Q):Q===q._f.ref)return;kt(a,D,{_f:{...q._f,...re?{refs:[..._e.filter(Vf),Q,...Array.isArray(Ee(l,D))?[{}]:[]],ref:{type:Q.type,name:D}}:{ref:Q}}}),ke(D,!1,void 0,Q)}else q=Ee(a,D,{}),q._f&&(q._f.mount=!1),(n.shouldUnregister||A.shouldUnregister)&&!(T1(y.array,D)&&h.action)&&y.unMount.add(D)}}},Rn=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&Al(a,Qe,y.mount),or=D=>{Ur(D)&&(b.state.next({disabled:D}),Al(a,(A,q)=>{const ee=Ee(a,q);ee&&(A.disabled=ee._f.disabled||D,Array.isArray(ee._f.refs)&&ee._f.refs.forEach(le=>{le.disabled=ee._f.disabled||D}))},0,!1))},Dn=(D,A)=>async q=>{let ee;q&&(q.preventDefault&&q.preventDefault(),q.persist&&q.persist());let le=Ut(c);if(b.state.next({isSubmitting:!0}),n.resolver){const{errors:W,values:Q}=await he();U(),s.errors=W,le=Ut(Q)}else await Xe({fields:a,eventType:oo.SUBMIT});if(y.disabled.size)for(const W of y.disabled)$t(le,W);if($t(s.errors,ov),rn(s.errors)){b.state.next({errors:{}});try{await D(le,q)}catch(W){ee=W}}else A&&await A({...s.errors},q),Rn(),setTimeout(Rn);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rn(s.errors)&&!ee,submitCount:s.submitCount+1,errors:s.errors}),ee)throw ee},qr=(D,A={})=>{Ee(a,D)&&(_t(A.defaultValue)?Ce(D,Ut(Ee(l,D))):(Ce(D,A.defaultValue),kt(l,D,Ut(A.defaultValue))),A.keepTouched||$t(s.touchedFields,D),A.keepDirty||($t(s.dirtyFields,D),s.isDirty=A.defaultValue?te(D,Ut(Ee(l,D))):te()),A.keepError||($t(s.errors,D),C.isValid&&F()),b.state.next({...s}))},Qr=(D,A={})=>{const q=D?Ut(D):l,ee=Ut(q),le=rn(D),W=ee;if(A.keepDefaultValues||(l=q),!A.keepValues){if(A.keepDirtyValues){const Q=new Set([...y.mount,...Object.keys(ca(l,c))]);for(const re of Array.from(Q)){const _e=Ee(s.dirtyFields,re),Ke=Ee(c,re),xt=Ee(W,re);_e&&!_t(Ke)?kt(W,re,Ke):!_e&&!_t(xt)&&Ce(re,xt)}}else{if(Hc&&_t(D))for(const Q of y.mount){const re=Ee(a,Q);if(re&&re._f){const _e=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(Tc(_e)){const Ke=_e.closest("form");if(Ke){Ke.reset();break}}}}if(A.keepFieldsRef)for(const Q of y.mount)Ce(Q,Ee(W,Q));else a={}}if(n.shouldUnregister){if(c=A.keepDefaultValues?Ut(l):{},A.keepFieldsRef)for(const Q of y.mount)kt(c,Q,Ee(W,Q))}else c=Ut(W);b.array.next({values:{...W}}),b.state.next({name:void 0,type:void 0,values:{...W}})}y={mount:A.keepDirtyValues?y.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},h.mount=!C.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!n.shouldUnregister&&!rn(W),h.watch=!!n.shouldUnregister,h.keepIsValid=!!A.keepIsValid,h.action=!1,A.keepErrors||(s.errors={}),b.state.next({submitCount:A.keepSubmitCount?s.submitCount:0,isDirty:le?!1:A.keepDirty?s.isDirty:A.keepValues?te():!!(A.keepDefaultValues&&!Vr(D,l)),isSubmitted:A.keepIsSubmitted?s.isSubmitted:!1,dirtyFields:le?{}:A.keepDirtyValues?A.keepDefaultValues&&c?ca(l,c):s.dirtyFields:A.keepDefaultValues&&D?ca(l,D):A.keepDirty?s.dirtyFields:{},touchedFields:A.keepTouched?s.touchedFields:{},errors:A.keepErrors?s.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?s.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:l})},Yr=(D,A)=>Qr(nr(D)?D(c):D,{...n.resetOptions,...A}),lr=(D,A={})=>{const q=Ee(a,D),ee=q&&q._f;if(ee){const le=ee.refs?ee.refs[0]:ee.ref;le.focus&&setTimeout(()=>{le.focus(),A.shouldSelect&&nr(le.select)&&le.select()})}},Bn=D=>{const{name:A,type:q,values:ee,...le}=D;s={...s,...le}},Kr={control:{register:ar,unregister:ir,getFieldState:Ct,handleSubmit:Dn,setError:sr,_subscribe:Nr,_runSchema:he,_updateIsValidating:U,_focusError:Rn,_getWatch:ge,_getDirty:te,_setValid:F,_setFieldArray:J,_setDisabledField:Hn,_setErrors:me,_getFieldArray:ue,_reset:Qr,_resetDefaultValues:()=>nr(n.defaultValues)&&n.defaultValues().then(D=>{Yr(D,n.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:$e,_disableForm:or,_subjects:b,_proxyFormState:C,get _fields(){return a},get _formValues(){return c},get _state(){return h},set _state(D){h=D},get _defaultValues(){return l},get _names(){return y},set _names(D){y=D},get _formState(){return s},get _options(){return n},set _options(D){n={...n,...D},O=yc(n.mode),_=yc(n.reValidateMode)}},subscribe:Wn,trigger:Be,register:ar,handleSubmit:Dn,watch:$n,setValue:Ce,setValues:je,getValues:lt,reset:Yr,resetField:qr,resetDefaultValues:(D,A={})=>{if(l=Ut(D),!A.keepDirty){const q=ca(l,c);s.dirtyFields=q,s.isDirty=!rn(q)}A.keepIsValid||F(),b.state.next({...s,defaultValues:l})},clearErrors:jn,unregister:ir,setError:sr,setFocus:lr,getFieldState:Ct};return{...Kr,formControl:Kr}}function Q1(t={}){const n=sn.useRef(void 0),s=sn.useRef(void 0),a=sn.useRef(t.formControl),[l,c]=sn.useState(()=>({...Ut(yv),isLoading:nr(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:nr(t.defaultValues)?void 0:t.defaultValues}));if(!n.current||t.formControl&&a.current!==t.formControl)if(a.current=t.formControl,t.formControl)n.current={...t.formControl,formState:l},t.defaultValues&&!nr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:y,...x}=q1(t);n.current={...x,formState:l}}const h=n.current.control;return h._options=t,R1(()=>{const y=h._subscribe({formState:h._proxyFormState,callback:()=>c({...h._formState,defaultValues:h._defaultValues}),reRenderRoot:!0});return c(x=>({...x,isReady:!0})),h._formState.isReady=!0,y},[h]),sn.useEffect(()=>h._disableForm(t.disabled),[h,t.disabled]),sn.useEffect(()=>{t.mode&&(h._options.mode=t.mode),t.reValidateMode&&(h._options.reValidateMode=t.reValidateMode)},[h,t.mode,t.reValidateMode]),sn.useEffect(()=>{t.errors&&(h._setErrors(t.errors),h._focusError())},[h,t.errors]),sn.useEffect(()=>{t.shouldUnregister&&h._subjects.state.next({values:h._getWatch()})},[h,t.shouldUnregister]),sn.useEffect(()=>{if(h._proxyFormState.isDirty){const y=h._getDirty();y!==l.isDirty&&h._subjects.state.next({isDirty:y})}},[h,l.isDirty]),sn.useEffect(()=>{var y;t.values&&!Vr(t.values,s.current)?(h._reset(t.values,{keepFieldsRef:!0,...h._options.resetOptions}),!((y=h._options.resetOptions)===null||y===void 0)&&y.keepIsValid||h._setValid(),s.current=t.values,c(x=>({...x}))):h._resetDefaultValues()},[h,t.values]),sn.useEffect(()=>{h._state.mount||(h._setValid(),h._state.mount=!0),h._state.watch&&(h._state.watch=!1,h._subjects.state.next({...h._formState})),h._removeUnmounted()}),n.current.formState=sn.useMemo(()=>j1(l,h),[h,l]),n.current}var ft;(function(t){t.assertEqual=l=>{};function n(l){}t.assertIs=n;function s(l){throw new Error}t.assertNever=s,t.arrayToEnum=l=>{const c={};for(const h of l)c[h]=h;return c},t.getValidEnumValues=l=>{const c=t.objectKeys(l).filter(y=>typeof l[l[y]]!="number"),h={};for(const y of c)h[y]=l[y];return t.objectValues(h)},t.objectValues=l=>t.objectKeys(l).map(function(c){return l[c]}),t.objectKeys=typeof Object.keys=="function"?l=>Object.keys(l):l=>{const c=[];for(const h in l)Object.prototype.hasOwnProperty.call(l,h)&&c.push(h);return c},t.find=(l,c)=>{for(const h of l)if(c(h))return h},t.isInteger=typeof Number.isInteger=="function"?l=>Number.isInteger(l):l=>typeof l=="number"&&Number.isFinite(l)&&Math.floor(l)===l;function a(l,c=" | "){return l.map(h=>typeof h=="string"?`'${h}'`:h).join(c)}t.joinValues=a,t.jsonStringifyReplacer=(l,c)=>typeof c=="bigint"?c.toString():c})(ft||(ft={}));var Ty;(function(t){t.mergeShapes=(n,s)=>({...n,...s})})(Ty||(Ty={}));const be=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fi=t=>{switch(typeof t){case"undefined":return be.undefined;case"string":return be.string;case"number":return Number.isNaN(t)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(t)?be.array:t===null?be.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?be.promise:typeof Map<"u"&&t instanceof Map?be.map:typeof Set<"u"&&t instanceof Set?be.set:typeof Date<"u"&&t instanceof Date?be.date:be.object;default:return be.unknown}},fe=ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class _s extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=n}format(n){const s=n||function(c){return c.message},a={_errors:[]},l=c=>{for(const h of c.issues)if(h.code==="invalid_union")h.unionErrors.map(l);else if(h.code==="invalid_return_type")l(h.returnTypeError);else if(h.code==="invalid_arguments")l(h.argumentsError);else if(h.path.length===0)a._errors.push(s(h));else{let y=a,x=0;for(;x<h.path.length;){const w=h.path[x];x===h.path.length-1?(y[w]=y[w]||{_errors:[]},y[w]._errors.push(s(h))):y[w]=y[w]||{_errors:[]},y=y[w],x++}}};return l(this),a}static assert(n){if(!(n instanceof _s))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=s=>s.message){const s={},a=[];for(const l of this.issues)if(l.path.length>0){const c=l.path[0];s[c]=s[c]||[],s[c].push(n(l))}else a.push(n(l));return{formErrors:a,fieldErrors:s}}get formErrors(){return this.flatten()}}_s.create=t=>new _s(t);const Sh=(t,n)=>{let s;switch(t.code){case fe.invalid_type:t.received===be.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case fe.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,ft.jsonStringifyReplacer)}`;break;case fe.unrecognized_keys:s=`Unrecognized key(s) in object: ${ft.joinValues(t.keys,", ")}`;break;case fe.invalid_union:s="Invalid input";break;case fe.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${ft.joinValues(t.options)}`;break;case fe.invalid_enum_value:s=`Invalid enum value. Expected ${ft.joinValues(t.options)}, received '${t.received}'`;break;case fe.invalid_arguments:s="Invalid function arguments";break;case fe.invalid_return_type:s="Invalid function return type";break;case fe.invalid_date:s="Invalid date";break;case fe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:ft.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case fe.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case fe.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case fe.custom:s="Invalid input";break;case fe.invalid_intersection_types:s="Intersection results could not be merged";break;case fe.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case fe.not_finite:s="Number must be finite";break;default:s=n.defaultError,ft.assertNever(t)}return{message:s}};let Y1=Sh;function G1(){return Y1}const K1=t=>{const{data:n,path:s,errorMaps:a,issueData:l}=t,c=[...s,...l.path||[]],h={...l,path:c};if(l.message!==void 0)return{...l,path:c,message:l.message};let y="";const x=a.filter(w=>!!w).slice().reverse();for(const w of x)y=w(h,{data:n,defaultError:y}).message;return{...l,path:c,message:y}};function Se(t,n){const s=G1(),a=K1({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===Sh?void 0:Sh].filter(l=>!!l)});t.common.issues.push(a)}class Vn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,s){const a=[];for(const l of s){if(l.status==="aborted")return Ye;l.status==="dirty"&&n.dirty(),a.push(l.value)}return{status:n.value,value:a}}static async mergeObjectAsync(n,s){const a=[];for(const l of s){const c=await l.key,h=await l.value;a.push({key:c,value:h})}return Vn.mergeObjectSync(n,a)}static mergeObjectSync(n,s){const a={};for(const l of s){const{key:c,value:h}=l;if(c.status==="aborted"||h.status==="aborted")return Ye;c.status==="dirty"&&n.dirty(),h.status==="dirty"&&n.dirty(),c.value!=="__proto__"&&(typeof h.value<"u"||l.alwaysSet)&&(a[c.value]=h.value)}return{status:n.value,value:a}}}const Ye=Object.freeze({status:"aborted"}),Fl=t=>({status:"dirty",value:t}),rr=t=>({status:"valid",value:t}),Cy=t=>t.status==="aborted",Oy=t=>t.status==="dirty",bo=t=>t.status==="valid",Oc=t=>typeof Promise<"u"&&t instanceof Promise;var De;(function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(De||(De={}));class Oi{constructor(n,s,a,l){this._cachedPath=[],this.parent=n,this.data=s,this._path=a,this._key=l}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const by=(t,n)=>{if(bo(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new _s(t.common.issues);return this._error=s,this._error}}};function rt(t){if(!t)return{};const{errorMap:n,invalid_type_error:s,required_error:a,description:l}=t;if(n&&(s||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:l}:{errorMap:(h,y)=>{const{message:x}=t;return h.code==="invalid_enum_value"?{message:x??y.defaultError}:typeof y.data>"u"?{message:x??a??y.defaultError}:h.code!=="invalid_type"?{message:y.defaultError}:{message:x??s??y.defaultError}},description:l}}class ot{get description(){return this._def.description}_getType(n){return fi(n.data)}_getOrReturnCtx(n,s){return s||{common:n.parent.common,data:n.data,parsedType:fi(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Vn,ctx:{common:n.parent.common,data:n.data,parsedType:fi(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const s=this._parse(n);if(Oc(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(n){const s=this._parse(n);return Promise.resolve(s)}parse(n,s){const a=this.safeParse(n,s);if(a.success)return a.data;throw a.error}safeParse(n,s){const a={common:{issues:[],async:(s==null?void 0:s.async)??!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:fi(n)},l=this._parseSync({data:n,path:a.path,parent:a});return by(a,l)}"~validate"(n){var a,l;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:fi(n)};if(!this["~standard"].async)try{const c=this._parseSync({data:n,path:[],parent:s});return bo(c)?{value:c.value}:{issues:s.common.issues}}catch(c){(l=(a=c==null?void 0:c.message)==null?void 0:a.toLowerCase())!=null&&l.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:s}).then(c=>bo(c)?{value:c.value}:{issues:s.common.issues})}async parseAsync(n,s){const a=await this.safeParseAsync(n,s);if(a.success)return a.data;throw a.error}async safeParseAsync(n,s){const a={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:fi(n)},l=this._parse({data:n,path:a.path,parent:a}),c=await(Oc(l)?l:Promise.resolve(l));return by(a,c)}refine(n,s){const a=l=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(l):s;return this._refinement((l,c)=>{const h=n(l),y=()=>c.addIssue({code:fe.custom,...a(l)});return typeof Promise<"u"&&h instanceof Promise?h.then(x=>x?!0:(y(),!1)):h?!0:(y(),!1)})}refinement(n,s){return this._refinement((a,l)=>n(a)?!0:(l.addIssue(typeof s=="function"?s(a,l):s),!1))}_refinement(n){return new Ro({schema:this,typeName:Ge.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return Ci.create(this,this._def)}nullable(){return Do.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hr.create(this)}promise(){return Dc.create(this,this._def)}or(n){return jc.create([this,n],this._def)}and(n){return Rc.create(this,n,this._def)}transform(n){return new Ro({...rt(this._def),schema:this,typeName:Ge.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const s=typeof n=="function"?n:()=>n;return new _h({...rt(this._def),innerType:this,defaultValue:s,typeName:Ge.ZodDefault})}brand(){return new wk({typeName:Ge.ZodBranded,type:this,...rt(this._def)})}catch(n){const s=typeof n=="function"?n:()=>n;return new Nh({...rt(this._def),innerType:this,catchValue:s,typeName:Ge.ZodCatch})}describe(n){const s=this.constructor;return new s({...this._def,description:n})}pipe(n){return qh.create(this,n)}readonly(){return Eh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const X1=/^c[^\s-]{8,}$/i,J1=/^[0-9a-z]+$/,ek=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tk=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nk=/^[a-z0-9_-]{21}$/i,rk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ik=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ak="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wf;const ok=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,uk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ck=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gv="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hk=new RegExp(`^${gv}$`);function vv(t){let n="[0-5]\\d";t.precision?n=`${n}\\.\\d{${t.precision}}`:t.precision==null&&(n=`${n}(\\.\\d+)?`);const s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${s}`}function mk(t){return new RegExp(`^${vv(t)}$`)}function pk(t){let n=`${gv}T${vv(t)}`;const s=[];return s.push(t.local?"Z?":"Z"),t.offset&&s.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${s.join("|")})`,new RegExp(`^${n}$`)}function yk(t,n){return!!((n==="v4"||!n)&&ok.test(t)||(n==="v6"||!n)&&uk.test(t))}function gk(t,n){if(!rk.test(t))return!1;try{const[s]=t.split(".");if(!s)return!1;const a=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),l=JSON.parse(atob(a));return!(typeof l!="object"||l===null||"typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||n&&l.alg!==n)}catch{return!1}}function vk(t,n){return!!((n==="v4"||!n)&&lk.test(t)||(n==="v6"||!n)&&ck.test(t))}class Ni extends ot{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==be.string){const c=this._getOrReturnCtx(n);return Se(c,{code:fe.invalid_type,expected:be.string,received:c.parsedType}),Ye}const a=new Vn;let l;for(const c of this._def.checks)if(c.kind==="min")n.data.length<c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="max")n.data.length>c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="length"){const h=n.data.length>c.value,y=n.data.length<c.value;(h||y)&&(l=this._getOrReturnCtx(n,l),h?Se(l,{code:fe.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):y&&Se(l,{code:fe.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),a.dirty())}else if(c.kind==="email")ik.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"email",code:fe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="emoji")Wf||(Wf=new RegExp(ak,"u")),Wf.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"emoji",code:fe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="uuid")tk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"uuid",code:fe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="nanoid")nk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"nanoid",code:fe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid")X1.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"cuid",code:fe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid2")J1.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"cuid2",code:fe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="ulid")ek.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"ulid",code:fe.invalid_string,message:c.message}),a.dirty());else if(c.kind==="url")try{new URL(n.data)}catch{l=this._getOrReturnCtx(n,l),Se(l,{validation:"url",code:fe.invalid_string,message:c.message}),a.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"regex",code:fe.invalid_string,message:c.message}),a.dirty())):c.kind==="trim"?n.data=n.data.trim():c.kind==="includes"?n.data.includes(c.value,c.position)||(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),a.dirty()):c.kind==="toLowerCase"?n.data=n.data.toLowerCase():c.kind==="toUpperCase"?n.data=n.data.toUpperCase():c.kind==="startsWith"?n.data.startsWith(c.value)||(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.invalid_string,validation:{startsWith:c.value},message:c.message}),a.dirty()):c.kind==="endsWith"?n.data.endsWith(c.value)||(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.invalid_string,validation:{endsWith:c.value},message:c.message}),a.dirty()):c.kind==="datetime"?pk(c).test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.invalid_string,validation:"datetime",message:c.message}),a.dirty()):c.kind==="date"?hk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.invalid_string,validation:"date",message:c.message}),a.dirty()):c.kind==="time"?mk(c).test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.invalid_string,validation:"time",message:c.message}),a.dirty()):c.kind==="duration"?sk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"duration",code:fe.invalid_string,message:c.message}),a.dirty()):c.kind==="ip"?yk(n.data,c.version)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"ip",code:fe.invalid_string,message:c.message}),a.dirty()):c.kind==="jwt"?gk(n.data,c.alg)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"jwt",code:fe.invalid_string,message:c.message}),a.dirty()):c.kind==="cidr"?vk(n.data,c.version)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"cidr",code:fe.invalid_string,message:c.message}),a.dirty()):c.kind==="base64"?dk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"base64",code:fe.invalid_string,message:c.message}),a.dirty()):c.kind==="base64url"?fk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"base64url",code:fe.invalid_string,message:c.message}),a.dirty()):ft.assertNever(c);return{status:a.value,value:n.data}}_regex(n,s,a){return this.refinement(l=>n.test(l),{validation:s,code:fe.invalid_string,...De.errToObj(a)})}_addCheck(n){return new Ni({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...De.errToObj(n)})}url(n){return this._addCheck({kind:"url",...De.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...De.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...De.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...De.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...De.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...De.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...De.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...De.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...De.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...De.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...De.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...De.errToObj(n)})}datetime(n){return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(n==null?void 0:n.offset)??!1,local:(n==null?void 0:n.local)??!1,...De.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...De.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...De.errToObj(n)})}regex(n,s){return this._addCheck({kind:"regex",regex:n,...De.errToObj(s)})}includes(n,s){return this._addCheck({kind:"includes",value:n,position:s==null?void 0:s.position,...De.errToObj(s==null?void 0:s.message)})}startsWith(n,s){return this._addCheck({kind:"startsWith",value:n,...De.errToObj(s)})}endsWith(n,s){return this._addCheck({kind:"endsWith",value:n,...De.errToObj(s)})}min(n,s){return this._addCheck({kind:"min",value:n,...De.errToObj(s)})}max(n,s){return this._addCheck({kind:"max",value:n,...De.errToObj(s)})}length(n,s){return this._addCheck({kind:"length",value:n,...De.errToObj(s)})}nonempty(n){return this.min(1,De.errToObj(n))}trim(){return new Ni({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ni({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ni({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n}get maxLength(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n}}Ni.create=t=>new Ni({checks:[],typeName:Ge.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...rt(t)});function xk(t,n){const s=(t.toString().split(".")[1]||"").length,a=(n.toString().split(".")[1]||"").length,l=s>a?s:a,c=Number.parseInt(t.toFixed(l).replace(".","")),h=Number.parseInt(n.toFixed(l).replace(".",""));return c%h/10**l}class $l extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==be.number){const c=this._getOrReturnCtx(n);return Se(c,{code:fe.invalid_type,expected:be.number,received:c.parsedType}),Ye}let a;const l=new Vn;for(const c of this._def.checks)c.kind==="int"?ft.isInteger(n.data)||(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.invalid_type,expected:"integer",received:"float",message:c.message}),l.dirty()):c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),l.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),l.dirty()):c.kind==="multipleOf"?xk(n.data,c.value)!==0&&(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.not_multiple_of,multipleOf:c.value,message:c.message}),l.dirty()):c.kind==="finite"?Number.isFinite(n.data)||(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.not_finite,message:c.message}),l.dirty()):ft.assertNever(c);return{status:l.value,value:n.data}}gte(n,s){return this.setLimit("min",n,!0,De.toString(s))}gt(n,s){return this.setLimit("min",n,!1,De.toString(s))}lte(n,s){return this.setLimit("max",n,!0,De.toString(s))}lt(n,s){return this.setLimit("max",n,!1,De.toString(s))}setLimit(n,s,a,l){return new $l({...this._def,checks:[...this._def.checks,{kind:n,value:s,inclusive:a,message:De.toString(l)}]})}_addCheck(n){return new $l({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:De.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:De.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(n)})}multipleOf(n,s){return this._addCheck({kind:"multipleOf",value:n,message:De.toString(s)})}finite(n){return this._addCheck({kind:"finite",message:De.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(n)})}get minValue(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n}get maxValue(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&ft.isInteger(n.value))}get isFinite(){let n=null,s=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(s===null||a.value>s)&&(s=a.value):a.kind==="max"&&(n===null||a.value<n)&&(n=a.value)}return Number.isFinite(s)&&Number.isFinite(n)}}$l.create=t=>new $l({checks:[],typeName:Ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...rt(t)});class Wl extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==be.bigint)return this._getInvalidInput(n);let a;const l=new Vn;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),l.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),l.dirty()):c.kind==="multipleOf"?n.data%c.value!==BigInt(0)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:fe.not_multiple_of,multipleOf:c.value,message:c.message}),l.dirty()):ft.assertNever(c);return{status:l.value,value:n.data}}_getInvalidInput(n){const s=this._getOrReturnCtx(n);return Se(s,{code:fe.invalid_type,expected:be.bigint,received:s.parsedType}),Ye}gte(n,s){return this.setLimit("min",n,!0,De.toString(s))}gt(n,s){return this.setLimit("min",n,!1,De.toString(s))}lte(n,s){return this.setLimit("max",n,!0,De.toString(s))}lt(n,s){return this.setLimit("max",n,!1,De.toString(s))}setLimit(n,s,a,l){return new Wl({...this._def,checks:[...this._def.checks,{kind:n,value:s,inclusive:a,message:De.toString(l)}]})}_addCheck(n){return new Wl({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:De.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:De.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:De.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:De.toString(n)})}multipleOf(n,s){return this._addCheck({kind:"multipleOf",value:n,message:De.toString(s)})}get minValue(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n}get maxValue(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n}}Wl.create=t=>new Wl({checks:[],typeName:Ge.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...rt(t)});class jy extends ot{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==be.boolean){const a=this._getOrReturnCtx(n);return Se(a,{code:fe.invalid_type,expected:be.boolean,received:a.parsedType}),Ye}return rr(n.data)}}jy.create=t=>new jy({typeName:Ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...rt(t)});class bc extends ot{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==be.date){const c=this._getOrReturnCtx(n);return Se(c,{code:fe.invalid_type,expected:be.date,received:c.parsedType}),Ye}if(Number.isNaN(n.data.getTime())){const c=this._getOrReturnCtx(n);return Se(c,{code:fe.invalid_date}),Ye}const a=new Vn;let l;for(const c of this._def.checks)c.kind==="min"?n.data.getTime()<c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),a.dirty()):c.kind==="max"?n.data.getTime()>c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:fe.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),a.dirty()):ft.assertNever(c);return{status:a.value,value:new Date(n.data.getTime())}}_addCheck(n){return new bc({...this._def,checks:[...this._def.checks,n]})}min(n,s){return this._addCheck({kind:"min",value:n.getTime(),message:De.toString(s)})}max(n,s){return this._addCheck({kind:"max",value:n.getTime(),message:De.toString(s)})}get minDate(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n!=null?new Date(n):null}}bc.create=t=>new bc({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ge.ZodDate,...rt(t)});class Ry extends ot{_parse(n){if(this._getType(n)!==be.symbol){const a=this._getOrReturnCtx(n);return Se(a,{code:fe.invalid_type,expected:be.symbol,received:a.parsedType}),Ye}return rr(n.data)}}Ry.create=t=>new Ry({typeName:Ge.ZodSymbol,...rt(t)});class Dy extends ot{_parse(n){if(this._getType(n)!==be.undefined){const a=this._getOrReturnCtx(n);return Se(a,{code:fe.invalid_type,expected:be.undefined,received:a.parsedType}),Ye}return rr(n.data)}}Dy.create=t=>new Dy({typeName:Ge.ZodUndefined,...rt(t)});class My extends ot{_parse(n){if(this._getType(n)!==be.null){const a=this._getOrReturnCtx(n);return Se(a,{code:fe.invalid_type,expected:be.null,received:a.parsedType}),Ye}return rr(n.data)}}My.create=t=>new My({typeName:Ge.ZodNull,...rt(t)});class Iy extends ot{constructor(){super(...arguments),this._any=!0}_parse(n){return rr(n.data)}}Iy.create=t=>new Iy({typeName:Ge.ZodAny,...rt(t)});class Ly extends ot{constructor(){super(...arguments),this._unknown=!0}_parse(n){return rr(n.data)}}Ly.create=t=>new Ly({typeName:Ge.ZodUnknown,...rt(t)});class bi extends ot{_parse(n){const s=this._getOrReturnCtx(n);return Se(s,{code:fe.invalid_type,expected:be.never,received:s.parsedType}),Ye}}bi.create=t=>new bi({typeName:Ge.ZodNever,...rt(t)});class Fy extends ot{_parse(n){if(this._getType(n)!==be.undefined){const a=this._getOrReturnCtx(n);return Se(a,{code:fe.invalid_type,expected:be.void,received:a.parsedType}),Ye}return rr(n.data)}}Fy.create=t=>new Fy({typeName:Ge.ZodVoid,...rt(t)});class Hr extends ot{_parse(n){const{ctx:s,status:a}=this._processInputParams(n),l=this._def;if(s.parsedType!==be.array)return Se(s,{code:fe.invalid_type,expected:be.array,received:s.parsedType}),Ye;if(l.exactLength!==null){const h=s.data.length>l.exactLength.value,y=s.data.length<l.exactLength.value;(h||y)&&(Se(s,{code:h?fe.too_big:fe.too_small,minimum:y?l.exactLength.value:void 0,maximum:h?l.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:l.exactLength.message}),a.dirty())}if(l.minLength!==null&&s.data.length<l.minLength.value&&(Se(s,{code:fe.too_small,minimum:l.minLength.value,type:"array",inclusive:!0,exact:!1,message:l.minLength.message}),a.dirty()),l.maxLength!==null&&s.data.length>l.maxLength.value&&(Se(s,{code:fe.too_big,maximum:l.maxLength.value,type:"array",inclusive:!0,exact:!1,message:l.maxLength.message}),a.dirty()),s.common.async)return Promise.all([...s.data].map((h,y)=>l.type._parseAsync(new Oi(s,h,s.path,y)))).then(h=>Vn.mergeArray(a,h));const c=[...s.data].map((h,y)=>l.type._parseSync(new Oi(s,h,s.path,y)));return Vn.mergeArray(a,c)}get element(){return this._def.type}min(n,s){return new Hr({...this._def,minLength:{value:n,message:De.toString(s)}})}max(n,s){return new Hr({...this._def,maxLength:{value:n,message:De.toString(s)}})}length(n,s){return new Hr({...this._def,exactLength:{value:n,message:De.toString(s)}})}nonempty(n){return this.min(1,n)}}Hr.create=(t,n)=>new Hr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ge.ZodArray,...rt(n)});function uo(t){if(t instanceof Bt){const n={};for(const s in t.shape){const a=t.shape[s];n[s]=Ci.create(uo(a))}return new Bt({...t._def,shape:()=>n})}else return t instanceof Hr?new Hr({...t._def,type:uo(t.element)}):t instanceof Ci?Ci.create(uo(t.unwrap())):t instanceof Do?Do.create(uo(t.unwrap())):t instanceof _a?_a.create(t.items.map(n=>uo(n))):t}class Bt extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),s=ft.objectKeys(n);return this._cached={shape:n,keys:s},this._cached}_parse(n){if(this._getType(n)!==be.object){const w=this._getOrReturnCtx(n);return Se(w,{code:fe.invalid_type,expected:be.object,received:w.parsedType}),Ye}const{status:a,ctx:l}=this._processInputParams(n),{shape:c,keys:h}=this._getCached(),y=[];if(!(this._def.catchall instanceof bi&&this._def.unknownKeys==="strip"))for(const w in l.data)h.includes(w)||y.push(w);const x=[];for(const w of h){const E=c[w],O=l.data[w];x.push({key:{status:"valid",value:w},value:E._parse(new Oi(l,O,l.path,w)),alwaysSet:w in l.data})}if(this._def.catchall instanceof bi){const w=this._def.unknownKeys;if(w==="passthrough")for(const E of y)x.push({key:{status:"valid",value:E},value:{status:"valid",value:l.data[E]}});else if(w==="strict")y.length>0&&(Se(l,{code:fe.unrecognized_keys,keys:y}),a.dirty());else if(w!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const w=this._def.catchall;for(const E of y){const O=l.data[E];x.push({key:{status:"valid",value:E},value:w._parse(new Oi(l,O,l.path,E)),alwaysSet:E in l.data})}}return l.common.async?Promise.resolve().then(async()=>{const w=[];for(const E of x){const O=await E.key,_=await E.value;w.push({key:O,value:_,alwaysSet:E.alwaysSet})}return w}).then(w=>Vn.mergeObjectSync(a,w)):Vn.mergeObjectSync(a,x)}get shape(){return this._def.shape()}strict(n){return De.errToObj,new Bt({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(s,a)=>{var c,h;const l=((h=(c=this._def).errorMap)==null?void 0:h.call(c,s,a).message)??a.defaultError;return s.code==="unrecognized_keys"?{message:De.errToObj(n).message??l}:{message:l}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(n){return new Bt({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Bt({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:Ge.ZodObject})}setKey(n,s){return this.augment({[n]:s})}catchall(n){return new Bt({...this._def,catchall:n})}pick(n){const s={};for(const a of ft.objectKeys(n))n[a]&&this.shape[a]&&(s[a]=this.shape[a]);return new Bt({...this._def,shape:()=>s})}omit(n){const s={};for(const a of ft.objectKeys(this.shape))n[a]||(s[a]=this.shape[a]);return new Bt({...this._def,shape:()=>s})}deepPartial(){return uo(this)}partial(n){const s={};for(const a of ft.objectKeys(this.shape)){const l=this.shape[a];n&&!n[a]?s[a]=l:s[a]=l.optional()}return new Bt({...this._def,shape:()=>s})}required(n){const s={};for(const a of ft.objectKeys(this.shape))if(n&&!n[a])s[a]=this.shape[a];else{let c=this.shape[a];for(;c instanceof Ci;)c=c._def.innerType;s[a]=c}return new Bt({...this._def,shape:()=>s})}keyof(){return xv(ft.objectKeys(this.shape))}}Bt.create=(t,n)=>new Bt({shape:()=>t,unknownKeys:"strip",catchall:bi.create(),typeName:Ge.ZodObject,...rt(n)});Bt.strictCreate=(t,n)=>new Bt({shape:()=>t,unknownKeys:"strict",catchall:bi.create(),typeName:Ge.ZodObject,...rt(n)});Bt.lazycreate=(t,n)=>new Bt({shape:t,unknownKeys:"strip",catchall:bi.create(),typeName:Ge.ZodObject,...rt(n)});class jc extends ot{_parse(n){const{ctx:s}=this._processInputParams(n),a=this._def.options;function l(c){for(const y of c)if(y.result.status==="valid")return y.result;for(const y of c)if(y.result.status==="dirty")return s.common.issues.push(...y.ctx.common.issues),y.result;const h=c.map(y=>new _s(y.ctx.common.issues));return Se(s,{code:fe.invalid_union,unionErrors:h}),Ye}if(s.common.async)return Promise.all(a.map(async c=>{const h={...s,common:{...s.common,issues:[]},parent:null};return{result:await c._parseAsync({data:s.data,path:s.path,parent:h}),ctx:h}})).then(l);{let c;const h=[];for(const x of a){const w={...s,common:{...s.common,issues:[]},parent:null},E=x._parseSync({data:s.data,path:s.path,parent:w});if(E.status==="valid")return E;E.status==="dirty"&&!c&&(c={result:E,ctx:w}),w.common.issues.length&&h.push(w.common.issues)}if(c)return s.common.issues.push(...c.ctx.common.issues),c.result;const y=h.map(x=>new _s(x));return Se(s,{code:fe.invalid_union,unionErrors:y}),Ye}}get options(){return this._def.options}}jc.create=(t,n)=>new jc({options:t,typeName:Ge.ZodUnion,...rt(n)});function kh(t,n){const s=fi(t),a=fi(n);if(t===n)return{valid:!0,data:t};if(s===be.object&&a===be.object){const l=ft.objectKeys(n),c=ft.objectKeys(t).filter(y=>l.indexOf(y)!==-1),h={...t,...n};for(const y of c){const x=kh(t[y],n[y]);if(!x.valid)return{valid:!1};h[y]=x.data}return{valid:!0,data:h}}else if(s===be.array&&a===be.array){if(t.length!==n.length)return{valid:!1};const l=[];for(let c=0;c<t.length;c++){const h=t[c],y=n[c],x=kh(h,y);if(!x.valid)return{valid:!1};l.push(x.data)}return{valid:!0,data:l}}else return s===be.date&&a===be.date&&+t==+n?{valid:!0,data:t}:{valid:!1}}class Rc extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n),l=(c,h)=>{if(Cy(c)||Cy(h))return Ye;const y=kh(c.value,h.value);return y.valid?((Oy(c)||Oy(h))&&s.dirty(),{status:s.value,value:y.data}):(Se(a,{code:fe.invalid_intersection_types}),Ye)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([c,h])=>l(c,h)):l(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Rc.create=(t,n,s)=>new Rc({left:t,right:n,typeName:Ge.ZodIntersection,...rt(s)});class _a extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.parsedType!==be.array)return Se(a,{code:fe.invalid_type,expected:be.array,received:a.parsedType}),Ye;if(a.data.length<this._def.items.length)return Se(a,{code:fe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;!this._def.rest&&a.data.length>this._def.items.length&&(Se(a,{code:fe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...a.data].map((h,y)=>{const x=this._def.items[y]||this._def.rest;return x?x._parse(new Oi(a,h,a.path,y)):null}).filter(h=>!!h);return a.common.async?Promise.all(c).then(h=>Vn.mergeArray(s,h)):Vn.mergeArray(s,c)}get items(){return this._def.items}rest(n){return new _a({...this._def,rest:n})}}_a.create=(t,n)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _a({items:t,typeName:Ge.ZodTuple,rest:null,...rt(n)})};class Ay extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.parsedType!==be.map)return Se(a,{code:fe.invalid_type,expected:be.map,received:a.parsedType}),Ye;const l=this._def.keyType,c=this._def.valueType,h=[...a.data.entries()].map(([y,x],w)=>({key:l._parse(new Oi(a,y,a.path,[w,"key"])),value:c._parse(new Oi(a,x,a.path,[w,"value"]))}));if(a.common.async){const y=new Map;return Promise.resolve().then(async()=>{for(const x of h){const w=await x.key,E=await x.value;if(w.status==="aborted"||E.status==="aborted")return Ye;(w.status==="dirty"||E.status==="dirty")&&s.dirty(),y.set(w.value,E.value)}return{status:s.value,value:y}})}else{const y=new Map;for(const x of h){const w=x.key,E=x.value;if(w.status==="aborted"||E.status==="aborted")return Ye;(w.status==="dirty"||E.status==="dirty")&&s.dirty(),y.set(w.value,E.value)}return{status:s.value,value:y}}}}Ay.create=(t,n,s)=>new Ay({valueType:n,keyType:t,typeName:Ge.ZodMap,...rt(s)});class Hl extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.parsedType!==be.set)return Se(a,{code:fe.invalid_type,expected:be.set,received:a.parsedType}),Ye;const l=this._def;l.minSize!==null&&a.data.size<l.minSize.value&&(Se(a,{code:fe.too_small,minimum:l.minSize.value,type:"set",inclusive:!0,exact:!1,message:l.minSize.message}),s.dirty()),l.maxSize!==null&&a.data.size>l.maxSize.value&&(Se(a,{code:fe.too_big,maximum:l.maxSize.value,type:"set",inclusive:!0,exact:!1,message:l.maxSize.message}),s.dirty());const c=this._def.valueType;function h(x){const w=new Set;for(const E of x){if(E.status==="aborted")return Ye;E.status==="dirty"&&s.dirty(),w.add(E.value)}return{status:s.value,value:w}}const y=[...a.data.values()].map((x,w)=>c._parse(new Oi(a,x,a.path,w)));return a.common.async?Promise.all(y).then(x=>h(x)):h(y)}min(n,s){return new Hl({...this._def,minSize:{value:n,message:De.toString(s)}})}max(n,s){return new Hl({...this._def,maxSize:{value:n,message:De.toString(s)}})}size(n,s){return this.min(n,s).max(n,s)}nonempty(n){return this.min(1,n)}}Hl.create=(t,n)=>new Hl({valueType:t,minSize:null,maxSize:null,typeName:Ge.ZodSet,...rt(n)});class Py extends ot{get schema(){return this._def.getter()}_parse(n){const{ctx:s}=this._processInputParams(n);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Py.create=(t,n)=>new Py({getter:t,typeName:Ge.ZodLazy,...rt(n)});class Uy extends ot{_parse(n){if(n.data!==this._def.value){const s=this._getOrReturnCtx(n);return Se(s,{received:s.data,code:fe.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:n.data}}get value(){return this._def.value}}Uy.create=(t,n)=>new Uy({value:t,typeName:Ge.ZodLiteral,...rt(n)});function xv(t,n){return new jo({values:t,typeName:Ge.ZodEnum,...rt(n)})}class jo extends ot{_parse(n){if(typeof n.data!="string"){const s=this._getOrReturnCtx(n),a=this._def.values;return Se(s,{expected:ft.joinValues(a),received:s.parsedType,code:fe.invalid_type}),Ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(n.data)){const s=this._getOrReturnCtx(n),a=this._def.values;return Se(s,{received:s.data,code:fe.invalid_enum_value,options:a}),Ye}return rr(n.data)}get options(){return this._def.values}get enum(){const n={};for(const s of this._def.values)n[s]=s;return n}get Values(){const n={};for(const s of this._def.values)n[s]=s;return n}get Enum(){const n={};for(const s of this._def.values)n[s]=s;return n}extract(n,s=this._def){return jo.create(n,{...this._def,...s})}exclude(n,s=this._def){return jo.create(this.options.filter(a=>!n.includes(a)),{...this._def,...s})}}jo.create=xv;class Vy extends ot{_parse(n){const s=ft.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(n);if(a.parsedType!==be.string&&a.parsedType!==be.number){const l=ft.objectValues(s);return Se(a,{expected:ft.joinValues(l),received:a.parsedType,code:fe.invalid_type}),Ye}if(this._cache||(this._cache=new Set(ft.getValidEnumValues(this._def.values))),!this._cache.has(n.data)){const l=ft.objectValues(s);return Se(a,{received:a.data,code:fe.invalid_enum_value,options:l}),Ye}return rr(n.data)}get enum(){return this._def.values}}Vy.create=(t,n)=>new Vy({values:t,typeName:Ge.ZodNativeEnum,...rt(n)});class Dc extends ot{unwrap(){return this._def.type}_parse(n){const{ctx:s}=this._processInputParams(n);if(s.parsedType!==be.promise&&s.common.async===!1)return Se(s,{code:fe.invalid_type,expected:be.promise,received:s.parsedType}),Ye;const a=s.parsedType===be.promise?s.data:Promise.resolve(s.data);return rr(a.then(l=>this._def.type.parseAsync(l,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Dc.create=(t,n)=>new Dc({type:t,typeName:Ge.ZodPromise,...rt(n)});class Ro extends ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:s,ctx:a}=this._processInputParams(n),l=this._def.effect||null,c={addIssue:h=>{Se(a,h),h.fatal?s.abort():s.dirty()},get path(){return a.path}};if(c.addIssue=c.addIssue.bind(c),l.type==="preprocess"){const h=l.transform(a.data,c);if(a.common.async)return Promise.resolve(h).then(async y=>{if(s.value==="aborted")return Ye;const x=await this._def.schema._parseAsync({data:y,path:a.path,parent:a});return x.status==="aborted"?Ye:x.status==="dirty"||s.value==="dirty"?Fl(x.value):x});{if(s.value==="aborted")return Ye;const y=this._def.schema._parseSync({data:h,path:a.path,parent:a});return y.status==="aborted"?Ye:y.status==="dirty"||s.value==="dirty"?Fl(y.value):y}}if(l.type==="refinement"){const h=y=>{const x=l.refinement(y,c);if(a.common.async)return Promise.resolve(x);if(x instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return y};if(a.common.async===!1){const y=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return y.status==="aborted"?Ye:(y.status==="dirty"&&s.dirty(),h(y.value),{status:s.value,value:y.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(y=>y.status==="aborted"?Ye:(y.status==="dirty"&&s.dirty(),h(y.value).then(()=>({status:s.value,value:y.value}))))}if(l.type==="transform")if(a.common.async===!1){const h=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!bo(h))return Ye;const y=l.transform(h.value,c);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:y}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(h=>bo(h)?Promise.resolve(l.transform(h.value,c)).then(y=>({status:s.value,value:y})):Ye);ft.assertNever(l)}}Ro.create=(t,n,s)=>new Ro({schema:t,typeName:Ge.ZodEffects,effect:n,...rt(s)});Ro.createWithPreprocess=(t,n,s)=>new Ro({schema:n,effect:{type:"preprocess",transform:t},typeName:Ge.ZodEffects,...rt(s)});class Ci extends ot{_parse(n){return this._getType(n)===be.undefined?rr(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ci.create=(t,n)=>new Ci({innerType:t,typeName:Ge.ZodOptional,...rt(n)});class Do extends ot{_parse(n){return this._getType(n)===be.null?rr(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Do.create=(t,n)=>new Do({innerType:t,typeName:Ge.ZodNullable,...rt(n)});class _h extends ot{_parse(n){const{ctx:s}=this._processInputParams(n);let a=s.data;return s.parsedType===be.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}_h.create=(t,n)=>new _h({innerType:t,typeName:Ge.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...rt(n)});class Nh extends ot{_parse(n){const{ctx:s}=this._processInputParams(n),a={...s,common:{...s.common,issues:[]}},l=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Oc(l)?l.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new _s(a.common.issues)},input:a.data})})):{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new _s(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Nh.create=(t,n)=>new Nh({innerType:t,typeName:Ge.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...rt(n)});class zy extends ot{_parse(n){if(this._getType(n)!==be.nan){const a=this._getOrReturnCtx(n);return Se(a,{code:fe.invalid_type,expected:be.nan,received:a.parsedType}),Ye}return{status:"valid",value:n.data}}}zy.create=t=>new zy({typeName:Ge.ZodNaN,...rt(t)});class wk extends ot{_parse(n){const{ctx:s}=this._processInputParams(n),a=s.data;return this._def.type._parse({data:a,path:s.path,parent:s})}unwrap(){return this._def.type}}class qh extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?Ye:c.status==="dirty"?(s.dirty(),Fl(c.value)):this._def.out._parseAsync({data:c.value,path:a.path,parent:a})})();{const l=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return l.status==="aborted"?Ye:l.status==="dirty"?(s.dirty(),{status:"dirty",value:l.value}):this._def.out._parseSync({data:l.value,path:a.path,parent:a})}}static create(n,s){return new qh({in:n,out:s,typeName:Ge.ZodPipeline})}}class Eh extends ot{_parse(n){const s=this._def.innerType._parse(n),a=l=>(bo(l)&&(l.value=Object.freeze(l.value)),l);return Oc(s)?s.then(l=>a(l)):a(s)}unwrap(){return this._def.innerType}}Eh.create=(t,n)=>new Eh({innerType:t,typeName:Ge.ZodReadonly,...rt(n)});var Ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ge||(Ge={}));const Sk=Ni.create;bi.create;Hr.create;jc.create;Rc.create;_a.create;jo.create;Dc.create;Ci.create;Do.create;function kk({value:t,onChange:n}){const s=Lg(),[a,l]=Z.useState(""),c=s.data??[],h=[...new Set([...c,...t])].sort(),y=w=>{t.includes(w)?n(t.filter(E=>E!==w)):n([...t,w].sort())},x=()=>{const w=a.trim();w!==""&&!t.includes(w)&&n([...t,w].sort()),l("")};return d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["MACHINES ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(pick targets; none = runs nowhere)"})]}),h.length===0?d.jsx("div",{className:"machine-empty",children:"No machines known yet — add one below."}):d.jsx("div",{className:"machine-chips",children:h.map(w=>d.jsx("button",{type:"button",className:t.includes(w)?"machine-chip on":"machine-chip",onClick:()=>y(w),children:w},w))}),d.jsxs("div",{className:"machine-add",children:[d.jsx("input",{type:"text",className:"form-input",placeholder:"add a machine name",autoComplete:"off",spellCheck:!1,value:a,onChange:w=>l(w.target.value)}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:x,children:"ADD"})]})]})}const $y="Copy of ";function _k(t){return t.startsWith($y)?t:`${$y}${t}`}function Nk(t){return t.map(n=>n.branch&&n.branch.trim()!==""?`${n.repository} ${n.branch}`:n.repository).join(`
`)}function Ek(t){const n=[];for(const s of t.split(`
`)){const a=s.trim().split(/\s+/).filter(Boolean),l=a[0];l&&n.push({repository:l,branch:a[1]??null})}return n}function Tk(t){return t.join(", ")}function Ck(t){return t.split(",").map(n=>n.trim()).filter(n=>n!=="")}function Ok(t){const n=t.trim();return n===""||!/^\d+$/.test(n)?null:Number(n)}const bk=[["3600","1h"],["86400","1d"],["604800","7d"],["2592000","30d"]];function jk(t){return t==null?"default":t===0?"0s":t%86400===0?`${t/86400}d`:t%3600===0?`${t/3600}h`:t%60===0?`${t/60}m`:`${t}s`}const gc=Sk().trim().min(1),Rk=["claude","codex"],Dk=[["@daily","@daily"],["@hourly","@hourly"],["@weekly","@weekly"],["@monthly","@monthly"],["0 0 9 * * 1-5 *","weekdays 9am"],["0 0 * * * * *","every hour"]];function Wy(t){return{title:(t==null?void 0:t.title)??"",schedule:(t==null?void 0:t.schedule)??"",agent:(t==null?void 0:t.agent)??"claude",model:(t==null?void 0:t.model)??"",prompt:(t==null?void 0:t.prompt)??"",goal:(t==null?void 0:t.goal)??"",reposRaw:Nk((t==null?void 0:t.repositories)??[]),machines:(t==null?void 0:t.machines)??[],tagsRaw:Tk((t==null?void 0:t.tags)??[]),ttlRaw:(t==null?void 0:t.ttl_secs)!=null?String(t.ttl_secs):"",enabled:(t==null?void 0:t.enabled)??!0}}function Hf({initial:t,mode:n,saving:s,onCancel:a,onSave:l}){const c=Nw(),h=c.data&&c.data.length>0?c.data:Rk,{register:y,watch:x,setValue:w,handleSubmit:E,reset:O}=Q1({defaultValues:Wy(t)});Z.useEffect(()=>{O(Wy(t))},[t]);const _=x(),S=gc.safeParse(_.title).success&&gc.safeParse(_.schedule).success&&gc.safeParse(_.agent).success&&gc.safeParse(_.prompt).success,[C,T]=kS(_.schedule),b=_.schedule.trim()===""?"cron-preview":C?"cron-preview ok":"cron-preview bad",I=E(J=>{l({schedule:J.schedule,title:J.title,agent:J.agent,model:J.model.trim()===""?null:J.model,prompt:J.prompt,goal:J.goal.trim()===""?null:J.goal,repositories:Ek(J.reposRaw),machines:J.machines,enabled:J.enabled,ttl_secs:Ok(J.ttlRaw),tags:Ck(J.tagsRaw)})}),j=n==="edit",F=s?"…":j?"SAVE CHANGES":"CREATE ROUTINE",U=d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"TITLE*"}),d.jsx("input",{className:"form-input",placeholder:"nightly triage",autoComplete:"off",spellCheck:!1,...y("title")})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"SCHEDULE*"}),d.jsx("input",{className:"form-input",placeholder:"sec min hour dom month dow year",...y("schedule")}),d.jsx("div",{className:"cron-presets",children:Dk.map(([J,se])=>d.jsx("button",{type:"button",className:"preset-btn",onClick:()=>w("schedule",J),children:se},J))}),d.jsx("div",{className:b,children:T})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"AGENT*"}),d.jsx("select",{className:"form-select",...y("agent"),children:h.map(J=>d.jsx("option",{value:J,children:J},J))})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["MODEL ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(optional; blank = agent default)"})]}),d.jsx("input",{className:"form-input",placeholder:"claude-sonnet-4-6",...y("model")})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"PROMPT*"}),d.jsx("textarea",{className:"form-textarea",rows:6,placeholder:"Review open PRs and summarize…",...y("prompt")})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["GOAL ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(optional; ≤5 lines — the why)"})]}),d.jsx("textarea",{className:"form-textarea",rows:3,placeholder:"Keep the PR backlog under control…",...y("goal")})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["REPOSITORIES ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(one url [branch] per line)"})]}),d.jsx("textarea",{className:"form-textarea",rows:3,placeholder:"https://github.com/org/repo main",...y("reposRaw")})]}),d.jsx(kk,{value:_.machines,onChange:J=>w("machines",J)}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["TAGS ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(comma-separated)"})]}),d.jsx("input",{className:"form-input",placeholder:"triage, nightly",...y("tagsRaw")})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["WORKBENCH TTL ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(seconds; blank = server default)"})]}),d.jsx("input",{className:"form-input",type:"number",min:0,placeholder:"604800",...y("ttlRaw")}),d.jsx("div",{className:"ttl-presets",children:bk.map(([J,se])=>d.jsx("button",{type:"button",className:"preset-btn",onClick:()=>w("ttlRaw",J),children:se},J))})]}),d.jsxs("div",{className:"toggle-row",children:[d.jsx("span",{children:"ENABLED"}),d.jsxs("label",{className:"toggle",children:[d.jsx("input",{type:"checkbox",...y("enabled")}),d.jsx("div",{className:"toggle-track"})]})]})]}),$=d.jsxs("div",{className:"modal-ft",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:a,children:"CANCEL"}),d.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:s||!S,onClick:I,children:F})]});return j?d.jsx("div",{className:"overlay open",children:d.jsxs("div",{className:"dialog modal",children:[d.jsxs("div",{className:"modal-hd",children:[d.jsx("div",{className:"modal-title",children:"EDIT ROUTINE"}),d.jsx("button",{type:"button",className:"modal-x",title:"Close","aria-label":"Close",onClick:a,children:"✕"})]}),d.jsx("div",{className:"modal-body",children:U}),$]})}):d.jsxs("main",{className:"create-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:a,children:"← BACK"}),d.jsx("div",{className:"page-title",children:n==="clone"?"NEW ROUTINE (FROM CLONE)":"NEW ROUTINE"})]}),d.jsxs("div",{className:"page-card card",children:[d.jsx("div",{className:"modal-body",children:U}),$]})]})}function wv(t){if(t==="")return[];const n=t.split(`
`);return n.length>0&&n[n.length-1]===""&&n.pop(),n}function Mk(t,n){const s=n.trim().toLowerCase(),a=[],l=wv(t);for(let c=0;c<l.length;c++){const h=l[c]??"";(s===""||h.toLowerCase().includes(s))&&a.push([c+1,h])}return a}function Ik(t,n){const s=wv(t),a=s.length,l=n.trim().toLowerCase();return l===""?[a,a]:[s.filter(h=>h.toLowerCase().includes(l)).length,a]}function Lk(t,n){const s=n.trim().toLowerCase();if(s==="")return[[!1,t]];const a=Array.from(t),l=a.map(E=>E.toLowerCase()[0]??E),h=Array.from(s).length,y=[];let x=0,w=0;for(;x<a.length;){const E=l.slice(x,x+h).join("");E===s&&E.length>0?(x>w&&y.push([!1,a.slice(w,x).join("")]),y.push([!0,a.slice(x,x+h).join("")]),x+=h,w=x):x++}return w<a.length&&y.push([!1,a.slice(w).join("")]),y}function Fk({text:t,query:n}){return d.jsx(d.Fragment,{children:Lk(t,n).map(([s,a],l)=>s?d.jsx("mark",{className:"log-hl",children:a},l):d.jsx("span",{children:a},l))})}function Sv({content:t,loading:n,err:s}){const[a,l]=Z.useState(""),c=Z.useRef(null);Z.useEffect(()=>{const y=c.current;y&&(y.scrollTop=y.scrollHeight)},[t==null?void 0:t.length]);let h=null;if(n)h=d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})});else if(s!==void 0)h=d.jsxs("div",{className:"logs-error",children:["Error: ",s]});else if(t!==void 0)if(t==="")h=d.jsx("div",{className:"logs-empty",children:"— no logs yet —"});else{const y=Mk(t,a),[x,w]=Ik(t,a),E=a.trim()===""?`${w} lines`:`${x} / ${w} matches`;h=d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"log-search",children:[d.jsx("input",{type:"search",className:"log-search-input",placeholder:"Search logs…","aria-label":"Search log lines",value:a,onChange:O=>l(O.target.value)}),a!==""&&d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Clear search","aria-label":"Clear search",onClick:()=>l(""),children:"✕"}),d.jsx("span",{className:"log-match-count",children:E})]}),d.jsx("div",{className:"log-lines",children:y.map(([O,_])=>d.jsxs("div",{className:"log-line",children:[d.jsx("span",{className:"log-ln",children:O}),d.jsx("span",{className:"log-lc",children:d.jsx(Fk,{text:_,query:a})})]},O))})]})}return d.jsx("div",{className:"logs-wrap",ref:c,children:h})}function Ak({id:t,title:n,onBack:s}){const a=Dw(t),[l,c]=Z.useState(void 0),h=Iw(t,l??"",l!==void 0),y=a.data??[],x=Math.floor(Date.now()/1e3);return d.jsxs("main",{className:"logs-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"← BACK"}),d.jsxs("div",{className:"page-title",children:["HISTORY / ",n]}),a.dataUpdatedAt>0&&d.jsx("span",{className:"page-freshness",children:Ah(Math.max(0,(Date.now()-a.dataUpdatedAt)/1e3))}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void a.refetch(),children:"↻"})]}),a.isLoading?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):a.isError?d.jsxs("div",{className:"logs-error",children:["Error: ",a.error.message]}):y.length===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⧗"}),d.jsx("div",{className:"empty-msg",children:"NO RUNS YET"})]})}):d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"STARTED"}),d.jsx("th",{children:"STATUS"}),d.jsx("th",{children:"DURATION"}),d.jsx("th",{children:"EXIT CODE"}),d.jsx("th",{children:"RETENTION"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:y.map(w=>{const E=l===w.workbench;return d.jsxs("tr",{className:E?"row-selected":"",children:[d.jsx("td",{children:d.jsx("div",{className:"cell-time",title:w.workbench,children:Oo(w.started_at)})}),d.jsx("td",{children:d.jsx("span",{className:Kg(w.status),children:zh(w.status)})}),d.jsx("td",{children:w.finished_at!=null?Xg(w.started_at,w.finished_at):"—"}),d.jsx("td",{children:w.exit_code??"—"}),d.jsx("td",{children:w.retention_expires_at!=null?d.jsx("span",{className:"cell-meta",children:$S(x,w.retention_expires_at)}):"—"}),d.jsx("td",{children:d.jsx("button",{type:"button",className:"act-btn logs",onClick:()=>c(E?void 0:w.workbench),children:E?"HIDE LOG":"VIEW LOG"})})]},w.workbench)})})]})}),l!==void 0&&d.jsx(Sv,{content:h.data,loading:h.isLoading,err:h.isError?h.error.message:void 0})]})}function Pk({id:t,title:n,onBack:s}){const[a,l]=Z.useState(Vc),c=Mw(t);Z.useEffect(()=>{const y=Uc(a);if(y===void 0)return;const x=window.setInterval(()=>void c.refetch(),y);return()=>window.clearInterval(x)},[a,t]);const h=y=>{l(y),zc(y)};return d.jsxs("main",{className:"logs-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"← BACK"}),d.jsxs("div",{className:"page-title",children:["LOGS / ",n]}),d.jsx($c,{token:a,updatedAtMs:c.dataUpdatedAt,onChange:h}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void c.refetch(),children:"↻"})]}),d.jsx(Sv,{content:c.data,loading:c.isLoading,err:c.isError?c.error.message:void 0})]})}const Bf=6,Hy=2,Zf=14,Uk={running:"var(--warn)",success:"var(--ok)",failed:"var(--err)",unknown:"var(--text-faint)"};function Vk({runs:t}){if(t.length===0)return d.jsx("span",{className:"spark-empty muted",children:"—"});const n=t.length*Bf-Hy;return d.jsx("svg",{className:"spark",role:"img","aria-label":`Last ${t.length} runs`,width:n,height:Zf,viewBox:`0 0 ${n} ${Zf}`,children:t.map((s,a)=>d.jsx("rect",{x:a*Bf,y:0,width:Bf-Hy,height:Zf,rx:1,fill:Uk[s.status],className:`spark-tick ${s.status}`,children:d.jsx("title",{children:`${zh(s.status)} · ${Oo(s.started_at)}`})},`${s.workbench}-${a}`))})}function zk({routine:t,now:n}){if(!t.enabled)return d.jsx("span",{className:"cell-next muted",children:"paused"});if(ka(t,n)){const l=s1(t,n);return d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"cell-next muted",children:"snoozed"}),l!==""&&d.jsx("div",{className:"cell-next-until muted",children:l})]})}const s=Ao(t.schedule,n);if(s===void 0)return d.jsx("span",{className:"cell-next muted",children:"—"});const a=s.getTime()-n.getTime()<=$h;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"cell-next-when",children:Uh(n,s)}),d.jsx("div",{className:a?"cell-next-until soon":"cell-next-until",children:Wc(n,s)})]})}function $k({routine:t,now:n,runs:s,selected:a,onSelect:l,onEdit:c,onClone:h,onDelete:y,onToggle:x,onTrigger:w,onLogs:E,onHistory:O,onFlags:_}){var me;const[S,C]=Z.useState(!1),T=t.schedule_description??"—",b=Oo(t.updated_at),I=t.repositories??[],j=(t.machines??[]).filter(ye=>ye.trim()!==""),F=t.tags??[],U=(me=t.goal)!=null&&me.trim()?t.goal.split(`
`)[0]:void 0,$=yh(t),J=t.last_manual_trigger_at!=null&&(t.last_scheduled_trigger_at==null||t.last_manual_trigger_at>=t.last_scheduled_trigger_at),se=Ec(t,n);return d.jsxs("tr",{className:a?"row-selected":"",children:[d.jsx("td",{className:"col-select",children:d.jsx("input",{type:"checkbox",checked:a,onChange:()=>l(t.id),"aria-label":`Select ${t.title}`})}),d.jsxs("td",{children:[d.jsx("div",{className:"cell-schedule",title:t.id,children:t.title}),U!==void 0&&d.jsx("div",{className:"cell-goal",title:t.goal??"",children:U})]}),d.jsxs("td",{children:[d.jsx("div",{className:"cell-schedule",children:t.schedule}),d.jsx("div",{className:"cell-schedule-human",children:T}),d.jsx("button",{type:"button",className:S?"sched-preview-btn open":"sched-preview-btn","aria-expanded":S,onClick:ye=>{ye.stopPropagation(),C(ke=>!ke)},children:"▸ fires"}),S&&d.jsx(Wk,{schedule:t.schedule,now:n})]}),d.jsx("td",{children:d.jsx(zk,{routine:t,now:n})}),d.jsx("td",{children:$===void 0?d.jsx("span",{className:"muted",children:"—"}):d.jsxs("div",{className:"cell-triggered",children:[J?"↻":"⏱"," ",Oo($)]})}),d.jsx("td",{children:d.jsx(Vk,{runs:s})}),d.jsxs("td",{children:[d.jsxs("span",{className:"cell-handler",title:t.agent_registered?"agent registered":"agent config missing",children:[d.jsx("span",{className:t.agent_registered?"handler-dot ok":"handler-dot warn"}),t.agent]}),t.model&&d.jsx("div",{className:"cell-goal",children:t.model})]}),d.jsx("td",{children:I.length===0?"—":d.jsx("span",{title:I.map(ye=>ye.repository).join(`
`),children:I.length})}),d.jsx("td",{className:j.length===0?"cell-meta cell-no-machines":"cell-meta",children:j.length===0?"—":d.jsx("span",{title:j.join(`
`),children:j.length})}),d.jsx("td",{children:F.length===0?"—":d.jsx("span",{title:F.join(", "),children:F.join(", ")})}),d.jsx("td",{children:d.jsx("span",{className:"cell-meta",title:"workbench retention for finished runs",children:jk(t.ttl_secs)})}),d.jsx("td",{children:d.jsx("span",{className:r1(se),title:gh(se),children:gh(se)})}),d.jsx("td",{children:d.jsxs("label",{className:"toggle",children:[d.jsx("input",{type:"checkbox",checked:t.enabled,onChange:ye=>x(t.id,ye.target.checked)}),d.jsx("div",{className:"toggle-track"})]})}),d.jsx("td",{children:d.jsx("div",{className:"cell-time",children:b})}),d.jsx("td",{children:d.jsxs("div",{className:"row-actions",children:[d.jsx("button",{type:"button",className:"act-btn run",title:i1(t),"aria-label":"Run now",disabled:!t.enabled||t.power_saving,onClick:()=>w(t.id),children:"▶"}),d.jsx("button",{type:"button",className:"act-btn logs",onClick:()=>E(t.id),children:"LOGS"}),d.jsx("button",{type:"button",className:"act-btn history",title:"Run history",onClick:()=>O(t.id),children:"HISTORY"}),d.jsxs("button",{type:"button",className:"act-btn flags",title:"Open flags",onClick:()=>_(t.id),children:["FLAGS",(t.flag_count??0)>0&&d.jsx("span",{className:"flag-badge",children:t.flag_count})]}),d.jsx("button",{type:"button",className:"act-btn edit",onClick:()=>c(t.id),children:"EDIT"}),d.jsx("button",{type:"button",className:"act-btn clone",title:"Duplicate routine","aria-label":"Duplicate routine",onClick:()=>h(t.id),children:"⧉"}),d.jsx("button",{type:"button",className:"act-btn del",title:"Delete routine","aria-label":"Delete routine",onClick:()=>y(t.id,t.title),children:"✕"})]})})]})}function Wk({schedule:t,now:n}){const s=NS(t,n,10);return s.length===0?d.jsx("div",{className:"fires-panel",children:d.jsx("div",{className:"fires-empty",children:"— no future fires —"})}):d.jsxs("div",{className:"fires-panel",children:[d.jsx("div",{className:"fires-hd",children:"NEXT 10 FIRES"}),s.map((a,l)=>d.jsxs("div",{className:"fires-item",children:[d.jsx("span",{className:"fires-when",children:Uh(n,a)}),d.jsx("span",{className:"fires-until",children:Wc(n,a)})]},l))]})}function la({label:t,col:n,current:s,dir:a,onSort:l}){const c=s===n,h=c?a==="asc"?" ▲":" ▼":"";return d.jsxs("th",{className:c?"th-sort th-sort-active":"th-sort",onClick:()=>l(n),children:[t,h]})}function Hk(t){const{routines:n,loading:s,filterActive:a,onClearFilters:l}=t;if(s)return d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})});if(n.length===0)return d.jsx("div",{className:"table-wrap",children:a?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⊘"}),d.jsx("div",{className:"empty-msg",children:"NO ROUTINES MATCH"}),d.jsx("div",{className:"empty-sub",children:d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:l,children:"CLEAR FILTERS"})})]}):d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⧗"}),d.jsx("div",{className:"empty-msg",children:"NO ROUTINES SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"press + NEW ROUTINE to create one"})]})});const c=n.length>0&&n.every(y=>t.selected.has(y.id)),h=x1(n,t.groupBy);return d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:"col-select",children:d.jsx("input",{type:"checkbox",checked:c,onChange:t.onSelectAll,"aria-label":"Select all visible routines",title:"Select all visible"})}),d.jsx(la,{label:"TITLE",col:"title",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{children:"SCHEDULE"}),d.jsx(la,{label:"NEXT RUN",col:"next_run",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx(la,{label:"LAST FIRE",col:"last_fire",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{children:"RUN HISTORY"}),d.jsx(la,{label:"AGENT",col:"agent",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{children:"REPOS"}),d.jsx("th",{children:"MACHINES"}),d.jsx("th",{children:"TAGS"}),d.jsx("th",{children:"TTL"}),d.jsx(la,{label:"HEALTH",col:"health",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx(la,{label:"ENABLED",col:"enabled",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx(la,{label:"UPDATED",col:"updated",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{})]})}),d.jsx("tbody",{children:h.map(([y,x])=>d.jsxs(Z.Fragment,{children:[t.groupBy!=="none"&&d.jsx("tr",{className:"group-hd",children:d.jsxs("td",{colSpan:15,children:[d.jsx("span",{className:"group-label",children:y})," ",d.jsxs("span",{className:"group-count",children:["(",x.length,")"]})]})},`hd-${y}`),x.map(w=>d.jsx($k,{routine:w,now:t.now,runs:t.runHistory.get(w.id)??[],selected:t.selected.has(w.id),onSelect:t.onSelect,onEdit:t.onEdit,onClone:t.onClone,onDelete:t.onDelete,onToggle:t.onToggle,onTrigger:t.onTrigger,onLogs:t.onLogs,onHistory:t.onHistory,onFlags:t.onFlags},w.id))]},`grp-${y}`))})]})})}const kv="moadim.routines.saved_views",_v="moadim.routines.last_view";function By(t,n,s,a){return{query:t.query,status:t.status,agent:gs(t.agent),machine:xc(t.machine),repository:gs(t.repository),tag:gs(t.tag),sortCol:n,sortDir:s,groupBy:a}}function Zy(t){const n={query:t.query,status:Jg(t.status),agent:co(t.agent),machine:rv(t.machine),repository:co(t.repository),tag:co(t.tag)},s=t.sortCol===void 0?void 0:h1(t.sortCol),a=p1(t.sortDir),l=iv(t.groupBy);return{filter:n,sortCol:s,sortDir:a,groupBy:l}}function Nv(t){try{const n=window.localStorage.getItem(t);return n===null?void 0:JSON.parse(n)}catch{return}}function Ev(t,n){try{window.localStorage.setItem(t,JSON.stringify(n))}catch{}}function Bk(){return Nv(kv)??[]}function qy(t){Ev(kv,t)}function Zk(){return Nv(_v)}function qk(t){Ev(_v,t)}function Qk({views:t,onApply:n,onSave:s,onDelete:a}){const[l,c]=Z.useState(!1),[h,y]=Z.useState(""),[x,w]=Z.useState(""),E=S=>{const C=t.find(T=>T.name===S);C&&n(C.snapshot),w(S)},O=()=>{const S=h.trim();S!==""&&(s(S),w(S),c(!1))},_=()=>{x!==""&&(a(x),w(""))};return d.jsx("div",{className:"filter-bar saved-views-bar",children:d.jsxs("div",{className:"filter-field",children:[d.jsx("span",{className:"filter-label",children:"VIEWS"}),d.jsxs("select",{className:"filter-select","aria-label":"Saved views",value:x,onChange:S=>E(S.target.value),children:[d.jsx("option",{value:"",children:"— select —"}),t.map(S=>d.jsx("option",{value:S.name,children:S.name},S.name))]}),l?d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",className:"filter-input",placeholder:"View name…","aria-label":"New view name",value:h,onChange:S=>y(S.target.value)}),d.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:h.trim()==="",onClick:O,children:"SAVE"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>c(!1),children:"CANCEL"})]}):d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Save current filters, sort, and grouping as a named view",onClick:()=>{c(!0),y("")},children:"☆ SAVE VIEW"}),x!==""&&d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Delete this saved view",onClick:_,children:"DELETE"})]})]})})}const Yk=300,Gk=10;function Kk(t){const n=new Map;for(const s of t){let a=n.get(s.routine_id);a||(a=[],n.set(s.routine_id,a)),a.length<Gk&&a.push(s)}for(const s of n.values())s.reverse();return n}function Xk({routines:t,now:n,active:s,onStatus:a}){const l=t.length,c=t.filter(S=>S.enabled).length,h=l-c,y=t.filter(S=>S.enabled&&!ka(S,n)&&Ph(S.schedule,n,$h)).length,x=t.filter(S=>S.enabled&&ka(S,n)).length,w=t.filter(S=>S.enabled&&(S.machines??[]).length===0).length,E=t.reduce((S,C)=>S+(C.flag_count??0),0),O=t.filter(S=>!S.agent_registered).length,_=[["all","TOTAL",l,""],["enabled","ENABLED",c,""],["disabled","DISABLED",h,""],["dormant","DORMANT",w,w>0?"has-dormant":""],["due","DUE SOON",y,""],["snoozed","SNOOZED",x,""],["flagged","FLAGS",E,E>0?"has-flags":""],["agent-unreg","UNREGISTERED AGENT",O,O>0?"has-unreg":""]];return d.jsx("div",{className:"stats",children:_.map(([S,C,T,b])=>{const I=s===S;return d.jsxs("button",{type:"button",className:`stat-card ${b}${I?" active":""}`.trim(),"aria-pressed":I,onClick:()=>a(I?"all":S),children:[d.jsx("div",{className:"stat-label",children:C}),d.jsx("div",{className:"stat-val",children:T})]},S)})})}const Jk=[["table","LIST"],["calendar","CALENDAR"],["day","DAY"]];function e_({view:t,onSetView:n}){return d.jsx("div",{className:"view-toggle",children:Jk.map(([s,a])=>d.jsx("button",{type:"button",className:t===s?"view-btn active":"view-btn",onClick:()=>n(s),children:a},s))})}const t_=3e4;function n_(){const{addToast:t}=Fo(),[n,s]=vg(),a=Z.useMemo(()=>Zk(),[]),l=a?Zy(a):void 0,[c,h]=Z.useState({kind:"list"}),[y,x]=Z.useState({kind:"none"}),[w,E]=Z.useState("table"),[O,_]=Z.useState((l==null?void 0:l.filter)??Uf()),[S,C]=Z.useState(l==null?void 0:l.sortCol),[T,b]=Z.useState((l==null?void 0:l.sortDir)??"asc"),[I,j]=Z.useState((l==null?void 0:l.groupBy)??"none"),[F,U]=Z.useState(new Set),[$,J]=Z.useState(Bk),[se,me]=Z.useState(Vc),[ye,ke]=Z.useState(()=>new Date),pe=Z.useRef(null);Z.useEffect(()=>{const W=n.get("history");if(W){h({kind:"history",id:W});const Q=new URLSearchParams(n);Q.delete("history"),s(Q,{replace:!0})}},[]),Z.useEffect(()=>{const W=setInterval(()=>ke(new Date),t_);return()=>clearInterval(W)},[]),Z.useEffect(()=>{qk(By(O,S,T,I))},[O,S,T,I]),Z.useEffect(()=>{const W=Q=>{var Ke;if(Q.key==="Escape"&&y.kind!=="none"){x({kind:"none"});return}const re=Q.target,_e=re&&["INPUT","TEXTAREA","SELECT"].includes(re.tagName);Q.key==="/"&&!_e&&!Q.metaKey&&!Q.ctrlKey&&!Q.altKey&&(Q.preventDefault(),(Ke=pe.current)==null||Ke.focus())};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[y.kind]);const ve=Uc(se),he=Fh({},{refetchInterval:ve}),Me=Ug(Yk),Pe=Ag(),Xe=Ig(),$e=Lg();Z.useEffect(()=>{if(ve===void 0)return;const W=setInterval(()=>void Me.refetch(),ve);return()=>clearInterval(W)},[ve]);const te=Z.useMemo(()=>he.data??[],[he.data]),ge=Z.useMemo(()=>Kk(Me.data??[]),[Me.data]),ue=Z.useRef(!1);Z.useEffect(()=>{var Q;const W=(Q=Xe.data)==null?void 0:Q.name;!W||ue.current||(ue.current=!0,_(re=>re.machine.kind==="any"?{...re,machine:{kind:"machine",value:W}}:re))},[Xe.data]),Z.useEffect(()=>{const W=new Set(te.map(Q=>Q.id));U(Q=>{const re=new Set([...Q].filter(_e=>W.has(_e)));return re.size===Q.size?Q:re})},[te]);const B=Ow(),ne=bw(),ze=jw(),Ce=Fg(),je=Rw(),Le=Pg(),Qe=()=>h({kind:"list"}),Be=()=>x({kind:"none"}),lt=()=>{Le.mutate("all",{onSuccess:()=>t("Routines unlocked","ok"),onError:W=>t(`Unlock failed: ${W.message}`,"err")})},Ct=W=>{B.mutate({...W},{onSuccess:()=>{Qe(),t("Routine created","ok")},onError:Q=>t(`Create failed: ${Q.message}`,"err")})},jn=(W,Q)=>{ne.mutate({id:W,body:{...Q}},{onSuccess:()=>{Be(),t("Routine updated","ok")},onError:re=>t(`Update failed: ${re.message}`,"err")})},sr=W=>{ze.mutate(W,{onSuccess:()=>{Be(),t("Routine deleted","ok")},onError:Q=>t(`Delete failed: ${Q.message}`,"err")})},$n=(W,Q)=>{ne.mutate({id:W,body:{enabled:Q}},{onSuccess:()=>t(Q?"Routine enabled":"Routine disabled","ok"),onError:re=>t(`Toggle failed: ${re.message}`,"err")})},Nr=W=>{Ce.mutate(W,{onSuccess:()=>t("Routine triggered","ok"),onError:Q=>t(`Trigger failed: ${Q.message}`,"err")})},Wn=()=>{je.mutate(void 0,{onSuccess:W=>{const Q=W.removed;t(`Cleanup removed ${Q} workbench${Q===1?"":"es"} (freed ${KS(W.freed_bytes)})`,"ok")},onError:W=>t(`Cleanup failed: ${W.message}`,"err")})},ir=async W=>{const Q=[...F];if(Q.length===0)return;let re=0,_e=0;for(const xt of Q)try{await ne.mutateAsync({id:xt,body:{enabled:W}}),re++}catch{_e++}const Ke=W?"enabled":"disabled";_e===0?t(`${re} routine(s) ${Ke}`,"ok"):t(`${re} ${Ke}, ${_e} failed`,"err")},Hn=async()=>{const W=[...F];let Q=0,re=0;const _e=[];for(const Ke of W)try{await ze.mutateAsync(Ke),Q++,_e.push(Ke)}catch{re++}U(Ke=>{const xt=new Set(Ke);for(const Kt of _e)xt.delete(Kt);return xt}),Be(),re===0?t(`${Q} routine(s) deleted`,"ok"):t(`${Q} deleted, ${re} failed`,"err")},ar=W=>{const Q=Zy(W);_(Q.filter),C(Q.sortCol),b(Q.sortDir),j(Q.groupBy)},Rn=W=>{const Q=By(O,S,T,I);J(re=>{const _e=[...re.filter(Ke=>Ke.name!==W),{name:W,snapshot:Q}];return qy(_e),_e})},or=W=>{J(Q=>{const re=Q.filter(_e=>_e.name!==W);return qy(re),re})},Dn=Z.useMemo(()=>a1(te),[te]),qr=Z.useMemo(()=>l1(te),[te]),Qr=Z.useMemo(()=>u1(te),[te]),Yr=Z.useMemo(()=>[...new Set([...o1(te),...$e.data??[]])].sort(),[te,$e.data]),lr=sv(O),Bn=Z.useMemo(()=>w1(n1(te,O,ye,$h),S,T,ye),[te,O,ye,S,T]),Gr=Cw(y.kind==="edit"?y.id:"",y.kind==="edit"),At=y.kind==="edit"?Gr.data:void 0,Kr=W=>U(Q=>{const re=new Set(Q);return re.delete(W)||re.add(W),re}),D=()=>{const W=Bn.map(re=>re.id),Q=W.length>0&&W.every(re=>F.has(re));U(Q?new Set:new Set(W))},A=W=>{S===W?b(Q=>m1(Q)):(C(W),b("asc"))},q=W=>{me(W),zc(W)},ee=W=>{var Q;return((Q=te.find(re=>re.id===W))==null?void 0:Q.title)??""};if(c.kind==="new")return d.jsx(Hf,{mode:"create",saving:B.isPending,onCancel:Qe,onSave:Ct});if(c.kind==="clone"){const W={schedule:c.source.schedule,title:_k(c.source.title),agent:c.source.agent,model:c.source.model??null,prompt:c.source.prompt??"",goal:c.source.goal??null,repositories:c.source.repositories??[],machines:c.source.machines??[],enabled:c.source.enabled,ttl_secs:c.source.ttl_secs??null,tags:c.source.tags??[]};return d.jsx(Hf,{mode:"clone",initial:W,saving:B.isPending,onCancel:Qe,onSave:Ct})}if(c.kind==="logs")return d.jsx(Pk,{id:c.id,title:ee(c.id),onBack:Qe});if(c.kind==="history")return d.jsx(Ak,{id:c.id,title:ee(c.id),onBack:Qe});if(c.kind==="flags")return d.jsx(N1,{id:c.id,title:ee(c.id),onBack:Qe});const le=Bn.filter(W=>W.enabled).map(W=>({id:W.id,label:W.title,schedule:W.schedule,snoozed:ka(W,ye),flagCount:W.flag_count??0}));return d.jsxs("div",{className:"page",children:[d.jsx("h1",{className:"page-title",children:"Routines"}),d.jsx(Wg,{status:Pe.data,onUnlock:lt}),d.jsx(Xk,{routines:te,now:ye,active:O.status,onStatus:W=>_(Q=>({...Q,status:W}))}),d.jsxs("div",{className:"section-hd",children:[d.jsx("div",{className:"section-label",children:"SCHEDULED ROUTINES"}),d.jsxs("div",{className:"section-acts",children:[d.jsx($c,{token:se,updatedAtMs:he.dataUpdatedAt,onChange:q}),w==="table"&&d.jsx(k1,{groupBy:I,onChange:j}),d.jsx(e_,{view:w,onSetView:E}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Reap finished, expired run workbenches now",onClick:Wn,children:"CLEANUP NOW"}),d.jsx("button",{type:"button",className:"btn btn-primary btn-sm",onClick:()=>h({kind:"new"}),children:"+ NEW ROUTINE"})]})]}),d.jsx(d1,{filter:O,agents:Dn,machines:Yr,repositories:qr,tags:Qr,shown:Bn.length,total:te.length,searchRef:pe,onQuery:W=>_(Q=>({...Q,query:W})),onStatus:W=>_(Q=>({...Q,status:W})),onAgent:W=>_(Q=>({...Q,agent:W})),onMachine:W=>_(Q=>({...Q,machine:W})),onRepository:W=>_(Q=>({...Q,repository:W})),onTag:W=>_(Q=>({...Q,tag:W})),onClear:()=>_(Uf())}),d.jsx(Qk,{views:$,onApply:ar,onSave:Rn,onDelete:or}),d.jsx(QS,{count:F.size,onEnable:()=>void ir(!0),onDisable:()=>void ir(!1),onDelete:()=>x({kind:"confirmBulkDelete"}),onClear:()=>U(new Set)}),w==="table"&&d.jsx(Hk,{routines:Bn,loading:he.isLoading,filterActive:lr,now:ye,selected:F,onSelect:Kr,onSelectAll:D,sortCol:S,sortDir:T,groupBy:I,runHistory:ge,onSort:A,onEdit:W=>x({kind:"edit",id:W}),onClone:W=>{const Q=te.find(re=>re.id===W);Q&&h({kind:"clone",source:Q})},onDelete:(W,Q)=>x({kind:"confirmDelete",id:W,title:Q}),onToggle:$n,onTrigger:Nr,onLogs:W=>h({kind:"logs",id:W}),onHistory:W=>h({kind:"history",id:W}),onFlags:W=>h({kind:"flags",id:W}),onClearFilters:()=>_(Uf())}),w==="calendar"&&d.jsx(_1,{routines:Bn,loading:he.isLoading,onEdit:W=>x({kind:"edit",id:W})}),w==="day"&&d.jsx(JS,{items:le,loading:he.isLoading,onClick:W=>x({kind:"edit",id:W})}),y.kind==="edit"&&Gr.isLoading&&d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})}),y.kind==="edit"&&At&&d.jsx(Hf,{mode:"edit",initial:At&&{schedule:At.schedule,title:At.title,agent:At.agent,model:At.model??null,prompt:At.prompt??"",goal:At.goal??null,repositories:At.repositories??[],machines:At.machines??[],enabled:At.enabled,ttl_secs:At.ttl_secs??null,tags:At.tags??[]},saving:ne.isPending,onCancel:Be,onSave:W=>jn(y.id,W)}),y.kind==="confirmDelete"&&d.jsx(GS,{title:y.title,onCancel:Be,onConfirm:()=>sr(y.id)}),y.kind==="confirmBulkDelete"&&d.jsx(YS,{count:F.size,onCancel:Be,onConfirm:()=>void Hn()})]})}function r_(t,n){const s=Array.from({length:24},()=>[]);for(const a of t)for(const l of qg(a.schedule,n)){const c=s[l.getHours()];c==null||c.push({time:l,label:a.label,snoozed:a.snoozed,flagCount:a.flagCount})}for(const a of s)a.sort((l,c)=>l.time.getTime()-c.time.getTime());return s}function s_(t,n){const s=t.snoozed_until;return s!=null&&s>Math.floor(n.getTime()/1e3)||(t.skip_runs??0)>0}function i_(t,n){return t.filter(s=>s.enabled).map(s=>({label:s.title,schedule:s.schedule,snoozed:s_(s,n),flagCount:s.flag_count}))}function a_(t){var a;const n=Xl[t.getDay()],s=(a=Vh[t.getMonth()])==null?void 0:a.slice(0,3);return`${n} · ${s} ${t.getDate()} ${t.getFullYear()}`}function o_({day:t,items:n,loading:s,isToday:a,currentHour:l,onPrev:c,onNext:h,onToday:y,onClose:x}){const w=r_(n,t),E=w.reduce((O,_)=>O+_.length,0);return d.jsxs("section",{className:"hm-day card",children:[d.jsxs("div",{className:"hm-day-nav",children:[d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:c,"aria-label":"Previous day",children:"‹"}),d.jsx("div",{className:"hm-day-title",children:a_(t)}),d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:h,"aria-label":"Next day",children:"›"}),d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:y,children:"TODAY"}),d.jsx("div",{className:"hm-day-spacer"}),d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:x,"aria-label":"Close day view",children:"✕"})]}),s?d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})}):E===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"🗓"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"no fire times on this day"})]}):d.jsx("div",{className:"hm-day-hours",children:w.map((O,_)=>d.jsxs("div",{className:a&&_===l?"hm-day-hour now":"hm-day-hour",children:[d.jsxs("div",{className:"hm-day-hour-label",children:[String(_).padStart(2,"0"),":00"]}),d.jsx("div",{className:"hm-day-hour-slot",children:O.map((S,C)=>d.jsxs("div",{className:S.snoozed?"hm-day-chip snoozed":"hm-day-chip",title:S.label,children:[d.jsxs("span",{className:"hm-day-chip-time",children:[String(S.time.getHours()).padStart(2,"0"),":",String(S.time.getMinutes()).padStart(2,"0")]}),d.jsx("span",{className:"hm-day-chip-label",children:S.label}),S.flagCount>0&&d.jsx("span",{className:"hm-day-chip-flag",children:`⚑${S.flagCount}`})]},C))})]},_))})]})}const fo=7,ho=24,l_=2e4;function u_(t){return t==="all"?"ALL":"ROUTINES"}function c_(t,n){return t==="all"||t===n}function d_(t,n,s){const a=Br(n),l=new Date(a.getFullYear(),a.getMonth(),a.getDate()+fo),c=Array.from({length:fo},()=>new Array(ho).fill(0));let h=0;for(const E of t){if(!E.enabled||!c_(s,E.kind))continue;const O=Kl(E.schedule,n);if(!O)continue;let _=!1;for(let S=0;S<l_&&O.hasNext();S++){const C=O.next().toDate(),T=Br(C);if(T.getTime()>=l.getTime())break;const b=Math.round((T.getTime()-a.getTime())/864e5),I=c[b];I&&(I[C.getHours()]=(I[C.getHours()]??0)+1,_=!0)}_&&h++}let y=0,x=0,w;for(let E=0;E<fo;E++){const O=c[E];if(O)for(let _=0;_<ho;_++){const S=O[_]??0;y+=S,S>x&&(x=S,w=[E,_])}}return{grid:c,total:y,maxCell:x,peak:w,sources:h}}function f_(t,n){if(t===0||n===0)return 0;const s=t/n;return Math.min(4,Math.max(1,Math.ceil(s*4)))}function h_(t){return t.grid.map(n=>n.reduce((s,a)=>s+a,0))}function m_(t){return Array.from({length:ho},(n,s)=>t.grid.reduce((a,l)=>a+(l[s]??0),0))}function p_(t){return t.grid.flat().filter(n=>n>0).length}function Tv(t){return t.getDay()}function y_(t,n){const s=new Date(t.getFullYear(),t.getMonth(),t.getDate()+n);return Xl[Tv(s)]??""}function g_(t,n){var h;if(!t.peak)return;const[s,a]=t.peak,l=((h=t.grid[s])==null?void 0:h[a])??0,c=l===1?"run":"runs";return`${y_(n,s)} ${String(a).padStart(2,"0")}:00 · ${l} ${c}`}function qf(t,n){const s=new Date(t.getFullYear(),t.getMonth(),t.getDate()+n);return`${Xl[Tv(s)]} ${s.getDate()}`}function v_(t){return t.map(n=>({kind:"routine",schedule:n.schedule,enabled:n.enabled}))}const x_=6e4,w_=["all","routine"];function Qf(t,n){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+n)}function S_(t){const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${a}`}function k_(t){const n=t?/^(\d{4})-(\d{2})-(\d{2})$/.exec(t):null;if(!n)return;const[,s,a,l]=n;return new Date(Number(s),Number(a)-1,Number(l))}function Qy(t){if(t!==0)return`color-mix(in srgb, var(--accent) ${10+t*20}%, var(--surface))`}function __(){const[t,n]=Z.useState(Vc),{data:s,isLoading:a,error:l,dataUpdatedAt:c}=Fh({},{refetchInterval:Uc(t)}),[h,y]=Z.useState(()=>new Date),[x,w]=Z.useState("all"),[E,O]=vg(),_=pe=>{zc(pe),n(pe)};Z.useEffect(()=>{const pe=setInterval(()=>y(new Date),x_);return()=>clearInterval(pe)},[]);const S=Br(h),C=h.getHours(),T=Z.useMemo(()=>v_(s??[]),[s]),b=Z.useMemo(()=>d_(T,h,x),[T,h,x]),I=k_(E.get("day")),j=pe=>{O(ve=>{const he=new URLSearchParams(ve);return he.set("day",S_(pe)),he})},F=()=>{O(pe=>{const ve=new URLSearchParams(pe);return ve.delete("day"),ve})},U=Z.useMemo(()=>i_(s??[],h),[s,h]),$=l==null?void 0:l.message,J=Array.from({length:fo},(pe,ve)=>ve),se=Array.from({length:ho},(pe,ve)=>ve),me=h_(b),ye=m_(b),ke=fo*ho-p_(b);return d.jsxs("div",{className:"page",children:[d.jsxs("div",{className:"hm-hd",children:[d.jsx("h1",{className:"page-title",children:"Heatmap"}),d.jsxs("div",{className:"hm-hd-acts",children:[d.jsx("div",{className:"hm-filter",role:"group","aria-label":"Source filter",children:w_.map(pe=>d.jsx("button",{className:pe===x?"hm-filter-btn active":"hm-filter-btn","aria-pressed":pe===x,onClick:()=>w(pe),children:u_(pe)},pe))}),d.jsx($c,{token:t,updatedAtMs:c,onChange:_})]})]}),d.jsxs("div",{className:"stats",children:[d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"FIRES / 7 DAYS"}),d.jsx("div",{className:"stat-val",children:b.total})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"BUSIEST WINDOW"}),d.jsx("div",{className:"stat-val stat-val-sm c-accent",children:g_(b,S)??"—"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"PEAK / HOUR"}),d.jsx("div",{className:"stat-val",children:b.maxCell})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"SOURCES"}),d.jsx("div",{className:"stat-val",children:b.sources})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"OPEN SLOTS"}),d.jsxs("div",{className:"stat-val stat-val-sm",children:[ke," / ",fo*ho]})]})]}),$?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⚠"}),d.jsx("div",{className:"empty-msg",children:"FAILED TO LOAD"}),d.jsx("div",{className:"empty-sub",children:$})]})}):a?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):b.total===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"▦"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"no enabled routine fires in the next 7 days"})]})}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"hm-grid-wrap",children:d.jsxs("div",{className:"hm-grid",role:"grid","aria-label":"Fire density by day and hour",children:[d.jsx("div",{className:"hm-corner",role:"columnheader",children:"DAY \\ HR"}),se.map(pe=>d.jsx("div",{className:pe===C?"hm-hcol now":"hm-hcol",role:"columnheader",children:String(pe).padStart(2,"0")},pe)),d.jsx("div",{className:"hm-rowtot hm-corner",role:"columnheader",children:"Σ"}),J.map(pe=>{const ve=Qf(S,pe);return d.jsxs(Z.Fragment,{children:[d.jsx("button",{className:pe===0?"hm-daylabel today":"hm-daylabel",onClick:()=>j(ve),title:`View ${qf(S,pe)}`,children:qf(S,pe)}),se.map(he=>{var ge,ue;const Me=((ge=b.grid[pe])==null?void 0:ge[he])??0,Pe=f_(Me,b.maxCell),Xe=((ue=b.peak)==null?void 0:ue[0])===pe&&b.peak[1]===he,$e=pe===0&&he===C;let te="hm-cell";return Xe&&(te+=" peak"),$e&&(te+=" now"),d.jsx("button",{className:te,style:{backgroundColor:Qy(Pe)},onClick:()=>j(ve),title:`${qf(S,pe)} ${String(he).padStart(2,"0")}:00 — ${Me} run${Me===1?"":"s"}`,children:Me>0?d.jsx("span",{className:"hm-n",children:Me}):null},`${pe}-${he}`)}),d.jsx("div",{className:"hm-rowtot",children:me[pe]})]},pe)}),d.jsx("div",{className:"hm-daylabel hm-foot",children:"Σ"}),se.map(pe=>d.jsx("div",{className:"hm-rowtot hm-foot",children:ye[pe]},`hourtot-${pe}`)),d.jsx("div",{className:"hm-rowtot hm-foot grand",children:b.total})]})}),d.jsxs("div",{className:"hm-legend",children:[d.jsx("span",{className:"hm-legend-label",children:"LESS"}),[0,1,2,3,4].map(pe=>d.jsx("span",{className:"hm-cell hm-legend-swatch",style:{backgroundColor:Qy(pe)}},pe)),d.jsx("span",{className:"hm-legend-label",children:"MORE"}),d.jsx("span",{className:"hm-legend-note",children:"fires per weekday · hour across the next 7 days"})]})]}),I&&d.jsx(o_,{day:I,items:U,loading:a,isToday:Br(I).getTime()===S.getTime(),currentHour:C,onPrev:()=>j(Qf(I,-1)),onNext:()=>j(Qf(I,1)),onToday:()=>j(S),onClose:F})]})}function N_(){const{addToast:t}=Fo(),n=Ew(),s=Tw(),[a,l]=Z.useState(""),[c,h]=Z.useState("");Z.useEffect(()=>{n.data!==void 0&&(l(n.data),h(n.data))},[n.data]);const y=a!==c,x=()=>{s.mutate(a,{onSuccess:()=>{h(a),t("Prompt saved","ok")},onError:w=>t(`Save failed: ${w.message}`,"err")})};return d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Settings"}),d.jsxs("div",{className:"card",style:{padding:16},children:[d.jsx("div",{style:{fontWeight:700,marginBottom:4},children:"Persistent prompt"}),d.jsx("p",{style:{color:"var(--text-dim)",fontSize:13,marginTop:0},children:"Appended to every routine's agent instructions file (CLAUDE.md/AGENTS.md), alongside the moadim-managed preamble, on every run."}),n.isLoading?d.jsx("div",{children:"Loading…"}):d.jsxs(d.Fragment,{children:[d.jsx("textarea",{className:"form-textarea",rows:12,placeholder:"e.g. always run `cargo fmt` before finishing a task",value:a,onChange:w=>l(w.target.value)}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:10},children:[d.jsx("button",{className:"btn btn-primary",disabled:!y||s.isPending,onClick:x,children:s.isPending?"Saving…":"Save"}),y&&d.jsx("span",{style:{color:"var(--text-faint)",fontSize:12},children:"unsaved changes"})]})]})]})]})}function E_(){return d.jsx(mx,{children:d.jsxs(ua,{element:d.jsx(lS,{}),children:[d.jsx(ua,{index:!0,element:d.jsx(qS,{})}),d.jsx(ua,{path:"routines",element:d.jsx(n_,{})}),d.jsx(ua,{path:"heatmap",element:d.jsx(__,{})}),d.jsx(ua,{path:"settings",element:d.jsx(N_,{})}),d.jsx(ua,{path:"*",element:d.jsx(dx,{to:"/",replace:!0})})]})})}function T_(){return d.jsx(aS,{children:d.jsx(E_,{})})}const C_=new tw({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Cv=document.getElementById("root");if(!Cv)throw new Error("#root element missing");w0.createRoot(Cv).render(d.jsx(Z.StrictMode,{children:d.jsx(nw,{client:C_,children:d.jsx(_x,{basename:"/client",future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:d.jsx(T_,{})})})}));</script>
    <style rel="stylesheet" crossorigin>:root{--bg: #14130f;--surface: #1c1a15;--surface-2: #24211b;--border: #343026;--border-strong: #4a4536;--text: #f2ede2;--text-dim: #b3ab98;--text-faint: #7d7566;--accent: #e08a4c;--accent-ink: #14130f;--ok: #7fbf8a;--ok-bg: #1c2b1e;--err: #e2685a;--err-bg: #2e1c19;--warn: #d9ab5c;--warn-bg: #2e2517;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;--mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;--radius: 6px;--shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 4px 12px rgba(0, 0, 0, .18);color-scheme:dark}html.theme-light{--bg: #f7f6f3;--surface: #ffffff;--surface-2: #f0eee9;--border: #e2ded5;--border-strong: #cfc9ba;--text: #1f1d1a;--text-dim: #6b6558;--text-faint: #9b9484;--accent: #b5541e;--accent-ink: #ffffff;--ok: #3f7d4a;--ok-bg: #e8f2e9;--err: #b13a2c;--err-bg: #fbeae7;--warn: #a6741a;--warn-bg: #fbf1de;--shadow: 0 1px 2px rgba(31, 29, 26, .06), 0 4px 12px rgba(31, 29, 26, .05);color-scheme:light}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}a{color:inherit}button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}.app-shell{display:flex;flex-direction:column;min-height:100%}.app-header{display:flex;align-items:center;gap:16px;padding:12px 20px;border-bottom:1px solid var(--border);background:var(--surface)}.brand{font-weight:700;letter-spacing:.02em;font-size:15px}.brand-sub{color:var(--text-faint);font-weight:500;margin-left:6px}.header-spacer{flex:1}.header-right{display:flex;align-items:center;gap:10px}.dep-warn{font-size:12px;padding:3px 8px;border-radius:var(--radius);background:var(--warn-bg);color:var(--warn);font-weight:600}.health{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-dim)}.health-dot{width:8px;height:8px;border-radius:50%;background:var(--text-faint)}.health-dot.ok{background:var(--ok)}.health-dot.error{background:var(--err)}.machine-badge,.icon-btn{border:1px solid var(--border);background:var(--surface);border-radius:var(--radius);padding:6px 10px;cursor:pointer;font-size:12px;font-weight:600}.machine-badge:hover,.icon-btn:hover{border-color:var(--border-strong)}.icon-btn.danger{color:var(--err);border-color:var(--err)}.icon-btn.danger:disabled{opacity:.4;cursor:not-allowed}.app-nav{display:flex;gap:4px;padding:0 20px;border-bottom:1px solid var(--border);background:var(--surface)}.nav-link{padding:10px 12px;font-size:13px;font-weight:600;color:var(--text-dim);text-decoration:none;border-bottom:2px solid transparent}.nav-link:hover{color:var(--text)}.nav-link.active{color:var(--accent);border-bottom-color:var(--accent)}.page{flex:1;padding:24px 20px 60px;max-width:1200px;width:100%;margin:0 auto}.page-title{font-size:20px;font-weight:700;margin:0 0 16px}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}.btn{border-radius:var(--radius);border:1px solid var(--border-strong);background:var(--surface);padding:7px 14px;font-size:13px;font-weight:600;cursor:pointer}.btn:hover{border-color:var(--accent)}.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.btn-danger{background:var(--err);border-color:var(--err);color:#fff}.btn-ghost{background:transparent;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#14130f66;display:flex;align-items:flex-start;justify-content:center;padding-top:12vh;z-index:100}.dialog{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;min-width:340px;max-width:90vw}.dialog-title{font-weight:700;margin-bottom:8px}.dialog-msg{color:var(--text-dim);font-size:13px;margin-bottom:16px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.form-label{display:block;font-size:12px;font-weight:700;color:var(--text-dim);margin-bottom:6px;letter-spacing:.02em}.form-input,.form-textarea,.form-select{width:100%;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:8px 10px;font-size:13px}.form-textarea{font-family:var(--mono);resize:vertical}.toast-wrap{position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:200}.toast{padding:10px 14px;border-radius:var(--radius);font-size:13px;font-weight:600;box-shadow:var(--shadow)}.toast.ok{background:var(--ok-bg);color:var(--ok)}.toast.err{background:var(--err-bg);color:var(--err)}.cmdk{width:560px;max-width:92vw;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.cmdk-search{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--border)}.cmdk-input{flex:1;border:none;outline:none;background:transparent;font-size:14px}.cmdk-hint{font-size:11px;color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 5px}.cmdk-list{list-style:none;margin:0;padding:6px;max-height:50vh;overflow-y:auto}.cmdk-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--radius);cursor:pointer}.cmdk-row.active{background:var(--surface-2)}.kind-badge{font-size:10px;font-weight:700;padding:2px 6px;border-radius:4px;background:var(--surface-2);color:var(--text-dim);flex-shrink:0}.cmdk-row-text{display:flex;flex-direction:column;min-width:0}.cmdk-row-title{font-size:13px;font-weight:600}.cmdk-row-sub{font-size:12px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cmdk-empty{padding:24px;text-align:center;color:var(--text-faint)}.cmdk-foot{display:flex;gap:14px;padding:8px 14px;border-top:1px solid var(--border);font-size:11px;color:var(--text-faint)}.cmdk-key{border:1px solid var(--border);border-radius:4px;padding:0 4px;margin-right:3px}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin-bottom:20px}.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.stat-card-wide{grid-column:span 2}.stat-label{font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--text-faint);margin-bottom:6px}.stat-val{font-size:24px;font-weight:700;color:var(--text)}.stat-val-sm{font-size:16px}.c-accent{color:var(--accent)}.c-red{color:var(--err)}.c-amber{color:var(--warn)}.section-hd{display:flex;align-items:center;justify-content:space-between;margin:24px 0 8px}.section-label{font-size:12px;font-weight:700;letter-spacing:.05em;color:var(--text-dim)}.section-label.attn{color:var(--err)}.section-acts{display:flex;align-items:center;gap:10px}.table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow-x:auto}.table-wrap table{width:100%;border-collapse:collapse;font-size:13px}.table-wrap th{text-align:left;font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--text-faint);padding:10px 14px;border-bottom:1px solid var(--border);white-space:nowrap}.table-wrap td{padding:10px 14px;border-bottom:1px solid var(--border);vertical-align:middle}.table-wrap tbody tr:last-child td{border-bottom:none}.table-wrap tbody tr:hover{background:var(--surface-2)}.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:36px 14px;text-align:center}.empty-icon{font-size:22px;color:var(--text-faint)}.empty-msg{font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--text-dim)}.empty-sub{font-size:12px;color:var(--text-faint)}.spinner{width:20px;height:20px;border-radius:50%;border:2px solid var(--border);border-top-color:var(--accent);animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.ov-name-link{font-weight:600;text-decoration:none}.ov-name-link:hover{color:var(--accent);text-decoration:underline}.ov-flag-badge{margin-left:8px;font-size:11px;font-weight:700;color:var(--warn);background:var(--warn-bg);border-radius:4px;padding:1px 6px}.kind-badge.routine{background:var(--surface-2);color:var(--text-dim)}.attn-badge{font-size:11px;font-weight:700;color:var(--err);background:var(--err-bg);border-radius:4px;padding:2px 7px;letter-spacing:.02em}.attn-detail,.cell-schedule-human,.cell-time,.cell-meta{color:var(--text-dim)}.cell-next-when{font-weight:600}.cell-next-until{font-size:12px;color:var(--text-faint)}.cell-next-until.soon{color:var(--err);font-weight:600}.cell-act{text-align:right}.btn-sm{padding:4px 10px;font-size:12px}.run-now-btn{border:1px solid var(--border-strong)}.refresh-control{display:flex;align-items:center;gap:8px}.refresh-lbl{font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--text-faint)}.refresh-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:5px 8px;font-size:12px}.refresh-fresh{font-size:11px;color:var(--text-faint)}.hm-hd{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.hm-hd-acts{display:flex;align-items:center;gap:14px}.hm-filter{display:flex;gap:4px}.hm-filter-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;color:var(--text-dim)}.hm-filter-btn:hover{border-color:var(--accent);color:var(--text)}.hm-filter-btn.active{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.hm-grid-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow-x:auto;padding:14px}.hm-grid{display:grid;grid-template-columns:64px repeat(24,minmax(26px,1fr)) 44px;gap:3px;min-width:760px}.hm-corner,.hm-hcol{font-size:10px;font-weight:700;letter-spacing:.03em;color:var(--text-faint);text-align:center;padding:4px 0}.hm-corner{text-align:left}.hm-hcol.now{color:var(--accent)}.hm-daylabel{border:none;background:transparent;font-size:11px;font-weight:700;color:var(--text-dim);text-align:left;padding:0 6px;cursor:pointer;border-radius:var(--radius)}.hm-daylabel:hover{color:var(--accent);background:var(--surface-2)}.hm-daylabel.today{color:var(--accent)}.hm-daylabel.hm-foot{cursor:default;color:var(--text-faint);border-top:1px solid var(--border);padding-top:6px;font-weight:700}.hm-daylabel.hm-foot:hover{background:transparent;color:var(--text-faint)}.hm-cell{border:1px solid var(--border);background:var(--surface-2);border-radius:3px;aspect-ratio:1;min-height:22px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center}.hm-cell:hover{border-color:var(--accent)}.hm-cell.now{border-color:var(--accent);border-width:2px}.hm-cell.peak{box-shadow:0 0 0 2px var(--accent) inset}.hm-n{font-size:10px;font-weight:700;color:var(--text)}.hm-rowtot{font-size:11px;color:var(--text-faint);text-align:center;padding:2px 0}.hm-rowtot.hm-foot{border-top:1px solid var(--border);padding-top:6px;font-weight:700;color:var(--text-dim)}.hm-rowtot.grand{color:var(--accent)}.hm-legend{display:flex;align-items:center;gap:6px;margin-top:12px;font-size:11px;color:var(--text-faint)}.hm-legend-label{font-weight:700;letter-spacing:.03em}.hm-legend-swatch{width:14px;height:14px;min-height:0;aspect-ratio:auto;cursor:default;border-radius:3px}.hm-legend-note{margin-left:8px}.hm-day{margin-top:20px;padding:16px}.hm-day-nav{display:flex;align-items:center;gap:8px;margin-bottom:12px}.hm-day-title{font-size:13px;font-weight:700;letter-spacing:.03em}.hm-day-spacer{flex:1}.hm-day-hours{display:flex;flex-direction:column;gap:2px;max-height:520px;overflow-y:auto}.hm-day-hour{display:grid;grid-template-columns:56px 1fr;gap:10px;padding:4px 6px;border-bottom:1px solid var(--border)}.hm-day-hour.now{background:var(--surface-2);border-radius:var(--radius)}.hm-day-hour-label{font-size:11px;color:var(--text-faint);padding-top:3px}.hm-day-hour-slot{display:flex;flex-wrap:wrap;gap:6px}.hm-day-chip{display:flex;align-items:center;gap:6px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:3px 8px;font-size:12px}.hm-day-chip.snoozed{opacity:.55}.hm-day-chip-time{font-family:var(--mono);color:var(--text-dim);font-size:11px}.hm-day-chip-label{font-weight:600}.hm-day-chip-flag{font-size:11px;color:var(--warn)}.filter-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 14px;padding:12px 14px;margin-bottom:12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}.filter-field{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.filter-label{font-size:11px;font-weight:700;letter-spacing:.03em;color:var(--text-faint)}.filter-input,.filter-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:6px 9px;font-size:12px}.filter-input{min-width:200px}.filter-count{font-size:12px;color:var(--text-faint)}.saved-views-bar{margin-top:-4px}.group-by-ctrl{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:700;letter-spacing:.03em;color:var(--text-faint)}.view-toggle{display:flex;border:1px solid var(--border-strong);border-radius:var(--radius);overflow:hidden}.view-btn{border:none;background:var(--surface);padding:6px 10px;font-size:12px;font-weight:600;color:var(--text-dim);cursor:pointer}.view-btn+.view-btn{border-left:1px solid var(--border-strong)}.view-btn.active{background:var(--accent);color:var(--accent-ink)}.btn-refresh{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);width:26px;height:26px;cursor:pointer;font-size:14px;line-height:1}.btn-refresh:hover{border-color:var(--accent)}.btn-refresh:disabled{opacity:.4;cursor:not-allowed}.stat-card{cursor:pointer;text-align:left;font:inherit;color:inherit}.stat-card.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.stat-card.has-dormant .stat-val,.stat-card.has-flags .stat-val,.stat-card.has-unreg .stat-val{color:var(--warn)}.col-select{width:28px}.th-sort{cursor:pointer;-webkit-user-select:none;user-select:none}.th-sort:hover{color:var(--text-dim)}.th-sort-active{color:var(--accent)!important}.row-selected td{background:var(--surface-2)}.group-hd td{background:var(--surface-2);padding:6px 14px;font-size:11px}.group-label{font-weight:700;letter-spacing:.03em}.group-count{color:var(--text-faint)}.cell-schedule{font-family:var(--mono);font-size:12px}.cell-goal{color:var(--text-faint);font-size:11px;margin-top:2px}.cell-next,.cell-no-machines{color:var(--text-faint)}.cell-handler{display:inline-flex;align-items:center;gap:6px}.handler-dot{width:7px;height:7px;border-radius:50%;background:var(--text-faint)}.handler-dot.ok{background:var(--ok)}.handler-dot.warn{background:var(--warn)}.cell-triggered{color:var(--text-dim);font-size:12px}.sched-preview-btn{display:block;margin-top:4px;border:none;background:transparent;color:var(--text-faint);font-size:11px;cursor:pointer;padding:0}.sched-preview-btn:hover,.sched-preview-btn.open{color:var(--accent)}.fires-panel{margin-top:6px;padding:8px 10px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);font-size:11px;max-width:220px}.fires-hd{font-weight:700;letter-spacing:.03em;color:var(--text-faint);margin-bottom:4px}.fires-item{display:flex;justify-content:space-between;gap:10px;padding:2px 0}.fires-until,.fires-empty{color:var(--text-faint)}.spark{display:block}.spark-empty{font-size:12px}.muted{color:var(--text-faint)}.health-badge{display:inline-block;font-size:10px;font-weight:700;letter-spacing:.03em;padding:2px 7px;border-radius:4px;white-space:nowrap}.health-badge.healthy{background:var(--ok-bg);color:var(--ok)}.health-badge.disabled,.health-badge.power-saving,.health-badge.snoozed{background:var(--surface-2);color:var(--text-dim)}.health-badge.dormant,.health-badge.dead,.health-badge.agent-missing{background:var(--err-bg);color:var(--err)}.toggle{position:relative;display:inline-block;width:32px;height:18px}.toggle input{opacity:0;width:0;height:0}.toggle-track{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--border-strong);border-radius:999px;transition:background .15s}.toggle-track:before{content:"";position:absolute;width:14px;height:14px;left:2px;top:2px;background:var(--surface);border-radius:50%;transition:transform .15s}.toggle input:checked+.toggle-track{background:var(--accent)}.toggle input:checked+.toggle-track:before{transform:translate(14px)}.toggle-row{display:flex;align-items:center;justify-content:space-between;padding:8px 0;font-size:12px;font-weight:700;color:var(--text-dim)}.row-actions{display:flex;align-items:center;gap:4px;white-space:nowrap}.act-btn{border:1px solid transparent;background:transparent;border-radius:4px;padding:3px 6px;font-size:10px;font-weight:700;letter-spacing:.02em;color:var(--text-faint);cursor:pointer;position:relative}.act-btn:hover{background:var(--surface-2);color:var(--text)}.act-btn:disabled{opacity:.4;cursor:not-allowed}.act-btn.del:hover{color:var(--err)}.act-btn.run{color:var(--ok)}.flag-badge{margin-left:3px;background:var(--warn-bg);color:var(--warn);border-radius:999px;padding:0 5px;font-size:9px;font-weight:700}.bulk-bar{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;margin-bottom:12px;background:var(--warn-bg);border:1px solid var(--warn);border-radius:var(--radius)}.bulk-count{font-size:12px;font-weight:700;color:var(--warn)}.bulk-acts{display:flex;gap:8px}.create-page{max-width:720px;margin:0 auto}.page-card{padding:20px}.page-freshness{font-size:11px;color:var(--text-faint)}.modal{width:640px;max-width:92vw;max-height:88vh;display:flex;flex-direction:column;padding:0}.modal-hd{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border)}.modal-title{font-weight:700}.modal-x{border:none;background:transparent;cursor:pointer;color:var(--text-faint);font-size:14px}.modal-x:hover{color:var(--text)}.modal-body{padding:20px;overflow-y:auto}.modal-ft{display:flex;justify-content:flex-end;gap:8px;padding:14px 20px;border-top:1px solid var(--border)}.form-group{margin-bottom:16px}.cron-presets,.ttl-presets{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.preset-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);padding:4px 9px;font-size:11px;cursor:pointer}.preset-btn:hover{border-color:var(--accent)}.cron-preview{margin-top:6px;font-size:12px;color:var(--text-faint)}.cron-preview.ok{color:var(--ok)}.cron-preview.bad{color:var(--err)}.machine-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.machine-chip{border:1px solid var(--border-strong);background:var(--surface);border-radius:999px;padding:4px 11px;font-size:12px;cursor:pointer}.machine-chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.machine-empty{font-size:12px;color:var(--text-faint);margin-bottom:8px}.machine-add{display:flex;gap:8px}.machine-add .form-input{flex:1}.logs-page{max-width:1000px;margin:0 auto}.page-hd{display:flex;align-items:center;gap:12px;margin-bottom:16px}.page-hd .page-title{margin:0;flex:1}.logs-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);max-height:70vh;overflow-y:auto}.logs-empty,.logs-error{padding:20px;color:var(--text-faint)}.logs-error{color:var(--err)}.log-search{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface)}.log-search-input{flex:1;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:6px 9px;font-size:12px}.log-match-count{font-size:11px;color:var(--text-faint);white-space:nowrap}.log-lines{font-family:var(--mono);font-size:12px;padding:4px 0}.log-line{display:flex;gap:12px;padding:1px 14px}.log-line:hover{background:var(--surface-2)}.log-ln{color:var(--text-faint);min-width:3.5em;text-align:right;-webkit-user-select:none;user-select:none}.log-lc{white-space:pre-wrap;word-break:break-word}.log-hl{background:var(--warn-bg);color:var(--warn);border-radius:2px}.flags-list{display:flex;flex-direction:column;gap:10px}.flags-count{font-size:12px;color:var(--text-faint)}.flag-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.flag-item-hd{display:flex;align-items:center;gap:10px;margin-bottom:6px}.flag-type{font-weight:700;font-size:12px;text-transform:uppercase}.flag-scope{font-size:11px;color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 6px}.flag-age{font-size:11px;color:var(--text-faint);flex:1}.flag-desc{color:var(--text-dim);font-size:13px}.cal-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.cal-nav{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border)}.cal-month{font-weight:700;flex:1}.cal-weekdays{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--border)}.cal-weekday{padding:6px;text-align:center;font-size:10px;font-weight:700;letter-spacing:.03em;color:var(--text-faint)}.cal-grid{display:grid;grid-template-columns:repeat(7,1fr)}.cal-day{min-height:90px;padding:6px;border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.cal-day.other-month{background:var(--surface-2);color:var(--text-faint)}.cal-day.today .cal-daynum{color:var(--accent);font-weight:700}.cal-daynum{font-size:11px;margin-bottom:4px}.cal-hits{display:flex;flex-direction:column;gap:2px}.cal-chip{font-size:10px;padding:1px 5px;border-radius:3px;background:var(--surface-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cal-chip.clickable{cursor:pointer}.cal-chip.clickable:hover{background:var(--accent);color:var(--accent-ink)}.cal-chip.snoozed{opacity:.6}.cal-more{font-size:10px;color:var(--text-faint)}.day-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.day-nav{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border)}.day-date{font-weight:700;flex:1}.day-zoom{display:flex;align-items:center;gap:6px}.day-zoom-level{font-size:11px;color:var(--text-faint);min-width:2em;text-align:center}.day-scroll{max-height:70vh;overflow-y:auto}.day-hour{display:flex;border-bottom:1px solid var(--border);min-height:var(--dh, 40px)}.day-hour.now{background:var(--surface-2)}.day-hour-label{width:60px;flex-shrink:0;padding:6px;font-size:11px;color:var(--text-faint);border-right:1px solid var(--border);display:flex;flex-direction:column;gap:2px}.day-hour-label .qt,.day-hour-label .qt-end{color:var(--text-faint);opacity:.5;font-size:10px}.day-hour-slot{flex:1;padding:4px 8px;display:flex;flex-wrap:wrap;align-content:flex-start;gap:4px;position:relative}.day-scroll.detail .day-hour-slot{display:block}.day-scroll.detail .day-chip{position:absolute;left:8px;right:8px}.day-chip{display:inline-flex;align-items:center;gap:5px;font-size:11px;padding:2px 7px;border-radius:4px;background:var(--surface-2)}.day-chip.clickable{cursor:pointer}.day-chip.clickable:hover{background:var(--accent);color:var(--accent-ink)}.day-chip.snoozed{opacity:.6}.day-chip-time{font-family:var(--mono);color:var(--text-dim);font-size:10px}.day-chip-label{font-weight:600}.day-chip-flag{font-size:10px;color:var(--warn)}</style>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>